Full text
A Framework for Artificial Data Generation Based on Anatomical Differences for Electroencephalography-Based Brain-Computer Interfaces Rachel Elizabeth Rapp July 1, 2019 Master in Artificial Intelligence Master’s Thesis Completed at the Technical University of Berlin Advisor: Prof. Dr. Benjamin Blankertz Head of the Department of Neurotechnology and the Berlin Brain-Computer Interface (BBCI) Project Technical University of Berlin Co-Advisor: Daniel Miklody PhD Candidate in the Department of Neurotechnology Technical University of Berlin Tutor: Assoc. Prof. Dr. Alfredo Vellido Alcacena Associate Professor, Department of Computer Science Universitat Polit´ecnica de Catalunya Facultat d’Inform´atica de Barcelona (FIB) Facultat de Matem´atiques (UB) Escola T´ecnica Superior d’Enginyeria (URV) Universitat Polit´ecnica de Catalunya (UPC) Universitat de Barcelona (UB) Universitat Rovira i Virgili (URV)
Abstract One of the major limitations of brain-computer interfaces (BCI) is the need for a long and tedious calibration period in order for a subject to become proficient with the system. A principal challenge in training a BCI classifier that should work without user-specific calibration is that the training set is not large enough to capture the spectrum of potential signals. In this thesis, a new method to reduce BCI calibration time is proposed. Since one cause for subject-to-subject variability is the anatomical differences between subjects, we aimed to generate artificial data which would resemble the signals obtained from a new subject with a different cortical anatomy. This would allow for a large expansion of the training set size. To generate the artificial data we begin by decomposing the original signals, localizing the most prominent sources and shifting their orientation relative to the cortex. New signals are then regenerated using different head models. Training a classifier on the enriched training set should result in better generalizability. Although inter-subject classification ultimately fell outside the scope of this thesis, we consider intra-subject classification as a starting point for consideration of the methods applied. This ultimately lays the foundation for a much greater field of research involving the use of artificial data generation to combat the calibration time issue for BCIs.
Acknowledgments First and foremost, I’d like to thank Prof. Dr. Benjamin Blankertz for giving me the incredible opportunity to join the Neurotechnology team in Berlin and start working with research in BCIs. This has been a dream come true for me. I’d like to thank Daniel Miklody for all of the friendly guidance along the way. This project would not have happened without you. I’m also very grateful to Oleksandr Zlatov for his assistance in revising the pipeline and algorithms, and for making the long days reviewing code much more fun. In the grander scheme of things, I’d like to give a huge thanks to Bj¨orn Wahle for his help throughout the program as a whole. Switching from a neuroscience background to a Master’s in AI would have been infinitely more daunting without your support these past two years. Last but in no way the least, I have to give thanks for my dad. Everything I do has been made possible because of you. Thank you for being my support always, and rooting for me along the way. 1
Contents 1 Introduction 5 1.1 Motivation .............................. 6 1.2 Goals ................................. 7 2 The Foundations of Electroencephalography-Based Brain-Computer Interfaces 9 2.1 Electroencephalography Explained . . . . . . . . . . . . . . . . . 9 2.1.1 From Neuronal Sources to Meaningful EEG Data . . . . . 9 2.1.2 EEG Sources as Summed Pyramidal Output . . . . . . . 10 2.1.3 The Need for Multivariate Sources . . . . . . . . . . . . . 10 2.1.4 Motor Imagery and Event-Related Desynchronization ...................... 11 2.2 EEGasaBCI ............................ 11 2.2.1 WhyEEG? .......................... 12 2.2.2 Relevant Features for the Motor Imagery Paradigm . . . . 12 2.3 Forward Modeling and the Inverse Problem . . . . . . . . . . . . 13 2.3.1 Forward Modeling . . . . . . . . . . . . . . . . . . . . . . 13 2.3.2 Inverse Modeling . . . . . . . . . . . . . . . . . . . . . . . 14 2.4 Signal Decomposition . . . . . . . . . . . . . . . . . . . . . . . . 14 2.4.1 SSD .............................. 15 2.4.2 CSP.............................. 17 2.5 DipoleLocalization.......................... 18 2.6 StateoftheArt............................ 18 3 Methods 20 3.1 ProblemDefinition.......................... 20 3.2 Data.................................. 21 3.3 Preprocessing............................. 22 3.4 SSD .................................. 22 3.5 CSP .................................. 22 3.6 DipoleLocalization.......................... 22 3.7 Data Generation through Dipole Modification.............................. 23 3.8 Classification ............................. 24 2
4 Results 26 4.1 SSD .................................. 26 4.2 CSP .................................. 27 4.3 Power Spectral Densities . . . . . . . . . . . . . . . . . . . . . . . 30 4.4 Classification ............................. 31 4.4.1 Original Data Using SSD . . . . . . . . . . . . . . . . . . 31 4.4.2 Augmented Data Using SSD . . . . . . . . . . . . . . . . 31 4.4.3 Original Data Using CSP . . . . . . . . . . . . . . . . . . 31 4.4.4 Augmented Data Using CSP . . . . . . . . . . . . . . . . 32 4.5 Time to Generate Trials . . . . . . . . . . . . . . . . . . . . . . . 35 5 Discussion 37 5.1 SSD-FilteredData .......................... 37 5.2 CSP-FilteredData .......................... 38 5.3 SSDvs.CSP ............................. 38 5.4 General Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.5 Limitations and Directions for Future Research................................ 40 6 Conclusion 42 Bibliography 44 A SSD Filters and Patterns 49 B CSP Filters and Patterns 52 C CSP Potential Plots 57 D Classification of Original Data Using SSD 60 E Classification with Artificial Trials Using SSD 62 F Classification of Original Data Using CSP 71 G Classification with Artificial Trials Using CSP 74 H CSP Eigenvalue Plots 77 I Power Spectral Density Plots for Data Generated Using SSD 79 I.1 VPJH ................................. 80 I.2 VPKT................................. 81 I.3 VPTAA ................................ 82 I.4 VPTBT................................ 83 3
J Power Spectral Density Plots for Data Generated Using CSP 84 J.1 VPJH ................................. 84 J.2 VPKT................................. 85 J.3 VPTAA ................................ 85 J.4 VPTBT................................ 86 4
Chapter 1 Introduction In recent years brain computer interfaces (BCI) have made significant progress as an assistive device technology. Meanwhile, due to its non-invasiveness, portability, and relatively low cost, electroencephalography (EEG) has made its way to the forefront of the field. BCI systems transform recorded brain activity into commands which control a computer or external device (Nicolas-Alonso & Gomez-Gil, 2012). Popularly proposed uses for BCIs include communication, environmental control, and neurorehabilitation (Mak & Wolpaw, 2010). Ideally BCI systems would be sufficiently functional and reliable that they could be used outside of laboratory (i.e. research) settings, and provide domestic support. Indeed, presumably one of the ultimate goals of BCI research is the ability to produce commercializable BCI products for the aforementioned uses. However, before this can become a feasible reality, several key issues in BCI usability must be addressed. One such issue is that of the training required for a subject to become proficient with the BCI system, also known as the calibration time. Many examples of a user’s EEG signals must be recorded in order to calibrate a BCI using machine learning (Lotte et al., 2007). This is because the signal preprocessing, feature extraction, and/or classification algorithms may all be calibrated specifically for each user, due to the large variability among subjects (Lotte, 2015). Unfortunately the calibration period is both inconvenient and time consuming, thus lowering a BCI’s usefulness commercially and domestically. As Fabien Lotte relates, ”nobody would indeed use a computer mouse if it required a 20-min-long calibration before each use” (Lotte, 2015). Lowering (or, ideally, eliminating) calibration times is thus an area of active research. This thesis explores a potential route to address the issue of long and tedious BCI calibration times. Through the use of a specific signal processing and data augmentation workflow, we generate artificial data which should resemble trials that would be obtained from new subjects. As a result, the amount of training data available is easily multiplied. Although the calibration time issue serves as the primary inspiration for the present work, we ultimately focus only on singlesubject classification to guide our choices in the development of the framework. 5
This Introduction begins by explaining the Motivation and Goals of the project in greater detail. Following in Chapter 2 is a discussion of some of the fundamental concepts behind EEG as a BCI which are key to understanding the methods applied. This includes an explanation of the neuronal activity that leads to EEG signals, how the motor imagery paradigm works, forward and inverse modeling, and the signal decomposition algorithms used, namely spatiospectral decomposition (SSD) and common spatial patterns (CSP). Chapter 2 is concluded with a brief consideration of the source localization algorithm used, MUSIC (MUltiple SIgnal Classification), and a brief State of the Art to contextualize the work. Chapter 3 describes the Methods applied. Beginning is a brief Problem Definition, followed by a description of the data used and how it was obtained, the preprocessing steps, application of the signal decomposition and source localization algorithms, and how the artificial data was generated and subsequently classified. Chapter 4 presents the Results. This includes topographical scalp maps of the filters and patterns obtained using SSD and CSP, and the power spectral density plots for the artificially generated data. The classification loss is given for each signal decomposition method using the original data alone, as well as the original data with the addition of the augmented trials. The chapter is concluded with the time taken to generate different quantities of artificial trials. In Chapter 5 a Discussion of the results is given. This includes an analysis of any significant differences between classification using only the original data and the original plus augmented data, as well as a comparison of the framework using each of the two signal decomposition algorithms. Chapter 5 is concluded with an elaboration on the Limitations of the framework, and suggested Directions for Future Research. This thesis is concluded in Chapter 6. In Appendices A-J the reader can find the graphs for four of the five subjects tested here. In order to avoid an overwhelming number of graphs only those for one subject are presented in the body of the thesis. 1.1 Motivation This thesis was inspired by the challenge of minimizing calibration time for EEG-based BCIs. As mentioned previously, BCIs are scarcely used outside of laboratories for practical applications (Lotte, 2015). One reason for this can be attributed to the calibration time needed to train a system to work for a particular user. In theory, if the system already had sufficient knowledge of the subject-to-subject variability of EEG signals, it would be able to better generalize to new subjects and thus need less (or ideally, no) calibration time for a new user. However, capturing the spectrum of possible EEG signals is inherently challenging. The first reason for this is that training sets for EEG studies are notoriously small (Thiagarajan, 2017). Additionally, EEG can have a lengthy setup process 6
(especially for caps with a higher number of electrodes), and users get fatigued throughout an experiment. While different subjects’ signals may differ greatly from one another, a single user’s signals may also vary day-to-day, which limits the usefulness of long or extended training sessions. Meanwhile, oscillatory activity-based BCIs (such as the motor imagery (MI) paradigm) suffer from the calibration time issue even more than other BCI paradigms, such as those using event-related potentials (ERPs) (Lotte, 2015). Since the training sets are not large enough to capture the spectrum of potential signals, we set out to obtain training data that would. As recording EEG data from a sufficiently large, diverse, and controlled group of people is unfeasible, we proposed to generate the data instead. One cause for subject- to-subject variability is due to anatomical differences, as well as inter-subject variations in functional specialization of cortical anatomy. This anatomical influence is what we honed in on. We aimed to create new data which would imitate the brain signals that would be obtained from users with a different brain anatomy. This would allow for a significant expansion of the training set size with signals that should account for subject-to-subject variability. When trained on the expanded training set of enriched data, we hypothesized that the classier would be more generalizable and the system would therefore need less time for calibration. Of course, performance in terms of classification ability will always play a role in a BCI’s usability as well. This short project may not prepare a framework which is ready to confront the calibration time reduction challenge, but it lays the groundwork for future experimentation that may. This project in particular focuses on single-subject classification in order to infer the meaningfulness of the methods applied. There are still a plethora of ways in which one can augment the original data in order to generate new data which should be investigated. With a significant enlargement of the training set size, this could also pose a good opportunity for the application of deep learning techniques and an investigation of their usefulness. Indeed, any part of this pipeline could be modified and further investigated in its own right. 1.2 Goals In order to approximate the brain signals of users with a different brain anatomy, the following procedure was proposed. We began by decomposing the signals from existing users. Then we localized the strongest source(s) and modified their orientation relative to the cortex. New signals were regenerated using the head models of different participants in order to imitate data which would be obtained from that person with a different cortical anatomy. We believed that training a classifier on the enriched and enlarged dataset would reduce overfitting and increase generalizability. Within the allotted time frame the primary goal of this project became the establishment of the present framework, followed by an assessment of the meaningfulness of the methods applied. Further modifications in order to improve 7
The computation of the lead fields is a labor in itself. It depends on the different conductivities of the involved materials such as the brain, skull, and scalp; the head geometry, which would ideally be obtained from structural MRI; and the electrode positions (Haufe, 2014). Different techniques are used to obtain the forward model, each varying in how realistic and computationally intensive it is. One popular and more realistic technique is to use boundary element methods (BEMs), which require a geometrical model describing the interfaces between different tissue types. A brief description of how BEM was used to compute the lead fields used in this study is given Setion 3.6. Forward models are key both to gain insight into the neuronal origin of EEG signals, as well as for inverse modeling, which is described below. Generally speaking, lead fields link the forward and inverse solutions together. 2.3.2 Inverse Modeling Inverse modeling involves trying to deduce from the measured scalp potentials what the location of the responsible current source is (Mosher, 1999). In other words, this is the process of estimating the brain source(s) which produced the data according to the head model in question. The inverse solution essentially involves ”moving” candidate dipoles through the lead field to see which configuration best explains the data (in the present work we did this using the MUltiple SIgnal Classification (MUSIC) algorithm, explained in further detail in Section 2.5). The inverse problem itself is ill-posed; between ”silent” sources and sources which may cancel each other out, there are ultimately an infinite number of possible source combinations that could produce the resulting pattern. As a result, prior knowledge must be introduced, such as the expected number of sources and anatomical information (Haufe, 2014). That means that the accuracy and validity of the estimates also depend on the correctness of this ”prior knowledge” (Whittingstall et al., 2003). 2.4 Signal Decomposition It has already been explained that neuronal oscillations underlie brain activity, and how they can be used as the basis for BCI control systems. Neuronal oscillations are ubiquitous; they are generated in almost any area of the cortex and in subcortical structures (Steriade, 2001). This ultimately poses an issue for reading the EEG signal. Since there are so many sources of neuronal oscillations (including neuronal ”background” noise), it can be difficult to extract distinct, meaningful sources of oscillatory activity from the recorded signal (Nikulin et al., 2011). This is compounded by the fact that other sources of noise are just as ubiquitous—from the hardware, to eye movement artifacts, physical movement from the subject, and so on—and both the signal and noise can have overlapping frequency content. The extraction of neuronal oscillations is therefore an important first step in any EEG classification task. 14
Different signal decomposition techniques have been proposed for this purpose. The fundamental independent component analysis (ICA) and principal component analysis (PCA) algorithms have been found to be unsatisfactory options for most EEG decomposition problems. In the case of ICA, this is believed to be because ICA essentially finds the components with amplitudes resembling the most non-Gaussian distributions, while the interesting sources in EEG (or MEG) are often not very far from Gaussian (Hyv¨arinen et al., 2010). This makes ICA biased towards artifact detection, but less effective for the desired task of finding components related to brain activity, which is ultimately the goal EEG control studies. A compounding issue is that the majority of ICA methods are based on numerical approaches which may not converge, as well as the fact that the computation time can be intensive (Nikulin et al., 2011). Meanwhile, PCA often performs poorly because it is so sensitive to noise, which is abundant in EEG studies for the reasons mentioned above. In addition to these inherent issues, related PCA and ICA algorithms developed with the intent of circumnavigating these caveats are simply found to not perform as well as newer decomposition methods which have therefore become popular in this domain. Two of these methods include common spatial patterns (CSP) and spatio-spectral decomposition (SSD). In this work both SSD and CSP were used (independently) to decompose and filter the signals. The background explaining both methods is presented here. 2.4.1 SSD Spatio-spectral decomposition is a method developed by Nikulin et al. (2011) for the task of separating oscillatory sources from a set of mixed signals. The key advantage of SSD lies in its ability to select components explaining oscillationsrelated variance, instead of just any variance (as is the case for PCA) (Haufe et al., 2014). SSD is based on a linear decomposition of the recorded signals guided by the objective of maximizing the power at a peak frequency of oscillations while simultaneously minimizing the power at the neighboring frequency bins. This is ultimately equivalent to the maximization of signal-to-noise ratio (SNR, i.e. the ratio of the powers at a given frequency for the signal and noise, respectively). The outputs are components with spectral profiles characteristic for oscillatory sources. The SSD approach relies on the assumption that noise sources produce signals with a relatively broad frequency range (from a few Hz to tens of Hz). This allows the use of frequency bins around the frequency range of interest in order to enhance the SNR by estimating the noise in the spectral neighborhood of the band of interest. Algorithmically, this involves finding spatial filters which minimize the variance of the noise around the peak of interest while maximizing the variance of the signal at the peak frequency (Nikulin et al., 2011). As a result we have a typical peaky profile of the spectrum, with large power at a central peak flanked by considerably smaller power at the neighboring frequency bins. This would represent the characteristic shape of a spectrum with good SNR. 15
SSD accomplishes this through the diagonalization of two covariance matrices corresponding to the signal of interest and the surrounding, flanking noise. First, we start with a (t×c) measurement matrix M, where tis the number of samples and cis the number of channels. The columns of Mare filtered in two different ways to produce two new matrices: first, around the signal frequency of interest f, and then around the frequencies f-∆fand f+∆f, which are summed. These new matrices correspond to the frequency ranges of the signal plus noise (Ms)and noise alone (Mn), respectively. The columns in each matrix are centered to have a zero mean, and then the time-averaged covariance matrices are calculated for Msand Mn, respectively: Cs=MT sMs t(2.1) Cn=MT nMn t(2.2) Where Tdenotes transpose. We are then looking for the spatial filters w which would be related to high variance at the frequency of interest, and low variance in the surrounding frequency bins. The problem is thus to maximize: SNR(w) = wTCsw wTCnw(2.3) The task of finding the spatial filters becomes quite simple: this leads to the generalized eigenvalue decomposition. If the flanking frequency bins would contain other oscillations, SSD would also work by contrasting those oscillations at different frequency bins, and finding components with small power in one and larger power in another. In this case the separation from noise would not be perfect, but it would still allow for the extraction of the oscillations within the band-pass range (Nikulin et al., 2011). SSD has been found to outperform both PCA and ICA-based algorithms. A study conducted by Haufe et al. (2014) found that SSD significantly improved the performance of single-trial classification of imagined movements compared to classification with PCA pre-processing, or no dimensionality reduction. For ICA-based algorithms, Nikulin et al. found that while FastICA and ICA on the basis of the infomax approach did not converge, SOBI (”Second-Order Blind Identification Algorithm”) gave poorer results compared to SSD on both simualted and real EEG data. For the simulated data, Nikulin et al. found that SSD recovered the patterns of the original sources with an error about half that of SOBI in a quite broad SNR range (down to 0.05), which approximately corresponds to conventional situations where one observes peaks above the noise part of the spectra in the theta, alpha, beta and gamma bands. For the real EEG data, SSD commonly resulted in clear patterns, and posed another advantage by requiring only a few milliseconds to run, compared to tens of seconds or even minutes in the case of ICA (thus being at least 10,000 times faster, according to their experimental setup). The authors conclude that SSD allows 16
for reliable and fast extraction of neuronal oscillations in a predefined frequency range, maximizing the SNR. It should be noted that the SSD algorithm uses frequency bands which are known a priori as the target bands of interest (for example, for alpha/mu rhythms, this could be in the 8-13 Hz range (Muthukumaraswamy et al., 2004)). This is generally not an issue, since a significant quantity of prior EEG research has demonstrated that certain frequency ranges tend to correspond to specific cognitive, perceptual and motor processes. Since SSD extracts both the time courses and topographies of neuronal sources, we believed it would be a good technique to use in conjunction with source localization. 2.4.2 CSP Common spatial patterns (CSP) is another algorithm used to find optimal spatial filters. The CSP algorithm focuses on class differences, aiming to find the spatial filters which maximize the variance of the filtered signals for one class while minimizing it for another. Optimizing CSP spatial filters w(with wbeing a weight vector) consists of maximizing the following equation (Lotte, 2015): JCSP (w) = wC1wT wC2wT(2.4) where Ciis the average spatial covariance matrix of the band-pass filtered EEG signals from class i, and Tdenotes transpose. These spatial covariance matrices are typically obtained by computing the spatial covariance matrix from each trial per class, and then averaging them. This optimization problem is solved through the generalized eigenvalue decomposition of the two matrices C1and C2(Blankertz et al., 2008). The spatial filters which maximize one class while minimizing the other correspond to the eigenvectors for the largest and smallest eigenvalues of the generalized eigenvalue decomposition. CSP is a very useful method for signal decomposition as it makes explicit use of the label information, thus making it notable for its ability to highlight class discriminability. As output, the CSP algorithm gives an ordered list of characteristic spatial patterns which describe directions in the pattern space that are optimally suited for distinguishing between the two classes (M¨uller- Gerking et al., 1999). Once the filters ware obtained, CSP feature extraction typically consists of filtering the EEG signals using wand then computing the resulting signal’s log-variance for each trial. It is common practice to select three pairs of CSP spatial filters, corresponding to the three largest and smallest eigenvalues, thus resulting in a trial being described by six CSP features (Lotte, 2015). CSP leads to a drastic reduction in dimensionality while still making use of the information contained in all channels (M¨uller-Gerking et al., 1999). 17
2.5 Dipole Localization Dipole localization was done with the MUSIC (MUltiple SIgnal Classification) algorithm. Although MUSIC was first introduced for frequency estimation and radio direction finding (Schmidt, 1986), it has since been extended and applied to source localization problems as well (Mosher & Baillet, 1999). As discussed previously, a popular model for neural activity is that of the Equivalent Current Dipole (ECD). Each ECD represents the primary current associated with the combined activation of a large number of neurons located in a small volume of the brain (Mosher et al., 1992). The MUSIC algorithm is a parametric dipole fitting algorithm which scans a single dipole model through the head volume, computing the projections onto the signal subspace. The MUSIC algorithm finds the source locations for which the corresponding array vector is nearly orthogonal to the noise-only subspace, or equivalently, projects almost entirely into the estimated signal subspace (Mosher & Leahy, 1999). MUSIC is notable for scanning quickly with a single dipole search (instead of searching for all dipoles at once). 2.6 State of the Art The motor imagery (MI) paradigm has long been established as an effective method for BCI control. Examples of successful MI experiments include cursor control in 1- and 2-D (Wolpaw et al., 1991; Wolpaw & McFarland, 1994; Wolpaw & McFarland, 2004); prosthetic arm, hand, and hand orthosis control (Baxter et al., 2013; Murguialday et al., 2007; and Chen et al., 2009, respectively); and control of a rehabilitation robot (Ang et al., 2009; Sarac et al., 2013), to name a few examples. Within the motor imagery paradigm, the ability to reduce or suppress calibration time remains an open and challenging research question. Since oscillatory activity-based BCIs can be useful for so many applications (from self-paced BCI control and stroke rehabilitation, to ambient computing and more), there is an obvious motivation in current research to confront this challenge. A typical oscillatory activity-based BCI is designed around two main algorithms: one to optimize spatial filters (such as CSP or SSD), and the linear discriminant analysis (LDA) algorithm for classification (Lotte, 2015). It should be noted that both algorithms require the estimation of covariance matrices. If too little training data is available (or if the available data does not adequately reflect the variability that can occur during BCI use), the covariance matrices will be poorly estimated, leading to poor classifiers and/or spatial filters. As a consequence, many examples of EEG signals are desired in order to correctly calibrate BCI systems. This leads to the tedious BCI calibration process. BCI calibration time reduction has been only scarcely addressed in the literature so far. A few suggested approaches include the following (according to Lotte, 2015): 18
1. Regularization approaches which enable us to use machine learning efficiently with little training data 2. User-to-user transfer, where relevant data, features or classifiers from users for which much data is available are used to improve calibration time for the target user for which little training data is available 3. Semi-supervised learning, which adapts and refines the initially optimized model based on data obtained during BCI use 4. Using a priori physiological information about which features are expected to be relevant to help guide the design of the BCI One newer approach to the calibration time issue has since been proposed by Fabien Lotte (2015). This adds to the list a fifth method: artificial data generation in order to expand the training set size. Artificial data generation has been proposed previously as a solution for machine learning problems. For instance, Chakraborty & Garain (2010) used artificial data generation to increase the accuracy of speech processing, while Mouch`ere et al. (2007) did the same for handwriting recognition. To confront the calibration time issue for BCIs, Lotte (2015) proposed to generate artificial data from the few training trials available in three ways: 1. Using signal segmentation and recombination in the time domain 2. Using signal segmentation and recombination in the time-frequency domain 3. Using analogy-based data generation For each method six filters from CSP were used (corresponding to the three largest and three smallest eigenvalues of the generalized eigenvalue decomposition problem; refer to Section 2.4.2). 100 artificial trials were generated from various quantities of the available training data. These artificial trials were then added to the initial training set before training with CSP and LDA. It was found that the data generation approaches often increased classification performances, particularly when little training data was available. This idea and its reported success played a strong role in inspiring the present work. 19
Chapter 3 Methods This project can be conceptualized in four stages: 1. Signal decomposition 2. Source localization 3. Pattern augmentation 4. Data generation With the goal of ensuring that the achieved results were not just due to the particularities of the single subject in question, we ran this pipeline for five random subjects (from the group of 80, data acquisition described below). The subjects are titled VPJJ, VPJH, VPKT, VPTAA, and VPTBT. More details on each of these steps is hereafter presented. 3.1 Problem Definition The problem thus boils down to the need to adequately capture the variability in EEG signals during BCI use, in the face of limited or small training sets. In the present study we proposed to approach this issue from the angle of anatomical differences between subjects as a cause for subject-to-subject variability. We proposed that the generation of artificial data which modifies the orientation of the most prominent dipoles would result in data that approximates the brain signals of users with a different brain anatomy. Training a classifier on the enriched training set should result in better generalizability. While the experimental setup aims at capturing subject-to-subject variability in order to confront the calibration time issue, inter-subject classification is ultimately outside the scope of the present work. Instead, this work focuses only on single-subject classification as a means of analyzing the usefulness of methods selected for signal decomposition and data generation. This lays the foundation for methods which combine the use of a priori information (i.e. by 20
using inverse solutions to hone in on regions of interest from which relevant features are likely to be found, in order to guide the optimization of the spatial filters or classifier) with a pooled approach in order to reduce calibration time in future studies. 3.2 Data The data used in this experiment came from the study conducted by Blankertz et al. (2010), the aim of which was to develop a neurophysiological predictor for a participant’s performance for operating a sensorimotor rhythm (SMR)- based BCI. This was done in the context of the ”BCI illiteracy” phenomena, i.e. the fact that BCI control fails to correctly detect a user’s mental state for a non-negligible proportion of participants (estimated between 15% to 30%) (Blankertz et al., 2010). This study involved eighty healthy BCI-novices (41 female; ages 29.9±11.5 years; 4 left-handed). All subjects had full contractual capability, spoke German as their native language, and had no neurological disease. All measurements of a participant (calibration and feedback runs) were recorded on the same day. Brain activity was recorded from the scalp with multi-channel EEG amplifiers using 119 Ag/AgCl electrodes (reference at nasion) in an extended 10-20 system. Sampling was at 1000 Hz, with a band-pass filter of 0.05 Hz to 200 Hz. Electromyogram (EMG) and electrooculogram (EOG) were also recorded; however, this data is excluded from the present study. The data used in the present work was taken from the ”calibration” phase recording. During this phase, one of three different visual cues (arrows pointing left, right, or down) was shown every eight seconds; this indicated to the participant which type of motor task to imagine: left hand, right hand, or right foot (or feet, according to the preference of the participant), respectively. This setup is described in Figure 3.1. In one run, 25 trials of each motor condition were recorded. Three runs of imagined movement were done, resulting in 225 motor imagery trials altogether. Since this data was used to calibrate the system, results on accuracy for the calibration data alone were not given. For the post-calibration feedback Figure 3.1: The course of a calibration trial, including 2 seconds of a fixed cross followed by 4 seconds of the motor imagery cue (signified by left, right, or down arrows), finally followed by 2 seconds of a blank screen. Image taken from Blankertz et al. (2010). 21
results it was shown that feedback accuracy varied largely between participants (mean 74.4% ±16.5%), covering the full range from chance-level performance (50%) to perfect control (100%). For most participants performance also varied strongly between runs; the intra-participant performance variability between runs ranged from 0% to 19.8% (mean 5.3% ±3.7%). On average, feedback performance decreased from run to run, while self-assessed fatigue increased on average within the three feedback runs (2.8-3.3-3.8, on a scale from 1 to 7). More details on this experiment can be found in (Blankertz et al., 2010). 3.3 Preprocessing First, we excluded all of the channels which were not shared between the EEG data and the lead fields. The original data was obtained with 119 EEG electrodes, whereas the lead fields were obtained with only 92. Of these 92, only 64 channels were shared for subjects VPJJ, VPJH, and VPKT; 62 in the case of VPTAA and VPTBT. The extra channels were excluded from both the EEG data and lead fields. The lead fields included 3990 sources, but all dipoles located outside of the cortex were excluded. This led to 3748 sources considered for the source localization step. Next, the data was filtered using either SSD or CSP, described below. 3.4 SSD SSD was run with a center band of 8-13 Hz, with flanking bands at 5-8 and 13-16 Hz. All of the data (i.e. both training and test) was subsequently filtered, using the same amount of SSD filters as sources we aim to locate. A source was then located using MUSIC for each of the same number of patterns. We experimented with shifting 1-4 dipoles. 3.5 CSP The EEG data was bandpass filtered from 8-13 Hz (corresponding to the expected mu rhythm band frequency) prior to running CSP. From CSP we took the three highest and lowest eigenvalues for a total of 6 CSP components. All data (i.e. both training and test) was subsequently filtered with the corresponding 6 filters. We then located and modified the same number of dipoles. 3.6 Dipole Localization We took the best-fitting dipole for each of npatterns, where n=6for CSP, and ranged from 1-4 for SSD. A random lead field was used for the purpose of 22
source localization, which was done with the MUSIC algorithm (see Section 2.5 for more information). In this study we used pre-obtained lead fields which were calculated according to the head modeling done by Miklody et al., 2017. The authors represented individual head geometries using a 4-shell boundary element method (BEM) model including descriptions of the tissue boundaries for the brain, cerebrospinal fluid (CSF), skull and scalp. These descriptions were based on single points (vertices) of the boundaries between the different tissue types and their triangular connections, termed ”meshes.” From these meshes, an average head was built which was used to construct the individual head models of each subject as a linear projection of the points of the average head. Extraction from individual structural magnetic resonance images (MRIs) was done using the ”new segment” algorithm of the SPM8 toolbox. 3.7 Data Generation through Dipole Modification Augmented patterns were used to shift the orientation of the relevant dipoles for each subject’s original source data. The augmented patterns were generated by taking the dot product of the lead fields for just the dipole(s) of interest with the ”grid norms,” also for the corresponding dipole(s) of interest. The grid norms describe the orientation normal to the surface of the gray matter for each source, and were obtained using the MATLAB software toolbox FieldTrip. Augmented patterns were generated for the database of lead fields, which included 318 subjects, for a total of 318 augmented patterns. The patterns had dimensionality (channels×subjects×dipoles), e.g. (64×318×3). Each pattern could then be used to shift a subject’s original source data, giving the possibility to augment the original data 318 times. Artificial trials were generated by taking the dot product of the augmented patterns and the source data. This was then concatenated onto the original (filtered) data. We experimented with generating different numbers of artificial trials, with the possibility of expanding the training set given from the original subjects (listed above) by a maximum of 318 sets of artificial data. We used 175 trials from the original subjects as the training set. Each set of modified data would therefore contain 175 trials, and the maximum amount of trials that could be generated is therefore 318 ×175 = 55,650, which would be concatenated to the original subject’s 175 trials. From hereon, we refer to the number of sets of trials generated for simplicity, rather than the exact number of trials. Corresponding trial markers and class labels were also generated according to the number of sets generated. 23
4.3 Power Spectral Densities The power spectral density (PSD) was calculated in the Laplace-filtered channels C3 and C4 for the original plus augmented data for various numbers of subjects and modified dipoles. These highlight the amplitude of the SMRs over the hand areas of the sensorimotor cortex. Below subject VPJJ is shown (Figures 4.5-4.6 for SSD and CSP, respectively). The graphs for the other four subjects can be found in Appendices I and J for the data generated with SSD and CSP, respectively. In order to limit the number of graphs, only those with 318 sets of additional augmented trials are shown. Figure 4.5: Power spectral densities for subject VPJJ with 318 sets of generated trials using SSD. The plots are for 1-4 modified dipoles, from top to bottom. 30
Figure 4.6: Power spectral densities for subject VPJJ with 318 sets of generated trials using CSP. 6 CSP components were used. 4.4 Classification 4.4.1 Original Data Using SSD Classification loss using only the original data with various numbers of SSD filters (1-4) can be found in Figure 4.7. Figure 4.7: Loss on train and test per number of SSD components used for filtering (which corresponds to the number of dipoles that would be modified in the augmented data). The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for classes 0-2 (left to right) for subject VPJJ. 4.4.2 Augmented Data Using SSD Classification loss using the additional augmented trials with SSD filtering and different numbers of shifted dipoles (1-4) can be found in Figures 4.8-4.10. 4.4.3 Original Data Using CSP Classification loss using only the original data with CSP filtering can be found in Figure 4.11. 31
Figure 4.8: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 0, 1-4 dipoles (top to bottom, left to right) for subject VPJJ. 4.4.4 Augmented Data Using CSP Classification loss using the additional augmented trials with CSP filtering using 6 components can be found in Figure 4.12. 32
Figure 4.9: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 1, 1-4 dipoles (top to bottom, left to right) for subject VPJJ. Figure 4.10: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 2, 1-4 dipoles (top to bottom, left to right) for subject VPJJ. 33
Figure 4.11: Loss on train and test using only original data for classes 0 and 1 using 6 CSP filters for subject VPJJ. The dashed lines are the respective means, and the error bars show the standard deviation. Figure 4.12: Loss on train and test for the data using 6 CSP components, and shifting 6 dipoles. Plots are for classes 0 and 1 (left to right) for subject VPJJ. The dashed lines are the respective means, and the error bars show the standard deviation. 34
4.5 Time to Generate Trials Figure 4.13 shows the amount of computational time taken to generate each set of trials using SSD filters and patterns. Figure 4.14 shows the same using CSP filters and patterns. Since the times were quite similar across subjects for each decomposition algorithm, given number of dipoles shifted and sets of trials generated, only subject VPJJ is shown here for brevity. All runs were done on the Technical University of Berlin’s cluster, which uses the Univa Grid Engine batch-queuing system and has the following graphics processing units (GPUs): Tesla P100 with 12GB, Tesla P100 with 16GB, GTX 1080, Tesla K80, and Tesla K40c. 35
Figure 4.13: Time in seconds taken to generate each number of sets of artificial trials for subject VPJJ using SSD filters and patterns, for different numbers of shifted dipoles. Figure 4.14: Time in seconds taken to generate each number of sets of artificial trials for subject VPJJ using 6 CSP filters and patterns. 36
Chapter 5 Discussion 5.1 SSD-Filtered Data With SSD filtering, for class 0 (imagined left hand movement) the addition of the augmented data improved classification for subject VPKT (p<.05), and worsened classification for subjects VPJJ (p<.01) and VPTAA (p<.02). For class 1 (imagined right hand movement), the addition of the augmented data improved classification for subject VPJH (p<.01). There were otherwise no significant differences in classification (regardless of the number of filters used/dipoles shifted) using the original or the original plus artificial data, including for all of class 2 (imagined right foot/feet movement) (p>.05). Across all subjects there were no significant differences in classification loss between the original data filtered with nfilters and the augmented data (using all 318 sets of trials) with the corresponding nshifted dipoles. For only the original SSD-filtered data, filtering with more components increases overfitting, not always accompanied with a significant decrease in test loss. In fact, the consequent changes in test loss across subjects is quite varied. For subject VPJJ, filtering with an increased number of components led to a decrease in test loss for classes 0 and 1, whereas there was an increase for class 2; for subjects VPJH and VPTAA, test loss increased in class 0, stayed relatively the same for class 1, and decreased for class 2; subject VPTBT showed the opposite trend; and subject VPKT saw an increase, decrease, and then increase in loss for classes 0, 1 and 2, respectively. As more artificial trials are added the overfitting generally gets worse across subjects, classes, and numbers of shifted dipoles, without improvement in test performance. We expected that modifying only one dipole would worsen results, as this would result in a loss of information from the other sources which would be representative of different classes. Moving multiple dipoles would ideally capture the source activity for the various classes. It can be seen that train loss with one shifted dipole is greater than when 2-4 dipoles are shifted, especially when a greater number of trials are generated. In general, train loss gets closer 37
to 0 when more dipoles are shifted and more trials are generated. However, regardless of the number of shifted dipoles, test loss across subjects and classes stays at or around 50. 5.2 CSP-Filtered Data For class 0, while the artificial data (considering all 318 trials) lead to better classification for subjects VPJJ and VPJH (and only barely better for subject VPTBT, with a loss of 45.45 compared to 45.71), it was worse for subjects VPKT and VPTAA. For class 1, classification improved with the addition of the augmented trials for VPJJ, VPKT, and VPTBT, and worsened for the other subjects. 5.3 SSD vs. CSP In general, test loss was much more variable for CSP than SSD depending on the number of subjects used to generate artificial trials. Train loss was also much higher when using CSP rather than SSD, for the original as well as the original plus augmented trials. Classification with only the original data tended to be better with CSP filtering than SSD filtering for class 1; it was highly variable for class 0. For class 0, there was a generally lower test loss with the inclusion of all 318 sets of trials with CSP than with SSD, regardless of the number of shifted dipoles with SSD (except for subject VPTAA, which generally had poorer results with CSP, although these poor results for both SSD and CSP could be due to the subject’s lack of sensorimotor rhythm; see Figures I.3 and J.3.) 5.4 General Discussion There are no significant differences or salient patterns which could justify the use of this framework as it is currently applied. However, it should be noted that this framework is designed to capture variability between subjects, and it still needs to be investigated in this capacity. We wanted to investigate the application to single-subject classification as a starting point for implementing the methods currently applied, and it is still interesting to see if this augmentation can explain anything on a single subject level. That being said, it is not particularly surprising that single subject classification did not improve overall. Unfortunately, it is quite difficult to make generalizable inferences as to the performance of the system since there are so many variables at play. Many factors that could have decreased performance are elaborated on below, in Limitations and Directions for Future Research (Section 5.5). Some additional theories are presented here. Since 5 subjects were chosen randomly out of the database of 80 subjects, and all had similarly poor results, it is doubtful that these poor results are 38
explainable by the subjects being ”BCI illiterate.” However, it is still worth mentioning as BCI illiteracy affects approximately 20% of users. Assuming this is not the issue, then there may be several other reasons contributing to poor performance. To begin with, it is possible that the augmented data could be amplifying spurious correlations in the data that are meaningless for classification. For instance, for subjects VPJJ and VPKT the pattern obtained from SSD for the strongest component appears to correspond to a visual artifact (Figures 4.1 and A.2), meaning that this information which is irrelevant to the motor imagery task would then be amplified with the generation of the artificial trials. SSD was initially selected because it is good for finding anatomical regions associated with activity, however, one of the caveats of SSD is that it has no regard for classes. As such, it can just as easily amplify features of the chosen band which are irrelevant to the experiment at hand. Since the sensorimotor mu rhythm and the visual alpha rhythm coincide, this means that SSD may just as well find visual artifacts, the sources of which would subsequently be localized by MUSIC and shifted with the augmented patterns. This issue inspired the inclusion of CSP in the experimental pipeline. However, as previously discussed, CSP also did not lead to any exceptional improvements in classification. Aside from issues with the signal decomposition algorithm, it could also be that the sources were not moved in a meaningful way. We’ve begun by shifting the orientation of the sources randomly; it could be that they were shifted too much and added excessive variability, especially for within one subject. It could also simply be that too much similar data is being added, which leads to the overfitting problem. Indeed, all of the transformations done in this work are linear; no new information has actually been added, but rather the same information has been presented in different ways. The question is whether this would change the distribution of the data, or if it would make it more robust to changes which were already there. The results obtained are yet inconclusive in answering this question. It should also be noted that cross-validation was not done, which is, generally speaking, a poor methodological approach–especially for BCI experiments. However, given the computational time involved, it was not feasible to implement. For instance, the entire pipeline (for the different shifted dipoles and subjects presented here) took approximately 20 hours to run for subject VPJJ for the SSD-filtered data, and several subjects had to be run again as they sometimes resulted in memory errors (on the Technical University of Berlin’s cluster). Running all of the algorithms for different folds of the data would have exacerbated these issues, and indeed, may not have worked at all. Although the train and test split method can give an unreliable estimate of the performance of a model on new data, this gave us an easily implementable starting point for a ”quick” estimate of system performance. Additionally, since we add so many trials to increase the size of the training set, the estimation should not be so unreliable for runs where 318 sets of trials were generated. 39
20. Mosher, J. C. & Baillet, S. (1999). EEG Source Localization and Imaging Using Multiple Signal Classication Approaches. Journal of Clinical Neurophysiology, 16(3), 225-238. doi:10.1097/00004691-199905000-00004 21. Mosher, J. C., & Leahy, R. M. (1999). Source Localization Using Recursively Applied and Projected (RAP) MUSIC. IEEE Transactions on Signal Processing, 47(2), 332-340. doi:10.1109/78.740118 22. Mosher, J. C., Leahy, R. M., & Lewis, P. S. (1999). EEG and MEG: Forward Solutions for Inverse Methods. IEEE Transactions on Biomedical Engineering, 46(3), 245-259. doi:10.1109/10.748978 23. Mosher, J. C., Lewis, P. S., & Leahy, R. M. (1992). Multiple Dipole Modeling and Localization from Spatio-Temporal MEG Data. IEEE Transactions on Biomedical Engineering, 39(6), 541-557. doi:10.1109/10.141192 24. Mouch`ere, H., Bayoudh, S., Anquetil, E., & Miclet, L. (2007). Synthetic On-line Handwriting Generation by Distortions and Analogy. 13th Conference of the International Graphonomics Society (IGS2007), 10-13. 25. M¨uller-Gerking, J., Pfurtscheller, G., & Flyvbjerg, H. (1999). Designing optimal spatial filters for single-trial EEG classification in a movement task. Clinical Neurophysiology, 110(5), 787-798. doi:10.1016/S1388- 2457(98)00038-8 26. Murguialday, A. R., Aggarwal, V., Chatterjee, A., Cho, Y., & Rasmussen, R. (2007). Brain-Computer Interface for a Prosthetic Hand Using Local Machine Control and Haptic Feedback. 2007 IEEE 10th International Conference on Rehabilitation Robotics, 609-613. doi:10.1109/ICORR.2007.4428487 27. Muthukumaraswamy, S. D., Johnson, B. W., & McNair, N. A. (2004). Mu rhythm modulation during observation of an object-directed grasp. Cognitive Brain Research, 19(2), 195-201. doi:10.1016/j.cogbrainres.2003.12.001 28. Ng, B. S., Logothetis, N., & Kayser, C. (2013). EEG phase patterns reflect the selectivity of neural firing. Cerebral Cortex 23(2), 389-398. doi:10.1093/cercor/bhs031 29. Nicolas-Alonso, L. F., & Gomez-Gil, J. (2012). Brain computer interfaces, a review. Sensors, 12(2), 1211-1279. doi:10.3390/s120201211 30. Nikulin, V. V., Nolte, G., & Curio, G. (2011). A novel method for reliable and fast extraction of neuronal EEG/MEG oscillations on the basis of spatio-spectral decomposition. NeuroImage, 55(4), 1528-1535. doi:10.1016/j.neuroimage.2011.01.057 31. Nurse, E. S., Karoly, P. J., Grayden, D. B., & Freestone, D. R. (2015). A Generalizable Brain-Computer Interface (BCI) Using Machine Learning for Feature Discovery. PLoS One, 10(6), e0131328. doi:10.1371/journal.pone.0131328 46
32. Olejniczak, P. (2006). Neurophysiologic Basis of EEG. Journal of Clinical Neurophysiology, 23(3), 186-189. doi:10.1097/01.wnp.0000220079.61973.6c 33. Pfurtscheller, G. (2001). Functional brain imaging based on ERD/ERS. Vision Research, 41(10-11), 1257-1260. doi:10.1016/S0042-6989(00)00235-2 34. Pfurtscheller, G., & Lopes da Silva, F. H. (1999). Event-related EEG/MEG synchronization and desynchronization: basic principles. Clinical Neurophysiology, 110(11), 1842-1857. doi:10.1016/S1388-2457(99)00141-8 35. Pfurtscheller, G. & Neuper, C. (1997). Motor imagery activates primary sensorimotor area in humans. Neuroscience Letters, 239(2) 65-68. doi:10.1016/S0304-3940(97)00889-6 36. Sarac, M., Koyas, E., Erdogan, A., Cetin, M., & Patoglu, V. (2013). Brain Computer Interface based robotic rehabilitation with online modification of task speed. 2013 IEEE 13th International Conference on Rehabilitation Robotics (ICORR). doi:10.1109/ICORR.2013.6650423 37. Sch¨afer, J., & Strimmer, K. (2005). A shrinkage approach to largescale covariance matrix estimation and implications for functional genomics. Statistical Applications in Genetics and Molecular Biology, 4(1). doi:10.2202/1544-6115.1175 38. Schmidt, R. (1986). Multiple emitter location and signal parameter estimation. IEEE Transactions on Antennas and Propagation, 34(3), 276- 280. doi:10.1109/TAP.1986.1143830 39. Steriade, M. (2001). Impact of network activities on neuronal properties in corticothalamic systems. Journal of Neurophysiology, 86 (1), 1-39. doi:10.1152/jn.2001.86.1.1 40. Thiagarajan, T. (2017). Human Brains and the Control Issue. Retrieved from: https://sapienlabs.co/human-brains-control-issue/ 41. Towle, V. L., Bola˜nos, J., Suarez, D., Tan, K., Grzeszczuka, R., Levin, D. N., Cakmur, R., Frank, S. A., & Spire, J. P. (1993). The spatial location of EEG electrodes: locating the best-fitting sphere relative to cortical anatomy. Electroencephalography and Clinical Neurophysiology, 86(1), 1-6. doi:10.1016/0013-4694(93)90061-Y 42. Wolpaw, J. R., & McFarland, D. J. (2004). Control of a two-dimensional movement signal by a noninvasive brain-computer interface in humans. Proceedings of the National Academy of Sciences of the United States of America, (101)51, 17849-17854. doi:10.1073/pnas.0403504101 43. Wolpaw, J. R., & McFarland, D. J. (1994). Multichannel EEG-based brain-computer communication. Electroencephalography and Clinical Neurophysiology, 90(6), 444-449. doi:10.1016/0013-4694(94)90135-X 47
44. Wolpaw, J. R., McFarland, D. J., Neat, G. W., & Forneris, C. A. (1991). An EEG-based brain-computer interface for cursor control. Electroencephalography and Clinical Neurophysiology, (78)3, 252-259. doi:10.1016/0013-4694(91)90040-B 45. Whittingstall, K., Stroink, G., Gates, L., Connolly, J. F., & Finley, A. (2003). Effects of dipole position, orientation and noise on the accuracy of EEG source localization. Biomedical Engineering Online, 2 (14). doi:10.1186/1475-925X-2-14 46. Yuan, H., & He, B. Brain-Computer Interfaces Using Sensorimotor Rhythms: Current State and Future Perspectives. (2014). IEEE Transactions on Biomedical Engineering, 61(5), 1425-1435. doi:10.1109/TBME.2014.2312397 48
Appendix A SSD Filters and Patterns 49
Figure A.1: Scalp topographies of the filters and patterns obtained from SSD for the four largest eigenvalues for subject VPJH, in arbitrary units. Figure A.2: Scalp topographies of the filters and patterns obtained from SSD for the four largest eigenvalues for subject VPKT, in arbitrary units. 50
Figure A.3: Scalp topographies of the filters and patterns obtained from SSD for the four largest eigenvalues for subject VPTAA, in arbitrary units. Figure A.4: Scalp topographies of the filters and patterns obtained from SSD for the four largest eigenvalues for subject VPTBT, in arbitrary units. 51
Appendix B CSP Filters and Patterns 52
Figure B.1: The patterns obtained from CSP for the selected highest and lowest eigenvalues for subject VPJH, in arbitrary units. Figure B.2: The filters obtained from CSP for the selected highest and lowest eigenvalues for subject VPJH, in arbitrary units. 53
Figure B.3: The patterns obtained from CSP for the selected highest and lowest eigenvalues for subject VPKT, in arbitrary units. Figure B.4: The filters obtained from CSP for the selected highest and lowest eigenvalues for subject VPKT, in arbitrary units. 54
Figure B.5: The patterns obtained from CSP for the selected highest and lowest eigenvalues for subject VPTAA, in arbitrary units. Figure B.6: The filters obtained from CSP for the selected highest and lowest eigenvalues for subject VPTAA, in arbitrary units. 55
Appendix E Classification with Artificial Trials Using SSD 62
Figure E.1: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 0, 1-4 dipoles (top to bottom, left to right) for subject VPJH. Figure E.2: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 1, 1-4 dipoles (top to bottom, left to right) for subject VPJH. 63
Figure E.3: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 2, 1-4 dipoles (top to bottom, left to right) for subject VPJH. 64
Figure E.4: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 0, 1-4 dipoles (top to bottom, left to right) for subject VPKT. Figure E.5: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 1, 1-4 dipoles (top to bottom, left to right) for subject VPKT. 65
Figure E.6: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 2, 1-4 dipoles (top to bottom, left to right) for subject VPKT. 66
Figure E.7: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 0, 1-4 dipoles (top to bottom, left to right) for subject VPTAA. Figure E.8: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 1, 1-4 dipoles (top to bottom, left to right) for subject VPTAA. 67
Figure E.9: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 2, 1-4 dipoles (top to bottom, left to right) for subject VPTAA. 68
Figure E.10: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 0, 1-4 dipoles (top to bottom, left to right) for subject VPTBT. Figure E.11: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 1, 1-4 dipoles (top to bottom, left to right) for subject VPTBT. 69
Figure E.12: Loss on train and test per number of modified dipoles. The dashed lines are the respective means, and the error bars show the standard deviation. Heavy overfitting is apparent. Plots are for class 2, 1-4 dipoles (top to bottom, left to right) for subject VPTBT. 70
Appendix F Classification of Original Data Using CSP 71
Figure H.3: The explained variance per eigenvalue for classes 0 and 1, for subject VPKT. Figure H.4: The explained variance per eigenvalue for classes 0 and 1, for subject VPTAA. Figure H.5: The explained variance per eigenvalue for classes 0 and 1, for subject VPTBT. 78
Appendix I Power Spectral Density Plots for Data Generated Using SSD 79
I.1 VPJH Figure I.1: Power spectral densities for subject VPJH with 318 sets of generated trials. The plots are for 1-4 modified dipoles, from top to bottom. 80
I.2 VPKT Figure I.2: Power spectral densities for subject VPKT with 318 sets of generated trials. The plots are for 1-4 modified dipoles, from top to bottom. 81
I.3 VPTAA Figure I.3: Power spectral densities for subject VPTAA with 318 sets of generated trials. The plots are for 1-4 modified dipoles, from top to bottom. 82
I.4 VPTBT Figure I.4: Power spectral densities for subject VPTBT with 318 sets of generated trials. The plots are for 1-4 modified dipoles, from top to bottom. 83
Appendix J Power Spectral Density Plots for Data Generated Using CSP J.1 VPJH Figure J.1: Power spectral densities for subject VPJH with CSP and 318 sets of generated trials. 6 CSP components were used. 84
J.2 VPKT Figure J.2: Power spectral densities for subject VPKT with CSP and 318 sets of generated trials. 6 CSP components were used. J.3 VPTAA Figure J.3: Power spectral densities for subject VPTAA with CSP and 318 sets of generated trials. 6 CSP components were used. 85
J.4 VPTBT Figure J.4: Power spectral densities for subject VPTBT with CSP and 318 sets of generated trials. 6 CSP components were used. 86