Campus Monterrey
School of Engineering and Sciences
Evaluation of electroencephalogram source localization methods for the decoding of motor information
A thesis presented by
Roberto Alejandro Esparza Lepe
Submitted to the
School of Engineering and Sciences
in partial fulfillment of the requirements for the degree of Master of Science
in
Engineering Sciences
Monterrey, Nuevo Le´on, July, 2020
I have never been one to make great speeches, but the occasion deserves the mention of personalities that were key in the realization of this work. So, without further ado, here are the thanks to those who made it possible for me to continue with this master’s project.
First, I would like to thank my parents for the great effort they put in getting me a good education. Thanks, also for their support and wisdom throughout all my life.
Second, I would like to thank the ITESM for their support on tuition and for the great teachers and materials they make available for students to help them in the learning process.
And to CONACyT for the support for living expenses of these two years. Without them, this thesis would not be here.
I would like to thank my thesis advisor, Dr. Mauricio Antelis, for his patience in teaching me everything that I did not know in this interdisciplinary project, and also for being an excellent teacher. Also, thanks to Dr. Omar Mendoza, who also helped with his insight and feedback in machine learning matters.
Next, I would like to thank my girlfriend and my friends for their love, support and friendship that helps to keep going even in the darkest of times.
Also, I would like to thank two people, without whom this thesis would not have gone so smoothly. Thanks to Erick Emerich and Joshmara Pineda for all of your time and effort in helping with the experiment and with the arduous work of cleaning and pre-processing of the data. It goes without saying that they made my life easier.
Special thanks to H´ector Mu˜noz, the author of the experiment which provided the EEG data used in a part of this thesis. Also, thanks for the companionship of these two years, may great things come your way.
I would, also, like to give thanks to some entities that played a significant role and I feel the need to thanked them from the bottom of my heart but I am afraid they are not entirely well seen, given some legal issues. So, I will just mention their initials. Thanks S.H. and thanks L.G., and also thanks A.B. I know you know who you are, thanks for making the world a better place.
Lastly, I would like to thank myself and to my dogs for their unconditional love and because if I don’t who will?
iii
methods for the decoding of motor information by
Roberto Alejandro Esparza Lepe Abstract
There are several technologies in the world that start using brain signals as input, such as wheelchairs, gadjets, or prosthesis. This machines are known as brain-computer interfaces, which are systems that establish a means of communication between a user and his surround- ings using only neural activity. Traditionally, the electroencephalogram (EEG), which is the effect produced by brain activity, is recorded through electrodes placed on the head. Features are extracted from the EEG in order to find patterns using a machine learning algorithm. And finally, commands that activate an application are generated from these patterns. However, BCIs have reached a limit in their performance, so it has been proposed to use the neural sources that generate the EEG to improve their reach.
This thesis explores the use of EEG source localization methods (EEG-SLMs) to deter- mine if they are a viable option for future research. Three studies were carried out in order to evaluate EEG-SLMs. The first study evaluates the performance of EEG-SLMs using syn- thetic signals in a simulated environment. The second study evaluates the performance of EEG-SLMs using real EEG signals obtained from an experiment with motor tasks. The third study evaluates the classification accuracy of machine learning algorithms when features are extracted from the EEG and when they are extracted from the neural sources that generated the EEG.
From the results obtained, the performance of the EEG-SLMs was verified when tested with simulated scenarios and known synthetic signals in the first study. The second study was useful in learning about the main brain areas involved in the development of motor tasks, these being not only the primary and secondary motor cortices, but also the areas responsible for locating the body and objects in space, as well as those responsible for calculating distances and take decisions. Furthermore, satisfactory results were obtained in the classification of motor tasks using neural sources.
iv
1.1 Brain-computer interface [29]. It is a system that allows communication be- tween a person and its environment. It has many applications through which
the user can improve their life. . . 2
1.2 Traditional BCIs extract information from the EEG to generate control signals in order to activate an application (left). The proposed alternative BCIs could work with information gathered from the sources that generate the EEG to produce commands for an application (right). [2] . . . 4
2.1 A neuron and its parts (left). Credits to David Baillot/UC San Diego. Primary and secondary currents (right) [5]. . . 8
2.2 a) Representation of a current dipole. The current flows from I to −I. b) Representation in Cartesian coordinates of a current dipole. . . 12
2.3 Three-shell head model. The inner sphere represents the surface of the brain. The middle sphere represents the skull. The outer sphere represents the scalp. Each sphere has its own radius and conductivity. . . 14
2.4 Brain Grid. Each position has its respective anatomical position as well as the BA to which it belongs. . . 19
2.5 Motor cortex. BA 4 (left) and BA 6 (right). . . 20
2.6 Spherical head model used. . . 20
2.7 Position on the scalp and order of the 62 electrodes. . . 21
3.1 (Left) EEG produced by solving the forward problem. The max dipole dmax was chosen to be in BA 4 in the left hemisphere. (Right) EEG produced by 3 different sources. The active dipoles were chosen to be in BA 4 and left hemisphere, BA 7 and right hemisphere, and BA 45 and left hemisphere. The colorbar indicates the dipoles’ magnitude in mA. . . 23
3.2 Case one: (Left) Simulated activity, in mA, located in the left hemisphere of the BA 6. (Right) EEG, in mV , produced by the chosen dipole configuration. 25 3.3 Case one: SL using MLE. (Left) Estimated dipole activity, in mA. (Right) EEG, in mV , produced by the estimated dipole configuration. . . 25
3.4 Case one: SL using MNE (top row) and wMNE (bottom row). From left to right the value for α goes α = 0.0001 for the left column, α = 0.1 for the middle column and α = 1 for the right column. All colorbars express the brain activity in mA. . . 25
3.5 Case one metrics: MLE has the lowest errors of all three SLMs. All errors grow when the value of α grows. . . 26
v
brain activity. . . 28 3.7 Case two: SL for the smallest radius (top row) and for the no radius (bottom
row) scenarios. The left column shows the result yielded with MLE. The middle column shows the results yielded with MNE. The right column shows the results yielded using wMNE. . . 28 3.8 Case two metrics: The y-axis is the scale for the value of each individual
metric. The x-axis represents the number of scenario, being 1 the first scenario with the smallest radius of activity. With the increase of the brain activity extension it is observed an improvement in the metrics. . . 29 3.9 Case three: Real activity. The max dipole was chosen to be at a random
position in the left hemisphere of the BA 6 (left). The EEG produced by the given dipole configuration (right). . . 30 3.10 Case three: Source in the left hemisphere. EEG-SL using MLE (left), MNE
(middle), wMNE (right). . . 30 3.11 Case four real activity. The global maximum dipole was chosen to be at a ran-
dom position in the left hemisphere of the BA 6 (left). Three local maximum dipoles were located at random positions of the right hemisphere of BA 4, left hemisphere of BA 7, and right hemisphere of BA 30. The EEG produced by the given dipole configuration (right). . . 32 3.12 Case four: EEG-SL using MLE (left), MNE (middle) and wMNE (right). . . 33 3.13 Case five: Original brain activity. The global max dipole was chosen to be at a
random position in the left hemisphere of the BA 6 (left). The EEG produced by the given dipole configuration with additional noise corresponding to a SN R = −4 (right). . . 34 3.14 Case five: EEG-SL with SN R = −4. The left column shows the dipole
estimation done with MLE, the middle column shows the estimation done with MNE and the right column shows the estimation done with wMNE. . . . 35 3.15 Case five: EEG resulting from the SL with SN R = −4. The left column
shows the EEG produced by the estimation done with MLE, the middle col- umn shows the EEG produced with the estimation done with MNE and the right column shows the EEG corresponding to the SL done with wMNE. . . . 35 3.16 Case five: EEG-SL with a zero SNR. The left corresponds to the SL done with
MLE, the middle column shows the SL done with MNE and the right column shows the SL done with wMNE. . . 35 3.17 Case five: EEG resulting of the SL with a zero SNR. The left corresponds to
MLE, the middle to MNE and the right column for wMNE. . . 36 3.18 Case five: EEG-SL with SN R = 4. The left column shows the dipole esti-
mation in each case with MLE, the middle column shows the estimation with MNE and the right column shows the estimation with wMNE. . . 36 3.19 Case five: EEG resulting from the SL with SN R = 4. The left column shows
the EEG in each case produced by the estimation of MLE, the middle column shows the EEG for MNE and the right column shows the EEG for wMNE. . . 36 3.20 Case five metrics: comparison between methods for case five. . . 37
vi
setup. . . 38
3.22 Case six: EEG-SL with 8 electrodes. Left brain shows the estimation done with MLE. The middle brain shows the estimation done with MNE. The right brain shows the estimation done with wMNE. . . 38
3.23 Case six: 62 electrodes uniformly distributed along the head’s surface (left). Simulated brain activity (middle). EEG measured with the given electrode setup. . . 39
3.24 Case six: EEG-SL with 62 electrodes. Left brain shows the estimation done with MLE. The middle brain shows the estimation done with MNE. The right brain shows the estimation done with wMNE. . . 39
3.25 Case six: Metrics. . . 40
4.1 Experimental setup. Images from H´ector Mu˜noz’s master’s thesis. . . 42
4.2 Tasks during a single trial, from H´ector Mu˜noz’s master’s thesis. . . 42
5.1 The six electrodes chosen for study three are the closest to the motor cortex of the brain. . . 53
5.2 Studio three: Case one using time-domain features: Accuracy for each partic- ipant (left). Empirical chance level (right). . . 53
5.3 Studio three: Case one using frequency-domain features: Accuracy for each participant (left). Empirical chance level (right). . . 55
5.4 Studio three: Case two using sources estimated with MLE: Accuracy for each participant (left). Empirical chance level (right). . . 56
5.5 Studio three: Case two using sources estimated with MNE: Accuracy for each participant (left). Empirical chance level (right). . . 57
5.6 Studio three: Case two using sources estimated with wMNE: Accuracy for each participant (left). Empirical chance level (right). . . 57
A.1 Studio one: Case one: From left to right the value for α goes α = 0.0001 for the left column, α = 0.1 for the middle column and α = 1 for the bottom col- umn. (Top) EEG calculated using the estimated dipoles using MNE. (Bottom) EEG calculated using the estimated dipoles using wMNE. . . 61
A.2 Studio one: Case two: Simulation of the brain activity (top row) for the sce- narios with r = 3.5 cm (left), 4.5 cm (middle) and r = 4.5 cm (right). EEG produces by the simulated dipoles (bottom row). Radius of activity increasing from left to right. . . 62
A.3 Studio one: Case two: SL using MLE for the scenarios with r = 3.5 cm (left), 4.5 cm (middle) and r = 4.5 cm (right). Estimated brain activity (top row). Corresponding EEG (bottom row). Radius of activity increasing from left to right. . . 62
A.4 Studio one: Case two: SL using MNE for the scenarios with r = 3.5 cm (left), 4.5 cm (middle) and r = 4.5 cm (right). Estimated brain activity (top row). Corresponding EEG (bottom row). Radius of activity increasing from left to right. . . 63
vii
row). Corresponding EEG (bottom row). Radius of activity increasing from left to right. . . 63 A.6 Studio one: Case two: EEGs for the lowest radius of activity (top row) and the
no boundaries (bottom row) scenarios. MLE (left). MNE (middle). wMNE (right). . . 64 A.7 Studio one: Case three: EEGs for the scenario with the source in the left
hemisphere. EEG of the SL using MLE (left), MNE (middle) and wMNE (right). . . 64 A.8 Studio one: Case three: Real activity in the right hemisphere. The max dipole
was chosen to be at a random position in the right hemisphere of the BA 6 (left). The EEG produced by the given dipole configuration (right). . . 64 A.9 Studio one: Case three: Source in the right hemisphere. EEG-SL using MLE
(left), MNE (middle) and wMNE (right). . . 65 A.10 Studio one: Case three: EEGs for the scenario with the source in the right
hemisphere. EEG of the SL using MLE (left), MNE (middle) and wMNE (right). . . 65 A.11 Studio one: Case four: EEG of the SL using MLE (left), MNE (middle) and
wMNE (right). . . 66 A.12 Studio one: Case five: EEG-SL with a low SNR. The top corresponds to a
SN R = −3, the middle row to a SN R = −2 and the bottom to a SN R =
−1. The left column shows the dipole estimation in each case with MLE, the middle column shows the estimation with MNE and the right column shows the estimation with wMNE. . . 67 A.13 Studio one: Case five: EEG-SL with a low SNR. The top corresponds to a
SN R = −3, the middle row to a SN R = −2 and the bottom to a SN R =
−1. The left column shows the EEG in each case produced by the estimation of MLE, the middle column shows the EEG for MNE and the right column shows the EEG for wMNE. . . 68 A.14 Studio one: Case five: EEG-SL with a high SNR. The top corresponds to a
SN R = 1, the middle to a SN R = 2 and the bottom row to a SN R = 3. The left column shows the dipole estimation in each case with MLE, the middle column shows the estimation with MNE and the right column shows the estimation with wMNE. . . 69 A.15 Studio one: Case five: EEG resulting from the SL with a high SNR. The top
corresponds to a SN R = 1, the middle row to a SN R = 2and the bottom row to a SN R = 3. The left column shows the dipole estimation in each case with MLE, the middle column shows the estimation with MNE and the right column shows the estimation with wMNE. . . 70 A.16 Studio one: Case six: Electrode setup for each scenario. . . 71 A.17 Studio one: Case six: SL for the scenarios with 8 electrodes (top row), 16
electrodes (second row), 24 electrodes (third row) and 32 electrodes (bottom row). We used MLE for the left column, MNE for the middle column and wMNE for the right column. . . 72
viii
row). We used MLE for the left column, MNE for the middle column and wMNE for the right column. . . 73 A.19 Studio one: Case six: SL for the scenarios with 40 electrodes (top row), 48
electrodes (second row), 56 electrodes (third row) and 62 electrodes (bottom row). We used MLE for the left column, MNE for the middle column and wMNE for the right column. . . 74 A.20 Studio one: Case six: EEG for the scenarios with 40 electrodes (top row), 48
electrodes (second row), 56 electrodes (third row) and 62 electrodes (bottom row). We used MLE for the left column, MNE for the middle column and wMNE for the right column. . . 75
ix
3.1 Case three (left): Qualitative metrics. . . 30
3.2 Case three (right): Quantitative metrics. . . 31
3.3 Case four: Qualitative metrics. . . 33
3.4 Case four: Quantitative metrics. . . 33
4.1 Study two: Case one: Brodmann areas located with source localization for participant 1. . . 44
4.2 Study two: Case one: Brodmann areas located with source localization for participant 6. . . 45
4.3 Study two: Case one: Brodmann areas located with source localization for participant 11. . . 45
4.4 Study two: Case one: Brodmann areas located with source localization for participant 15. . . 46
4.5 Brodmann areas located with source localization of the 15 participants. . . 46
4.6 Study two: Case two: Brodmann areas located with source localization for participant 1. . . 47
4.7 Study two: Case two: Brodmann areas located with source localization for participant 6. . . 48
4.8 Study two: Case two: Brodmann areas located with source localization for participant 11. . . 48
4.9 Study two: Case two: Brodmann areas located with source localization for participant 15. . . 49
4.10 Study two: Case two: Brodmann areas located with source localization of the 15 participants. . . 49
5.1 Study 3: Classification results. Using the sources estimated with wMNE yielded the best classification results. . . 58
A.1 Studio one: Case three: Qualitative metrics for the scenario with the source in the right hemisphere. . . 65
A.2 Studio one: Case three: Quantitative metrics for the scenario with the source in the right hemisphere. . . 66
A.3 Studio one: Case four: Qualitative metrics for the three additional sources. . . 66
B.1 Study two: Case one: Brodmann areas located with source localization for participant 2. . . 76
x
B.3 Study two: Case one: Brodmann areas located with source localization for participant 4. . . 77 B.4 Study two: Case one: Brodmann areas located with source localization for
participant 5. . . 78 B.5 Study two: Case one: Brodmann areas located with source localization for
participant 7. . . 78 B.6 Study two: Case one: Brodmann areas located with source localization for
participant 8. . . 79 B.7 Study two: Case one: Brodmann areas located with source localization for
participant 9. . . 79 B.8 Study two: Case one: Brodmann areas located with source localization for
participant 10. . . 80 B.9 Study two: Case one: Brodmann areas located with source localization for
participant 12. . . 80 B.10 Study two: Case one: Brodmann areas located with source localization for
participant 13. . . 81 B.11 Study two: Case one: Brodmann areas located with source localization for
participant 14. . . 81 B.12 Study two: Case two: Brodmann areas located with source localization for
participant 2. . . 82 B.13 Study two: Case two: Brodmann areas located with source localization for
participant 3. . . 82 B.14 Study two: Case two: Brodmann areas located with source localization for
participant 4. . . 83 B.15 Study two: Case two: Brodmann areas located with source localization for
participant 5. . . 83 B.16 Study two: Case two: Brodmann areas located with source localization for
participant 7. . . 84 B.17 Study two: Case two: Brodmann areas located with source localization for
participant 8. . . 84 B.18 Study two: Case two: Brodmann areas located with source localization for
participant 9. . . 85 B.19 Study two: Case two: Brodmann areas located with source localization for
participant 10. . . 85 B.20 Study two: Case two: Brodmann areas located with source localization for
participant 12. . . 86 B.21 Study two: Case two: Brodmann areas located with source localization for
participant 13. . . 86 B.22 Study two: Case two: Brodmann areas located with source localization for
participant 14. . . 87
xi
Abstract iv
List of Figures ix
List of Tables xi
1 Introduction 1
1.1 Brain-Computer Interfaces . . . 1
1.2 Problem Description . . . 3
1.3 Objective . . . 4
1.4 Methodology . . . 5
1.5 Thesis Organization . . . 6
2 Electroencephalography based Source Localization 7 2.1 Biophysical background . . . 7
2.2 Forward Problem . . . 9
2.2.1 The Neuron as an Electric Dipole . . . 12
2.2.2 Head Model . . . 13
2.2.3 Solving the Forward Problem . . . 15
2.3 Inverse Problem: EEG-SL Methods . . . 16
2.4 Modelling of the Brain Signals for EEG Simulation . . . 19
3 Study One: Simulated EEG 22 3.1 Simulated brain activity . . . 22
3.2 Metrics . . . 23
3.3 Case One: Effect of the regularization term α . . . 24
3.4 Case Two: Effect of activity distribution . . . 27
3.5 Case Three: Source localization with one activated brain area . . . 29
3.6 Case Four: Source localization with several activated brain areas . . . 31
3.7 Case Five: Effect of noise . . . 34
3.8 Case Six: Effect of number of electrodes . . . 38
4 Study Two: Real EEG 41 4.1 Materials . . . 41
4.1.1 Data . . . 41
4.1.2 Pre-processing . . . 43 xii
4.3 Case Two: Source localization in a segment of 0.5 seconds . . . 47
5 Study Three: Classification Performance 51 5.1 Materials . . . 51
5.1.1 Data . . . 51
5.1.2 Procedure . . . 51
5.1.3 Metrics . . . 52
5.2 Case One: Classification with EEG . . . 52
5.2.1 Time-domain features . . . 52
5.2.2 Frequency-domain features . . . 54
5.3 Case Two: Classification with brain sources . . . 55
5.3.1 Pre-processing & Feature Selection . . . 55
5.3.2 Classification . . . 56
6 Conclusion 59
A Studio One: Figures and tables 61
B Studio Two: Figures and tables 76
Bibliography 90
xiii
Introduction
Controlling objects or communicating with computers directly with the human mind, without the need of muscular activity has been a dream for several decades and has had its appearance in popular fiction and fantasy. For this kind of technology to be real humanity needs to have a better understanding of how the brain works. In recent years several research groups have started studying how to use brain signals for a variety of tasks. This master thesis addresses the possibility of using something more than just the brain signals obtained by non-invasive techniques, but the very source that generate these signals [28].
1.1 Brain-Computer Interfaces
Since many decades ago humanity has dreamed of using only their thoughts for carrying out activities. The study of brain signals, although very recent, is rapidly growing thanks to the emergence of powerful and inexpensive computer hardware and software. These technolog- ical advances have allowed a better understanding of the central neural system and with it, a new recognition of the needs of people with motor disabilities. The ability of using brain activity to control different kinds of applications through a machine could help these people lead better lives [29].
A brain-computer interface (BCI) is a system that enables the communication between the user and its environment by using only brain activity. BCIs are able to recognize patterns in brain signals in order to activate applications. A BCI is a system that gathers information from the brain. Then it processes that information and extracts key features that would help a machine learning algorithm find patterns in the brain information. Lastly, the BCI translates the patterns into commands that activate an application [8] [9] [14] [23] [28] [29]. Some examples are shown in fig. 1.1.
Figure 1.1 shows some examples of BCI applications. They can be used to replace a body part that has lost part or all of its functionality. They can also be used to help restore the movement of damaged limbs by inducing a special state known as ”neural plasticity”. BCI can also be used to enhance or improve the experience or performance of a person’s activity.
Another important application is to enhance the normal human capabilities. In summary, BCI’s applications focus on communication and control of different devices [8] [9] [14] [28].
Brain signals can be gathered with invasive or non-invasive techniques. Invasive BCIs
1
Figure 1.1: Brain-computer interface [29]. It is a system that allows communication between a person and its environment. It has many applications through which the user can improve their life.
have the advantage of being able to measure the brain signals with very high quality, but have the disadvantage of needing surgery to place the sensors inside the skull, which poses a threat to the user’s health. On the other hand, non-invasive BCIs have the advantage of being completely safe for the user at the cost of having more noisy signals (lower signal-to-noise ratio in comparison with invasive recordings). Non-invasive BCIs are more widely used given their practicality and low cost. This thesis focuses on non-invasive BCIs [3] [23].
Non-invasive BCIs may work with different kinds of brain signals, which can be used to obtain control signals to activate an external application. Currently, there are mainly four types of control signals used in non-invasive BCIs. These signals are Visual Evoked Potentials (VEPs), which are brain activity modulations produced after receiving a visual stimulus [23], Slow Cortical Potentials (SCPs), which are shifts in the brain signal that have slow voltage and last from one to several seconds and are related to neuronal activity [23], P300 evoked potentials, which are positive peaks that appear in the brain signal about 300 ms after having received an infrequent visual or auditory stimuli, and Sensorimotor Rhythms, which are os- cillations in the brain activity with located at a frequency band of 7 − 30 Hz [23]. These last signals are related to Motor Imagery (MI), i.e. imagined movement [28]. MI is not easy since people tend to imagine images of related real movement whose patterns differ from the actual
MI [23].
1.2 Problem Description
The most common technique for gathering brain activity for BCI is through an electroen- cephalogram (EEG), which measures the electrical brain signals and provides high temporal resolution. EEG consists on electrical brain signals measured by sensors placed on the per- son’s skin. EEG-based BCIs work by recognizing patterns in the brain signals which are induced by a mental task. In MI the mental task is to imagine the movement of a limb while the EEG is recorded. This mental task may be imagined at a very specific moment (syn- chronous) or at the user’s pace (a-synchronous). A set of special features are selected from the EEG in order to recognize the movement of the limb. These features are provided to a machine learning algorithm which identifies the movement the user is imaging and produces an output that is translated into a command for an application, as it is shown in fig. 1.2 left.
For example, the user can imaging either the movement of the left hand, right hand or both hands which in turn they can be linked to turning left, turning right or moving forwards on a robotic wheelchair. Here, the accuracy depends on the classification algorithm and on the extracted features from the EEG [3].
Although there have been several classification techniques that have yielded successful results, they have reached an upper limit in the recognition of EEG signals due to the nature of the EEG. The EEG measurements are made from outside of the head while the activity is generated inside of the head, thus, the scalp, skull thickness and brain tissue adds noise to the brain signals. Therefore it would be interesting and important for future research to explore the possibility of using the information from the neural sources responsible of generating the EEG, but without the invasive part. Using the neural source information instead of just the EEG could open the path for machine learning algorithms to improve their ability to discriminate and classify a multitude of mental tasks [3] [13] [23].
However, the way to find the neural sources that produced the EEG without the need of invasive procedures is through mathematical models called source localization methods (SLM). These methods are computational demanding but the possibility of improving classi- fication of mental tasks is promising. The question to answer is if SL based BCIs (fig. 1.2 right) are viable to explore. This thesis addresses this issue by evaluating SLMs with synthetic EEG signals and with real EEG signals. The results yielded from the SLMs in motor tasks are then analyzed and used to train a machine learning algorithm used in BCIs and compare their performance with the traditional classification used in BCIs [13].
This new alternative has been explored in previous recent works. In such research, the authors compare the performance of the SLMs wMNE (weighted Minimum Norm Estimate), sLORETA (standardized low resolution electromagnetic tomography) and dSPM (dynamic Statistical Parametric Mapping) with the aim of selecting and using one for movement predic- tion in a single trial. The data they used was gathered from eight participants who performed voluntary arm movements (reach and retreat). They used two metrics to evaluate each SLM:
the classification performance as a quality measure and a distance metric to assess physiologi- cal justification. Every SLM yielded similar results for the classification metric but found that wMNE outperformed the others in the distance metric [26].
Figure 1.2: Traditional BCIs extract information from the EEG to generate control signals in order to activate an application (left). The proposed alternative BCIs could work with information gathered from the sources that generate the EEG to produce commands for an application (right). [2]
In another work in source localization (SL) the authors not only compared the perfor- mance of SLMs MNE (Minimum Norm Estimate), wMNE, sLORETA as well as combina- tions using independent component analysis with wMNE (ICA-wMNE) and a proposed over- lapping averaging over the temporal domain (OA-MNE and OA-wMNE). The data they used was gathered from five participants who performed MI of hands and feet (open and close).
The only metric in which they focused was in the classification performance of each SLM.
They found that the proposed method (OA-wMNE) outperformed the others [22].
These studies pave the way for more research on unexplored topics. Current research has yet to study the performance of SLMs under a complete controlled environment. It would be meaningful to explore the behavior of SLMs using computer simulations of the brain activity.
It would also be interesting to compare the results of the SL of simulated EEG with the results of the SL of real EEG.
1.3 Objective
It is of great interest to comprehend how SL works and how can it improve BCIs. It is im- portant to note that previous investigations in this area are performed with data acquired from real persons, which means that is subject to the presence of noise. That is why we performed a first study of EEG-SL in a controlled simulated environment. A second study is carried out to estimate the neural sources from real EEG signals recorded from an experiment with motor tasks. Furthermore, a third study is performed to compare the performance in classification of a machine learning algorithm when it is trained using information from the EEG and when is trained using information from the neural sources that generated that EEG.
The aim of this thesis is to evaluate the plausibility of using EEG-SLMs for decoding motor tasks in modern BCIs by studying their behavior in a completely controlled simulated environment, evaluating their performance in estimating neural sources relevant to motor tasks and comparing the precision in the classification of rest and movement intention using the
neural sources estimated by the EEG-SLMs against traditional techniques used in BCIs. The specific objectives are:
• to teview the literature on the biophysical bases of EEG, the SLMs used for EEG and recent research in this regard.
• to select and implement three SLMs among the most used in the literature.
• to observe and verify the behavior of SLMs in a simulated environment by varying numerous parameters in different cases of interest.
• to perform SL with real EEG signals from a motor activity experiment.
• to evaluate the performance of a vector support machine (SVM) using only the EEG and its performance when using the neural sources that generated the EEG.
• to analyze the results obtained and draw conclusions about the plausibility of the use of EEG-SL for the decoding of motor information in BCIs.
Among the existing techniques to visualize brain activity, the best is through EEG, since it is non-invasive, it is the cheapest option, it is portable, and it has excellent temporal resolution, especially to identify motor tasks in humans. The most important area for EEG-based BCIs is in neuroprostheses. But, they have a limited degree of control. Therefore, the importance of studying EEG-SL lies in how essential it is to understand the dynamics of brain activity, since this can help generate a greater number of control commands with more degrees of freedom, in addition to improving the characterization of pathologies that affect movement.
1.4 Methodology
Review of literature: To study the physics of EEG. To understand the forward and inverse problem. To review the state-of-the-art in EEG-SL.
Implementation of EEG-LS methods: To define a forward model. To define a head model.
To select the methods to be implemented.
Evaluation of the selected methods in fully controlled environment: To implement the selected methods in software. To establish metrics. To assess the performance of the selected methods in different scenarios. To analyze the results.
Evaluation of the selected methods with real EEG data: To gather the information from experiment. To establish metrics. To perform SL in instants of time and in intervals. To learn to use the sLORETA software application. To analyze the results.
Comparison of the classification performance using EEG vs sources: To implement a machine learning algorithm. To perform classification using only EEG information. To per- form classification using EEG source information. To analyze and compare the results. To draw conclusions.
Results analysis and conclusions: To analyze the results obtained in the different stages of the thesis. To assess the plausibility for EEG-SL to be used in BCIs. To draw conclusions.
1.5 Thesis Organization
Chapter 1 presents a general description of the current status of BCI systems to motivate re- search. Chapter 2 provides a detailed technical description of EEG SLMs, from the equations of electrodynamics to the equations implemented in the algorithms and how they are derived.
Chapter 3 presents the procedure and results for the first study case using simulated brain sig- nals. Chapter 4 explains the development and results of the second study case analyzing real EEG data with SLMs. Chapter 5 compares the performance of machine learning algorithms using EEG data versus using EEG sources.
Electroencephalography based Source Localization
This chapter will discuss the physics and technical details of source localization of the EEG (EEG-SL). The following sections explain the biophysical nature of EEG generation, the es- timation of the neural sources responsible of the production of the EEG, the derivation of the mathematical expressions of the SLMs chosen for this study and the details of the model used to generate a simulated EEG.
2.1 Biophysical background
The brain electrical signal recorded with the EEG are voltages produced by the flow of electric current due to the neuronal activity inside the brain. Electrodes register the effect of a current produced by a large group of them that simultaneously activates. A neuron, as seen in fig. 2.1, is a nerve cells composed of a body called soma, which contains the nucleus, branches called dendrites, and a long arm called axon. The dendrites arise from the soma and are specialized in receiving electric pulses from other neurons. The axon connects to other neurons via the dendrites and is the responsible of sending pulses to other neurons. This connection between neurons is known as a synapse, which is a specialized interface between two nerve cells. The neurons communicate with each other by secreting a specialized chemical substance called a neuro-transmitter. This substance can depolarize the receiveing neuron, meaning that the potential difference between the inside and the outside of the neuron decreases, when the depolarization reaches a certain threshold an action potential is generated, which then causes a current to flow through the axon and to other neurons [15].
This current, known as the primary current, forms a closed loop with extracellular cur- rents, known as secondary currents, as seen in fig. 2.1. These are the currents responsible for generating the EEG. However, it is believed that the main contributors of EEG are cumulus of thousands of simultaneously activated neurons because of their perpendicular orientation to the cortical surface. Some observations suggest that the observed sources are on the or- der of 10 nA − m, and hence the cumulative summation of millions of active neurons in a small region [5]. Some calculations suggest that the brain cortex has a current density of about 100 nA/mm2. Assuming a thickness of 4 mm for the cortex, then a small patch of
7
Figure 2.1: A neuron and its parts (left). Credits to David Baillot/UC San Diego. Primary and secondary currents (right) [5].
5 mm × 5 mm would yield a net current of 10 nA − m, which is consistent with empirical observations and invasive studies [5].
Given that we want to model electric currents we are obliged to understand the core of electrodynamics: Maxwell’s equations, shown in their general form
∇ × H = ∂D
∂t + J, (2.1)
∇ × E = −∂B
∂t, (2.2)
∇ · D = ρv, (2.3)
∇ · B = 0. (2.4)
Where eq. 2.1 is Ampere’s law, eq. 2.2 is Faraday’s law, and eq. 2.3 and eq. 2.4 are Gauss’ laws for electricity and magnetism, respectively. H is the magnetic field strength (A/m), E is the electric field strength (V /m), D is the electric flux density (C/m2), ∂D/∂t is the displacement electric current density (A/m2), J is the conduction current density (A/m2), B is the magnetic flux density (wb/m2or Tesla), ∂B/∂t is the time-derivative of the magnetic flux density (wb/m2s) and ρv is the volume charge density (C/m3) [18][19][27].
These equations help describe the classical dynamics of interacting charged particles and electromagnetic fields, and form the basis of all classical electromagnetic phenomena in any medium[18]. Ampere’s law (eq. 2.1) states that the changing magnetomotive force around a closed path will result in the summation of electric displacement and conduction currents through any surface bounded by the path. Faraday’s law states that the electromotive force around a closed path is equal to the negative time-derivative of magnetic flux flowing through any surface bounded by the path. Gauss’ law for electricity defines the relationship
between electric displacement and total charge inside that surface. Finally, Gauss’ law for magnetism states that the total magnetic flux passing through any closed surfaced is equal to zero [18][19][27].
Given the conditions of brain activity, the frequency range that is typically studied by neuroscientists is below 1 kHz. Therefore, there is no need to use dynamical equations due to the very short range of the studied phenomenon. This is why we use a quasi-static ap- proximation for Maxwell’s equations to describe the physics of EEG. Now the quasi-static approximation of Maxwell’s equations become
∇ × B = µ0J + µ0r0∂E
∂t, (2.5)
∇ × E = −∂B
∂t , (2.6)
∇ · E = ρ
r0, (2.7)
∇ · B = 0, (2.8)
where 0 is the vacuum permittivity, ris the relative permittivity, and µ0 is the vacuum permeability [17] [25]. In eq. 2.6, given the low frequencies, we can ignore the time-derivative and it becomes
∇ × E = 0. (2.9)
This quasi-static approximation makes mathematical analysis simpler by separating the electric and the magnetic field, and it ignores the delay of any neural signal transmitted from the brain onto the scalp.
2.2 Forward Problem
The voltage measured in EEG is caused by the total current density, J, which is the sum of the primary, Jp, and secondary, Js, currents in the brain. From eq. 2.9 we can relate the gradient of the scalar potential V to field strength as
E = −∇V. (2.10)
The relationship between the secondary current density Js(A/m2) and the electric field E (V /m) is given by Ohm’s law:
Js = σE, (2.11)
where σ(r) ∈ R3 is the position dependant conductivity tensor with units A/(V m) = S/m. This tensor is used due to the anisotropic nature of some head tissues. Hence, the total current density becomes
J = Jp+ Js = Jp+ σE = Jp− σ∇V. (2.12)
Now, using eq. 2.11 in eq. 2.5 we have
∇ × B = µ0
σE + r0∂E
∂t
, (2.13)
and by taking E(t) = E0· e−jωtin eq. 2.13 we have
∇ × B = µ0(σE − jr0ωE). (2.14)
For the quasi-static approximation |r0/σ| 1. Therefore eq. 2.14 can be rewritten as
∇ × B = µ0σE = µJ. (2.15)
By applying a divergence operator on both sides of eq. 2.15 we get
∇ · (∇ × B) = ∇ · (µJ). (2.16)
The current density J is a three-dimensional vector field and its divergence is defined as
∇ · J = lim
G→0
1 G
I
∂G
JdS, (2.17)
which is the integral over a closed surface ∂G in the extracellular space. Given that no charge can be piled up in the extracellular space, the current flowing into the small volume must be equal to the current leaving it. So, the integral is zero and ∇ · J = 0. Using eq. 2.12 and eq. 2.16 we obtain Poisson’s equation.
∇ · J = ∇ · Jp− ∇ · (σ∇V) = 0
∇ · (σ∇V) = ∇ · Jp. (2.18)
In eq. 2.18, taking the divergence of this vector field, Jp generates a current source density with units A/m3, which is represented as Im. Hence,
∇ · (σ∇V) = Im. (2.19)
Eq. 2.19 is the forward problem equation for EEG-SL [19]. With a given head model and a current source, we can evaluate the potential and formulate the forward problem with satisfying results, i.e., voltages calculated with eq. 2.19 correspond to real head measure- ments. Similar derivations can be found in lectures [5][19][15]. In order to solve the forward problem for EEG-SL we need first to satisfy the Neumann and the Dirichlet boundary con- ditions. The former states that charges do not accumulate on the interfaces but move from one compartment to another, i.e., all current leaving a region with conductivity σ1 through the interfaces enters the neighboring region with conductivity σ2. This is expressed in eq. 2.20 and eq. 2.21
J1· n0 = J2· n0, (2.20)
(σ1∇V1) · n0 = (σ2∇V2)n0, (2.21)
where n0 is the normal vector on the interface.
Given the very low conductivity of the air, no current can flow from the head and into the air. Therefore, the current density at the surface of the head is expressed as
J1· n0 = (σ1∇V1) · n0 = 0. (2.22)
Eq. 2.22 is known as as the homogeneous Neumann boundary condition. The latter holds true only for internal interfaces and states that the electric potential is continuous across interfaces,
V1 = V2. (2.23)
Eq. 2.23 represents the Dirichlet boundary condition. Additionally, a reference electrode is assigned, which has zero potential, Vr = 0.
2.2.1 The Neuron as an Electric Dipole
The cyclical behavior of the current in neurons let us model them as current dipoles. The cur- rent dipole consists of a current source and a current sink separated by a distance p as shown in fig 2.2.1. The dipole moment d shows the magnitude and orientation of the dipole, in the figure it is pointing from the source to the sink. Thus, the dipole’s moment is given by
d = Ipn0, (2.24)
Figure 2.2: a) Representation of a current dipole. The current flows from I to −I. b) Repre- sentation in Cartesian coordinates of a current dipole.
where n0is the unit vector pointing from source to sink. The dipole’s magnitude is given by |d| = Ip. In the Cartesian coordinate system, the dipole is represented as
d = dxx + dˆ yy + dˆ zz,ˆ (2.25)
where ˆx, ˆy and ˆz are the unit vectors in each direction of the Cartesian coordinate system, and dx, dy and dzare the Cartesian components of the dipole.
Due to the linearity of eq. 2.19 we can apply the superposition rule to generate a sum- mation result for the net dipole. Now, a potential V generated by a dipole at a position rdip
and with a dipole moment d measured at a point r can be expressed in Cartesian coordinates as
V(r, rdip, d) = dxV(r, rdip, nx) + dyV(r, rdip, ny) + dzV(r, rdip, nz). (2.26)
All these cells are oriented orthogonal to the cortical surface. Because of this the super- position results in an amplification of the potential distribution. A cumulus of active neurons can be represented as an equivalent dipole in the macroscopic scale.
The potential field generated by a current dipole with dipole moment d = dedat a posi- tion rdipin an infinite conductor with conductivity σ is given by
V (r, rdip, d) = d · (r − rdip)
4πσ||r − rdip||3, (2.27)
where r is the position where the voltage is calculated. This equation tells us that the closer the measurements is taken from the source, the voltage will be stronger.
2.2.2 Head Model
Eq. 2.27 defines the potential given by a known current dipole at any position in an infinitely homogeneous space, but this is not the case for the brain, thus the next step is to define the volume conductor, i.e., the head model. Initially, the first human head models consisted of a homogeneous sphere [15]. However, it was soon noticed that the skull had different and con- siderably lower conductivity than the scalp and brain tissue. Therefore, the head model was refined, introducing the three-shell concentric spherical model. In this model the inner sphere represents the brain, the middle sphere represents the skull, and the outer sphere represents the scalp, as shown in fig. 2.3. For this model there exists an analytical solution of Poisson’s equation 2.18. Considering a dipole located on the z-axis and a scalp point P , located in the xz-plane, the dipole components located in the xz-plane, i.e., the radial component dr and the tangential component dtare the only contributions to the potential at scalp point P due to the fact that the zero potential plane of the orthogonal component to the xz-plane traverses P . The potential V at scalp point P for this proposed dipole is given by
V = 1
4πSR2
∞
X
i=1
X(2i + 1)3
gi(i + 1)i bi−1[idrPi(cos θ) + dtPi1(cos θ)], (2.28)
where gi is given by
gi = [(i+1)X +i]
iX i + 1 + 1
+(1−X)[(i+1)X +i](f1i1−f2i1)−i(1−X)2 f1 f2
i1
, (2.29)
where dris the radial component [m], dtis the tangential component [m], Ris the radius of the outer shell [m], S is the conductivity of the scalp and brain tissue [S/m], X is the ratio between the skull and soft tissue conductivity [unitless], b is the relative distance of the dipole from the centre [unitless], θ is the polar angle of the surface point [rad], Pi(·) is the Legendre polynomial, Pi1(·) is the associated Legendre polynomial, i is an index, i1 equals 2i + 1, r1 is the radius of the inner shell [m], r2 is the radius of the middle shell [m], f1 equals r1/R [unitless], and f2equals r2/R [unitless].
Figure 2.3: Three-shell head model. The inner sphere represents the surface of the brain. The middle sphere represents the skull. The outer sphere represents the scalp. Each sphere has its own radius and conductivity.
Eq. 2.28 gives the scalp potentials generated by a dipole located on the z-axis, with zero dipole moment in the y direction. To find the scalp potentials generated by an arbitrary dipole, the coordinate system has to be rotated accordingly [15].
This type of model has the advantage of being simple and needing low computational power. If one desires to improve the localization capability of EEG SL then the use of a real- istic model is advised. This models are complex in geometry and require high computational power but have accurate localization. Another difference between models is that there is only numerical solutions for the realistic models [5] [15].
An approach situated in between the spherical head model and the realistic models is the sensor-fitted sphere approach, which consists of a multilayer sphere that has the location of each sensors on the surface of a realistic head model fitted in. Such approach is used in this thesis with a fitted-in realistic brain shape [15].
2.2.3 Solving the Forward Problem
Generalizing eq. 2.27 to the electrode potential caused by multiple dipoles sources would become
φ(r) =X
i
l(r, rdip, di). (2.30)
Assuming the superposition principle, then eq. 2.30 can be rewritten as
φ(r) =X
i
l(r, rdip)(dix, diy, diz)T =X
i
l(r, rdip)diei, (2.31)
where l(r, rdip) has three components corresponding to the Cartesian directions, di = (dix, diy, diz) is a vector consisting of the three dipole magnitude components, ‘T’ denotes the transpose of a vector, di = ||di|| is the dipole magnitude, and ei = |ddi
i| is the dipole orientation. In practice, one calculates the potential between an electrode and a reference, be it either another electrode or an average reference.
For N electrodes and p dipoles:
M =
m(r1)
... m(rN)
=
l(r1, rdip1) . . . l(r1, rdipp) ... . .. ... l(rN, rdip1) . . . l(rN, rdipp)
d1e1
... dpep
, (2.32)
where i = 1, . . . , p and j = 1, . . . , N , M is the matrix of data measurements, and D is the vector of dipole moments. This matrix is called the gain matrix or leadfield L [11]. Each row describes the current flow for a given electrode through each dipole position [12].
So far the formulation assumes that both the magnitude and the orientation of the dipoles are unknown. However, the calculations can be simplified by assuming fixed positions for the dipoles. In the latter case the magnitude of the dipoles will remain variable and eq. 2.32 can
be rewritten as:
M =
l(r1, rdip1)e1 . . . l(r1, rdipp)ep ... . .. ... l(rN, rdip1)e1 . . . l(rN, rdipp)ep
d1
... dp
(2.33)
= L(rj, rdipi, ei)
d1
... dp
(2.34)
= L(rj, rdipi, ei)D, (2.35)
where D is now a matrix of dipole magnitudes. This formulations have less variables to estimate than before. A noise matrix can be added such that the recorded data matrix M looks like
M = LD + n, (2.36)
where M is a N × 1 vector of observations, L is a N × p matrix and D is a p × 1 vector of dipole magnitudes.
2.3 Inverse Problem: EEG-SL Methods
The inverse problem consist of finding an estimate ˆD of the dipole magnitude matrix given the electrode positions and scalp measurements M and using the lead-field matrix L calculated in the forward problem. It is important to note that this is an ill-posed problem in which with a limited amount of observations (N ) one aims to estimate thousands of variables (3 × p), therefore there is no unique solution.
There are two main approaches to solve the inverse problem: parametric and non- parametric methods. The former are also known as dipolar source models. In these approaches just a few dipoles of unknown position and orientation are assumed. The latter are also known as distributed source models. In these models there are several dipole sources with fixed loca- tions and possible fixed orientations distributed in the the whole brain volume or the cortical surface. Starting with a generalized approach from eq. 2.36 assuming that n is white gaussian noise (WGN), that is n ∼ N (0, σ2I), where I is the identity matrix, the probability density function of the observations M given the dipoles D is given by
p(M; D) = (2πσ2)−N/2e−2σ21 (M−LD)T(M−LD). (2.37)
The next step is to find an estimator for ˆD. This can be achieved by satisfying the fol- lowing condition,
∂
∂θ(ln(p(M; D))) = F(D)(g(x) − D), (2.38)
where M is the vector of observations, D is the vector to be estimated, IFis the Fisher’s information and g(M) is the estimator for D [21].
Applying the natural logarithm to eq. 2.37
ln(p(M; D)) = −N
2 ln(2πσ2) − 1
2σ2(M − LD)T(M − LD). (2.39)
Taking the derivative with respect to D
∂
∂Dln(p(M; D)) = − 1 2σ2
∂
∂DMTM − 2MTLD + DTLTLD . (2.40)
Using the following identities for handling vectors and matrices
daTx
dx = a,
∂xTAx
∂x = 2Ax,
eq. 2.40 becomes
∂
∂Dln(p(M; D)) = − 1
2σ2 −2LTM + 2LTLD
(2.41)
= 1
σ2 LTM − LTLD . (2.42)
Eq. 2.42 needs to look like the right side of eq. 2.38. For this the Fisher’s information is calculated, which is defined as
var(ˆθ) ≥ 1
F(θ) = 1
−E∂2
∂θ2(ln p(x; θ)) , (2.43) where var(ˆθ) is the variance of the estimated ˆθ and E is the expected value.
Taking the second derivative from eq. 2.42 the Fisher’s information is obtained
F = −LTL
σ2 . (2.44)
Knowing eq. 2.44, then eq. 2.42 can be rewritten as
∂
∂Dln(p(M; D)) = −LTL
σ2 (LTL)−1LTM − D , (2.45)
The estimation for D is found when eq. 2.45 is equal to zero. Therefore, the estimator is
DˆM LE = (LTL)−1LTM. (2.46)
This method is known as the Maximum Likelihood Estimator (MLE) [21]. To solve the problem of singular matrices in the MLE one can add a regularization parameter α. Hence, eq. 2.46 becomes
DˆM N E = (LTL + αI)−1LTM. (2.47)
This method is known as Minimum Norm Estimate (MNE). A variation of this method that is also widely used in EEG-SL is the weighted Minimum Norm Estimate (wMNE). This method compensates the tendency of MNE to favour weak and surface sources by introducing a 3p × 3p weighted matrix W
DˆwM N E = (LTL + αWTW)−1LTM, (2.48)
where W is a diagonal matrix constructed as the norm of the columns of the leadfield L : W = Ω∧I3, where∧ denotes the Kronecker product and Ω is a diagonal p × p matrix with Ωββ =
qPN
α=1g(rα, rdipβ) · g(rα, rdipβ)T, for β = 1, . . . , p [5][12][19][20].
These are the three methods alongside with the well known sLORETA that are used in this thesis. The latter was used within its own software which is free and can be accessed by everyone [20] [24].
2.4 Modelling of the Brain Signals for EEG Simulation
The model used in this thesis is a hybrid head model with realistic electrode positions over a three-shell spherical head model with realistic dimensions, i.e., the size of an average human.
The shape of the brain is also based on a realistic head model conformed with 6226 dipole fixed positions, as can be seen in fig 2.4 . Besides knowing the positions of all dipoles the Brodmann area associated with each position are also known [24]. This is of special impor- tance due to the somatotopical organization of the brain.
Figure 2.4: Brain Grid. Each position has its respective anatomical position as well as the BA to which it belongs.
There are 47 Brodmann areas, each of which has specialized functions. The areas of interest in this thesis are the ones related with motor movement, i.e., Brodmann areas 4 and 6, primary motor cortex and secondary motor cortex respectively [1] [4] [6]. This areas are located in a ”belt” like shape in the frontal lobe as can be seen in fig. 2.5
The head model consisted of three concentrical spheres, as can be seen in fig. 2.6. The inner sphere corresponds to the surface of the brain and has a radius of 8 cm and a resistivity of 2.22 Ωm. The middle sphere corresponds to the skull and has a radius of 8.5 cm and a resistivity of 9.2 Ωm. The outer sphere corresponds to the scalp and has a radius of 9.2 cm and a resistivity of 2.22 Ωm [10].
The positions of the observations are given by the 62 scalp locations uniformly dis- tributed using a 10/10 international system. The 62 electrodes were chosen according to the
Figure 2.5: Motor cortex. BA 4 (left) and BA 6 (right).
Figure 2.6: Spherical head model used.
equipment available in the laboratory, a g.HIamp biosignal amplifier and a g.GAMMAsys system for active electrodes. The label for each electrode in order are FP1, FPZ, FP2, AF7, AF3, AF4, AF8, F7, F5, F3, F1, FZ, F2, F4, F6, F8, FT7, FC5, FC3, FC1, FCZ, FC2, FC4, FC6, FT8, T7, C5, C3, C1, CZ, C2, C4, C6, T8, TP7, CP5, CP3, CP1, CPZ, CP2, CP4, CP6, TP8, P7, P5, P3, P1, PZ, P2, P4, P6, P8, PO7, PO3, POZ, PO4, PO8, O1, OZ, O2, F9, F10.
The configuration can be seen in fig. 2.7.
Figure 2.7: Position on the scalp and order of the 62 electrodes.
Study One: Simulated EEG
Several works have been carried out exploring the possibility of using EEG-SL in the classi- fication of motor tasks, however, all these works are carried out with real EEG signals, which means that noise from measurements is present in the signal, product of factors that are out of the researcher’s control. In this chapter, a study is conducted evaluating three SLMs with syn- thetic EEG signals. The aim of this study is to verify the operation and behavior of the chosen methods when subjected to an evaluation in a completely controlled environment without the presence of external noise.
The chapter starts by describing the procedure for obtaining a simulation of brain activity and by defining the metrics for the evaluation of the SLMs. Subsequently, this study is divided into 6 cases of interest. The first addresses the effect of the α regularization term on SL. In the second case, it is observed what happens when brain activity is totally diffused by the brain and when it is not, by varying the maximum radius of simulated activity. In the third, three SLMs are evaluated, the maximum likelihood estimator (MLE), the minimum norm estimator (MNE), and the weighted minimum norm estimator (wMNE), in the reconstruction of brain activity generated by a single source dipole. In the fourth case, the three SMLs are evaluated in the reconstruction of brain activity generated by several simultaneous dipole sources of different magnitudes. In the fifth case, the effect that noise has on the estimation of brain sources is explored. In the latter case, the effect on the location of sources is addressed by using different amounts of electrodes on the head.
3.1 Simulated brain activity
The simulation was done using MATLAB 2018b. The geometric model of the head needed to begin the simulation was specified in section 4 of chapter 2. The first step was to choose a point that was part of the motor cortex and that served as the epicenter of the simulated brain activity. A brain model point was randomly chosen that was located in the specified Brodmann area (BA) and hemisphere. Given the nature of this study, the BAs chosen were 4 or 6. Then a magnitude was assigned. In this thesis, 100 mA is used as the magnitude for the central activity, the dipole with maximum activity. In this way, the maximum activity point was of the form 57.74ˆi + 57.74ˆj + 57.74ˆk, where ˆi, ˆj and ˆk are the normal unit vectors.
The surrounding points were assigned a damped magnitude based on their distance from the
22
central point of the activity, so that the farthest points had a lower magnitude approaching zero, as it is shown in the left image of fig. 3.1. In the event that more than one single source was chosen, as is done in case 4, the process already described is repeated as many times as sources are chosen, and then their individual contributions are added to generate brain activity as a result of various simultaneous sources, as can be seen in the right image of fig. 3.1. The next step is to solve the forward problem to calculate the EEG generated by the simulated brain activity. For future reference, every colorbar in a figure showing the brain expresses the brain activity in mA and every colorbar in a figure showing the EEG expresses its activity in mV .
Figure 3.1: (Left) EEG produced by solving the forward problem. The max dipole dmax was chosen to be in BA 4 in the left hemisphere. (Right) EEG produced by 3 different sources.
The active dipoles were chosen to be in BA 4 and left hemisphere, BA 7 and right hemisphere, and BA 45 and left hemisphere. The colorbar indicates the dipoles’ magnitude in mA.
3.2 Metrics
To evaluate the SLMs MLE, MNE and wMNE, both qualitative and quantitative metrics were chosen. As qualitative metrics, the characteristics (magnitude, components, position in the brain model, BA and cerebral hemisphere) of the simulated, dmax, and estimated, ˆdmax, max- imum dipoles were visually compared.
As quantitative metrics a distance error metric was chosen:
(rmax) = ||rmax− ˆrmax||, (3.1)
where rmaxis the position of the chosen (or real) max dipole and ˆrmax is the position of the estimated max dipole.
The error between the real and estimated dipole’s momentum were also considered:
(dmax)[mA] = ||dmax− ˆdmax||, (3.2)
(||dmax||)[%] = ||dmax|| − ||ˆdmax||
||dmax|| , (3.3)
(||d||)[mA] = 1 N
N
X
i=1
||d − ˆd||, (3.4)
(dI)[%] = I − ˆI
I × 100, (3.5)
where (dmax) is the error in the max dipole’s momentum and is expressed in mA,
(||dmax||) is the error in the maximum dipole’s magnitude and is adimensional, (||d||) is the error in all the dipoles’ magnitudes which is expressed in mA, (dI) is the error in the dipoles’ intensity which is expressed as a percentage, and the intensity I is defined by
I[mA] = 1 N
N
X
i=1
||di||. (3.6)
The last chosen quantitative metric was the goodness of fit, expressed in mV , for com- paring both simulated EEG and estimated EEG:
G[mV ] = ||M − ˆM||. (3.7)
3.3 Case One: Effect of the regularization term α
The first case of interest focuses on the regularization term α. This term is present in two SLM: MNE in eq. 2.47 and wMNE in eq. 2.48. The purpose of this constant is to avoid having a singular matrix when solving the inverse problem. Therefore, it was expected that the simulations that have α closer to 0 will perform better than when α is closer to 1.
The simulated source was chosen to be located at an arbitrary position inside the left hemisphere of the secondary motor cortex, BA 6, as shown in fig. 3.2. Three values for α were tested: α = 0.0001, α = 0.01 and α = 1. EEG-SL using MLE was also done to compare the performance with the other two SLMs. In total there were seven source estimations.
The results for the estimation of the brain activity using MLE can be observed in fig. 3.3.
The neuronal source can be observed at the center of the yellow points and the consequential activity surrounding it (left). The resulting EEG is shown to the right. At simple inspection the EEG is virtually the same as in fig. 3.2. While the estimated brain activity has a similar shape and epicenter as the simulated one, there is a clear difference in the dipoles furthest from
Figure 3.2: Case one: (Left) Simulated activity, in mA, located in the left hemisphere of the BA 6. (Right) EEG, in mV , produced by the chosen dipole configuration.
Figure 3.3: Case one: SL using MLE. (Left) Estimated dipole activity, in mA. (Right) EEG, in mV , produced by the estimated dipole configuration.
Figure 3.4: Case one: SL using MNE (top row) and wMNE (bottom row). From left to right the value for α goes α = 0.0001 for the left column, α = 0.1 for the middle column and α = 1 for the right column. All colorbars express the brain activity in mA.