BCI Challenge: Error Potential Detection With Cross-Subject Generalisation
BCI Challenge: Error Potential Detection With Cross-Subject Generalisation
generalisation
Duncan Barrack
Nottingham, UK
[email protected]
March 10, 2015
1 Summary
In this document I outline my solution to the brain computer interface (BCI challenge hosted on Kaggle [1]
which was awarded first prize. The competition used data collected in the study conducted by Perrin et al.
[6] and the aim was to form a statistical model to predict errors in the spelling task of the P-300 speller [3].
During a P-300 trial users are presented with letters and numbers and are tasked with spelling words. Using
electroencephalogram (EEG) data the speller attempts to determine which letter the user is thinking of and
presents him/her with this letter. If the letter coincides with the same letter the user was thinking about then
the feedback is regarded as positive, otherwise the feedback is negative. The challenge is to predict, based on
the user’s response to the feedback event, whether feedback was positive or negative.
The EEG (56 channels) and Electrooculography (EOG, 1 channel) data of sixteen subjects who partook in
340 P-300 trials are provided as a training set. Ten other subjects make up the test set for which it is not known
whether the feedback was positive or negative. The efficacy of the predictive models submitted by competition
entrants are measured against this test set. Two subjects make up the score used for the public leader-board
and eight for the private leader-board. It is the latter which is used for the final standings.
For the solution presented in this work, I focused on the 1.3s long EEG and EOG signals after feedback
which contain the event related potentials (ERP) associated with the user’s response to the feedback event. I
engineered several features from the ERP signals including the means of the EEG values for each channel in
windows of various lengths and lags, features based on template matching, as well as meta features such as trial
time-stamp, trial session number etc. To predict the probability of a positive feedback event in the test set I
took the arithmetic mean of the posterior probabilities of two regularised support vector machines which were
trained on different features sets using linear kernels. This approach scored an area under the receiver operating
characteristic curve on the private leader-board of 0.76921.
1
the feedback letter then it would present the user with the next most probable letter. It was possible to infer
whether this had happened by looking at the times between feedback events (longer times tended to correspond
with ‘retrials’ where the initial prediction of the P-300 speller was incorrect). I used this as a feature.
2.2 Feature set B - Mean EEG values in windows of different lengths and lags
Based on a video lecture given by Müller, Blankertz et al. [2] I took the mean of the EEG and EOG recordings
after the feedback event over windows of a number different lengths (50ms to 650ms at increments of 50ms)
and lags (0ms to 1250ms at increments of 50ms). This was done for each channel separately giving a total of
14820 features.
2
4 Code Description
The code used is available at https://github.com/duncan-barrack/kaggle_BCI_challenge. The repository
contains seven programs which are described below.
• generate meta features.m - generates all of the features in set A (Section 2.1) except the features based
on session 5 retrials.
5 Dependencies
To generate the features I used Matlab R2014b. To fit and predict the model Python 2.7.6 was used with
scikit-learn 0.14.1, numpy 1.8.2 and pandas 0.13.1.
3
7 Figures
0.80
0.75
AUC CV score
0.70
0.65
0.60
0.0 0.2 0.4 0.6 0.8 1.0
Relative weight of SVM model (features sets A and B)
Figure 1: Plot showing the CV scores when the posterior probabilities from a linear SVM model which uses
features sets A and B and a linear SVM model which uses features sets A and C (both described in Section 3.2)
are averaged using different weights. Here the maximum CV score ≈ 0.75 is obtained by a applying a relative
weight of 0.46 to the results of the SVM model which uses features sets A and B. This weighting was used to
predict the labels of the test set.
References
[1] BCI Challenge @ NER 2015. https://www.kaggle.com/c/inria-bci-challenge. Accessed: January
2015.
[2] Machine Learning and Signal Processing Tools for BCI. http://videolectures.net/bbci09_blankertz_
muller_mlasp/. Accessed: January 2015.
[3] Lawrence Ashley Farwell and Emanuel Donchin. Talking off the top of your head: toward a mental prosthesis
utilizing event-related brain potentials. Electroencephalography and clinical Neurophysiology, 70(6):510–523,
1988.
[4] Trevor Hastie, Robert Tibshirani, Jerome Friedman, T Hastie, J Friedman, and R Tibshirani. The elements
of statistical learning, volume 2. Springer, 2009.
[5] B Latni. Signal processing and linear systems. Oxford University Press, USA, 1998.
[6] Margaux Perrin, Emmanuel Maby, Sébastien Daligault, Olivier Bertrand, and Jérémie Mattout. Objec-
tive and subjective evaluation of online error correction during p300-based spelling. Advances in Human-
Computer Interaction, 2012:4, 2012.
4
[7] Fren TY Smulders, JL Kenemans, and A Kok. A comparison of different methods for estimating single-trial
p300 latencies. Electroencephalography and Clinical Neurophysiology/Evoked Potentials Section, 92(2):107–
114, 1994.