Classifications of Motor Imagery Tasks in Brain Computer Interface Using Linear Discriminant Analysis

—In this paper, we address a method for motor imagery feature extraction for brain computer interface (BCI). The wavelet coefficients were used to extract the features from the motor imagery EEG and the linear discriminant analysis was utilized to classify the pattern of left or right hand imagery movement and rest. The performance of the proposed method was evaluated using EEG data recorded by us, with 8 g.tec active electrodes by means of g.MOBIlab+ module. The maximum accuracy of classification is 91%.


INTRODUCTION
Brain computer interface is a system of communication with the external environment, a device that reads brain signals and converts them into control and communication signals.The research on BCI domain is motivated by the hope of creating new communication channels for people with severe neuromuscular disabilities.BCI can offer the patients who suffer from some diseases, like amyotrophic lateral sclerosis or total paralysis (-locked-in‖ syndrome), the possibility to communicate with the environment, to control computers, or to drive external devices by regulation produced by brain activity alone, [1].
In the 60's, the control of devices using brain signals was considered science fiction.Although recording brain signals have attracted attention since 1922, when the German scientist, Hans Berger [2], recorded the electrical activity of the brain, measurement technology and signal processing were still quite limited to understand how the brain operated.Nowadays the situation has changed.Research in the field of neuroscience in recent years has led to a much better understanding of the human brain.Algorithms and signal processing capabilities of computers have advanced so much that the real-time processing of signals from the brain not require expensive and very bulky equipment.
The movement of a member or even a single muscle contraction causes changes in brain activity.In fact, only the imagining or preparing of a movement modifies the sensorimotor rhythms.
Sensorimotor rhythms (SMR) refer to oscillations recorded on brain activity in somatosensory and motor areas.Brain oscillations are usually classified according to specific frequency bands, named: delta <4 Hz, theta: 4-7 Hz, alpha 8-12 Hz, beta: 12-30 Hz, gamma :> 30 Hz. Alpha rhythm activity recorded on sensorimotor areas is called the mu rhythm.The decrease in oscillatory activity in a specific frequency band is called event related desynchronization -ERD, [3].Similarly, the increase of oscillatory activity in a specific frequency band is called event related synchronization -ERS.The patterns ERD / ERS can be produced by motor imagery.So, the sensorimotor rhythms are represented by mu (8-12 Hz) and beta rhythms (12-30Hz).

Imagining
left hand movement produces a desynchronization on C4 electrode in the right side of the scalp, while imagining right hand movement produces a desynchronization on electrode C3, on the left side of the brain.The cerebral activity caused by hand movement is localized in the contralateral area of the brain.
In this paper we used multiresolution wavelet analysis for feature extraction.This method was very used in signal processing of BCI data recordings, [4], but in combination with linear discriminant analysis (LDA) we obtain a better classification rate than the classification obtained in the online cursor movement task.
The multiresolution wavelet analysis gives us a time localization of spectral components so time-frequency analysis represents a suited tool to get appropriate features which will be used to train the classifier.
The signals are classified using two methods based on LDA.We use this type of classifier because we want to compare our result with those obtained by the BCI2000 software, when it uses LDA to show the success of the testing paradigm.Our contribution is represented by the use of the LDA with the normalized feature matrix.
The goal of this paper is to show that the classifier used in BCI2000 can be improved to obtain better accuracy and our acquired signals are appropriate to be used to control a BCI system.www.ijarai.thesai.orgII.METHODOLOGY

A. Experimental paradigms
The EEG signals used for this experiment were recorded by means of a g.tec acquisition system, namely g.MOBIlab+ module, and BCI2000 platform.The data were recorded with 8 wet active electrodes, placed on scalp according to the international 10-20 system, [5].
The electrodes are placed on channels: CP3, CP4, P3, C3, Pz, C4, P4 and Cz.These channels are selected in both hemispheres, in sensorimotor areas, due to the appearance of sensorimotor rhythms in these areas.The reference electrode is placed on the right ear.

Train paradigm
The subjects received instructions regarding their behavior during recording.The subjects were seated in front of a monitor that during the sessions will either be blank or displaying an arrow pointing left or right.When a left or right arrow is displayed, the subjects need to imagine the movement of the respective hand.When the screen monitor is blank, they must relax and stop any movement.Each left and right arrow appears 30 times.The time interval of the visual stimulus was 2 seconds.After this part of training we perform an offline analysis which computed the coefficient r 2 comparing the EEG spectra associated with each motor-imagery task with spectra recorded at rest, [6].

Test paradigm
During the testing paradigm the subject should imagine the movements of only one hand, that for which we obtained the best results in the offline analysis, such classification will be perform only for two classes: motor imagery of the left or right hand and rest.
On the testing paradigm the subject must lead a ball so that it hit the target, represented by a yellow bar.When the target is at the top of the screen, the subject must imagine the movement of the hand, and when the target is at the bottom of the monitor, the subject needs to relax.When the ball reaches the target, it changes color (Table I).At the end of the paradigm, BCI2000 software displays the percentage of success of the experiment (classification which is based on LDA).The signal resolution (a measure of detail information carrier) changes by filtration and the scale by subsampling www.ijarai.thesai.org(decimation).Subsampling by a factor, n, reduced the number of samples n times, [7].
The discrete signal, denoted by x(n) is passed thought a low pass filter, that cuts the superior half of the signal frequency band.The impulse response of the filter is h(n).The filtration is equivalent to the signal convolution with the impulse response of the filter.In discrete-time, convolution is defined as, [8]: The multiresolution decomposition of a recorded signal is schematically shown in Figure 1.Taking into account that the frequency components of the EEG signal are in the 0-128Hz range, while the spectrum of the mu rhythm is around 8-12Hz and beta rhythm around 12-30Hz, a fourth level decomposition of the signal was required.
After the first level of decomposition, the EEG signal is decomposed in the detail coefficients of high frequency D 1 (64-128Hz) and the approximation coefficients of low frequency A 1 (0-64Hz).At the second level of the decomposition, the coefficients A 1 are further decomposed in the detail coefficients D 2 (32-64Hz) and approximation ones A 2 (0-32Hz).Following this procedure, the coefficients D 3 (16-32Hz), A 3 (0-16Hz) and D 4 (8-16Hz) and A 4 (0-8Hz) are obtained.
For linear discriminant analysis classification we use only the feature from the coefficients of interest: the detailed coefficient of fourth level with 8-16 Hz frequency band (corresponding to mu rhythm) and the detailed coefficient of third level decomposition with 16-32 Hz frequency band (corresponding to beta rhythm).

C. Linear discriminat analysis (LDA)
We used LDA classifier because it is one of the most effective linear classification methods for BCI and because it is also used by BCI2000 software on the testing paradigm.The method we used is a bit different applied and we want to compare the results with those obtained after the online paradigm.
LDA computes the discriminant vector w that separates the classes best possible.Suppose we have a set of m samples x 1 ,x 2 ,..,x m belonging to a class.The objective function LDA is as follows, [10]: where is the total samples vector, mk is the number of samples in the k-th class, () k is the average vector of the k-th class, and () k i x is the i-th sample in the k-th class.We call w S the within-class scatter matrix and b S the between-class scatter matrix.There are many linear classification models and they differ greatly on how the coefficients are set.A quality of LDA is that it does not require multiple passes over the data to obtain optimization.LDA also faces up to problems with more than two classes, obtaining probability estimates for each of the classes.www.ijarai.thesai.org

III. RESULTS
The classification will be performed on those three channels corresponding to imagining movement of the right hand, C3, CP3 and P3, respectively C4, CP4 and P4 for motor imagery of the left hand.
The components of the features matrix were selected from the detailed coefficient of fourth level with 8-16 Hz frequency band and the detailed coefficient of third level decomposition with 16-32 Hz frequency band.This features matrix is computed for the training set and for the test set of the signals.
Classification is performed between two classes: the relaxation and the imagined movement.BCI2000 software uses a LDA classification method.The accuracy percentage is displayed at the end of the testing paradigm.We can observe than the paradigm is not so rigorous because the subject correctly imagine the movement or the relaxation but the ball did not reach the target.Because of this, we implemented our own classification software, in MATLAB and we obtained better classification accuracy.
We perform the classification with the LDA software implemented by us, for all the subjects and the result are expressed in percentage of accuracy.Then we classified the signals with a LDA MATLAB code that uses the normalization of the features matrix.
In TABLE II and III are presented the results obtained with the three classification methods when subjects imagine the right hand movement (Table I) and left hand respectively (Table II).
In TABLE II we obtain better classification rates with the LDA implemented than the LDA used by BCI2000 software, except one subject for which we obtain the same percentage.Also, we can see that for most subjects we obtained higher classification rates with the normalized features matrix LDA.The best classification rate is obtained, 86%, with the normalized LDA on channel P3.In TABLE II we obtain better classification rates with the LDA implemented than the LDA used by BCI2000 software for all the subjects.The best classification rate, 91%, was obtained with LDA classifier implemented by us, for the first subject on channel C4 and with LDA with the normalized features matrix on channel P4.We have achieved a better classification, for most subjects, when we used LDA with the normalized features matrix except subject 15 on channel C4 and subject 11 on channel P4 when we obtain better classification with LDA.
From the results in both tables we can observe that we got better results when we use LDA classification methods that we implemented, compared to those obtained with the BCI2000 software.From the two LDA methods used, we have achieved a better classification, for most subjects, when we used LDA with the normalized features matrix.IV.CONCLUSIONS In this paper, two motor imagery EEG classification methods are proposed to compare the results obtained with BCI2000 at the end of the testing paradigm.The pattern classification techniques, as described in this work, make possible the development of a motor imagery EEG signals analysis system which is accurate, simple and reliable enough to use in brain computer interface.We obtained better results when we used LDA classification methods that we implemented, compared to the results obtained with the BCI2000 software.In conclusion, the classifier used in BCI2000 can be improved to obtain better accuracy.Future work will utilize the algorithms developed in this study, but the multiresolution wavelet analysis decomposition will be done with other types of mother wavelets.
extraction using multiresolutin wavelet analysis Frequency analysis using Fourier transform represents a current method used to analyze EEG signals, because the spectral components of the SMR may contain useful information.Usually, some features of interest are found especially in the frequency bands within 0-60Hz domain.The Fourier transform highlights only the information concerning the spectral components revealed in the signal; it doesn't present the time localization.The localization in time of spectral components may be performed by means of time-frequency analysis such as Short Time Fourier transform (STFT) or the continuous and discrete wavelet transform.In discrete time domain, digital filters with different cut off frequencies are used to analyze the signal at different scales.The signal is passed through a series of high pass filters to analyze high frequencies and through a series of low pass filters to analyze low frequencies.

Fig. 1 .
Fig. 1.Fourth level multiresolution wavelet decomposition . The objective function of LDA in (2) is equivalent to: optimal a's are the eigenvector corresponding to the non-zero eigenvalue of the generalized eigen-problem:, of b S is bounded by c-1, there are at most c- 1 eigenvectors corresponding to non-zero eigenvalues.The basic idea of LDA is simple: a linear function of attributes is computed for each identified class.The class function with the highest score represents the predicted class.

TABLE II .
LDA CLASSIFICATION CORRESPONDING TO THE MOTOR IMAGERY OF THE RIGHT HAND SIGNALS VERSUS THE REST SIGNALS

TABLE III .
LDA CLASSIFICATION CORRESPONDING TO THE MOTOR IMAGERY OF THE LEFT HAND SIGNALS VERSUS THE REST SIGNALS