DEVELOPMENT OF A LOW-COST SVM-BASED
SPONTANEOUS BRAIN-COMPUTER INTERFACE
Fernando Flórez, José M. Azorín, Eduardo Iáñez, Andrés Úbeda and Eduardo Fernández
Biomedical Neuroengineering Group (NBIO), Miguel Hernández University of Elche, Elche, Spain
Keywords: Brain-computer interface, Electroencephalography, Support vector machines, Emotiv epoc.
Abstract: This paper describes a spontaneous non-invasive Brain-Computer Interface (BCI) using an inexpensive
EEG device. The aim of this work is to determine the feasibility of using the Emotiv Epoc device in a BCI.
BCIs provide a method for interaction with a computer for people with severe communication disabilities.
The EEG signals of five healthy users have been registered and preprocessed. The Fast Fourier Transform
(FFT) has been used to extract the relevant characteristics of the EEG signals. Frequency spectrum between
8 Hz - 30 Hz has been calculated. An offline analysis to the recorded data has been performed using a
Support Vector Machine (SVM) as a classification algorithm in order to differentiate three and four mental
tasks. Results of up to 71% classification accuracy for three tasks and 64% classification accuracy for four
tasks were obtained, showing that the Emotiv Epoc is suitable to be used in a Brain-Computer Interface.
1 INTRODUCTION
A Brain-Computer Interface (BCI) provides a
communication and control system that does not
depend on the brain’s normal neuromuscular output
channels (Wolpaw, et al., 2002). A BCI is based on
the use of the mental activity of a person to generate
control commands in a device (Dornhege, et al.,
2007). For this purpose, the brain activity of the user
has to be registered and processed appropriately in
order to distinguish between different cognitive
processes or “mental tasks”.
BCIs are an alternative to classical methods of
human-machine communication, like a keyboard or
a mouse. For that reason, this kind of interfaces are
very useful for people with severe communication
disabilities. BCIs have been used in different
applications, from the control of a wheelchair
(Galán, et al., 2008) to the control of a smart home
(Guger, et al., 2008).
Brain activity can be registered in several ways,
using invasive and non-invasive techniques. Using
invasive techniques, the activity of a single neuron
or a small group of neurons can be registered with
microelectrodes arrays implanted directly in the
brain. These techniques have been used to determine
the intention of movements in animals (Carmena, et
al., 2003) or to control a cursor on a screen (Serruya,
et al., 2002). Non-invasive techniques use electrodes
on the scalp to measure the EEG signals. For
humans, non-invasive techniques based on EEG
signals are more appropriate due to ethical aspects
and medical risks.
Non-invasive BCIs can be classified as evoked
or spontaneous. In an evoked BCI, the registered
signals evidence the automatic response of the brain
to certain external stimuli (Bayliss, 2003; Sirvent, et
al., 2010). Nevertheless, the need for external stimuli
limits the number of applications. In contrast, in a
spontaneous BCI, the user performs the mental tasks
of his/her own free will (Iáñez, et al., 2010).
Once the EEG signals have been registered, they
have to be processed and filtered, and a
classification has to be done in order to differentiate
between the cognitive processes.
Table 1: Inexpensive EEG devices.
Price Range Device Channels
0€ - 200€
Neurosky MindWave
Modular EEG
OCZ Technology NIA
1
2-6
3
200€ - 500€ Emotiv Epoc 14
500€ - 1.000€
Neurobit Optima
Neurobics Pendant EEG
2-4
2
415
Elgendi M., Vialatte F., Constable M. and Dauwels J..
IMMERSIVE NEUROFEEDBACK - A New Paradigm.
DOI: 10.5220/0003725704650469
In Proceedings of the International Conference on Neural Computation Theory and Applications (Special Session on Challenges in Neuroengineering-
2011), pages 465-469
ISBN: 978-989-8425-84-3
Copyright
c
2011 SCITEPRESS (Science and Technology Publications, Lda.)
Figure 1: Sensor placement of the 14 data channels in the Emotiv Epoc, according to the 10/20 International System (left).
Emotiv Epoc (centre). User with the Emotiv Epoc (right).
Different classification algorithms has been used
in BCI experiments (Bashashati, Fatourechi, Ward
and Birch, 2007). Among several of them, like
Linear Discriminant Analysis (LDA) and Neural
Networks (NN), Support Vector Machines (SVM)
provide a powerful method for data classification
(Garrett, Peterson, Anderson and Thaut, 2003). In
this project, a SVM has been used as a classification
algorithm.
Nowadays, several low-cost EEG devices are
available for the consumer. They have a very
affordable price by comparison with the professional
EEG systems, whose prices vary between 10.000€
and 150.000€. Table 1 presents a list of inexpensive
EEG devices. The Emotiv Epoc has been chosen in
this experiment.
In recent years, there has been an increasing
amount of literature on inexpensive BCI. The
Emotiv Epoc device have been used from the control
of a mobile phone (Campbell, et al., 2010) to the
control of a car without using a steering wheel
(AutoNOMOS project Freie Universität Berlin,
2011).
This paper describes a spontaneous non-invasive
EEG-based Brain-Computer Interface using the
Emotiv Epoc device. The BCI developed uses the
Fast Fourier Transform (FFT) to extract the
relevants characteristics of the EEG signals. The
results of five voluntary users will be obtained using
a Support Vector Machine (SVM) as a classification
algorithm to differentiate between mental tasks. The
aim of this experiment is to check the feasibility of
using an inexpensive EEG device in a Brain-
Computer Interface.
The rest of this paper is organized as follows.
Section 2 describes the Brain-Computer Interface
developed and the classifier used is introduced. In
section 3, the experimental results are shown.
Finally, Section 4 contains the conclusions.
2 BRAIN-COMPUTER
INTERFACE
In this section, the Emotiv Epoc device is
introduced. The procedure followed to register the
EEG signals and to extract the relevant features of
the signals is explained. The classifier used in this
experiment is presented.
2.1 EEG Hardware
The EEG signals have been registered using the
Emotiv Epoc headset (Figure 1, centre), released by
the Emotiv Company (Emotiv Systems, 2011).
Emotiv Epoc is a wireless device composed of
14 channels and 2 reference electrodes, located
according to the 10/20 International System
(American Electroencephalographic Society, 1991)
in the positions AF3, F7, F3, FC5, T7, P7, O1, O2,
P8, T8, FC6, F4, F8 and AF4. CMS/DRL reference
electrodes are located in the positions P3/P4 (Figure
1, left). Each electrode has to be moistened with a
saline solution before being used. Once the device is
placed on the scalp (Figure 1, right), the signal
quality of the electrodes has to be checked. It has
been seen that the signal quality decreases when the
electrodes get dry.
The Emotiv Epoc device does not provide the
impedance level of each channel. Instead, the
contact quality of each sensor is represented by a
colour code: Black – No signal; Red – Very poor
signal; Orange – Poor signal; Yellow – Fair signal;
Green – Good signal. This connection quality has to
be checked from within the Emotiv Control Panel.
The headset transmits the EEG signals wirelessly
to a Windows-based computer in the frequency of
2.4 GHz. The signals are filtered on the device
NCTA 2011 - International Conference on Neural Computation Theory and Applications
416
Table 2: Mental tasks.
Number Name Description
1 Rest Countdown from 20 to 0
2 Arm
Imagination of a repetitive
low circular movement
of the right arm
3 Song
Mentally singing the
“Happy Birthday” song
4 Math
Mentally performing
the Fibonacci series
5 Object Mentally rotating an object
before amplifying the data. A high-pass filter at 0.16
Hz cut-off frequency and a low-pass filter at 83 Hz
are applied. The internal sampling rate is 2.048 Hz.
Then, the data are filtered with a 5
th
order Sinc filter
to notch out the 50 Hz and 60 Hz frequencies, and
downsampled to 128 Hz.
2.2 Mental Tasks
Five cognitive processes or mental tasks have been
considered in the experiment. These mental tasks
have been taken into consideration due to the
placement of the electrodes in the Emotiv Epoc.
Table 2 shows the mental tasks considered.
2.3 Acquisition
A Matlab interface has been developed to register
the EEG signals. The interface gives us options to
connect and disconnect with the device, select the
configuration of the test, and start/stop the test. The
process used to register the data is as follows.
Each test is comprised of 25 trials, lasts 250
seconds and is repeated 4 times. There is a short
pause between tests. Once the test is started, the
mental tasks that the user has to perform are
displayed. Each of the five tasks is showed randomly
5 times, and lasts 10 seconds (Figure 2). In the first 2
seconds, a cross appears to indicate the user that a
new task is started; in the following 2 seconds, the
image of the mental task to perform is displayed; in
the last 6 seconds, the user performs the mental task.
Once the test is finished, 120 seconds of each task
have been recorded. A similar timing paradigm as
the one described in (Guger, et al., 2001) is used to
register the data.
Using the Emotiv Control Panel, it has been
checked that the signal quality of each electrode was
always good (green colour).
EEG signals were acquired at a sample
frequency of 128 Hz. The EEG signals registered are
processed in sequences of 1 second of length,
including an overlap of 1/8 a second with the
previous sequence. Once the data are recorded, they
are preprocessed and a feature extraction algorithm
is applied.
2.4 Feature Extraction
Before extracting the main characteristics of the
registered data, a preprocessing has been applied to
the signals. The DC offset in all channels is
removed. Afterwards, the baseline of each electrode
is removed, eliminating the mean value of the signal
registered by each electrode. In this preprocessing,
all 14 electrodes have been used.
Following this, a feature extraction algorithm is
applied to the data in order to extract the main
characteristics of the EEG signals, to facilitate the
posterior classification. The algorithm used is based
on the frequency domain. The Fast Fourier
Transform (FFT) has been used to extract the
relevant characteristics of the EEG signals. The
frequency spectrum between 8 Hz and 30 Hz, with
2 Hz resolution (12 features), has been calculated in
order to analyze the rhythmic activity variations. All
the mental tasks are expected to be found in the EEG
signals in the alpha (8 Hz – 12 Hz) and beta waves
(12 Hz – 30 Hz). Each feature vector consists of 168
elements (12 features x 14 electrodes), obtaining 960
feature vectors by user.
Finally, a Surface Laplacian is applied in order to
improve the signal/noise ratio in each electrode
(Babiloni, et al., 2001).
2.5 Classifier
A Support Vector Machine (SVM) has been used in
this experiment as a classification algorithm. SVMs
are a very useful technique for data classification
(Hsu, Chang and Lin, 2003). It uses a hyperplane or
set of hyperplanes in a high or infinite dimensional
space to distinguish between object of different
classes.
A classification task usually consists in separating
data into trainings and testing sets. Each instance
Figure 2: Time distribution of each task.
DEVELOPMENT OF A LOW-COST SVM-BASED SPONTANEOUS BRAIN-COMPUTER INTERFACE
417
Figure 3: Image of a user performing the test.
in the training set contains a class label and several
features. The aim of SVM is to create a model,
based on the training data, which predicts the class
labels of the test data given its features.
The accuracy of the SVM depends on the
selection of the kernel type and the values of its
parameters. In a Brain-Computer Interface project,
the kernel generally used is the Gaussian or Radial
Basis Function (RBF) kernel (Lotte, et al., 2007).
There are two parameters for an RBF kernel, the
regularization parameter C and the parameter γ,
which determines the RBF width. It is not known
which C and γ are best for a specific problem. For
that reason, some kind of parameter search has to be
done. The aim of this search is to identify C and γ
values so that the classifier can accurately predict
the testing data. The best combination of C and γ is
often selected by a grid-search using cross-
validation with exponentially growing sequences of
C and γ. The one with the best cross-validation
accuracy will be selected.
3 EXPERIMENTAL RESULTS
In this section, the experimental results obtained are
showed. The offline analysis performed to the
registered data of five users is explained, using SVM
as a classification algorithm.
3.1 Participants
For the experiment, the participation of five healthy
right-handed male users with ages between 26 and
40 years old has been required. After informing the
users of the requirements and tests involved, the
volunteers agreed and gave their consent to take part
in the tests. All users had normal vision and hearing,
and no history of neurological or psychiatric
disorders. All tests were done in an isolated room
with the user sitting in front of a PC screen at a
distance of 1 meter (Figure 3).
3.2 SVM Classification
An offline analysis has been done to the registered
data. For this purpose, a Matlab application has been
developed.
The results of five users have been calculated.
Users 4 and 5 had not been previously involved in
any BCI experiment. For every user, all the possible
combinations of three and four tasks have been
calculated. For each combination of tasks, data may
be randomly extracted and separated into training
data and test data. 75% of the data has been used as
a training data, whereas the rest 25% is used as a test
data.
As a classification algorithm, the Matlab
interface of LIBSVM 2.9 library has been used
(Chang and Lin, 2001). LIBSVM, developed by the
National Taiwan University, is a free integrated
software for Support Vector classification,
regression, and distribution estimation. Features of
LIBSVM include, among many other, multi-class
classification, different SVM formulations and
various type of kernels.
In this BCI experiment, a C-SVM with a Radial
Basis Function (RBF) kernel has been used. To
identify C and γ parameters values so that the
classifier can more accurately predict the testing
data, a grid-search using cross-validation with
exponentially growing sequences of C (between 2
-3
and 2
12
) and γ (between 2
-13
and 2
1
) has been
perform. For the classification of three tasks, values
of C=512 and γ=0.0020 present the best results.
Classifying four tasks, values of C=1.024 and
γ=0.0020 have been selected.
Input values to the SVM were not normalized,
because normalization did not improve the
classification results.
3.3 Results
For each user and combination of three and four
tasks, the mean value of the accuracy achieved after
10 iterations of the application has been calculated,
in order to determine more accurately the success
percentage in the classification. Average percentage
of success for every set of tasks and user has been
calculated. Tables 3 and 4 show the results obtained
from the classification of three and four different
tasks.
NCTA 2011 - International Conference on Neural Computation Theory and Applications
418
Table 3: Percentage of correct classification using 3 mental tasks.
Tasks User 1 User 2 User 3 User 4 User 5 Average
Rest – Arm – Song 66.80 67.57 73.39 67.96 63.12 67.77
Rest – Arm – Math 74.08 72.80 72.78 67.55 67.18 70.88
Rest – Arm – Object 67.75 68.90 76.35 66.34 66.91 69.25
Rest – Song – Math 66.40 70.07 72.80 67.79 62.44 67.90
Rest – Song – Object 65.30 67.73 78.46 66.55 64.30 68.47
Rest – Math – Object 73.88 71.05 78.30 66.69 68.58 71.70
Arm – Song – Math 73.50 71.75 72.58 67.59 66.10 70.31
Arm –Song – Object 69.95 67.91 75.96 67.91 66.37 69.62
Arm – Math – Object 72.13 74.32 75.39 67.10 68.53 71.49
Song Math Object 71.83 71.21 76.35 68.05 66.86 70.86
Average 70.16 70.33 75.24 67.35 66.04
Table 4: Percentage of correct classification using 4 mental tasks.
Tasks User 1 User 2 User 3 User 4 User 5 Average
Rest – Arm – Song – Math 63.78 64.84 66.70 61.28 58.75 63.07
Rest – Arm – Song – Object 60.06 61.47 70.12 60.90 57.78 62.07
Rest – Arm – Math – Object 66.15 64.93 69.84 61.30 61.04 64.65
Rest – Song – Math – Object 62.38 63.45 70.57 61.38 58.60 62.28
Arm – Song – Math – Object 65.70 65.34 69.13 61.08 60.44 64.34
Average 63.62 64.01 69.27 61.19 59.32
On average, involving both three and four tasks,
user number 3 has achieved the best results. It is
noted that user number 3 was the one with more
experience in BCI experiments. In contrast, users 4
and 5, with no previous experience in BCI
experiments, have obtained a low success
percentage. This may probe that the more experience
you have in BCI experiments, the better results you
will obtain. Figure 4 shows the average accuracy of
each user.
As regards sets of three tasks, the combination
between the task “Rest – Math – Object” presents
the greatest accuracy, with a 71.70%. As for sets of
four tasks, the best results are classifying the tasks
“Rest – Arm – Math – Object”, with a 64.65% of
success. These combination of three and four tasks
can be used as cognitive processes to classify in
future works.
Furthermore, with the aim of obtaining more
information in the classification, tables 5 and 6 show
the average success percentage obtained by 5 users
on each task, for each combination of three and four
tasks. Results show that the task “Rest” has the
greatest success percentage (77.16% using 3 tasks
and 72.28% using 4 tasks) and the task “Math” has
the second best success percentage (69.72% using 3
tasks and 62.77% using 4 tasks). This is reflected in
the results showed in tables 3 and 4, where the
combination of tasks that achieves the best results
include these 2 tasks.
All results obtained indicate that an SVM
classification together with the Emotiv Epoc as a
register device can be used in a Brain-Computer
Interface.
Figure 4: Average accuracy of each user.
4 CONCLUSIONS AND FUTURE
WORK
A spontaneous non-invasive Brain-Computer
Interface has been proposed. Using the Emotiv Epoc
device to register the EEG signals, this BCI allows
performing the classification of mental tasks. The
feature extraction process using Fast Fourier
Transform and the subsequent classification using a
Support Vector Machine has been explained.
Results obtained in the classification have been
showed. Success percentage for three and four tasks
DEVELOPMENT OF A LOW-COST SVM-BASED SPONTANEOUS BRAIN-COMPUTER INTERFACE
419
Table 5: Average success percentage by 5 users on each task using 3 mental tasks.
Tasks Rest Arm Song Math Object
Rest – Arm – Song 75.02 64.48 60.83 - -
Rest – Arm – Math 76.76 64.70 - 67.86 -
Rest – Arm – Object 80.44 62.28 - - 63.67
Rest – Song – Math 76.19 - 58.60 66.54 -
Rest – Song – Object 77.09 - 60.07 - 66.44
Rest – Math – Object 77.48 - - 68.53 67.35
Arm – Song – Math - 67.66 73.71 68.93 -
Arm –Song – Object - 65.69 77.35 - 65.09
Arm – Math – Object - 67.04 - 76.39 68.49
Song – Math – Object - - 73.86 70.05 66.86
Average 77.16 65.31 67.40 69.72 66.32
Table 6: Average success percentage by 5 users on each task using 4 mental tasks.
Tasks Rest Arm Song Math Object
Rest – Arm – Song – Math 71.83 60.10 53.46 62.02 -
Rest – Arm – Song – Object 73.03 58.24 54.28 - 57.70
Rest – Arm – Math – Object 73.24 58.27 - 63.01 58.31
Rest – Song – Math – Object 71.01 - 53.81 62.13 61.70
Arm – Song – Math – Object - 59.54 69.10 63.92 59.31
Average 72.28 59.04 57.66 62.77 59.26
indicates that the Emotiv Epoc is suitable to be used
in a Brain-Computer Interface. As a future work, the
implementation of an online application has been
proposed. Also, is expected to perform different tests
using volunteers with disabilities. In order to
compare results and verify if there is any
performance loss due to the Emotiv Epoc device, it
is expected to test the same experiments with a high-
quality research-oriented EEG system (gUSBamp
g.tec). Finally, the use of a new set of tasks (for
example, new motor tasks, tongue movement,
mental calculation or word formation) are suggested,
as well as the use of new classification algorithms.
ACKNOWLEDGEMENTS
This work has been supported by the Ministerio de
Ciencia e Innovación of the Spanish Government
through project DPI2008-06875-C03-03 and by the
Consellería d’Educació de la Generalitat Valenciana
through grant BEST/2010/047, grant
ACOMP/2011/066 and grant FPA/2011/058.
REFERENCES
American Electroencephalographic Society. (1991).
American Electroencephalographic Society Guidelines
for Standard Electrode Position Nomenclature.
Journal of Clinical Neurophysiology 8(2)
pp. 200-202.
AutoNOMOS project Freie Universität Berlin. (2011).
Brain Driver. [online] Available at: <http://
autonomos.inf.fu-berlin.de/news/brain-driver>
[Accessed 10 May 2011]
Babiloni, F., Cincotti, F., Bianchi, L., Pirri, G., Millán, J.
R., Mourio, J., Salinari, S. and Marciani, M.G. (2001).
Recognition of imagined hand movements with low
resolution surface laplacian and linear classifiers.
Medical Engineering Samp; Physics 23, pp. 323-328.
Bashashati, A., Fatourechi, M., Ward, R. K. and Birch, G.
E. (2007). A survey of signal processing algorithms in
brain–computer interfaces based on electrical brain
signals. Journal of Neural Engineering, 4(2), R32-57.
Bayliss, J. D. (2003). Use of the evoked potential P3
component for control in a virtual environment. IEEE
Transactions on Neural Systems and Rehabilitation
Engineering 11, pp. 113-116.
Campbell, A. T., Choudhury, T., Hu, S., Lu, H., Mukerjee,
M. K., Rabbi, M. and Raizada, R. D. S. (2010).
NeuroPhone: Brain-Mobile Phone Interface using a
Wireless EEG Headset. [online] Available at
<http://sensorlab.cs.dartmouth.edu/publications.html>
[Accessed 15 May 2011]
Carmena, J. M., Lebedev, M. A., Crist, R. E., O’Doherty,
J. E., Santucci, D. M., Dimitrov, D. F., Patil, P. G,
Henriquez, C. S. and Nicolelis, M. A. L. (2003).
Learning to control a brain-machine interface for
reaching and grasping by primates. PloS Biology 1, pp.
193-208.
Chang, C.-C. and Lin, C.-J. (2001). LIBSVM: A Library
for Support Vector Machines. [online] (Updated April
NCTA 2011 - International Conference on Neural Computation Theory and Applications
420
2011) Available at <http://www.csie.ntu.edu.tw/
~cjlin/libsvm/index.html> [Accessed 12 May 2011]
Dornhege, G., Millán, J. R., Hinterberger, T., McFarland,
D. J. and Müller, K.-R. (2007). Towards Brain-
Computer Interfacing, MIT Press, Cambridge,
Massachussets.
Emotiv Systems. (2011). Brain Computer Interface
Technology. [online] Available at: <
http://www.emotiv.com/> [Accessed 12 May 2011]
Galán, F., Nuttin, M., Lew, E., Ferrez, P. W., Vanacker,
G., Philips J. and Millán, J. R. (2008). A brain-
actuated wheelchair: Asynchronous and non-invasive
Brain-computer interfaces for continuous control of
robots. Clinical Neurophysiology 119, pp. 2159-2169.
Garrett, D., Peterson, D. A., Anderson, C. W. and Thaut,
M. H. (2003). Comparison of Linear and Nonlinear
Methods for EEG Signal Classification. IEEE
Transactions on Neural Systems and Rehabilitation
Engineering, vol 11 (2), pp. 141-144.
Guger, C., Schlögl, A., Neuper, C., Walterspacher, D.,
Strein, T. and Pfurtscheller, G. (2001). Rapid
Prototyping of an EEG-Based Brain-Computer
Interface (BCI). IEEE Transactions on Rehabilitation
Engineering, vol. 9(1), pp. 49-58.
Guger, C., Holzner, C., Grönegress, C., Edlinger, G. and
Slater, M. (2008). Control of a smart home with a
Brain-Computer Interface. 4
th
International Brain-
Computer Interface Workshop and Training Course
2008, Graz, Austria.
Hsu, C.-W., Chang, C.-C. and Lin, C.-J. (2003). A
Practical Guide to Support Vector Classification.
[online] (Updated April 2010) Available at
<http://www.csie.ntu.edu.tw/~cjlin/libsvm/>
[Accessed 12 May 2011]
Iáñez, E., Azorín, J. M., Úbeda, A., Ferrández, J. M. and
Fernández, E. (2010). Mental Tasks-Based Brain-
Robot Interface. Robotics and Autonomous Systems,
vol. 58(12), pp. 1238-1245
Lotte, F., Congedo, M., Lécuyer, A., Lamarche, F. and
Arnaldi, B. (2007). A Review of Classification
Algorithms for EEG-Based Brain-Computer
Interfaces. Journal of Neural Engineering 4, R1-R13.
Serruya, M. D., Harsopoulos, N. G., Paninski, L., Fellows,
M. R. and Donoghue, K. (2002). Instant neural control
of a movement signal. Nature 416, pp. 141-142.
Sirvent, J. L., Azorín, J. M., Iáñez, E., Úbeda, A. and
Fernández, E. (2010). P300-based BCI for Internet
browsing. 8
th
International Conference on Practical
Applications of Agents and Multiagent Systems, IEEE
Spanish Chapter. Trends in PAAMS, AISC 71, pp.
615-622, ISS+: 1867;566
Wolpaw, J. R., Birbaumer, N., McFarland, D. J.,
Pfurtscheller, G. and Vaughan, T. M. (2002). Brain-
Computer Interfaces for communication and control.
Clinical Neurophysiology 113, pp. 767-791.
DEVELOPMENT OF A LOW-COST SVM-BASED SPONTANEOUS BRAIN-COMPUTER INTERFACE
421