Epileptic EEG Detection Using Neural Networks and Post-Classification
Epileptic EEG Detection Using Neural Networks and Post-Classification
Epileptic EEG Detection Using Neural Networks and Post-Classification
a r t i c l e i n f o a b s t r a c t
Article history: Electroencephalogram (EEG) has established itself as an important means of identifying
Received 17 July 2007 and analyzing epileptic seizure activity in humans. In most cases, identification of the
Received in revised form epileptic EEG signal is done manually by skilled professionals, who are small in num-
24 November 2007 ber. In this paper, we try to automate the detection process. We use wavelet transform
Accepted 25 February 2008 for feature extraction and obtain statistical parameters from the decomposed wavelet co-
efficients. A feed-forward backpropagating artificial neural network (ANN) is used for the
Keywords: classification. We use genetic algorithm for choosing the training set and also implement
Electroencephalogram (EEG) a post-classification stage using harmonic weights to increase the accuracy. Average speci-
Artificial neural network (ANN) ficity of 99.19%, sensitivity of 91.29% and selectivity of 91.14% are obtained.
Genetic algorithm © 2008 Elsevier Ireland Ltd. All rights reserved.
Resilient backpropagation
Discrete wavelet transform (DWT)
∗
Corresponding author at: Microprocessor Applications Laboratory, CEDT Building, First Floor, Room No. 239, Indian Institute of Science,
Bangalore 560012, Karnataka, India. Tel.: +91 80 23600451; fax: +91 80 23600683.
E-mail address: [email protected] (L.M. Patnaik).
0169-2607/$ – see front matter © 2008 Elsevier Ireland Ltd. All rights reserved.
doi:10.1016/j.cmpb.2008.02.005
c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 9 1 ( 2 0 0 8 ) 100–109 101
basis function network trained by a hybrid method and a sup- a constant frequency resolution is obtained for the entire
port vector method as candidate classifier tools. For training, time–frequency plane. Since the EEG signal is not determin-
7 h 18 min of data from 19 patients were used; while in test- istic, the problem lies in choosing a computationally efficient
ing, 3 h 48 min of data from 10 patients were involved. He time window since the starting and ending time of spectral
also correlated the classification outputs from 19 channels. components are not known beforehand. Testing for a particu-
Hostetler et al. [2] compared a commercial spike detecting lar window involves translating the window along the whole
computer program’s performance to six electroencephalogra- time scale, which involves a lot of calculation [21]. Conse-
phers using six 19-channel EEG recordings of 20 min duration quently we use wavelet transform for feature extraction.
each. One hundred and eighty minutes of 16-channel EEG from
11 patients was used to train an expert system written in
a descriptive artificial intelligence language by Dingle et al. 2. Theory of techniques
[3]. The expert system was tested with the same data used
for training. Adjouadi et al. [4] employed Walsh transform to 2.1. Wavelet transform
detect epileptic spikes in 21 EEG records of 20–30 min duration.
Processing parameters in his algorithm were set using 10 other The discrete wavelet transform (DWT) [22] is a versatile sig-
EEG records. Tzallas et al. [5] used artificial neural networks nal processing tool that finds many engineering and scientific
for detection of epileptic spikes after feature extraction. His applications. It has also proven useful in EEG signal analy-
data-set comprised of 10–15 min records of 25 patients—half sis [23,24]. DWT is a representation of a signal x(t) using an
of which were used for training. Breakspear and Williams [6] orthonormal basis consisting of a countably infinite set of
showed that different techniques of resampling the data in wavelets. DWT employs two functions, (t), the scaling func-
the wavelet domain have great potential for testing non-linear tion and (t), the wavelet function, which are associated with
hypothesis in complex non-linear and biophysical systems low- and high-pass filters, respectively. Both of these functions
like isolated spike in background EEG data. A fractal dimen- are shifted and scaled as shown below:
sion algorithm was used in EEG analysis by Petrosian [7]. An
association rule approach has been used for the classification ∀k, n, k ∧ n ∈ Z : k,n (t) = 2−k/2 (2−k t − n) (1)
of EEG signals [8], and the auto-SLEX method has been used
for preseizure detection of epilepsy in EEG [9]. Iasemidis [10]
∀k, n, k ∧ n ∈ Z : k,n (t) = 2−k/2 (2−k t − n) (2)
presented an overview of the application of signal processing
methodologies based on the theory of non-linear dynamics
and chaos theory to the problem of seizure prediction. Other The wavelet representation of a signal x(t) in terms of the
works of Iasemedis et al. [11–13] provide insight into mod- scaling and wavelet functions is given by
ern techniques applied to EEG for seizure detection. Kalitzin
et al. [14] have used relative phase clustering index (rPCI)
∞
∞
∞
to predict epileptic seizure onsets. Litt and co-workers [15] x(t) = ck0 ,n k0 ,n (t) + (dk,n k,n (t)) (3)
have presented a scheme for quantifying seizure precursors n=−∞ k=k0 n=−∞
2.2. Artificial neural network (ANN) • The system should be able to train/learn from the small
amount of epileptic data that is usually available. Clinical
The basic units of an ANN are neurons—which are mathe- EEG recordings usually have long hours of non-epileptic
matical functions that manipulate input data using weights data with relatively short durations of epileptic activity.
and biases to produce an output. These neurons can be • While the time taken to train the system is not of much con-
organized in groups which may then be cascaded, thus form- cern, it must be made as short as possible. This is because
ing multi-layered networks. A feed-forward backpropagating the system would have to be trained only once.
neural network involves supervised learning, in which the • If used for real-time detection, the time taken by the system
computed outputs from each neuron move forward to other to process EEG data and produce an output should be small.
layers until finally an output is formed. The backpropagation • The system should have good accuracy. This can be in the
technique then adjusts the weights and biases repeatedly so form of specificity, sensitivity, selectivity or other perfor-
that the computed output is close to the expected output—as mance ratios.
determined by the mean-squared error (MSE) value. The man- • It is an added advantage if the same system is capable of
ner in which the randomly initialized weights and biases detecting different types of epilepsies in multiple patients.
change is determined by training algorithms, such as the • Finally, the whole system should be low on resource
Levenberg–Marquardt (LM), resilient backpropagation (RP) and demand and simple enough for easy and large-scale imple-
the quasi-Newton algorithms. These algorithms vary in their mentation.
convergence speed, memory requirement and total time
to train. Although the Levenberg–Marquardt algorithm con-
4. System description
verges fast [25], it is memory-intensive, and hence we choose
the resilient backpropagation algorithm for training. The
4.1. Data set
training process stops when either the performance goal is
met or the maximum number of epochs is reached.
Our EEG database has been obtained from the website of the
2.3. Genetic algorithm
Albert-Ludwigs-Universtãt, Freiburg, Germany [27] and con-
tains invasive EEG recordings of 21 patients suffering from
The genetic algorithm [26] is a search technique used in
medically intractable focal epilepsy. The data was recorded
computing to find exact or approximate solutions to opti-
during an invasive pre-surgical epilepsy monitoring at the
mization and search problems. They are a particular class of
Epilepsy Center of the University Hospital of Freiburg, Ger-
evolutionary algorithms that use techniques inspired by evo-
many. In 11 patients, the epileptic focus was located in
lutionary biology such as inheritance, mutation, selection, and
neocortical brain structures, in eight patients in the hip-
crossover. These are commonly implemented as computer
pocampus, and in two patients in both. In order to obtain a
simulations where a population of abstract representations
high signal-to-noise ratio, data with artifacts were removed.
(called chromosomes) of candidate solutions to an optimiza-
To record directly from focal areas, intracranial grid, strip, and
tion problem, evolve towards better solutions. Traditionally,
depth electrodes were utilized. The EEG data was acquired
solutions are represented in binary as strings of 0 s and 1 s,
using a Neurofile NT digital video EEG system with 128 chan-
but other encodings are also possible. The evolution usually
nels, 256 Hz sampling rate, and a 16 bit analogue-to-digital
starts from a population of randomly generated individuals
converter. For each of the patients, we use an “ictal” dataset
and gives rise to new generations. In each generation, the fit-
containing recordings with epileptic seizures, atleast 50 min of
ness of every individual in the population is evaluated based
recording before seizure onset and atleast 50 min of recording
on the solution provided by it. Subsequently, multiple individ-
after the seizure stops. These recordings made before and after
uals are stochastically selected from the current population
the seizure are termed pre-ictal data. An average of 7.73 min
(based on their fitness), and modified (recombined and pos-
of epileptic data is available per patient—with a single seizure
sibly randomly mutated) to form a new population. The new
duration varying from 4 s to 28 min. Figs. 1 and 2 show the
population is then used in the next iteration of the algorithm.
ictal and pre-ictal recordings from a patient. The “interictal”
The algorithm terminates when either a maximum number
of generations has been produced, a satisfactory fitness level
has been reached for the population or when no improvement
is seen in the solution to the problem after a certain number
of generations. We use a binary representation of the chromo-
some to indicate whether or not a particular EEG recording is
used in the training set. The fitness of the chromosome is then
updated based on the value of the seizure detection sensitiv-
ity. The algorithm terminates if there is no improvement in
the sensitivity value after 200 successive generations.
3. Design considerations
D1 64–128
D2 32–64
D3 16–32
D4 8–16
D5 4–8
A5 0–4
Fig. 7 depicts the post-classification algorithm detailed 4.5.1. Further increasing sensitivity
above. This algorithm uses current-output and n outputs The above algorithm uses a simple threshold kp3 to distinguish
before this, to decide if current-output is a mis-classification between ictal and pre-ictal signals in step 6(a). Due to this, in
by the ANN classifier. A harmonic series is used for the some cases, parts of an epileptic EEG signal may be wrongly
weights ˛i so that the n previous outputs are weighted labeled as pre-ictal. To overcome this, we modify our post-
in such a way that older outputs are given lesser prior- classification algorithm using the following:
ity; but at the same time, small groups of newer outputs
that are possibly wrong do not adversely affect the post- • Define future-weight=(˛n , ˛n−1 , . . . , ˛n−m+1 ), where m(≤ n) is
classifier’s output. It may be noted that weights which are the number of classifier outputs occurring after current-
part of a geometric series do not have the second property output in the net-output vector, that are used for processing.
mentioned. ˛i are as defined in weight-vector-alpha. We use m = 10(= n).