Common Spatial Pattern for the Classification of Imagined
Total Page:16
File Type:pdf, Size:1020Kb
Common Spatial Pattern for the Classification of Imagined Geometric Objects Fabio R. Llorella Costa1, Gustavo Patow1 and Jose´ M. Azor´ın2 1VIRViG, Universitat de Girona, Girona, Spain 2BMI-LAB, Universidad Miguel Hernandez,´ Elche, Spain [email protected], [email protected], [email protected] Keywords: Brain-Computer Interface, Common Spatial Pattern, Support Vector Machine, Visual Imagery. Abstract: Electroencephalographic (EEG) signals contain cognitive information, which can be used by Brain-Computer Interface (BCI) systems to control devices through thought. In this work we study the possibility of detecting the visual imagination of seven different geometric objects (triangle, circle, square, pentagon, line, hexagon and parallelogram). The power spectral density in the a band were compared offline with using common spatial pattern (CSP) and the variance of each channel, obtaining as a best result the calculation of the CSP plus variance in the a band and classifying the vector of features with a support vector machine (SVM), obtaining an average result of 52% accuracy and a kappa value of 0.43 in the classification of the seven geometrical shapes, reaching up to 83% and a kappa value of 0.78 for a single user. 1 INTRODUCTION use techniques widely used in motor imagery classi- fication, such as the common spatial pattern, which Classification of electroencephalographic (EEG) sig- has offered good results (Wang et al., 2005; DaSalla nals is not a simple task as they show a great variabil- et al., 2009) and has been used to classify support vec- ity in time, that is, they are non-stationary signals (Lo tor machines, also widely used in the classification of et al., 2009). BCI are non-invasive systems that are EEG signals (Singla and Haseena, 2013; Mariko and ultimately based on the classification of EEG signals. Junichi, 2014; Lotte et al., 2018). To extract the char- There exist BCI devices that can properly classify acteristics of the signals, we chose to use the vari- EEG signals for the control of different devices (Chen ance of each channel, as it is a fast statistical tech- et al., 2015; Abiyev et al., 2016; Edlinger et al., 2011), nique. Currently, there are few works that offer light but the vast majority of works that can be found in the on how to build a BCI system that takes advantage of literature use motor imagery or related signals, as the the opportunities that visual imagination can offer in slow cortical potentials (SCP) (Mensh et al., 2004). the construction of BCI systems for people who have This limits applications of BCI systems to applica- artistic interests or who want to use BCI systems to tions of motor nature, i.e., where motor imagination carry out design or drawing applications. Here we can play an important role, as could be the movement demonstrate the possibility of classifying seven imag- of a wheelchair or a prosthesis (Ferreira et al., 2010; ined geometric objects with a high degree of accuracy. Galan´ et al., 2008; Guger et al., 2002). However, there Being simple geometric objects, these can be used for are applications that are difficult to implement and ul- the creation of a BCI system such as computer-aided timately are unnatural at the time of use. design. Another problem encountered by non-invasive BCI systems is that, as EEG signals are difficult to classify, these systems can only discriminate few 2 METHODS classes, usually between two and four classes, al- though it is true that There are studies where this number of classes is overcome using visual evoked 2.1 Subjects potentials (SSVEP) (Song et al., 2017). However, for imagined signals, the four-class limit cannot usu- Three subjects (two female and one male) between 24 ally be overcome. In this paper we have chosen to and 40 years of age, participated in this study. All sub- jects were right-handed and and they have not vision tors with the corresponding cognitive activity. In problems or neurological disorders. The experiment this work, we have used common spatial pattern, had the informed consent of the people. together with the variance of each component of the common spatial pattern in the feature extraction 2.2 Material phase (Ramoser et al., 2000). In this study, the g.Nautilus device of g.tec was used. 3.1 Data Processing The device consists of eight wet electrodes at a sam- pling rate of 250 Hz. We used the international 10-10 While the signals were being recorded, they were fil- system to place the electrodes on the scalp. The elec- tered by the hardware of the g.Nautilus device be- trodes used were: Oz, P3, POz, P4, PO7, PO4, PO3 tween 0.01 and 60 Hz with a pass banda filter, the and PO8, with AFz used as reference. We have used order of the filter was six, and then a Notch filter these electrodes because they are located in the occip- between 48 and 52 Hz was also applied. Once the ital area, an area linked to vision and because other EEG signals were registered, they were partitioned studies identified electrodes P4, PO4, PO3 and PO7 into fragments of a second without overlapping, omit- as good to classify signals coming from visual imagi- ting the first second of the imagination task. Once nation (Bobrov et al., 2011). At the time of registering the trials were partitioned, they were filtered in the a the impedance of the electrodes was below 10kW. band, between 8 and 12 Hz (this band is important in visual imagery (Bobrov et al., 2011)) using a butter- 2.3 Experimental Paradigm worth band pass filter of order six. All the processing of the EEG signals was done offline using MATLAB The paradigm used lasts a total of eight seconds. Dur- R2016a (Matlab, 2016). ing the first second, a white cross is shown on a black background, indicating the start of the trial. The next 3.2 Common Spatial Pattern two seconds show the geometric figure that the person must imagine, and in the last five the black screen ap- The CSP is a special filter that aims to maximize the pears and is left. This is when the person must imag- variance between two different classes. Although this ine the figure that has been previously shown. The or- algorithm is usually applied between two classes, it der the figures appear on the screen is random, so the can be extended to an arbitrary number N of classes. user does not know what figure will appear and thus The objective of the CSP filter is to return a transfor- cannot anticipate it. This procedure is performed 20 mation matrix W with respect to a group of EEG data times (14 trials each). Once the trials have been regis- matrices Xi. The first step is to calculate the normal- tered, the person makes a short break and re-registers ized spatial covariance matrices of Xi where i is the other 14 trials, making a total of 280 trials (40 trials type of class being analyzed. per geometric figure). The OpenVibe software was used to program of the paradigm, because it offers a X XT R = i i (1) simple and quick way to create these paradigms. i T trace(XiXi ) where T is the transpose operator and trace is the sum of the diagonal elements. 3 PROCESSING PIPELINE Next, it is necessary create the covariance matrix. In all BCI systems, there are differentiated phases, N the first phase always being the pre-processing of the Rc = ∑ Ri (2) EEG signals, where the EEG signals are conditioned i=1 for the following phases. In this pre-processing, EEG where N is the number of classes. Here, we used N = signals are usually partitioned into pieces to be fil- 7. The corresponding matrices of eigenvectors are: tered in the frequency range and spatial filters are ap- T plied to eliminate the artifacts that they may contain. Ri = VlV (3) The next phase is feature extraction. Features where V is the diagonal matrix of eigenvalues. Fi- must contain the necessary information to be able nally, W is constructed as: to differentiate between the different classes that we p want to classify. Q = V l−1 (4) The last phase is the classification, which will be responsible for associating the different feature vec- W = (V T ∗ Q)T (5) To create the feature vector, we must transform the not applied, we calculated only the time variance of signals in the following way: the EEG signal channels. Zi = W ∗ Xi (6) where xi is the set that contains the signals EEG that belong to class i. Finally is necessary calculate the variance for each component of Zi: fi = log(var(Zi( j)) (7) where j is the number of channels. With this method we build feature vectors of di- mension equal to the number of channels of the EEG signals. The advantage that this procedure has is that it creates small vectors and therefore does not need many trials to train the classifier, because if the size Figure 1: Result of applying CSP (orange) and without ap- of feature vectors is very large, more trials will be plying CSP (blue), the dotted line indicates value for a ran- needed (Trunk, 1979). dom selection. 3.3 Classification It can be seen that applying the CSP algorithm re- sults in more significant results than without applying The last stage of the BCI systems is usually the clas- it, obtaining a mean accuracy of 52% with CSP and sification of the vector of features that we have gener- 18% without applying CSP.