Runtime Calibration of Online EEG based Movement Prediction using
EMG Signals
Marc Tabie
1
, Hendrik Woehrle
2
and Elsa Andrea Kirchner
1,2
1
Robotics Lab, University of Bremen, Bremen, Germany
2
German Research Center for Artificial Intelligence (DFKI), Robotics Innovation Center, Bremen, Germany
Keywords:
Movement Prediction, EEG, EMG, Online Classifier Calibration.
Abstract:
Prediction of voluntary movements from electroencephalographic (EEG) signals is widely used and investi-
gated for applications like brain-computer interfaces (BCIs) or in the field of rehabilitation. Different com-
binations of signal processing and machine learning methods can be found in literature for solving this task.
Machine learning algorithms suffer from small signal-to-noise ratios and non-stationarity of EEG signals. Due
to the non-stationarity, prediction performance of a fixed classifier may degrade over time. This is because
the shape of motor-related cortical potentials associated with movement prediction change over time and thus
may no longer be well represented by the classifier. A solution is online calibration of the classifier. There-
fore, we propose a novel approach in which movement onsets, detected by the analysis of electromyographic
(EMG) signals are used to recalibrate the classifier during runtime. We conducted experiments with 8 subjects
performing self-initiated, self-paced movements of the right arm. We investigated the differences of online
calibration versus applying a fixed classifier. Further the effect of varying initial training instances (
1
3
or
2
3
of
available data) was examined. In both cases we found a significant improvement in prediction performance
(p < 0.05) when the online calibration was used.
1 INTRODUCTION
Online movement prediction based on single-trial
EEG is becoming a popular tool in various fields of
application. Examples are brain-computer interfaces
(BCIs) or rehabilitation robotics (Ahmadian et al.,
2013) (Ib
´
a
˜
nez et al., 2011) (Niazi et al., 2011) (Kirch-
ner et al., 2013).
However, the online prediction of voluntary move-
ments from EEG signals is a challenging task. Usu-
ally different sophisticated signal processing and ma-
chine learning methods are used in the prediction pro-
cess. These methods have to be calibrated with sub-
ject specific data that is acquired in a separate training
session.
Unfortunately, motor-related cortical potentials
(MRCPs) may change over time, due to exhaustion
of the subject or by resistance changes or movements
of EEG electrodes. A fixed classifier may struggle
to detect movement intentions from ongoing EEG in
case the activity in the movement preparation phase
changes in comparison to data that was acquired in
the initial training phase. Since movement prediction
has to be performed on single-trial EEG data due to
the strict time constraints, such changes are even more
critical and may have a strong impact on the perfor-
mance in movement prediction.
Furthermore, for optimizing the preprocessing
and to train a classifier on the EEG signals, the start of
movements needs to be labeled as accurately as pos-
sible. For this reason one may use devices contain-
ing microswitches, inertial sensors or motion tracking
or video systems (Tabie and Kirchner, 2013)(Ib
´
a
˜
nez
et al., 2011). These devices can only be used in spe-
cific experimental setups or laboratory environments
and require additional effort for their operation and
maintenance.
Since these devices are only used to generate la-
bels, one would like to eliminate any dependencies on
them. Usually, for future applications, one would like
to acquire these labels solely on physiological signals
to be able to construct simple and integrated systems
that can be operated without additional equipment.
An obvious approach is the usage of electromyo-
graphic (EMG) signals from muscles that are con-
tributing to the movement, which is supposed to be
predicted itself. Therefore, in this paper we propose
an approach where only onsets found in EMG sig-
284
Tabie M., Woehrle H. and Kirchner E..
Runtime Calibration of Online EEG based Movement Prediction using EMG Signals.
DOI: 10.5220/0004912202840288
In Proceedings of the International Conference on Bio-inspired Systems and Signal Processing (BIOSIGNALS-2014), pages 284-288
ISBN: 978-989-758-011-6
Copyright
c
2014 SCITEPRESS (Science and Technology Publications, Lda.)
nals, that are recorded from the right arm, are used to
train and, during the application, recalibrate a classi-
fier (Passive Aggressive 1) for predicting movements
from the EEG.
We compare two different procedures: 1) the us-
age of a classifier that is only calibrated based on an
initial training phase, which is kept fixed during the
actual application, and 2) another one that is addi-
tionally adapted during the application, whenever an
onset in the EMG is detected.
2 MATERIALS AND METHODS
2.1 Experimental Setup
Eight healthy right-handed male subjects (age 29.9 ±
3.3 years) participated in the study. The subjects were
seated in a comfortable chair in front of a table. A
monitor and two switches, a flat board and a buzzer,
were located on the table. During the experiments
both input devices were used to determine the begin
or the end of a movement.
The subjects were asked to perform 40 voluntary
self-paced movements of their right arm starting from
the flat board to the buzzer and back. The events from
the input devices (pressing/releasing) were marked in
the recorded EMG and EEG data. For each subject
three runs were recorded.
The experiments were designed and executed us-
ing Presentation (Neurobehavioral Systems, Inc.).
During the experiments a green circle with a black
fixation cross was shown on the monitor. A resting
time of 5 s between two movements had to be main-
tained. A wrong movement was indicated to the sub-
ject by changing the color of the circle from green
to red for 100 ms. Wrong movements were defined
as moving before the resting time (5 s) was expired.
Wrong movements were not taken into account for
data analysis, compare Figure 1. In order to get the
same amount of movements from each test person, a
run was finished after 40 valid movements. To de-
termine the physical begin of a movement a motion
tracking system was used to track the position of the
right hand. These labels were later used for perfor-
mance evaluation.
2.2 Data Acquisition
The EEG data was acquired with a 128 electrode
(extended 10-20-System) actiCAP system sampled at
5 kHz using four 32 channel BrainAmp DC ampli-
fier (BrainProducts GmbH, Munich, Germany), fil-
tered between 0.1 and 1000 Hz and stored. Four elec-
Figure 1: Illustration of the conducted experiments. At the
top of the figure the paradigm is visualized. In the resting
phase (dashed line) a fixation cross is displayed in a green
circle. When the subject starts to move (solid line) it is eval-
uated, whether the minimal resting time of 5 s seconds was
observed. Was this not the case, the circle around the fixa-
tion cross changes its color to red for 100 ms. At the bottom
of the figure three pictures of the setup are given, showing
from left to right, the resting phase, the movement phase
and the end of the movement. After pressing the buzzer in
the very right figure the subject moves back to the starting
position and is again in the resting phase.
trodes (I1, OI1h, OI2h and I2) were used to measure
the vertical and horizontal electrooculogram (EOG),
these channels were discarded for further processing.
EMG was recorded from four muscles of the right
arm (M. brachioradialis, M. biceps brachii, M. triceps
brachii and M. deltoideus) simultaneously with the
EEG using a BrainAmp ExG MR bipolar amplifier.
The EMGs and EEGs were stored together in one file.
In order to have ground truth data for physical
movement onsets from subjects a motion tracking
system was used to record movements of the testper-
sons’ right hand. Three cameras of the type ProRe-
flex 1000 (Qualisys AB, Gothenburg, Sweeden) were
used. A passive infrared marker placed on the back
of subjects’ hand was tracked with a frequency of
500 Hz. For later synchronization a trigger was used
to start and end a measurement, these events were also
marked in the EEG/EMG files.
2.3 Data Processing
All described analyses were done offline, however the
processing, especially the size and step in between
processing windows, were chosen in a way that an
online implementation is also possible with a standard
PC.
RuntimeCalibrationofOnlineEEGbasedMovementPredictionusingEMGSignals
285
2.3.1 EMG Processing
The processing of EMG-signals was originally de-
signed to detect movement intentions. For prepro-
cessing and simultaneous feature generation the vari-
ance of the signal was used. An adaptive threshold
was used to detect movement onsets based on EMG
analysis, this was done separately for each of the four
channels and additionally on a virtual channel derived
as the mean of all channels. The variance filter is de-
fined as,
v(t) =
1
N 1
N
i=0
x
2
(t i)
1
N 1
N
i=0
x(t i)
!
2
,
(1)
with, N the length of the window used for filtering
and x the raw EMG signal. The adaptive threshold is
given as,
T (t) = µ(t)
N
+ pσ(t)
N
, (2)
with µ the mean value, σ the standard deviation, N the
length of the window for the mean and standard devi-
ation and p the sensitivity factor of the threshold. The
parameter for the variance and the adaptive threshold
as well as the best EMG channel were optimized for
each subject using a grid search. For further details
please refer to (Tabie and Kirchner, 2013).
Each found onset in the EMG signals was later
used for training and online calibration of the classi-
fier that was applied for EEG based movement pre-
diction. Since classification of movement intentions
from EMG signals does not work perfectly, a few of
the found onsets are false positive detections (not re-
lated to movements) and some movements were not
predicted by EMG analysis.
2.3.2 EEG Processing
124 EEG channels were used for data analysis, as
mentioned before 4 channels were used for EOG mea-
surements and therefore discarded from the process-
ing. In the processing MRCPs are separated from
ongoing EEG signals, i.e. the classifier training and
online calibration is designed to detect the lateral-
ized readiness potential (LRP). The LRP is a MRCP
related to movement planing which can be detected
directly before the movement onset and is hard to
abort (Blankertz et al., 2006).
For data analysis we used the pySPACE software
framework (Signal Processing And Classification En-
vironment) (Krell et al., 2013).
The processing flow was performed as follows:
Windowing. All data processing was performed on
windows of data of the same length, i.e., 1 s of du-
ration. Predictions were performed every 0.05 s, so
adjacent windows overlapped by 0.95 s.
For training and online calibration, windows were
cut in a range from 4 s to 1 s (examples for no
movement class) and from 1.05 s to 0 s (examples
for movement class) in front of each found EMG on-
set, i.e. [5, 4],[4.95,3.95], .. ., [2,1] s (no
movement class) and [1.05,0.05], [1,0] s (move-
ment class).
We only used two windows for the movement
class and skipped the range from [1.95,0.95] to
[1.1,0.1] s, since we assume that these windows
contribute most to the LRP which the classifier shall
detect (Straube et al., 2013)(Seeland et al., 2013).
For testing windows were cut in a range from 4 s
to 0 s in front of the markers generated from the mo-
tion tracking system, where windows from 4 s to
1 s account for the no movement class and the re-
maining for the movement class.
All windows were processed independently from
each other.
Preprocessing and Feature Generation. The data
was preprocessed in several steps. First, all win-
dows were standardized channel-wise with the z-
score transformation (zero mean and standard devi-
ation one), i.e., the mean value of the window was
subtracted and the result was divided by the standard
deviation. Next, the data was decimated to reduce the
sampling rate from 5000 Hz to 20 Hz together with an
anti-alias finite impulse response filter. The resulting
window was further filtered from 0.1 to 4.0 Hz. After-
wards, the windows were reduced to the last 200 ms
since the latest relevant information for an evolving
MRCP is expected in this time range. For further data
reduction the xDAWN spatial filter (Rivet et al., 2009)
was applied to reduce the number of remaining chan-
nels to four. Data from the remaining channels were
merged to one feature vector and, again the z-score
transformation was applied.
Classification and Movement Probability Estima-
tion. We used the Passive Aggressive Perceptron
variant 1 (PA-1) (Crammer et al., 2006) for classifi-
cation. Training and testing was done individually for
each subject with a cross-validation over runs. For
training either each run was used and the classifica-
tion was done on the two remaining sets (1vs2) or the
data from two runs were concatenated for training and
testing was performed on the remaining run (2vs1).
2.4 Online Calibration of the Classifier
We used supervised online calibration of the classi-
BIOSIGNALS2014-InternationalConferenceonBio-inspiredSystemsandSignalProcessing
286
fier to adapt the classifier. The classifier was first pre-
trained on a training data set. During the application
phase, the data
{
x
1
,x
2
,. ..
}
,x
t
R
n
arrives one at a
time. At time t, the classifier makes a prediction p
t
.
Afterwards, the true label y
t
{−1, 1}, i.e. whether a
movement was performed or not is inferred based on
the EMG. Based on this label, the classifier suffers a
loss ` that can be used to update the classifier to im-
prove its performance in future predictions. Over the
whole run, the classifier tries to minimize a specific
loss function, in the case of the PA-1 this is the hinge
loss `
h
(p
t
,y
t
) = max{0,1 y
t
p
t
}.
3 RESULTS
The classification results are summarized in Table 1.
Statistical analysis with separated t-tests for training
on 1 or on 2 datasets showed that in both cases adap-
tivity leads to significantly higher classification per-
formances (p < 0.001 and p < 0.05 for 1vs2 and 2vs1,
respectively). This effect is bigger for less training
data (1vs2), there the increase is 0.1 in comparison to
0.07 in case of more training data (2vs1).
Further, another effect can be seen when the sub-
jects are grouped according to the achieved perfor-
mance in the non-adaptive classification case. Let the
two groups be i) worse and ii) better, the discrimina-
tion can be made based on subjects mean performance
compared to the mean performance of all subjects.
Subjects with a lower performance belong to group
i) and subjects with higher performance accordingly
to the group ii). Considering this, subjects 2,3,4 and 7
belong to group i) and the remaining subjects to group
ii), this is true for both training cases. When compar-
ing the mean improvements of these two groups it can
be seen, that for both training cases the group i) has
the higher benefit: 1vs2: i) 0.12 and ii) 0.08; 2vs1:
i) 0.11 and ii) 0.04. Therefore, it seems that adaptiv-
ity is even more advantageous when the non-adaptive
classifier tends to be worse.
4 DISCUSSION AND
CONCLUSIONS
In this paper we investigated the impact of online cal-
ibration on the prediction accuracy for online move-
ment prediction based on single trial EEG data. We
showed that training and online calibration of the clas-
sifier is possible solely on physiological signals, i.e.,
by labeling the data for training and calibration based
on onsets found in EMG signals. We used a motion
Table 1: Movement prediction performance in balanced ac-
curacy (BA) for 1vs2 training left and 2vs1 right, both for
non-adaptive (N A) and adaptive (A) testing. For each Sub-
ject (Sub) the mean BA for N A and A as well as the differ-
ence (A N A) is given.
Training 1vs2 Training 2vs1
Sub N A A D N A A D
1 0.84 0.94 0.09 0.88 0.95 0.07
2 0.72 0.89 0.17 0.77 0.89 0.12
3 0.79 0.92 0.13 0.82 0.91 0.09
4 0.81 0.91 0.1 0.81 0.91 0.10
5 0.89 0.95 0.06 0.94 0.96 0.02
6 0.82 0.93 0.11 0.86 0.92 0.06
7 0.75 0.82 0.07 0.73 0.86 0.13
8 0.91 0.96 0.05 0.92 0.92 0.00
Mean 0.82 0.91 0.1 0.84 0.91 0.07
tracking system as a ground truth in the evaluation
procedures.
Our results show that 1) if the initial training is
based on the EMG onsets a sufficiently high predic-
tion accuracy can be achieved, and 2) if an additional
online calibration of the classifier is performed in the
application phase, the prediction accuracy can be sig-
nificantly improved.
The high prediction results were achieved even
though a certain amount of label noise was introduced
due to false movement detections in EMG signals.
In future, we want to improve the EMG onset
detection to minimize the label noise and therefore,
hopefully, improve the prediction accuracy further.
ACKNOWLEDGEMENTS
Work was funded by the German Ministry of Eco-
nomics and Technology (grant no. 50 RA 1011 and
grant no. 50 RA 1012).
REFERENCES
Ahmadian, P., Cagnoni, S., and Ascari, L. (2013). How ca-
pable is non-invasive EEG data of predicting the next
movement? A mini review. Front. Hum. Neurosci.,
7:124.
Blankertz, B., Dornhege, G., Lemm, S., Krauledat, M.,
Curio, G., and M
¨
uller, K. (2006). The berlin brain-
computer interface: Machine learning based detection
of user specific brain states. Journal of Universal
Computer Science, 12(6):581–607.
Crammer, K., Dekel, O., Keshet, J., Shalev-Shwartz, S.,
and Singer, Y. (2006). Online passive-aggressive al-
gorithms. J. Mach. Learn. Res., 7:551–585.
Ib
´
a
˜
nez, J., Serrano, J. I., Castillo, M. D., Barrios, L., Gal-
lego, J. A., and Rocon, E. (2011). An EEG-Based De-
sign for the Online Detection of Movement Intention.
RuntimeCalibrationofOnlineEEGbasedMovementPredictionusingEMGSignals
287
In Cabestany, J., Rojas, I., and Joya, G., editors, Adv.
in Comp. Intelligence, volume 6691 of Lecture Notes
in Computer Science, pages 370–377. Springer Berlin
Heidelberg.
Kirchner, E. A., Albiez, J., Seeland, A., Jordan, M., and
Kirchner, F. (2013). Towards assistive robotics for
home rehabilitation. In Chimeno, M. F., Sol
´
e-Casals,
J., Fred, A., and Gamboa, H., editors, Proc. of the
6th International Conference on Biomedical Electron-
ics and Devices (BIODEVICES-13), pages 168–177,
Barcelona. SciTePress.
Krell, M. M., Straube, S., Seeland, A., W
¨
ohrle, H., Tei-
wes, J., Metzen, J. H., Kirchner, E. A., and Kirchner,
F. (submitted 2013). pySPACE A Signal Processing
and Classification Environment in Python. Frontiers
in Neuroinformatics. https://github.com/pyspace.
Niazi, I. K., Jiang, N., Tiberghien, O., Nielsen, J. F., Drem-
strup, K., and Farina, D. (2011). Detection of move-
ment intention from single-trial movement-related
cortical potentials. J. Neural Eng., 8(6):066009.
Rivet, B., Souloumiac, A., Attina, V., and Gibert, G. (2009).
xDAWN algorithm to enhance evoked potentials: Ap-
plication to brain computer interface. Biomedical En-
gineering, IEEE Transactions on, 56(8):2035 –2043.
Seeland, A., Woehrle, H., Straube, S., and Kirchner, E. A.
(2013). Online movement prediction in a robotic ap-
plication scenario. In 6th International IEEE/EMBS
Conference on Neural Engineering (NER).
Straube, S., Seeland, A., and Feess, D. (2013). Striving
for better and earlier movement prediction by post-
processing of classification scores. In Proc. Inter-
national Congress on Neurotechnology, Electronics
and Informatics, (NEUROTECHNIX-2013), page ac-
cepted, Vilamoura, Portugal.
Tabie, M. and Kirchner, E. A. (2013). EMG onset detection
- comparison of different methods for a movement
prediction task based on EMG. In Proceedings of the
International Conference on Bio-inspired Systems and
Signal Processing, pages 242–247. SciTePress.
BIOSIGNALS2014-InternationalConferenceonBio-inspiredSystemsandSignalProcessing
288