You are on page 1of 4

Classification of Motor Imagery EEG Signals Based on Time–Frequency Analysis

Zhendong Mu, Dan Xiao, Jianfeng Hu

Classification of Motor Imagery EEG Signals Based on


Time–Frequency Analysis
Zhendong Mu Dan Xiao Jianfeng Hu
Institute of Information Technology, Jiangxi Bluesky University,
,jiangxi Nanchang P.R.China 330098, zd_mu@sohu.com
doi: 10.4156/jdcta.vol3.issue4.13

Abstract specific methods employed for feature extraction or


classification, substantial between-subject variability in
classification accuracy is often observed, e.g. [22], so
We describe a new technique for the classification far there is no best way for all subjects.
of motor imagery electroencephalogram (EEG)
recordings. The technique is based on a time-frequency In this paper we describe a new algorithm for the
analysis of EEG signals, regarding the relations classification of motor imagery electroencephalogram
between the EEG data obtained from the C3/C4 (EEG). The algorithm is based on time-frequency
electrodes, the features were reduced according the analysis of EEG signals. The original EEG signals are
Fisher distance. This reduced feature set is finally fed converted to time-frequency signals by short time
to a linear discriminant for classification. The Fourier transforms (STFTs), then Fisher distance is
algorithm was applied to 3 subjects, the classification used to select the features.
performance of the proposed algorithm varied between
2. Data description
70% and 93.1%; across subjects.
The dataset of BCI competition 2003 is used in this
Keywords investigation. This dataset was provided by Graz
University of Technology. From this dataset, we choose
Brain computer interface (BCI); time-frequency data IIIa (include three subjects: k3b, k6b, l1b) to test
analysis; Fisher distance; EEG(electroencephalogram) our algorithm.
The recording was made with a 64-channel EEG
amplifier from Neuroscan, using the left mastoid for
1. Introduction reference and the right mastoid as ground. The EEG
was sampled with 250 Hz, it was filtered between 1 and
A brain computer interface is a system that can 50Hz with Notchfilter on. Sixty EEG channels were
translate the electrical activity of brain for using in recorded according the scheme in figure 1.
communication and control. Such a translation is
achieved invasively, e.g., by measuring single neuron
activities or non-invasively, e.g., by recording
electroencephalogram (EEG). We have to use some
algorithms to analyze the EEG signal and to select the
imagery feature characteristics for the sake of
communicating with environment because of the low
signal-to-noise ratio of these signals.
To distinguish signals of interest from the
background activity various feature extraction methods
have been applied, including band power calculations
[1], adaptive autoregressive models (AAR) [2-5],
common spatial filters (CSP) [6-9] and recently wavelet
transforms [10-13]. Using the extracted features of
interest, two main classification methods have been
used, linear and nonlinear classification. Linear
discrimination analysis (LDA) [14-16] is a commonly
used method for classification. Neural networks [17-20] Figure 1. Position of EEG electrodes
and support vector machines [21] are two main
nonlinear classification methods. Regardless of the

116
International Journal of Digital Content Technology and its Applications
Volume 3, Number 4, December 2009

As Figure 2 show, these subjects were asked to movement according to an experimental paradigm
execute an imagined left(L) or right(R) index finger

Figure 3. Averaged time-frequency maps of right and left hand movement imagination of K3b

show, The task was to perform imagery left hand, right movement imagination, the energy concentrated on the
hand according to a cue.. The experiment consists of 10 to 15 Hz frequency band on electrode C3, and it
several runs (>= 6) with 40 trials; after trial begin, the maintained to the end of imagining. In the same band
first 2s were quite, at t=2s an acoustic stimulus on electrode C4, the energy only concentrated in the
indicated the beginning of the trial, and a cross “+” is early stage of imagination (about 0 ~ 0.6 s). On the
displayed; then from t=3s an arrow to the left, right, as contrary during the right-hand movement imagination,
displayed for 1 s; at the same time the subject was the energy concentrated on the 10 to 15 Hz frequency
asked to imagine a left hand, right hand, respectively, band on electrode C3 only in the early stage of
until the cross disappeared. imagination (about 0 ~ 0.6 s), but it maintained to the
end of imagining on electrode C4.
Step 2: Calculated the Fisher distance[23] between
two classes. Fisher distance F is calculated as

( µ1 − µ 2 ) 2
F= (2)
Figure 2. Timing of the paradigm σ 12 + σ 22
In equation (2), μ and σ are the mean and the
3. Method standard deviation of the feature they correspond to.
Step 3: Sort F (vector of Fisher distance
In this paper the EEG data from the C3 ,Cz and )ascending and select the first k<n(n is the number of
C4 electrodes only are analyzed. In order to get the trials) as feature.
local activity ,the EEG data are converted to Hjort In this paper , we define category line to classify,
category line y is defined as
derivation. The Hjort derivation
C iH is calculated as k k

1 ∑ Pi − ∑ Qi
C iH = ci − ∑ sc j
8 j∈Si
(1)
y=
j =1 j =1
(3)
2
where ci is the reading of the center electrode scj, with In equation (3), Pi andQi are the set of feature(right
i=3 ,0 or 4 and j is the set of indices corresponding to hand movement imagination and left hand movement
the eight electrodes surrounding electrode ci. imagination).k is the number of feature
The algorithm we use in this paper as followed:
Step 1: Convert the time domain signal to
4. Result and discuss
time-frequency domain signal using STFTs. Here we
use matlab function “spectrogram”. The EEG data are
In this paper, the EEG data was separated into two
bandpass filtered and only signals between 1 Hz and 45
datasets, one dataset was used to learning, another
Hz was used. We use the 73 trials available of the
dataset was used to testing. in order to make the
subject k3b’s task to test.
selected features as far as possible including the
Figure 3 shows, the energy distribution on electrode
C3, Cz and C4 is different. During the left-hand essential features of motor imagery, we analyzed

117
Classification of Motor Imagery EEG Signals Based on Time–Frequency Analysis
Zhendong Mu, Dan Xiao, Jianfeng Hu

feature’s Fisher distance selected during the following three different frequency bands: θ rhythm(4~7Hz),

Figure 4. Fisher distance of three frequency band

rhythm (8~17Hz), β rhythm(18~30Hz).


α test our algorithm, we obtain the following results: The
classification ratio of k3b rise from 0.778 to 0.931, the
Figure 4 shows that the features selected from α best classification ratio appear in the four-second
rhythm (8~17Hz),Fisher distance is the highest. so the period. The classification ratio of L1b rise from 0.714
features of this paper used were selected on α to 0.857, the best classification ratio appears in the
rhythm. three-second period. The classification ratio of k6b rise
The fewer features means the quicker classify, so from 0.600 to 0.650, the best classification ratio appears
Kappa number is always used to evaluate the method of in the four-second period.
classification. Kappa number K is calculated as:
(x − 1/ k ) Table 2. The influence of the time period of HACS.
Kk = (4) K3b L1b K6b HACS
(1 − 1 / k )
In equation (4),x is the highest average classification One second 0.778 0.714 0.650 0.714
accuracy (HACS)and k is the number of features. two second 0.819 0.786 0.600 0.735
Table 1 show the highest average classification
three second 0.848 0.857 0.625 0.777
accuracy and Kappa number of K3b 、 K6b 、
L1b.Frome Table, we draw a conclusion that the four second 0.931 0.714 0.650 0.765
number of features to get the highest average
classification accuracy, is difference with difference To EEG signals research, the classification
person. method is very important, this paper convert the time
domain EEG signals to frequency domain by STFTs,
Table 1. Hacs and Kappa number of K3b、K6b, L1b through the study of frequency bands, the features
Kappa number of frequency band is defined. The result show that the
HACS classification accuracy up to 93.1%; the best time
number features
K3b 0.931 0.926 16 period is defined through the study of different time
K6b 0.65 0.627 13 period.
L1b 0.714 0.695 6 The feature extraction in this paper is signals
superimosed, so the speed of classification becomes
slower. In future work, we plan to extract the features
The main signals are concentrated on the time
from single-trial.
period from the third second to the seventh second. In
order to select the time period of the true signals, we
divide this time period(from the third second to the 5. Acknowledgements
seventh second)into four time period: one second(the
third second to the fourth second), two seconds (the This work was supported by IT projects of Jiangxi
third second to the fifth second), three seconds(the Office of Education [No. GJJ08477]. The authors are
third second to the sixth second), and four seconds(the grateful for the anonymous reviewers who made
third second to the seventh second). When we use constructive comments.
different time periods of three subjects’ EEG signals to

118
International Journal of Digital Content Technology and its Applications
Volume 3, Number 4, December 2009

[15] D. Garrett, D. A. Peterson and C. W. Anderson,


“Comparison of linear, nonlinear, and feature selection
6. References methods for EEG signal classification,” IEEE Trans.
Neural Systems Rehabil. Eng., Vol. 11, 2003, pp.
[1] G. Pfurtscheller, C. Neuper and D. Flotzinger, 141-144
“EEG-based discrimination between imagination of [16] O. Hauk, M. H. Davis and M. Ford, “The time course of
right and left hand movement,” Electroenceph. Clin. visual word recognition as revealed by linear regression
Neurophys., Vol. 103, 1997, pp. 642-651 analysis of ERP data,” NeuroImage, Vol. 30, 2006, pp.
[2] C. Guger, A. Schlogl and D. Walterspacher, “Design of 1383-1400
an EEG-based brain-computer interface (BCI) from [17] B. O. Peters, G. Pfurtscheller and H. Flyvbjerg,
standard components running in real-time under “Automatic differentiation of multichannel EEG
Windows,” Biomed. Tech., Vol. 44, 1999, pp. 12-16 signals,” IEEE Trans. Biomed. Eng., Vol. 48, 2001, pp.
[3] C. W. Anderson, E. A. Stolz and S. Shamsunder, 111-116
“Multivariate autoregressive models for classification of [18] B. Klöppel, “Classification by neural networks of
spontaneous electroencephalographic signals during evoked potentials - A first case study,”
mental tasks,” IEEE Trans. Biomed. Eng., Vol. 45, 1998, Neuropsychobiology, Vol. 29, 1994, pp. 47-52
pp. 277-286 [19] N. F. Guler, E. D. Ubeyli and I. Guler, “Recurrent
[4] D. J. Krusienski, D. J. McFarland and J. R. Wolpaw, neural networks employing Lyapunov exponents for
“An evaluation of autoregressive spectral estimation EEG signals classification,” Expert Syst. Appl., Vol. 29,
model order for brain-computer interface applications,” 2005, pp. 506-514
Proc. IEEE EMBS Ann. Int. Conf., New York, 2006, pp. [20] B. Cheng and D. M. Titterington, “Neural networks: A
1323-1326 review from a statistical perspective,” Statist Sci., Vol.9,
[5] D. J. McFarland and J. R. Wolpaw, “Sensorimotor 1994, pp. 2-54
rhythm-based brain–computer interface (BCI): model [21] E. D. Ubeyli, “Analysis of EEG signals by combining
order selection for autoregressive spectral analysis,” J. eigenvector methods and multiclass support vector
Neural Eng., Vol. 5, 2008, pp. 155-162 machines,” Comp. Biol. Med., Vol. 10, 2007, pp. 1016
[6] H. Ramoser, J. Müller -Gerking and G. Pfurtscheller, [22] G. Pfurtscheller, J. Kalcher and C. Neuper, “On-line
“Optimal spatial filtering of single trial EEG during EEG classification during externally-paced hand
imagined hand movement,” IEEE Trans. Rehabil. Eng., movements using a neural network-based classifier,”
Vol. 8, 2000, pp. 441-446 Electroenceph. Clin. Neurophys., Vol. 99, 1996, pp.
[7] J. Müller-Gerking, G. Pfurtscheller and H. Flyvbjerg, 416-425
“Designing optimal spatial filters for single-trial EEG [23] N. F. Ince, S. Arica and A. Tewfik, “Classification of
classification in a movement task,” Clin. Neurophysiol., single trial motor imagery EEG recordings with subject
Vol. 110, 1999, pp. 787-798 adapted nondyadi arbitrary time-frequency tilings,” J.
[8] U. Hoffmann, J. M. Vesin and T. Ebrahimi, “Spatial Neural Eng., Vol. 3, 2006, pp. 235-244
filters for the classification of event-related potentials,”
Proc. 14th Eur. Symp. Artif. Neural Networks, Bruges,
2006, pp. 47-52
[9] X. Liao, D. Z. Yao and D. Wu, “Combining Spatial
Filters for the Classification of Single-Trial EEG in a
Finger Movement Task,” IEEE Trans. Biomed. Eng.,
Vol. 54, 2007, pp. 821-831
[10] T. Hinterberger, A. Kubler and J. Kaiser, “A
brain-computer interface (BCI) for the locked-in:
comparison of different EEG classifications for the
thought translation device,” Clin. Neurophys., Vol. 114,
2003, pp. 416-425
[11] H. Adeli, Z. Zhou and N. Dadmehr, “Analysis of EEG
records in an epileptic patient using wavelet transform,”
J. Neurosci. Methods, Vol. 123, 2003, pp. 69-87
[12] V. Bostanov, “BCI Competition 2003 - data sets Ib and
IIb: feature extraction from event-related brain
potentials with the continuous wavelet transform and the
t-value scalogram,” IEEE Trans. Biomed. Eng. Special
Issue on Brain Machine Interfaces, Vol.51, 2004, pp.
1057-1061
[13] V. Bostanov and B. Kotchoubey, “Recognition of
affective prosody: continuous wavelet measures of
event-related brain potentials to emotional
exclamations,” Psychophysiology, Vol. 41, 2004, pp.
259-268
[14] G. Pfurtscheller, C. Neuper and C. Guger, “Current
trends in Graz Brain-Computer Interface (BCI)
research,” IEEE Trans. Rehabil. Eng., Vol. 8, 2000, pp.
216-219

119

You might also like