What is EEG and why is it needed

Scientists love to search for the first mention of their science. For example, I saw an article where it was seriously claimed that the first experiments on electrical stimulation of the brain were carried out in Ancient Rome, when someone was shocked by electric eel. One way or another, usually, the history of electrophysiology is usually calculated from the experiments of Luigi Galvani (XVIII century). In this series of articles we will try to tell a small part of what science has learned over the past 300 years about the electrical activity of the human brain, about what profits can be extracted from all this.













Where does brain electrical activity come from?



The brain is made up of neurons and glia. Neurons exhibit electrical activity, glia can also do this, but in a different way [ 1 ], [ 2 ], and today we will not pay attention to it.







The electrical activity of neurons consists in pumping sodium, potassium and chlorine ions between the cell and the environment. Between neurons, signals are transmitted using chemical mediators. When a mediator secreted by one neuron enters a suitable receptor of another neuron, it can open chemically activated ion channels and let a small amount of ions into the cell. As a result, the cell changes its charge a little. If enough ions have entered the cell (for example, a signal has arrived at several synapses at the same time), other ion channels depending on the voltage (there are more) open, and the cell is activated in a matter of milliseconds on the basis of an “all or nothing” principle, and then returns to previous condition. This process is called action potential.







image







How can I register it



The best way to record the activity of individual cells is to stick an electrode into the cortex. It can be one wire , it can be a matrix with several tens of channels , it can be a pin with several hundreds , or it can be a flexible board with several thousand (like this for you, mask mask ).







On animals, this has been done for a long time. Sometimes, for health reasons (epilepsy, Parkinson's disease, complete paralysis), they are done on a person. Patients with implants are able to print text with the power of thought, control exoskeletons, and even control all degrees of freedom of the industrial manipulator.









It looks impressive, but in the near future, such methods will not come to every district clinic, and especially to healthy people. Firstly, it is very expensive - the cost of the procedure for each patient is measured in hundreds of thousands of dollars. Secondly, implantation of electrodes into the cortex is still a serious neurosurgical operation with all possible complications and damage to the nervous tissue around the implant. Thirdly, the technology itself is imperfect - it is not clear what to do with tissue compatibility of implants, and how to prevent their fouling with glia, as a result of which the desired signal ceases to be recorded over time. In addition, teaching each patient how to use an implant can take more than a year of daily training.







You can not stick the wires deep into the bark, but gently put it on it - you get an electrocorticogram. Here the signal of individual neurons can no longer be registered, but you can see the activity of very small areas (the general rule is, the farther from the neurons, the worse the spatial resolution of the method). The invasiveness level is lower, but you still need to open the skull, so this method is mainly used for monitoring during operations.







You can put wires not even on the cortex, but on the dura (the thin skull that is between the brain and the real skull). Here the level of invasiveness and possible complications is even lower, but the signal is still quite high quality. Get epidural EEG. The method is good for everyone, however, an operation is still needed here.







Finally, a minimally invasive method for studying the electrical activity of the brain is an electroencephalogram, namely, recording using electrodes that are located on the surface of the head. The method is the most widespread, relatively cheap (top-end devices cost no more than several tens of thousands of dollars, and most are several times cheaper, consumables are practically free), and has the highest time resolution of non-invasive methods - you can study the processes of perception, which take a few milliseconds. Disadvantages - low spatial resolution and noisy signal, which, however, contains enough information for some medical and neuro-interface purposes.







In the picture with the action potential, it can be seen that the curve has two main parts - in fact, the action potential (large peak) and the synaptic potential (small amplitude change in front of the large peak). It would be logical to assume that what we register on the surface of the head is the sum of the action potentials of individual neurons. However, in reality, everything works the other way around - the action potential takes about 1 millisecond and, despite its high amplitude, does not pass through the skull and soft tissues, but the synaptic potentials due to their longer duration are well summed up and recorded on the surface of the skull. This has been proven by simultaneous recording by invasive and non-invasive methods. It is also important that the activity of not every neuron can be recorded using EEG (more details here ).







It is important that there are about 86 billion nerve cells in the brain (how can this be calculated with such accuracy, read here ), and the activity of one neuron in such noise is impossible to count. However, some information can still be pulled out. Imagine that you are standing in the center of a football stadium. While the fans are just making noise and talking among themselves, you hear a steady hum, but as soon as even a small part of those present begin to chant a chant, it can already be heard quite clearly. In the same way with neurons - on the surface of the skull you can see a meaningful signal only if immediately a large number of neurons show synchronous activity. For non-invasive EEG, this is approximately 50 thousand synchronously working neurons.







For the first time, the idea of ​​measuring tension on a person’s head was realized in 1924 by a rather interesting person . The first EEG record looked like this:













It is difficult to understand what this signal means, but it is immediately obvious that it does not look like white noise - spindles of high-amplitude oscillations and different frequencies are noticeable in it. This alpha rhythm is the most noticeable brain rhythm that can be seen with the naked eye.







Now, of course, EEG rhythms are analyzed not by eye, but by mathematical methods, among which the simplest of which are spectral.









Fourier spectrum of the electroencephalogram broken into bands ( source )







In total there are several bands in which the rhythmic activity of the EEG is usually analyzed, here are the most popular:







8-14 Hz - Alpha rhythm. Presented mainly in the occipital areas. It increases greatly when closing the eyes, it is also suppressed with mental stress and increases with relaxation. This rhythm is produced when arousal circulates between the cortex and the thalamus. The thalamus is a kind of router that decides how to redirect incoming information to the cortex. When a person closes his eyes, he has nothing to do, he begins to generate background activity, which causes an alpha rhythm in the cortex. In addition, the default mode network plays an important role - a network of structures that are active during quiet wakefulness, but this is a topic for a separate article.













A kind of alpha rhythm with which it is easy to confuse is mu rhythm. It has similar characteristics, but is recorded in the central areas of the head, where the motor cortex is located. An important feature is that its power decreases when a person moves his limbs, or even thinks about how to do it.







14-30 Hz - Beta rhythm. More pronounced in the frontal lobes of the brain. Increases with mental stress.







30+ Hz - Gamma rhythm. Maybe somewhere inside the brain it is, but most of what can be recorded from the surface comes from the muscles. We found out as follows :







It is necessary to somehow remove muscle activity from the head in order to record EEG with and without muscles. Unfortunately, there is no easy way to disable the muscles on the head without disconnecting them throughout the body. We take a scientist (no one else would agree to such a thing), pump it with a muscle relaxant, as a result of which all muscles are disconnected. The problem is if you turn off all the muscles, including the diaphragm and intercostal, he will not be able to breathe. Solution - put it on a ventilator. The problem is that he can’t even speak without muscles. Solution - we put a tourniquet on his arm so that the muscle relaxant does not fall there, then he can give signals with this arm. The problem is if you tighten the experiment, the hand will fall off. Solution - we stop the experiment when the scientist stops feeling his hand, and we hope that everything will end well. The result - a share in the EEG frequency spectrum of more than 20 Hz against the background of muscle relaxant becomes 10–200 times less, the higher the frequency, the higher the drop.







1-4 Hz - Delta rhythm. Expressed during the phase, suddenly, delta sleep (the deepest sleep), also increases with stress.







In addition to rhythmic activity, there is also an evoked one in EEG. If we know exactly at what moment we show a person an incentive (it can be a picture, sound, tactile sensation or even smell ), we can see what reaction was to this particular stimulus. The signal-to-noise ratio of such a response with respect to the background EEG is rather low, but if we show the stimulus, for example, 10 times, cut the EEG relative to the moment of presentation and average, we can get quite detailed curves, which are called evoked potentials (not to be confused with potentials actions).













This is the evoked potential for sound. We’ll leave the details to psychophysiologists - here it’s enough for us to understand that every extremum means something. With sufficient averaging, the responses of structures will be visible, starting from the auditory nerve (I) and ending with the associative cortex (P2).







What can be done with her



You can do a lot of things, but today we will concentrate on neurocomputer interfaces. These are real-time EEG analysis systems that allow you to give commands to a computer or robot without the help of muscles - the closest to telekinesis that modern science can provide.







The most obvious thing that comes to mind is to make an interface on rhythmic activity. We remember that the alpha rhythm is small when a person is tense, and a lot when he is relaxed? So relax. We write the EEG, do the Fourier transform, when the power in the window around 10 hertz has become above a certain threshold, turn on the light bulb - this is computer control by the power of thought. The same principle may allow you to control other rhythms. Due to the simplicity and undemanding to the equipment, a lot of toys have appeared that work on this principle - Neurosky , Emotiv , thousands of them. In principle, if you try hard, a person can learn to come to the right state, which will be correctly classified. The problem with consumer devices is that they often do not write a very high-quality signal, and they are not able to subtract artifacts from eye and facial muscle movements. As a result, there is a real opportunity to learn how to control muscles and eyes, and not the brain (and the subconscious mind works so that the more you try not to do this, the worse it will turn out). In addition, the signal-to-noise ratio in the rhythms is quite low, and the interface is slow and inaccurate (if you can correctly guess the state with an accuracy of more than 70%, this is already an achievement). Yes, and the scientific base of the states except relaxation and concentration, to put it mildly, is unsteady. However, with proper implementation, the method may have its application.







An important subspecies of interfaces on rhythms is the representation of movements. Here the person is invited not to imagine something abstractly relaxing, but to represent the movement of, say, the right hand. If you do it right (and it’s difficult to learn the correct presentation), you can detect a decrease in mu rhythm in the left hemisphere. The accuracy of such interfaces also revolves around 70%, but they are used in simulators for recovery from strokes and injuries , including using various exoskeletons, so they are still needed.







Another class of EEG neurointerfaces is based on the use of evoked activity of all sorts. These interfaces are very reliable, with a successful combination of circumstances approaching 100%.







The most popular form of neural interfaces includes the potential of the P300. It arises when a person tries to single out one stimulus he needs among many unnecessary ones.



















For example, if here we try to calculate how many times the letter “A” lights up, and at the same time do not pay attention to all the others, then in response to this stimulus, when averaging, we will see a red line, and when averaging all the others, a blue line. The difference between them is noticeable with the naked eye, and training the classifier that will distinguish them is not difficult.







Such interfaces are usually not very beautiful, and not very fast (printing a single letter will take about 10 seconds), but can be useful for completely paralyzed patients.







In addition, there is a cognitive component in IMC-P300 - just looking at a letter is not enough, you need to actively pay attention to it. This allows, under certain conditions, to make quite interesting games on this technology (but this is a topic for another article).







Due to the fact that P300 is a cognitive potential, it is not very important for him what, in fact, is shown to a person, the main thing is that he can react to it. As a result, the interface will work even if the letters replace each other at the same point - this is useful for patients who cannot move their eyes.













There are other interesting evoked potentials, in particular SSVEP (ZVPUS) - potentials of a stable state. If you look for analogies in the field of communication, then the P300 works like a walkie-talkie - the signals from different stimuli are separated by time, and SSVEP is a classic FDMA - separation by carrier frequency, as in GSM-communication.







carefully epileptic emergency lights


It is necessary to show a person several stimuli that flash at different frequencies. When choosing a stimulus, it is enough to carefully look at it, and after a few seconds its frequency will magically appear in the visual cortex, from where it can be pulled out by correlation or spectral methods. This is faster and easier than reading the letters for the P300, but it's hard to look at such a blink for a long time.







Where there is FDMA, there is the very place of CDMA:







carefully, even more epileptic emergency lights








Gray is the binary sequence, color is the activity caused by it in all channels, the map is the distribution of the potential in the EEG. It is seen that the maximum on the back of the head is in the visual areas







It is possible to modulate the blinking of stimuli not by frequencies and phases, but by orthogonal binary sequences , which likewise end up in the visual cortex and are classified using correlation analysis. This can help to optimize the classifier training a little and speed up the interface - it can take less than 2 seconds per letter. Due to the successful selection of colors, you can make the interface a little less vyrviglaznym, although completely get rid of blinking. Unfortunately, the cognitive component here is not so pronounced - tracking eye movements gives comparable results, but technically simpler, cheaper and more convenient.







When I talk about how well these or other types of interfaces can work, I have to constantly operate with a signal-to-noise ratio. Indeed, the evoked potentials have a low amplitude of about 5 microvolts, despite the fact that the background alpha rhythm can easily have an amplitude of 20. Such a weak signal seems rather difficult to classify, but in fact it is quite simple if the experiment is carried out correctly and good to record the EEG. Now most academic research is concentrated in the field of inventing new classifiers, including the use of neural networks, but a fairly good level can already be achieved with the simplest linear classifiers from scikit-learn. For example, a good dataset with P300 and code is here .







Neurocomputer interfaces - an evolving technology, looks like magic, especially for an unprepared person. However, in reality, this is a method in which there are many unobvious difficulties. The secret here, as with any technology, is to take into account all the limitations and find areas of its application in which these restrictions do not interfere with the work.








All Articles