You are on page 1of 8

Spiking Neural Network for On-line Cognitive

Activity Classification Based on EEG Data

Stefan Schliebs, Elisa Capecci , and Nikola Kasabov

KEDRI, Auckland University of Technology, New Zealand


{sschlieb,ecapecci,nkasabov}@aut.ac.nz

Abstract. The paper presents a method for the classification of EEG


data recorded in two cognitive scenarios, a relaxing and memory task.
The method uses a reservoir of spiking neurons that are activated by the
spatio-temporal EEG data. The states of the reservoir are periodically
read out and classified producing in a continuous classification result over
time. After suitable optimization of the model parameters, we achieve
a test accuracy of 82% on a small data set. Future applications of the
proposed model are discussed including its use for an early detection of
a cognitive impairment such as in Alzheimers disease.

Keywords: Spiking Neural Networks, Liquid State Machines, Reservoir


Computing, EEG data classification, Cognitive tasks.

1 Introduction
Intellectual functioning including memory testing is a commonly used diagnosis
tool to characterize the state of cognitive impairments such as Alzheimer’s dis-
ease. In this paper, we investigate the idea to use the classification ability of a
machine learning algorithm as an indicator for the detection of memory related
cognitive diseases. We have collected EEG recordings from a single healthy sub-
ject performing a relaxing and a memory task; the latter represents the cognitive
scenario. If the subject is healthy, a distinct difference between the EEG record-
ings of the two scenarios is expected and a classification algorithm should be
able to tell the memory and relax scenarios reliably apart. Therefore, if a high
classification accuracy is observed, the subject is expected to be healthy. On
the other hand, if the classification performance is poor, it may be an indicator
for memory related cognitive disease. In this paper, we investigate a brief proof
of concept only. We are especially interested in establishing the suitability of a
reservoir computing approach for the described learning scenario. Reservoir com-
puting has reported promising results on the detection of epileptic seizures [1]
and the classification of motor imagery based on EEG data streams [6]. While
the above studies have investigated the suitability of Echo State Networks [4],
we explore Liquid State Machines (LSM) [7] for classifying spatio-temporal EEG
signals in this paper.

Corresponding author.

M. Lee et al. (Eds.): ICONIP 2013, Part III, LNCS 8228, pp. 55–62, 2013.

c Springer-Verlag Berlin Heidelberg 2013
56 S. Schliebs, E. Capecci, and N. Kasabov

2 SNN Model and Experimental Setup

An LSM consists of two main components, a “liquid” (also called reservoir) in the
form of a recurrent Spiking Neural Network (SNN) [3] and a trainable readout
function. The liquid is stimulated by spatio-temporal input signals causing neural
activity in the SNN that is further propagated through the network due to its
recurrent topology. Therefore, a snapshot of the neural activity in the reservoir
contains information about the current and past inputs to the system.
The function of the liquid is to accumulate the temporal and spatial infor-
mation of all input signals into a single high-dimensional intermediate state in
order to enhance the separability between network inputs. The readout function
is then trained to transform this intermediate state into a desired system output.

2.1 EEG Data Related to a Cognitive Memory Task


EEG data was collected using a standard 14-channel EEG recording device1 .
The tool is affordable, easy to transport and users do not need to be experts to
manipulate it. The data was collected following two scenarios which were labelled
as either the “relax” or the “memory” scenario. The EEG data was recorded from
a single healthy subject over a period of 40 seconds for each of the two scenarios.
The length of a session was chosen in accordance with the duration of the memory
task. Brief test periods are preferred because they are more reliably to reproduce
even if the participants are affected by a particular disorder [2]. The experiment
labelled “Relax” was recorded with closed eyes, in order to avoid disturbing
artefacts from blinking and the subject was asked to avoid thinking or planning
thoughts as much as possible. For the “memory” experiment the Stenberg’s
Memory Scanning Test (SMT) was adopted. The experiment was performed
using the NBS Presentation software2 . The SMT method is used in a wide range
of scientific areas as it is an easy and practical model for evaluating information
processing in working memory [2]. Both scenarios were each repeated for five
times resulting in 2 × 5 = 10 sessions with a total of 400 seconds of recorded
data altogether.
Fig. 1 depicts the recorded EEG time series for each channel and each session.
Each plot contains two EEG traces, one for each class label (either “relax” or
“memory” scenario). Due to the limitations of the used EEG device and the
more or less informal recording conditions, some parts of the data might be
impacted by artefacts and noise (cf. e.g. channel 8 in session 4). For the further
processing, the recorded data was normalized by scaling it to zero mean and
unit standard deviation and extreme outliers (values outside the first and 99-th
percentile) were replaced by the mean of the time series of the corresponding
channel.
The ten sessions were concatenating into a multiple time series containing the
14 EEG channels. The data mining task studied in this paper is to classify the
1
Emotiv EPOC, www.emotiv.com
2
version 0.7, www.neurobs.com
SNN for On-line Cognitive Activity Classification Based on EEG Data 57

EEG channel
C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14
6
3
0

1
−3
−6
6
3
normalized EEG amplitude

2
−3
−6
6

session
3
0

3
−3
−6
6
3
0

4
−3
−6
6
3
0

5
−3
−6
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
10
20
30
40
0

0
time in sec

class MEM REL

Fig. 1. EEG data recorded in 2 × 10 sessions (five sessions for each task) using a
14-channel (C1 to C14) EEG recording device

data on-line while it streams into a classification algorithm. Our goal is to be


able to detect the scenario type of a (short) sequence of EEG activity using a
Liquid State Machine approach.

2.2 Encoding EEG Data into Spike Sequences


The time series data obtained from the EEG device is presented to the reservoir
in the form of an ordered sequence of real-valued data vectors. In order to obtain
an input compatible with the SNN, each real value of a data vector is transformed
into a spike train using a spike encoding. In [11], the authors explored two
different encoding schemes, namely Ben’s Spike Algorithm and a population
encoding technique. Since only the latter one reported satisfying results on a
temporal classification task, we restrict our analysis to this technique. Population
encoding uses more than one input neuron to encode a single time series. The idea
is to distribute a single input to multiple neurons, each of them being sensitive
to a different range of real values. Our implementation is based on arrays of 50
receptive fields with overlapping sensitivity profiles as described in [9]. We refer
to the mentioned references for further details and examples of this encoding
algorithm.
As a result of the encoding, input neurons emit spikes at predefined times
according to the presented data vectors. The input neurons are connected with
a random set of reservoir neurons. The connection weights between input and
reservoir neurons are initialized uniformly in the range [−1, 1]nA and then scaled
using a linear scaling factor win . As a consequence, after scaling the input weights
58 S. Schliebs, E. Capecci, and N. Kasabov

are in the range [−win , win ] nA. Configuring parameter win is very important,
since it determines how strong the state of the reservoir neurons is influenced by
the input signal. A low input scaling factor decreases the influence of the input
signal and increases the influence of the recurrently connected reservoir neurons.
Thus, by carefully adjusting parameter win , we decide how strongly the network
responds to the input and how strongly it reacts to the activity generated by its
reservoir neurons.

2.3 SNN Reservoir Structure


For the reservoir, we employ the Leaky Integrate-and-Fire neuron with expo-
nential synaptic currents and a dynamic firing threshold [10] along with dy-
namic synapses based on the short-term plasticity (STP) proposed by Markram
et al. [8]. We generate a recurrent SNN by aligning 1000 neurons in a three-
dimensional grid of size 10 × 10 × 10 in which the neurons are interconnected
using the small-world pattern described in [7]. More details on the creation of
this network and a complete description of all SNN parameters are given in [11].

2.4 Readout and Learning


A typical readout function convolves every spike by a kernel function which
transforms the spike train of each reservoir neuron into a continuous analogue
signal. We use an exponential kernel with a time constant of τ = 50 ms. The
convolved spike trains are then sampled using a time step of 10 ms resulting in
1000 time series – one for each neuron in the reservoir. In these series, the data
points at time t represent the readout for the presented input sample. Readouts
were labelled according to their readout time t. If the readout occurred at a time
corresponding to either a relax or a memory session, then the corresponding
readout is labelled accordingly.
The final step of the LSM framework consists of a mapping from a readout
sample to a class label. The general approach is to employ a machine learning
algorithm to learn the correct mapping using the readout data. Since the readout
samples are expected to be linearly separable with regard to their class label [7],
a comparably simple learning method can be applied for this task. From the
labelled readouts, we compute a ridge regression model for mapping a reservoir
readout sample to the corresponding class label. Ridge regression is essentially a
regularized linear regression that can counteract model over-fitting by adjusting a
regularization parameter α. We explored suitable configuration of this parameter
in the experiments presented below.

3 Modelling EEG Data and Experimental Results


The LSM has a large number of parameters which have to be carefully adjusted in
order to obtain satisfying classification results. We have worked with these type
of neural networks in other studies [10,11] and we have identified some critical
SNN for On-line Cognitive Activity Classification Based on EEG Data 59

variables which require careful optimization. These variables are the scaling win
of the input weights, the scaling ws of the connection weights of the reservoir, the
connection density λ of the reservoir neurons and the regularization parameter
α that is used for learning the mapping of the reservoir state to the class label.

3.1 Parameter Optimization


We have performed a grid search in which 400 network configurations are eval-
uated regarding their test accuracy. We investigate all possible combinations of
the following parameter options: win ∈ [5, 10, 20, 40, 60], ws ∈ [5, 10, 20, 40, 80],
λ ∈ [3, 8] and α ∈ [0, 1, 5, 10, 20, 50, 75, 100].

scaling of reservoir weights


5 10 20 40 80

0.8

0.7

λ=3
0.6

network density
test accuracy

0.5

0.8

0.7

λ=8
0.6

0.5
100

100

100

100

100
10
20
50
75

10
20
50
75

10
20
50
75

10
20
50
75

10
20
50
75
0
1
5

0
1
5

0
1
5

0
1
5

0
1
5

regularization α

scaling of
5 10 20 40 60
input weights

Fig. 2. Grid search for suitable parameter configurations for the LSM

The results of this grid search is reported in Fig. 2. Each point in this plot
represent one of the 400 configuration tested during the grid search. The y-axis
represents the test accuracy of the trained model which is our performance metric
for this study. Since the data is perfectly balanced (identical number of instances
for both classes), a test accuracy of 50% corresponds to a random classification
of the data.
In the figure, we clearly note the impact of the regularization parameter α
which directly controls the generalization capabilities of the trained model. If the
regularization is too small/large the regression model over/under-fits the data.
Also the input scaling has a considerate influence on the working of the model
although the rule of this influence is less clear. The network density does not
seem very important for this data set. From the grid search we select α = 1,
win = 40, ws = 10 and λ = 3 as the most suitable configuration.
60 S. Schliebs, E. Capecci, and N. Kasabov

3.2 EEG Classification


Fig. 3 shows the outputs obtained from each of the individual processing steps
of the LSM framework using the findings obtained in the previous section. Our
data consists of a set of 14 time series over a time window of 2 × 5 × 40 seconds
sampled at 128Hz. We have down-sampled this time series to 13Hz (keeping only
every 10-th data sample) resulting in 5160 data frames. A frame was fed every
1ms as an input to the LSM which in turn was simulated for 5160ms, cf. Fig. 3A.
The encoded spike trains (population encoding) derived from the time series
are depicted in 3B. The figures show a raster plot of the neural activity of the
input neurons over time. A point in these plots indicates a spike fired by a
particular neuron at a given time.
The obtained spike trains were then fed into a reservoir resulting in charac-
teristic response patterns of the reservoir neurons, cf. Fig. 3C. The reservoir is
continuously read out every 10ms of the simulation time using the technique de-
scribed in section 2.4. Fig. 3D shows the readouts over time for the population-
encoded reservoir inputs. The color in these plots indicates the value of the
readout obtained from a certain neuron; the brighter the color, the larger the
readout value.
The learning and classification step of the LSM framework is presented in
the last plot of Fig. 3. The ridge regression model was trained on the first 3100
time points of readout data (60% of the entire time series) and then tested on
the remainder of the time series. The raw output of the regression model was
smoothed using a moving average with a small window size of 10 time points.
Finally, we discretized the smoothed output using a simple threshold model with
a cutoff value of 0.5. More specifically, if the regression reported a value larger
than 0.5, then the sample was classified as the “memory class” and otherwise as
the “relax class”. The model reported an expected excellent classification on the
training data (100%) and a satisfying classification accuracy on the testing data
(82.3%). The alternating pattern of the relax and the memory sessions is clearly
visible from the model output and additional post-processing could potentially
further improve the results. Despite possible over-fitting of the regression model,
we could not improve the test accuracy by simply increasing the regularization
parameter α.

4 Conclusions and Future Directions


From the here presented results, it seems principally possible to distinguish be-
tween the described two cognitive scenarios. Considering the short training pe-
riod, the noisy nature of the data, its rather informal collection and the technical
limitations of the EEG reading device, the initial results seem very acceptable.
However, more extensive evidence is needed to establish the feasibility of a purely
data driven diagnosis method for memory related diseases. Further improvement
of the classification accuracy could be obtained by replacing the simple regres-
sion learning with more sophisticated learning techniques, e.g. the recently intro-
duced NeuCube architecture [5], and through the automatic selection of relevant
SNN for On-line Cognitive Activity Classification Based on EEG Data 61

Fig. 3. Experimental results obtained from the activity recognition


62 S. Schliebs, E. Capecci, and N. Kasabov

features (EEG channels). Future work could involve the acquisition of a more
suitable data set that also involves the EEG recordings from subjects suffering
from cognitive diseases.

Acknowledgements. The research is supported by the Knowledge Engineering


and Discovery Research Institute (www.kedri.aut.ac.nz) of the Auckland Univer-
sity of Technology.

References
1. Buteneers, P., Verstraeten, D., Nieuwenhuyse, B.V., Stroobandt, D., Raedt, R.,
Vonck, K., Boon, P., Schrauwen, B.: Real-time detection of epileptic seizures in
animal models using reservoir computing. Epilepsy Research 103(2-3), 124–134
(2013)
2. von der Elst, W., van Boxtel, M.J., van Breukelen, G.P., Jolles, J.: Assessment
of information processing in working memory in applied settings: the paper and
pencil memory scanning test. Psychological Medicine 37, 1335–1344 (2007)
3. Gerstner, W., Kistler, W.M.: Spiking Neuron Models: Single Neurons, Populations,
Plasticity. Cambridge University Press, Cambridge (2002)
4. Jaeger, H.: The “echo state” approach to analysing and training recurrent neural
networks. Tech. rep., Fraunhofer Institute for Autonomous Intelligent Syst. (2001)
5. Kasabov, N.: Neucube evospike architecture for spatio-temporal modelling and
pattern recognition of brain signals. In: Mana, N., Schwenker, F., Trentin, E. (eds.)
ANNPR 2012. LNCS (LNAI), vol. 7477, pp. 225–243. Springer, Heidelberg (2012)
6. Kindermans, P.J., Buteneers, P., Verstraeten, D., Schrauwen, B.: An uncued brain-
computer interface using reservoir computing. In: Workshop: Machine Learning
for Assistive Technologies, Proceedings, p. 8. Ghent University, Department of
Electronics and information systems (2010)
7. Maass, W., Natschläger, T., Markram, H.: Real-time computing without stable
states: A new framework for neural computation based on perturbations. Neural
Computation 14(11), 2531–2560 (2002)
8. Markram, H., Wang, Y., Tsodyks, M.: Differential signaling via the same axon
of neocortical pyramidal neurons. Proceedings of the National Academy of Sci-
ences 95(9), 5323–5328 (1998)
9. Schliebs, S., Defoin-Platel, M., Kasabov, N.: Integrated feature and parameter
optimization for an evolving spiking neural network. In: Köppen, M., Kasabov, N.,
Coghill, G. (eds.) ICONIP 2008, Part I. LNCS, vol. 5506, pp. 1229–1236. Springer,
Heidelberg (2009)
10. Schliebs, S., Fiasché, M., Kasabov, N.: Constructing robust liquid state machines to
process highly variable data streams. In: Villa, A.E.P., Duch, W., Érdi, P., Masulli,
F., Palm, G. (eds.) ICANN 2012, Part I. LNCS, vol. 7552, pp. 604–611. Springer,
Heidelberg (2012)
11. Schliebs, S., Hunt, D.: Continuous classification of spatio-temporal data streams
using liquid state machines. In: Huang, T., Zeng, Z., Li, C., Leung, C.S. (eds.)
ICONIP 2012, Part IV. LNCS, vol. 7666, pp. 626–633. Springer, Heidelberg (2012)

You might also like