Research on Algorithm for Feature Extraction and Classification of Motor Imagery EEG Signals

This paper made a research on the feature extraction and pattern recognition of left and right hands motor imagery EEG signals. In combination with the data from BCI Competition III, denoising preprocessing is carried out for EEG signals firstly; and then, the relative wavelet energy is extracted as a feature vector from the Channels C3 and C4 by use of the algorithm for relative wavelet energy, and pattern recognition is carried out by use of the radial basis function neural network (RBFNN). Simulation results show that the proposed method achieves good classification results.


Introduction
Brain-Computer Interface (BCI) is a short form of the interface between brain and computer.It reflects the consciousness of people through the EEG signals but not the normal physiological output pathways constituted by peripheral nerves and muscles, so it is a new way of communication and control [1] .There are many kinds of EEG signals generally used in BCI.As the modes of generation are different, EEG signals are mainly divided into two types, i.e., induced EEG signals and spontaneous EEG signals [2] .Motor imagery EEG signal is a kind of spontaneous EEG signal which is the most widely used.The research on BCI projects based on motor imagery EEG signals was firstly carried out by Pfurtscheller et al.The result showed that, during unilateral limb movement or motor imagery, Event related desynchronization(ERD) was produced in the contralateral brain areas and event related synchronization (ERS) [2] was produced in the ipsilateral brain area.Specifically, during the experiment, the cerebral cortex where channels C 3 and C 4 were located represented the area of right and left hands motor imagery in the brain; during the motor imagery, ERD/ERS in the areas on both sides of the brain was symmetrical, i.e., during the right hand motor imagery, ERD occurred on the cerebral cortex for motor imagery in the left area of the brain while ERS occurred on the cerebral cortex in the right area of the brain; and vice versa.Further research showed that during the motor imagery, obvious ERD/ERS phenomenon occurred mainly within the frequencies of Rhythm μ (8-12Hz) and Rhythm β (18-24Hz) of the corresponding cerebral cortex for motor imagery in the contralateral brain areas, and at these time points, the energy in the frequencies of Rhythm μ and Rhythm β decreased (or increased) [3][4][5][6] .
A complete BCI system mainly includes acquisition, preprocessing, feature extraction, pattern recognition, control equipment and peripheral equipment for EEG signals [7] , among which feature extraction and pattern recognition are the most critical parts.The main contents of this paper include feature extraction and pattern recognition of EEG signals by use of wavelet transformation and fuzzy neural network, taking the ERD/ERS phenomena corresponding to left and right hands motor imagery as the differentiating criteria in combination with the characteristics.

Feature Extraction
The purpose of feature extraction is to transform the preprocessed EEG signals into different feature vectors representing different consciousness tasks.Feature extraction is the most critical step in the identification of BCI signals, directly impacting on the design for the later classifier.In this paper, the relative energy extracted by use of the wavelet transformation technology from the characteristic frequency band is mainly used as the characteristic value.

Source of Experimental Data
The experimental data used in this paper comes from Dataset IIIb of BCI Competition III held in 2005.It was provided by Graz University of Technology in Austria and divided into two categories: left hand motor imagery and right hand motor imagery.The EEG data was collected from three healthy subjects, denoted as O3, S4 and X11.Among them, O3 had 640 pieces of data, and the experimental task was to adopt the method of virtual reality to control the feedback items on the screen by use of left and right hands motor imagery; S4 and X11 had 1,080 pieces of data respectively, and the experimental task was to control the virtual ball through motor imagery, moving the ball to the left or right end of the screen.All the data were collected from the EEG signals recorded in two-lead mode at electrodes C 3 , C Z and C 4 , among which the electrodes C 3 and C 4 were located in the functional area of the primary sensorimotor cortex of the brain, and they could reflect the most effective information about the changes in brain status during the left and right hands motor imagery of subjects; as a reference electrode, the sampling frequency of C 4 is 125Hz after 0.5-30Hz filtering.In order to reduce the amount of calculation, the experimental data was selected from S4 for this time, and there was a total of 1171677 x 2 pieces of data [8] .
The complete experimental procedure is described as follows: the duration of each experiment is 8s, and it is divided into three stages.During the first 2s, the subjects have a rest to keep a relaxed state.When T=2s, they begin to enter the stage of imagery; when T=3s, a short beep sounds and it suggests that the subjects' consciousness is being concentrated and the motor imagery is beginning; meanwhile, the cursor on the screen moves left or right, which will last for the whole process of the experiment, while the subjects imagine the movements as planned according to the movement of the cursor.When T=4s, the stage of information feedback begins, and the duration is 4s (within 4s-8s).The classification results of the feedback stage are given to the subjects from the classifier.The experimental process is shown in Figure 1.

Preprocessing of Experimental Data
The research shows that, during the acquisition process of EEG signals, false information such as ECG, EMG, REM, blink and power frequency interference will interfere with the observation and analysis against the EEG signals by people.Therefore, before the feature extraction, in this paper, denoising is carried out for the original EEG data by use of the wavelet transformation technology and collect the total a trigger 8 seconds in the data.The comparison of EEG signals before and after denoising is shown in Figure 2.

Basic Theory of Wavelet Transformation
Wavelet transformation is a multi-scale signal analysis method.In both time and frequency domains, it represents the local signal characteristics and is used for multi-resolution analysis, so it is applicable to analyze the transient and time-varying characteristics of non-stationary signals.EEG signals are a kind of complex nonlinear and non-stationary signal.Therefore, in this paper, wavelet transformation is used for the analysis and feature extraction of EEG signals [9] .It is assumed that the wavelet basis function is where, a represents the contraction-expansion factor or scale factor, and b represents the shift factor.
Discrete binary method is adopted for the calculation of "a" and "b", and the following discrete binary wavelet function can be obtained: The discrete wavelet transformation coefficient: The inverse transformation: It is assumed that the length of EEG data segment used for feature extraction is m x 2 N points, then, Formula (4) is converted into: According to the Mallat decomposition algorithm, the finite layer decomposition for ) (t f is obtained: where, J represents the decomposition layer, A J represents the low frequency approximate component coefficient, and D j represents the high frequency detail coefficient at different scales.
Under the premise that the wavelet basis function is orthogonal basis function, according to the energy conservation property of wavelet transformation, the formula for wavelet energy is obtained: In combination with Formula (6), it can be further expressed as: Then, the relative wavelet energy [10] is:

Analysis of Simulation Results
As the wavelet db possesses excellent local characteristics in both time and frequency domains [11] , in this paper, wavelet db4 in the time length of 1s is selected as the wavelet function to carry out 4-layer decomposition for the preprocessed EEG signals; the obtained wavelet coefficients of the detailed part are D 1 , D 2 , D 3 , and D 4 , and that of the approximate part is A 4 .The corresponding frequency ranges are: 8-13.5Hz,13.5-19Hz, 19-24.5Hz,and 24.5-30Hz, respectively.And then, for the EEG signals of Channels C 3 and C 4 , the relative wavelet energies within 4-7s are selected as the characteristic values of left and right hands motor imagery.The simulation results are shown in Figures3 and 4.  From Figure3, it can be seen that during left hand motor imagination, obvious ERD/ERS occurs at the sample points of 600-700 in Channels C 3 and C 4 ; from Figure 4, it can be seen that during right hand motor imagination, obvious ERD/ERS occurs at the sample points of 700-800 in Channels C 3 and C 4 .

Pattern Recognition
Pattern recognition is a very important part of BCI system, and the core part of pattern recognition is design of classifier.The common classification algorithms mainly include linear discriminant method, support vector machine-based method, and artificial neural network method.The artificial neural network method is widely used because of its simple application, convenient parameter selection, and high accuracy of classification results.According to the different neural network models, artificial neural network is divided into feed-forward neural network, feedback neural network, and self-organizing neural network, among which feed-forward neural network includes perceptron network, BP network, linear neural network, and radial basis function neural network.For radial basis function neural network, the nearest neighbor clustering algorithm is adopted and it has such advantages as short learning time, small amount of calculation and good performance, so in this paper, RBF neural network is selected for the classification of left and right hands motor imagery EEG signals.

Basic Theory of RBF Neural Network
RBF neural network is composed of input layer, hidden layer and output layer.For the hidden layer, radial basis function is adopted as the excitation function.
Gauss's function is taken as the radial basis function, and is recorded as: the variance of the radial basis function, respectively.m is the number of the centers.According to the empirical formula, i c can be 0, i σ can be 1, and i w can be 0-0.5.In order to simplify the calculation, in this paper, i c is taken as 0, i σ is taken as 1, and i w is taken as 0.5.

Analysis of Classification Result Analysis
In order to reduce the amount of calculation, in this paper, 300 sets of characteristic data from Channels C 3 and C 4 , among which 200 sets of data is taken as training samples and the other 100 sets of data is taken as test samples.The features of the training samples are used as the input data of RBF neural network, and the thinking task categories of the training sample are used as the output data of RBF neural network, with the category number recorded as "0" and "1".The rate of correct identification of the test samples (i.e., the ratio of the number of correctly identified samples to the total sample number) is used as the evaluation index.According to the above algorithm, this paper uses Matlab to compile the corresponding program to realize recognition of left and right hands motor.Test for 100 times and the overall recognition rate approaches 91%.

Conclusion
Feature extraction and feature classification are one of the key problems of BCI system.In this paper, through the research on left and right hands motor imagery EEG signals, ERD/ERS phenomenon is taken as the differentiating criteria, relative wavelet energy in the special frequencies of Channels C 3 and C 4 is used as feature vectors of left and right hands motor imagery EEG signals, RBF neural network is used for features classification, and simulation is carried out in combination with the data from BCI Competition III held in 2005.The results show that good classification effects are achieved.The research on BCI, as a new human-computer interface (HCI) mode, needs multidisciplinary cooperation.At present, the BCI system is not perfect and the corresponding theory and algorithm are not mature, so further research is required.With the continuous improvement and perfection of technology, the BCI system will eventually come out of the laboratory and be widely used in real life [12] .

Figure 1 .
Figure 1.Experiment Process of Left and Right Hands Motor Imagery

Figure 2 .
Figure 2. Comparison of EEG Signals Before and After Denoising (a) Before Denoising (b) After Denoising

Figure 3 .DOI
Figure 3. Relative Energies in Channels C3 and C4 during Left Hand Motor Imagery(a) Relative Energy in Channel C3 (b) Relative Energy in Channel C4

Figure 4 .
Figure 4. Relative Energies in Channels C3 and C4 during Right Hand Motor Imagery(a) Relative Energy in Channel C3 (b) Relative Energy in Channel C4

w 2 i
is the weight from the hidden layer to the output layer.i c and