Hidden Markov models for online classification of single ... - CiteSeerX

20 downloads 18478 Views 347KB Size Report
B. Obermaier b,c,*, C. Guger a, C. Neuper b, G. Pfurtscheller a,b .... Course of the experimental trial and the screen contents of a correctly classified left (A) and ...
Pattern Recognition Letters 22 (2001) 1299±1309

www.elsevier.com/locate/patrec

Hidden Markov models for online classi®cation of single trial EEG data B. Obermaier b,c,*, C. Guger a, C. Neuper b, G. Pfurtscheller a,b a

Department of Medical Informatics, Institute for Biomedical Engineering, Graz University of Technology, Graz, Austria b Ludwig Boltzmann-Institute for Medical Informatics and Neuroinformatics, Graz University of Technology, In€eldgasse 16a/II, A-8010, Graz, Austria c Instituto Superior Tecnico, ISR-LaSEEB, Lisbon, Portugal

Abstract Hidden Markov models (HMMs) are presented for the online classi®cation of single trial EEG data during imagination of a left or right hand movement. The classi®cation shows an improvement of the online experiment and the temporal determination of minimal classi®cation error compared to linear classi®cation methods. Ó 2001 Elsevier Science B.V. All rights reserved. Keywords: Brain-computer interface (BCI); Hidden Markov models; EEG classi®cation; Event-related desynchronisation (ERD)

1. Introduction It has been shown that the imagination of either a left or right hand movement results in an amplitude attenuation (desynchronisation) of l and central beta rhythms at the contra-lateral sensorimotor representation area and, in some cases, in an amplitude increase (synchronisation) at the ipsi-lateral hemisphere (Neuper and Pfurtscheller, 1999). The event-related (de)synchronisation (ERD, ERS) (Pfurtscheller, 1998) characterises brain states with localised patterns of cortical activation and deactivation, respectively, and is the base of an EEG-based brain±computer interface (BCI), where brain states associated with motor * Corresponding author. Tel: +43-316-873-5311; fax: +43316-873-5349. E-mail address: [email protected] (B. Obermaier).

imagery are transformed into control signals (Pfurtscheller et al., 1997). A BCI has to perform two tasks, the parameter estimation task, which attempts to describe the properties of the EEG signal and the classi®cation task, which separates the di€erent EEG patterns based on the estimated parameters. Di€erent groups have used di€erent classi®cation methods like Fisher's linear discriminant (LD) (Guger et al., 2000a,b), neural networks (Kalcher et al., 1996; Pregenzer et al., 1996; Anderson et al., 1998; Haselsteiner and Pfurtscheller, 2000) and linear threshold (McFarland et al., 1997; Kuebler et al., 1998; Birbaumer et al., 1999). One of the BCI systems presently used by the research group in Graz estimates AAR parameters derived from two bipolar EEG channels (electrode positions close to C3 and C4) and classi®es the patterns with LD (Guger et al., 2000b). Another BCI system is based on the method of common spatial patterns derived from 27 electrodes placed

0167-8655/01/$ - see front matter Ó 2001 Elsevier Science B.V. All rights reserved. PII: S 0 1 6 7 - 8 6 5 5 ( 0 1 ) 0 0 0 7 5 - 7

1300

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309

over the primary sensorimotor cortex and equally classi®es these patterns with LD (Ramoser et al., 1999; Guger et al., 2000a). The spatio-temporal EEG patterns associated with motor imagery are not always stable, but often demonstrate a dynamic behaviour. So for example, the l rhythm displays a relatively early onset of desynchronisation and a slow recovery, whereas the central beta rhythm shows a short-latency ERD often followed by a fast rebound or beta ERS (Pfurtscheller et al., 1999; Pfurtscheller et al., 1998). These brain oscillatory dynamics during motor imagery prompted us to introduce a classi®cation method, which also uses information on the change of brain states over time. This additional information should result in an improved BCI system. To describe these temporal changes the Hidden Markov model (HMM), which is well known in the area of speech recognition (Rabiner and Juang, 1993), is used. The Hjorth parameters (Hjorth, 1970) which describe the properties of the dynamic EEG changes (ERD/ERS) in a simple and compact manner were chosen to serve as the EEG parameters in this BCI system. Our preference of Hjorth over AAR parameters for an HMM-based classi®er is due to their lower dimensionality. A linear classi®er like the LD can suciently be the limited amount of available training data ± training of the non-linear HMM-based classi®er based on the same amount of data seemed critical therefore the need of a dimension reduction. O‚ine analysis of BCI data recorded during earlier sessions revealed that HMM in combination with Hjorth parameters are suitable to classify EEG signals related to imagination of either a left or right hand movement (Obermaier et al., 1999). Preliminary results of online classi®cation of EEG patterns in an HMMbased system were presented in (Obermaier et al., 2000). The aim of this paper is to introduce a new BCI system based on an HMM classi®er for EEG patterns obtained during right and left motor imagery. In addition, a comparison between the presently used BCI system based on AAR parameter estimation and LD, and the new BCI system using Hjorth parameters and HMM is presented. The fact that the classi®cation methods as well as the parameter estimations are di€erent,

makes a comparison dicult. In order to be still able to draw conclusions about the di€erent classi®cation methods, independently of the parameter estimation method we present the upper bound of the Bayes error for classi®cation with the AAR and Hjorth parameters. The experiment was designed to answer the following questions: 1. Is the application of HMM suitable for the online classi®cation of EEG patterns? 2. Does the HMM-based BCI result in lower error rates than the BCI based on LD? (The error rate refers to the number of misclassi®ed trials divided by the overall number of trials.) And if yes: is this due to di€erent classi®ers or due to the di€erent parameter estimation? 3. Is the continuous feedback provided by HMM bene®cial, so that it supports the subject's control of his brain states? 4. How reliable are both classi®cation methods, when the classi®er trained on EEG patterns is again used after a break and using new electrode montage? 2. Experimental setup and data acquisition 2.1. Subjects Four male subjects (age 17±26 years) took part in the study, three of them (S1, S2, S4) were familiar with the BCI, one (S3) was naive. They were paid for their participation and free from medication and central nervous system abnormalities. 2.2. Experimental procedure The subjects were sitting in a comfortable armchair looking at the centre of a monitor placed approximately 2 m in front of them. Each trial (Fig. 1) started with the presentation of a ®xation cross at the centre of the monitor, followed by a short warning tone at 2 s. At 3 s an arrow was displayed at the centre of the monitor for 1.25 s. Depending on the direction of the arrow presented (left or right) the subject was instructed to imagine a movement of either the left or the right hand. In case of a feedback session, a horizontal bar extending to the currently classi®ed direction was

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309

1301

Fig. 1. Course of the experimental trial and the screen contents of a correctly classi®ed left (A) and right trial (B). From 0.0 to 3.0 s a ®xation cross was presented, followed by the cue indicating either the left or right motor imagery. During the feedback period (from 4.25 to 8.0 s) a bar is displayed indicating the currently classi®ed direction (to the right or to the left).

presented from 4.25 to 8.0 s. Continuous feedback can enhance the di€erences between left and right motor imagery, as was shown recently by Neuper et al. (1999). The subject's task was to extend the bar via motor imagery to the side indicated by the cue stimulus. Fig. 1(A) shows the screen contents for a correct left trial and Fig. 1(B) for a right one, respectively. In the case of a session without feedback, the ®xation cross was presented again replacing the feedback bar. The trial ended after 8 s and a blank screen was shown until the beginning of the next trial. The inter-trial period (ranging from 0.5 to 2.5 s) and the order of trials with left and right motor imagery were randomised to avoid adaptation.

During the following discussion the abbreviation BCI±HMM is used for the HMM-based BCI system with feedback and BCI±LD for one based on LD with feedback. The procedure of the study is given in Fig. 2: the number of runs (each run contains 20 left and 20 right trials in random order) performed in one session is given in brackets. The relations between sessions were indicated using arrows pointing from the sessions used to set up the BCI system to the one using this BCI system. On the ®rst day the experiment started with session 1 in order to record subject-speci®c data of the motor imagery. Since the information about speci®c EEG patterns was not yet available no

Fig. 2. Setting of sessions to investigate the capabilities of the BCI±LD and the BCI±HMM. The arrows indicate which session was used to determine a classi®er, and which session was classi®ed using this classi®er. The number of runs of session are given in brackets.

1302

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309

feedback was provided. Based on the information of session 1 a BCI±LD was used in session 2. Session 2 was used to train the BCI±HMM (session 3) and the BCI±LD (session 4) both di€erent BCI systems were trained on the same session. Please note that unlike the BCI±LD the BCI± HMM has to be trained on a feedback session. Training a BCI±HMM on a non-feedback session fails because the temporal behaviour of the EEG patterns changes due to the feedback in¯uence (Neuper et al., 1999). While a system like the BCI± LD which classi®es the EEG patterns at one time only is insensitive to these temporal changes this is not the case for the BCI±HMM which models the temporal changes of the EEG patterns. The underlying assumption is that the feedback given by the BCI±LD produces the same spatio-temporal EEG pattern as that produced by a BCI±HMM feedback and therefore can be used as training session. The experiment on the second day started with session 5 using a BCI±HMM trained on session 3 followed by session 6, a BCI±LD session trained on session 4. One run in sessions 5 and 6 was sucient to draw conclusions whether the BCI systems were still able to distinguish the EEG patterns or not. Sessions 7, 8, 9 and 10 were identical to sessions 1±4 conducted on the ®rst day. To answer the questions raised in the introduction sessions 3, 5, 9 are used to assess the abilities of a BCI±HMM, whereas sessions 4, 5, and 10 are used to compare the results of the two di€erent approaches (BCI±LD and BCI±HMM) based on the same experimental conditions (electrode settings, condition of the subjects). Sessions 5 and 6 serve to investigate how good the BCI±HMM and BCI± LD trained on EEG patterns obtained on the ®rst day could classify the data recorded on the second day. 2.3. EEG recordings The bipolar EEG signals were recorded from four Ag/AgCl electrodes placed 2.5 cm anterior and posterior to electrode positions C3 and C4, respectively. The ground electrode was located on the forehead. The EEG signals were band-pass ®ltered between 0.5 and 30 Hz and sampled at

128 Hz. Training data for the set up of the classi®er were visually checked for EMG or EOG artefacts, while no artefact detection was performed during online sessions. 2.4. Data pre-processing The BCI±LD classi®es the EEG patterns based on the pth order AAR parameter estimation that describes an EEG signal y…t† by: y…t† ˆ a1;t y…t 1† ‡ a2;t y…t 2† ‡    ‡ ap;t y…t p† ‡ E…t†. Here, ai;t denotes the ith AAR parameter at time point t and E…t† is considered as white noise with zero mean and ®nite variance. A model order of p ˆ 6 (Schloegl et al., 1997b) was used, resulting in a feature space dimension of v ˆ 12 of the feature vector  v…t† ˆ …a1;t ; a2;t ; . . . ; a6;t †Electrode C3 ; …a1;t ; a2;t ; . . . ; a6;t †Electrode C4 : The Hjorth parameters namely activity, mobility and complexity describing the properties of the EEG signal y…t† were used in the BCI±HMM: Activity…y…t†† ˆ VAR…y…t††; v   u uActivity dy…t† t dt Mobility…y…t†† ˆ ; Activity…y…t††

Complexity…y…t†† ˆ

Mobility



dy…t† dt



Mobility…y…t††

combined to  v ˆ …Activity; Mobility; Complexity†Electrode …Activity; Mobility; Complexity†Electrode

C3 ;



C4

of dimension v ˆ 6. The AAR parameter and the Hjorth parameters were both calculated sample by sample based on y…t† which is derived from the EEG signal x…t† using an exponential window given as y…t† ˆ x…t†…C† ‡ y…t 1†…1 C†, C ˆ 0:99219 (Guger et al., 2000b).

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309

1303

3. Bhattacharyya distance

d ˆ wT v ‡ w0 ;

In order to make possible comparisons between two BCI systems, where both the classi®er and also the parameter estimation are di€erent the features were compared separately. Based on the Bhattacharyya distance (Bhattacharyya, 1943) l…1=2† an upper bound eu of the Bayes error ± the minimum achievable error ± is given for normal distributions as:

where wT is a vector of adjustable weights and w0 is called bias or threshold. In order to ®nd the most discriminating time point Tw during the trial, a 10 times 10-fold cross-validation test on every halfsecond (starting from 3 to 8 s of the trial) was performed. During an online session with feedback the length and the direction of the feedback bar was calculated using Eq. (1) with wT calculated at Tw multiplied by a scaling factor to keep the length of the bar within the screen boundaries. The threshold w0 was estimated in such a way that d results in values below zero for a left and values above zero for a right imagination. The basic principles of HMM will brie¯y be discussed throughout this section, whereas a detailed description can be found in (Rabiner and Juang, 1993; Deller et al., 1993). The HMM itself could be seen as a ®nite automata, containing s discrete states, emitting a feature vector at every time point that depends on the current state (see Fig. 3). Each feature vector is modelled using m Gaussian mixtures per state. The transition probabilities between states are described using a transition matrix. During the training phase the expectation maximisation (EM) algorithm introduced by Dempster (Dempster et al., 1977) was used to estimate the transition matrix and the Gaussian mixtures. Based on randomly selected values for the transition matrix (upper triangle matrix) and an initial estimation of the mixtures the EM algorithm was performed. The estimation formulas guarantee a monotonic increase of the likelihood P …VjHMM† until a local or global maximum, which ®nished the training phase. The number of states ranged from 1 to 5, which corresponds to physiological changes in the spatio-temporal patterns in a 1 s range (Schloegl et al., 1997a). The number of mixtures was limited to eight referring to earlier studies made by the authors (Obermaier et al., 1999). The Gaussian mixtures were estimated on a kmeans clustering of the feature vectors. The clustering was performed using the Euclidean distance, which necessitates feature vector components with a mean and variance within the same numerical

eu ˆ

1 e 2

l…1=2†

and 1 l…1=2† ˆ …MR 8

T



 RL ‡ RR …MR 2

ML † R ‡R L R 1 2 ‡ ln p : 2 jRL jjRR j

ML †

ML ; RL are the sample mean matrix and the covariance matrix of the features corresponding to the left motor imagery ± MR ; RR corresponding to the right motor imagery, respectively. The covariance matrices are in Toeplitz form, the number of parameters to be estimated surpasses the dimension of the features by one. This allows a robust estimation of the covariance matrix given the available training data. eu was calculated for both types of feature sets for all available feedback sessions (BCI±HMM (3, 5, 9) and BCI±LD (4, 6, 10)) to suppress e€ects due to the di€erent classi®cation methods. For comparison eu was calculated for the AAR parameter eu AAR and eu Hjorth for the Hjorth parameters, respectively. The ratio k ˆ eu Hjorth =eu AAR was calculated for 1 s windows starting from 3 to 8 s with a 0.5 s overlap.

4. Classi®cation methods The BCI±LD classi®es the spatio-temporal EEG patterns using the LD (Bishop, 1995). The LD separates two classes represented by feature vectors v by a linear transformation from the v dimensional feature space into a scalar d:

…1†

1304

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309

Fig. 3. The HMM used in the BCI±HMM consists out of s ˆ 3 states. The arrows indicate the allowed transitions, a feature vector comprising m ˆ 3 mixtures is emitted at every time point. The HMM is designed as a left to right model, because transitions are allowed from a state to itself and to any right neighbour state.

range. The mean and variance of all feature vectors belonging to one cluster were then used to model the Gaussian mixtures with a diagonal covariance matrix. This modelling is feasible only for the uncorrelated feature vector components. In order to meet both requirements of normalised and uncorrelated data, the whitening transformation (Fukunaga, 1990) was performed. The original data V ˆ …v…1†; v…2†; . . . ; v…T †† of length T  ˆ … …2†; . . . ; v  …T †† were transformed into V v…1†; v using:  ˆ UD12 V; V

…2†

where U and D are the eigenvector and eigenvalue matrices of the covariance matrix of V, respectively. Two HMM, one representing the left imagination (HMML ) and one the right imagination (HMMR ) were trained using the Hjorth parameters calculated for the period from 4.25 (beginning of feedback) to 8 s of artefact-free trials. Both HMM consisted of the same numbers of s and m because it was assumed that the spatiotemporal EEG patterns during left or right motor imagery are mirrored. Furthermore, the transition matrix was chosen in such a way, that only transitions from left to right were allowed. The optimum number for s and m resulting in the lowest error rate at the end of the trial was evaluated based on a 3 times 3 cross-validation, for various combinations of s and m. To force the subjects to

produce EEG patterns during the experiment which belong clearly to one of the two kinds of imagination another step was performed during training. Preliminary models were estimated on the given training data and were then used to classify the same training data. Finally, HMML and HMMR were estimated using the correct classi®ed trials. The classi®cation of an unknown trial was a selection of the maximum single best path proba  bility of Pp …VjHMM L † and of Pp …VjHMMR † calculated via the Viterbi algorithm (Rabiner and Juang, 1993). The continuous feedback was calculated as the di€erence between the probabilities   Pp …VjHMM L † and Pp …VjHMMR † on a sample by sample basis starting from 4.25 s. The resulting di€erence had to be scaled to keep the length of the feedback bar within the screen boundaries. 4.1. The BCI±HMM system The parameters estimation and classi®cation was embedded into a real-time Simulink (MathWorks, Natick, USA) model which samples two 2 EEG channels at a frequency of 128 Hz (see Fig. 4). The Hjorth parameters were calculated sample by sample using a window size of 1 s. These feature vectors were then normalised using Eq. (2). Furthermore, a third channel was sampled providing the trigger information, which was a pulse lasting

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309

1305

Fig. 4. The BCI±HMM system, realised by a real-time Simulink model. The Hjorth parameters of two channels (C3 and C4) were classi®ed using an HMM classi®er. The single best path probabilities for both models are calculated sample by sample and the difference is used to calculate the feedback bar. A device driver for the RTI800a (DAQ board from Analog Device) is added to the model to make the connection to the real world.

0.5 s with the raising edge at 2 s of a trial. This trigger was used to generate a reset signal at 4.25 s   setting Pp …VjHMM L † and Pp …VjHMMR †. In the  period from 4.25 until 8.0 s Pp …VjHMM L † and  Pp …VjHMMR † were calculated sample by sample. The length of the feedback bar was calculated based on the di€erence of these two probabilities. 5. Results The online error rates of the two BCI systems under investigation are presented in Fig. 5 for the BCI±HMM sessions (3, 5, 9) and the BCI±LD sessions for all subjects. The sessions 1, 2, 7 and 8 were excluded from the results because they were used to set up the systems and were therefore not of further interest. In 11 out of 12 corresponding sessions (3±4, 5± 6, 9±10) (except subject S3, session 5±6) the online

error rates of the BCI±HMM are lower than those of the BCI±LD. The average decrease of the error rate of all sessions and subjects is 9:1  6:9%. In Table 1 the number of states s and mixtures m of a BCI±HMM session and Tw (in seconds from the beginning of the trial) of a BCI±LD session are given. The number of s and m stay constant for just two sessions and for two subjects (S3/3±S3/5 and S4/3±S4/10), in all other sessions the structure of the BCI±HMM changed. Tw used in BCI±LD sessions never stayed the same for two sessions of a subject, whereby the earliest time point was at 4.5 s and the latest at 8.0 s. The propagation of the error rates during the feedback period is given in Fig. 6 for one subject (S2) in order to underpin the di€erent behaviours of BCI±HMM and BCI±LD. The sessions of the other subjects follow the same trends like the presented ones. It can be seen that the

Fig. 5. Online error rates in percent for sessions 3, 4, 5, 6, 9 and 10 for all subjects.

1306

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309

Table 1 For BCI±HMM sessions the number of states s and mixtures m is given as s; m. For BCI±LD sessions Tw is given in seconds from the beginning of the trial Subject

Session 3

4

5

6

9

10

S1 S2 S3 S4

1; 5 1; 4 3; 1 2; 3

6.5 5.0 8.0 8.0

1; 4 5; 4 3; 1 1; 1

8.0 5.5 7.0 7.0

2; 5 2; 3 2; 2 2; 3

7.5 7.0 5.5 4.5

BCI±HMM showed a steady decrease of the error rate in all sessions ± the lowest error rate was achieved at the end of the trial. In contrast to this the BCI±LD achieved the lowest error rate around Tw . In Table 2 the average online error rates achieved with the BCI±HMM system are compared to the averaged o‚ine error rates achieved with the optimal BCI systems for every session. The selection of the optimal BCI systems was determined as described in Section 3, except that for both systems a 5 times 5 fold cross-validation was chosen. The same procedure was performed for the BCI±LD and those results were also listed in Table 2. The k calculated for all feedback sessions (3, 4, 5, 6, 9 and 10) was averaged to 1:036  0:21. The upper bound of the Bayes error for classi®cation is slightly lower for the AAR parameters than for the Hjorth parameters.

6. Discussion The discussion of the results of the presented study will be organised in order to give answers to the questions posed in the introduction. Based on the results of the four subjects it can be stated that the HMM-based classi®er can be used for online classi®cation of spatio-temporal EEG patterns during motor imagery. The answer to question two, if the use of an HMM-based classi®er can lower the online error rate has to be answered prudently. To ®nd out why the online recognition errors using the BCI±HMM were lower than those obtained by the BCI±LD in 11 out of 12 sessions (in session S3/5, and S3/6 none of the two systems were able to discriminate), two additional o‚ine analysis of the recorded EEG were performed. (1) E€ects due to the use of di€erent parameter estimations: The averaged results of k ˆ 1:036  0:21 for all sessions and subjects showed that the upper bound of the Bayes error for classi®cation of the two motor imagery tasks are almost identical for the AAR parameters and the Hjorth parameters. Because k was calculated for sessions recorded using both types of BCI systems, the conclusion can be made that the lower error rates are due to the di€erent classi®cation methods and not due to the use of di€erent features. (2) Cross-validation test: In order to investigate how good the two BCI system were set up the

2

Fig. 6. Error rates in percent for sessions 3, 4, 5, 6, 9 and 10 of subject S2. In the case of a BCI±HMM session the number of states and mixtures is presented in brackets. In the case of a BCI±LD the time point at which the classi®cation takes place is indicated.

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309 Table 2 In column 2 the averaged online errors  standard deviation for all performed sessions and all subjects are given. Column 3 shows the averaged o‚ine errors based on the optimal classi®er for every session BCI system

Session type Online

O‚ine

BCI±HMM BCI±LD

18:6  12:8% 27:6  8:6%

15:1  8:6% 16:2  8:9%

online error rates of the two di€erent BCI systems were compared to those of the o‚ine cross-validation results (see Table 2). The closer the online results are to the o‚ine result, the better the classi®er can generalise the spatio-temporal brain patterns captured in di€erent sessions. In the case of the BCI±HMM, this online versus o‚ine difference was 3.5%, whereas this di€erence for the BCI±LD was 11.4%. The weak generalisation capabilities of the BCI±LD could be caused by a change of the EEG patterns due to the intermediate BCI±HMM session, or confusion of the subject due to change of BCI systems or bad set-up of the BCI±LD system. The change of EEG patterns can be excluded because the o‚ine classi®cation of the EEG signals recorded during the two BCI±LD sessions 4 and 10 using the BCI±HMM classi®er of sessions 3 and 9 resulted in an average error of 20:3  8:5%. The di€erence of 4.1% to the cross-validation results of the BCI±LD system shows that the EEG patterns did not change due to the intermediate BCI±HMM sessions. This leads to the conclusion that the BCI±LD system was not able to ®nd generalised representations of the spatio-temporal patterns. This is in contrast to earlier studies done by Guger et al. (2000b), where the BCI±LD system was successfully used for online EEG classi®cation during motor imagery. This study also reports that the BCI±LD system is very sensitive to the selection of the bias w0 , as a bad selection of w0 seems to be the reason of the bad generalisation abilities of the BCI±LD system. An answer to question two cannot be given based on the achieved ®rst results, due to the fact that the BCI±LD system was not con®gured properly. Nevertheless it has to be noted that the BCI± HMM has some advantages which are due to the principle of the classi®er and can be stated inde-

1307

pendently of the limited number of results presented in this study. Classi®cation in the BCI±LD system is taking place at Tw . However o‚ine analysis of the BCI±LD sessions revealed that in 10 out of 12 sessions this time point of classi®cation was not the time point where the propagation of the error rate was minimal. Tw was chosen for classi®cation because the optimal time point was not known in advance. This problem does not exist using the BCI±HMM, because the lowest error rate was always achieved at 8 s and therefore the classi®cation took place at the end of the trial. This can be explained by the fact that the BCI±HMM was trained to recognize a feature sequence from 4.25 until 8.0 s. The lowest error rate was achieved presenting the complete feature sequence. Moreover the results showed the sensitivity of the BCI±LD system in respect to w0 which makes the system unsuitable for automatic classi®er set-up without manual adjustment. The proposed calculation of the continuous feedback bar proportional to the di€erence of   Pp …VjHMM L † and Pp …VjHMMR † demonstrated the property to extend to the correct direction at the end of the trial. This is not the case using the BCI±LD system, where the feedback bar is proportional to Eq. (1), the feedback bar extends to the correct direction around Tw but is unreliable elsewhere. This might lead to confusion of the subject, especially when Tw is at the beginning of the feedback period (S2/4, S2/6, S3/10 and S4/10) (see Table 1). The results of the sessions 5 and 6 performed after a break of at least one week using a new electrode set-up showed that the spatio-temporal EEG patterns of the subjects familiar to the BCI, could even be distinguished after a break. The variation of the results in respect to the results of the sessions used for training could be caused by a slightly di€erent electrode setting or di€erent conditions of the subjects. In S3/S5 and S3/S6 none of the two BCI systems was able to classify the data. O‚ine analysis based on a 5 times 5 cross-validation test of these sessions showed that there is no class information inherent in the data. Various reasons might have caused the subject not to be concentrated during these sessions. Bad electrode set-up as a cause can be neglected,

1308

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309

because settings were done with a high accuracy, and also the following sessions (9 and 10) could be classi®ed with an accuracy of 15.3% (BCI±HMM) and 21.8% (BCI±LD). The determination of the BCI±HMM classi®er, (described in Section 3) based on the crossvalidation to test takes approximately 15 min for 120 trials using a Pentium K6, 300 MHz. One worrisome fact is the change of s and m for di€erent sessions: just for two subjects two BCI± HMM used the same structure for the classi®er (see Table 1). This makes an interpretation of what kind of brain phenomena are modelled by the HMMs more dicult. Further studies have to be performed to address that issue. Furthermore, it would be interesting how a classi®er with a constant s and m could perform in various sessions. To summarise this study we can conclude that the HMM-based BCI system can be used for online classi®cation of EEG patterns during motor imagery. The e€ect that classi®cation using the BCI±HMM system is optimal at the end of the trial is a major advantage compared to the BCI± LD system where the optimal time point of classi®cation is not known in advance. This has an impact on the classi®cation error and also the reliability of the feedback. Furthermore, because the lack of further adjustment, it is possible to perform an automated set-up of the classi®er. Further studies should evaluate the performance of the HMM-based BCI in more detail, e.g. the e€ect of prolonging the trials. It should also be examined what kind of brain phenomena are modelled by the HMM.

Acknowledgements This work was supported in part by the Austrian ``Fonds zur F orderung der wissenschaftlichen Forschung'', project P11208MED. Furthermore, we would like to thank Alois Schl ogl and Martin Pregenzer for their helpful suggestions, and Gunther Schweitzer and Stewart MacMillan for their proof-reading.

References Anderson, C., Stolz, E., Shamsunder, S., 1998. Multivariate autoregressive models for classi®cation of spontaneous electroencephalogram during mental tasks. IEEE Trans. Biomed. Eng. 45 (3), 277±286. Bhattacharyya, A., 1943. On a measure of divergence between two statistical populations de®ned by their probability distribution. Bull. Calcutta Math. Soc. 35, 99±110. Birbaumer, N., Ghanayim, N., Hinterberger, T., Iversen, I., Kotchoubey, B., K ubler, A., Perelmouter, J., Taub, E., Flor, H., 1999. A spelling device for the paralysed. Nature 398, 297±298. Bishop, Ch.M., 1995. Neural Networks for Pattern Recognition. Clarendon Press, Oxford. Deller, J.R., Proakis, J.G., Hansen, J.H.L., 1993. Discrete-Time Processing of Speech Signals. Macmillan, New York. Dempster, A.P., Laird, N.M., Rubin, D.B., 1977. Maximum likelihood from incomplete data via the EM algorithm. J. Roy. Statist. Soc., Ser. B (Methodological) 39 (1), 1±38. Fukunaga, K., 1990. Introduction to Statistical Pattern Recognition. Academic Press, New York. Guger, C., Ramoser, H., Pfurtscheller, G., 2000a. Real-time EEG Analysis with subject-speci®c spatial patterns for a brain±computer interface (BCI). IEEE Trans. Rehab. Eng. 447±456. Guger, C., Schl ogl, A., Neuper, C., Walterspacher, D., Strein, T., Pfurtscheller, G., 2000b. Rapid prototyping of an EEGbased brain±computer interface (BCI). IEEE Trans. Rehab. Eng. 49±58. Haselsteiner, E., Pfurtscheller, G., 2000. Using time dependent neural networks for EEG classi®cation. IEEE Trans. Rehab. Eng. 457±463. Hjorth, B., 1970. EEG analysis based on time domain properties. Electroencephalogr. Clin. Neurophysiol. 29, 206±310. Kalcher, J., Flotzinger, D., Neuper, C., G olly, S., Pfurtscheller, G., 1996. Graz brain±computer interface II: towards communication between humans and computers based on online classi®cation of three di€erent EEG patterns. Med. Biol. Eng. Comput. 34, 382±388. Kuebler, A., Kotchoubey, B., Salzmann, H.P., Ghanayim, N., Perelmouter, J., H ornberg, V., Birbaumer, N., 1998. Selfregulation of slow cortical potentials in completely paralyzed human patients. Neurosci. Lett. 252, 171±174. McFarland, D.J., Lefkowicz, A.T., Wolpaw, J.R., 1997. Design and operation of an EEG-based brain±computer interface with digital signal processing technology. Behav. Res. Meth., Instr. Comput. 29, 337±345. Neuper, C., Pfurtscheller, G., 1999. Motor imagery and ERD. In: Pfurtscheller, G., Lopes da Silva, F.H. (Eds.), EventRelated Desynchronization. Handbook of Electroencephalography and Clinical Neurophysiology (Revised Edition) Vol. 6. Elsevier, Amsterdam, pp. 303±325. Neuper, C., Schl ogl, A., Pfurtscheller, G., 1999. Enhancement of left±right sensorimotor EEG di€erences during feedbackregulated motor imagery. Clin. Neurophysiol. 16, 373±382.

B. Obermaier et al. / Pattern Recognition Letters 22 (2001) 1299±1309 Obermaier, B., Guger, C., Pfurtscheller, G., 1999. Hidden Markov models used for the o‚ine classi®cation of EEG data. Biomed. Tech. 44 (6), 158±162. Obermaier, B., Guger, C., Pfurtscheller, G., 2000. Online classi®cation of single trial EEG data using hidden Markov models. In: Proc. RECPAD2000, Portuguese Association for Pattern Recognition, pp. 251±255. Pfurtscheller, G., 1998. EEG event-related desynchronization (ERD) and event-related synchronization (ERS). In: Niedermeyer, E., Lopes da Silva, F.H. (Eds.), Electroencephalography: Basic Principles, Clinical Applications and Related Fields, fourth ed. Williams and Wilkins, Baltimore, pp. 958±967. Pfurtscheller, G., Neuper, C., Flotzinger, D., Pregenzer, M., 1997. EEG-based discrimination between imagination of right and left hand movement. Electroencephalogr. Clin. Neurophysiol. 103 (5), 1±10. Pfurtscheller, G., Neuper, C., Ramoser, H., M uller-Gerking, J., 1999. Visually guided motor imagery activates sensorimotor areas in humans. Neurosci. Lett. 269, 153±156.

1309

Pfurtscheller, G., Neuper, C., Schloegl, A., Lugger, K., 1998. Separability of EEG signals recorded during right and left motor imagery using adaptive autoregressive parameters. IEEE Trans. Rehab. Eng. 316±325. Pregenzer, M., Pfurtscheller, G., Flotzinger, D., 1996. Automated feature selection with a distinction sensitive learning vector quantizer. Neurocomputing 11, 19±29. Rabiner, L., Juang, B.H., 1993. Fundamentals of Speech Recognition. Prentice-Hall, Englewood Cli€s, NJ. Ramoser, H., M uller-Gerking, J., Pfurtscheller, G., 1999. Optimal spatial ®ltering of single trial EEG during imagined hand movement. IEEE Trans. Rehab. Eng. 441±446. Schloegl, A., Flotzinger, D., Pfurtscheller, G., 1997a. Adaptive autoregressive modelling used for single-trial EEG classi®cation. Biomed. Tech. 42, 162±167. Schloegl, A., Neuper, C., Pfurtscheller, G., 1997b. Subjectspeci®c EEG patterns during motor imagery. In: Proc. 19th Internat. Conf. on IEEE/EMBS, pp. 1530±1532.