Automated Seizure Detection Using Wavelet Transform and Support Vector Machine in Long-Term Intracranial EEG
Automated Seizure Detection Using Wavelet Transform and Support Vector Machine in Long-Term Intracranial EEG
Abstract—Automatic seizure detection is of great significance [5], time-frequency domain analysis [6], [7], artificial neural
for epilepsy long-term monitoring, diagnosis, and rehabilita- network based analysis [8], [9], and machine learning based
tion, and it is the key to closed-loop brain stimulation. This analysis [10]. For nonstationary EEG signals, time-frequency
paper presents a novel wavelet-based automatic seizure detection
method with high sensitivity. The proposed method first conducts analysis method, such as discrete wavelet transform (DWT),
wavelet decomposition of multi-channel intracranial EEG (iEEG) has been proved to be an effective analysis tool and could give
with five scales, and selects three frequency bands of them for quantitative evaluation of ictal EEG in different frequency
subsequent processing. Effective features are extracted, such as bands.
relative energy, relative amplitude, coefficient of variation and Selecting effective features which can best represent the char-
fluctuation index at the selected scales, and then these features
are sent into the support vector machine for training and clas- acteristics of the EEG signals is important in seizure detec-
sification. Afterwards a postprocessing is applied on the raw tion. A number of features have been investigated based on
classification results to obtain more accurate and stable results. wavelet features [6], [11], amplitude relative to background ac-
Postprocessing includes smoothing, multi-channel decision fusion tivity [12], energy [13], Lyapunov exponents [14], and entropy
and collar technique. Its performance is evaluated on a large [15], [16], etc.
dataset of 509 h from 21 epileptic patients. Experiments show that
the proposed method could achieve a sensitivity of 94.46% and A good classifier is essential for an excellent seizure detec-
a specificity of 95.26% with a false detection rate of 0.58/h for tion method. Support vector machine (SVM) based on statistical
seizure detection in long-term iEEG. learning theory and structural risk minimization is regarded as a
Index Terms—Electroencephalogram (EEG), seizure detection, powerful tool for pattern recognition [17] [18]. Due to its good
support vector machine (SVM), wavelet transform. generalization ability, SVM has been widely used for pattern
classification [19], [20].
In this study, an algorithm based on DWT is proposed for de-
I. INTRODUCTION tection of seizures from the long-term intracranial EEG signals.
The iEEG epochs were decomposed into five frequency bands
E PILEPSY is a common chronic neurological disorder
characterized by the sudden, usually brief, excessive
electrical discharges in a group of brain neurons [1]. More than
using wavelet transform with five scales and three frequency
bands at scales 3, 4, and 5 were selected for subsequent pro-
50 million people are diagnosed with epilepsy in the world [2]. cessing. Fluctuation index is proposed as a novel iEEG feature,
Electroencephalogram (EEG) signal analysis is widely used for which is sensitive to signal variations of frequency and ampli-
assessing disorders of brain function, especially for epilepsy tude. The statistical parameters such as fluctuation index, rela-
diagnosis. The traditional method used to identify seizures is tive energy, relative amplitude, coefficient of variation are com-
heavily dependent on the visual analysis of the EEG recordings puted within the selected three frequency bands. SVM classifier
by the trained professionals [3]. This is a very costly as well is employed for seizure classification. Finally, postprocessing
as tedious task to review a 24-h continuous EEG recording, including smoothing, multi-channel decision fusion and collar
particularly if the number of EEG channels increases. Au- technique is applied to obtain more accurate and stable classifi-
tomating the detection of epileptic seizures is valuable for cation results.
assisting neurologists to analyze the EEG recordings, and could
also offer solutions for closed-loop therapeutic devices such as II. INTRACRANIAL EEG DATASET
implantable electrical stimulation systems [4].
Automatic seizure detection methods in the diagnosis of The intracranial EEG data used in this study came from the
epilepsy were developed in the early 1970s. In recent years, Epilepsy Center of the University Hospital of Freiburg, Ger-
many algorithms for the detection of seizures have been many [21]. The database contains iEEG from 21 patients with
proposed and applied, such as frequency domain analysis a total of 87 seizures. The data were recorded during presur-
gical epilepsy monitoring with invasive electrodes. There are
Manuscript received January 11, 2012; revised March 24, 2012 and May 24–26 h of nonseizure data and 2–5 h of seizure data for each
27, 2012; accepted June 15, 2012. Date of publication July 31, 2012; date of patient. Six contacts were selected, three (channel 1, 2, 3) near
current version November 02, 2012. This work was supported in part by the
the epileptic focus and three (channel 4, 5, 6) in remote locations
Development Program of Science and Technology of Shandong under Grant
2010GSF10243 and in part by the Independent Innovation Foundation of Shan- involved in seizure spread and propagation. Seizure onset and
dong University under Grant 2009JC004. offset times were determined by the experts based on intracra-
The authors are with the School of Information Science and Engineering,
nial EEG recordings. In order to obtain a high signal-to-noise
Shandong University, Jinan 250100, China (e-mail: [email protected];
[email protected]; [email protected]; [email protected]). ratio and fewer artifacts, the iEEG data acquisition was per-
Digital Object Identifier 10.1109/TNSRE.2012.2206054 formed with a Neurofile NT digital video EEG system, with
TABLE I
DISTRIBUTION OF THE SAMPLES IN THE TRAINING AND TEST DATA SETS
A. Training Data
There are 105 segments of nonseizure data and 105 segments
of seizure data selected for training from the total 21 patients.
Each segment contains 1024 points (256 points = 1 s) and
the overall time length of the training segments is 840 s. The
seizure/nonseizure segments in training data set were randomly
chosen from the seizure/nonseizure parts marked by the EEG
experts.
B. Testing Data
In total, 80.14 h of iEEG data containing 82 seizures in 21
patients were selected as test data. There are 2359 segments of
seizure and 69 753 segments of nonseizure, and the length of
each segment is 1024 points too. Training data and test data are
shown in Table I.
C. Coefficient of Variation
The standard deviation shows how closely various fea-
tures are near to the mean value . We use mean value to mea-
sure the mean amplitude. The coefficient of variation can
measure the variations of the signal amplitude. The variance of
each decomposed subband can form a feature vector. Since the
epileptic signal exhibiting rhythmic behavior of regular ampli-
tude, the coefficient of variation in general gives smaller values
than that during the interictal times [6]. The corresponding co-
efficient of variance can be expressed as
(6)
where
and
Fig. 2. The differences of fluctuation index between normal and seizure
EEG signals. (a) The values of the D3 coefficients. (b) The values of is the number of DWT coefficients at scale .
the D4 coefficients. (c) The values of the D5 coefficients.
D. Fluctuation Index
The ictal iEEG commonly displays larger fluctuations than
A. Relative Energy the interictal. The fluctuation index is proposed to mea-
sure the intensity of iEEG signal changes. The of scale is
The relative energy indicates the strength of the signal as it
defined as
gives the area under the curve of power at any interval of time.
For the Daubechies wavelet, the sum of square of coefficients
of the wavelet series is the energy of the EEG signal [6]. The (7)
energy of EEG signal with limited length is given by
where is the number of DWT coefficients at scale . Fig. 2
(4) shows the difference of fluctuation index between normal and
seizure iEEG signals. It could be found that the fluctuation index
of the iEEG during seizures usually becomes greater than that
where is the sampling interval and is the number of DWT during the nonseizure periods.
coefficients presented at scale . The relative energy
of the scale is computed as IV. SUPPORT VECTOR MACHINE
The SVM built on statistical learning theory was developed
(5)
by Cortes and Vapnik (1995) for binary classification, and is
now widely used in pattern classification [10], [17]. The idea of
SVM algorithm is to project nonlinear separable samples onto
where is the number of the wavelet scales. another higher-dimensional space by kernel functions, and then
locate the optimal separating hyperplane (OSH) in the projec-
tion space by solving a quadratic optimization problem [27],
B. Relative Amplitude [28]. Typical kernel functions of SVM are linear kernel, polyno-
mial kernel, radial basis functions (RBF), and sigmoidal neural
Since the majority of seizure activity is paroxysmal, the
network kernel. In this study, satisfactory results were achieved
amplitude relative to the background would increase when
by using RBF kernel function, which is defined by
the seizure occurs [25]. The average amplitude of an epoch
.
was computed as the mean of the amplitudes of the segments
obtained after the half wave decomposition [26]. In order
to get the amplitude relative to the background, each iEEG V. POSTPROCESSING
epoch is normalized by the amplitude of the background in the In this paper, the value of the SVM output was defined as
corresponding scale. The background was defined as 120 s of 1 or 1, which 1 represents the normal/non-seizure iEEG and
data after leaving a gap of 60 s to the epoch being analyzed. 1 represents the seizure iEEG. But the value of the SVM
The analysis results show that relative amplitude values can output is not always 1 or 1, usually changing in the interval
clearly discriminate between normal and seizure iEEG time [ 1 1]. For this reason, postprocessing for the SVM outputs is
series, and large relative amplitude values usually accompany necessary. The postprocessing scheme consists of smoothing,
with seizures. multi-channel decision fusion, and collar technique.
752 IEEE TRANSACTIONS ON NEURAL SYSTEMS AND REHABILITATION ENGINEERING, VOL. 20, NO. 6, NOVEMBER 2012
VI. RESULTS
TABLE II
DETECTION PERFORMANCE OF THE PROPOSED ALGORITHM
SP: simple partial seizure, CP: complex partial seizure, and GTC: generalized tonic-clonic seizure. FP: false-positives, FN: false-negatives
scheme to detect epileptic seizure in the grouped multi-channel [7] B. Boashash, M. Mesbah, and P. Coldtiz, “Time-Frequency Detec-
EEG signals using independent component analysis (ICA) and tion of EEG Abnormalities,” in Time-Frequency Signal Analysis and
Processing: A Comprehensive Reference, B. Boashash, Ed. Oxford,
wavelet transform [37]. The short-term EEG data were col- U.K.: Elsevier, 2003, pp. 663–670.
lected from five patients with epilepsy, and divided into small [8] A. J. Gabor, “Seizure detection using a self-organizing neural network:
segments manfully, each 0.3 s. In a total, they obtained 2400 Validation and comparison with other detection strategies,” Electroen-
cephalogr. Clin. Neurophysiol., vol. 107, pp. 27–32, 1998.
segments (about 12 min recordings), where 345 segments were [9] W. R. Webber, B. Litt, K. Wilson, and R. P. Lesser, “Practical detection
epileptic seizure. Their system yielded a good performance for of epileptiform discharges (EDs) in the EEG using an artificial neural
classifying seizure and no-seizure EEG segments [37]. How- network: A comparison of raw and parameterized EEG data,” Elec-
troencephalogr. Clin. Neurophysiol., vol. 91, pp. 194–204, 1994.
ever, the successes of those above approaches depend on the [10] A. Subasi and M. I. Gursoy, “EEG signal classification using PCA,
use of short-term EEG for evaluation. This limits the clinical ICA, LDA and support vector machines,” Expert Syst. Appl., vol. 37,
applicability of those approaches, and their systems should be no. 12, pp. 8659–8666, 2010.
[11] A. Subasi, “EEG signal classification using wavelet feature extraction
further assessed on long-term EEG data so as to confirm their and a mixture of expert model,” Expert Syst. Appl., vol. 32, no. 4, pp.
effectiveness for seizure detection. 1084–1093, 2007.
As we know, selecting suitable features can improve the ef- [12] A. Murro, D. King, J. Smith, B. Gallagher, H. Flanigin, and
K. Meador, “Computerized seizure detection of complex partial
ficiency of classifier. Although amplitude, duration and shape seizures,” Electroencephalogr. Clin. Neurophysiol., vol. 79, no.
of waveforms features can make a distinction between normal 4, pp. 330–333, 1991.
and seizure segments, high variability of background EEGs and [13] H. Qu and J. Gotman, “A patient-specific algorithm for the detection of
seizure onset in long-term EEG monitoring: Possible use as a warning
seizure characteristics make it indispensable to make use of the device,” IEEE Trans. Biomed. Eng., vol. 44, no. 2, pp. 115–122, Feb.
statistical and relative values of these features. We have found 1997.
that the proposed method can obtain high performance in the [14] N. Güler, E. Übeyli, and I. Güler, “Recurrent neural networks em-
ploying Lyapunov exponents for EEG signals classification,” Expert
automatic seizure detection only if an appropriate subset of un- Syst. Appl., vol. 29, no. 3, pp. 506–514, 2005.
correlated features is extracted. Combination of the four features [15] N. Kannathal, M. Choo, U. Acharya, and P. Sadasivan, “Entropies for
such as relative energy, relative amplitude, coefficient of varia- detection of epilepsy in EEG,” Comput. Methods Programs Biomed.,
vol. 80, no. 3, pp. 187–194, 2005.
tion, and fluctuation index turns out to be strong separability for [16] V. Srinivasan, C. Eswaran, and N. Sriraam, “Approximate entropy-
different types of background activities and seizures. based epileptic EEG detection using artificial neural networks,” IEEE
Our proposed method for the automatic seizure detection Trans. Inf. Technol. Biomed., vol. 11, no. 3, pp. 288–295, May 2007.
[17] V. N. Vapnik, “An overview of statistical learning theory,” IEEE Trans.
in depth EEG provides high sensitivity and accuracy by using Neural Networks, vol. 10, no. 5, pp. 988–999, Sep. 1999.
DWT and SVM. The DWT is applied to nonstationary processes [18] M. Zavar, S. Rahati, M.-R. Akbarzadeh-T, and H. Ghasemifard,
with the advantages both in the time and frequency domains. “Evolutionary model selection in a wavelet-based support vector
machine for automated seizure detection,” Expert Syst. Appl., vol. 38,
SVM has been demonstrated many unique advantages in re- pp. 10751–10758, Sep. 2011.
solving small sample, nonlinear and high dimensional pattern [19] A. B. Gardner, A. M. Krieger, G. Vachtsevanos, and B. Litt, “One-class
recognition. We choose the relative energy, relative amplitude, novelty detection for seizure analysis from intracranial EEG,” J. Mach.
Learn. Res., vol. 7, pp. 1025–1044, 2006.
coefficient of variation, and fluctuation index as features and [20] S. Katagiri and S. Abe, “Incremental training of support vector ma-
then input them into the SVM for recognition. Finally, the chines using hyperspheres,” Pattern Recognit. Lett., vol. 27, no. 13,
postprocessing was applied to the SVM outputs. Experimental pp. 1495–1507, 2006.
[21] Freiburg Seizure Prediction Project. Freiburg, Germany, 2008 [On-
results show that our proposed method is effective and appli- line]. Available: http://epilepsy.uni-freiburg.de/freiburg-seizure-pre-
cable. In order to fit the user’s specific needs, the parameters diction-project/eeg-database
of our algorithm, i.e., the length of MAF, are tunable which [22] M. K. Kiymik, I. Güler, A. Dizibüyük, and M. Akin, “Comparison of
STFT and wavelet transform methods in determining epileptic seizure
allow for the adjustment of the detection performance. How to activity in EEG signals for real-time application,” Comput. Biol. Med.,
set the parameters automatically so as to improve the detection vol. 35, pp. 603–616, 2005.
efficiency further will be done in a forthcoming study. [23] T. Kalayci and O. Ozdamar, “Wavelet preprocessing for automated
neural network detection of EEG spikes,” IEEE Eng. Med. Biol. Mag.,
vol. 14, no. 2, pp. 160–166, Mar./Apr. 1995.
REFERENCES [24] M. E. Saab and J. Gotman, “A system to detect the onset of epileptic
seizures in scalp EEG,” Clin. Neurophysiol., vol. 116, no. 2, pp.
[1] S. Sanei and J. A. Chambers, EEG Signal Processing. New York: 427–442, 2005.
Wiley, 2007. [25] S. Grewal and J. Gotman, “An automatic warning system for epileptic
[2] S. Santaniello, S. P. Burns, A. J. Golby, J. M. Singer, W. S. seizures recorded on intracerebral EEGs,” Clin. Neurophysiol., vol.
Anderson, and S. V. Sarma, “Quickest detection of drug-resistant 116, no. 10, pp. 2460–2472, 2005.
seizures: An optimal control approach,” Epilepsy Behav., vol. [26] J. Gotman, “Automatic recognition of epileptic seizures in the EEG,”
22, pp. 49–60, 2011. Electroencephalogr. Clin. Neurophysiol., vol. 54, pp. 530–540,
[3] H. Adeli, Z. Zhou, and N. Dadmehrc, “Analysis of EEG records in an 1982.
epileptic patient using wavelet transform,” J. Neurosci. Methods, vol. [27] E. D. Übeyli, “Least squares support vector machine employing model-
123, no. 1, pp. 69–87, 2003. based methods coefficients for analysis of EEG signals,” Expert Syst.
[4] Y. Tang and D. M. Durand, “A tunable support vector machine as- Appl., vol. 37, no. 1, pp. 233–239, 2010.
sembly classifier for epileptic seizure detection,” Expert Syst. Appl., [28] C. J. C. Burges, “A tutorial on support vector machines for pattern
vol. 39, pp. 3925–3938, 2012. recognition,” Data Mining Knowledge Discovery, vol. 2, pp. 121–167,
[5] J. Gotman and P. Gloor, “Automatic recognition and quantifi- 1998.
cation of interictal epileptic activity in the human scalp EEG,” [29] A. Temko, E. Thomas, W. Marnane, G. Lightbody, and G. Boylan,
Electroencephalogr. Clin. Neurophysiol., vol. 41, pp. 513–529, “EEG-based neonatal seizure detection with support vector machines,”
1976. Clin. Neurophysiol., vol. 122, no. 3, pp. 464–473, 2011.
[6] Y. U. Khan and J. Gotman, “Wavelet based automatic seizure detection [30] Z. Huang and M. P. Harper, “Speech activity detection on multichan-
in intracerebral electroencephalogram,” Clin. Neurophysiol., vol. 114, nels of meeting recordings,” Lecture Notes in Computer Science, vol.
pp. 898–908, 2003. 3869, pp. 415–427, 2006.
LIU et al.: AUTOMATIC SEIZURE DETECTION USING WAVELET TRANSFORM AND SVM IN LONG-TERM INTRACRANIAL EEG 755
[31] K. K. Majumdar and P. Vardhan, “Automatic seizure detection in Weidong Zhou received the B.E. degree and M.E.
ECoG by differential operator and windowed variance,” IEEE Trans. degree from Zhejiang University, Hangzhou, China,
Neural Syst. Rehabil. Eng., vol. 19, no. 4, pp. 356–365, Aug. 2011. in 1986 and 1989, respectively, and received the
[32] A. Aarabi, R. Fazel-Rezai, and Y. Aghakhani, “A fuzzy rule-based Ph.D. degree from Shandong University, Jinan,
system for epileptic seizure detection in intracranial EEG,” Clin. Neu- China, in 2005.
rophysiol., vol. 120, pp. 1648–1657, 2009. He is currently a Professor in the School of Infor-
[33] E. C.-P. Chua, K. Patel, M. Fitzsimons, and C. J. Bleakley, “Improved mation Science and Engineering at Shandong Uni-
patient specific seizure detection during pre-surgical evaluation,” Clin. versity. He has published more than 60 articles in aca-
Neurophysiol., vol. 122, pp. 672–679, 2011. demic journals and conference papers. His research
[34] S. Raghunathan, A. Jaitli, and P. P. Irazoqui, “Multistage seizure interests include biomedical signal and image pro-
detection techniques optimized for low-power hardware platforms,” cessing, intelligent information processing.
Epilepsy Behav., vol. 22, pp. S61–S68, 2011.
[35] P. Zarjam and M. Mesbah, “Discrete wavelet transform based seizure
detection in newborns EEG signals,” in Proc. 7th Int. Symp. Signal
Process. Appl., 2003, vol. 2, pp. 459–462. Qi Yuan received the B.E. degree from Tianjin Uni-
[36] S. Mihandoost, M. C. Amirani, and B. Z. Varghahan, “Seizure detection versity of Technology and Education, Tianjin, China,
using wavelet transform and a new statistical feature,” in Proc. 2011 5th in 2009. He is currently working toward the M.S.
Int. Conf. Appl. Inf. Commun. Technol., 2011, pp. 1–5. degree and Ph.D. degree in the School of Informa-
[37] H. Y. Chang, S. C. Yang, S. H. Lan, and P. C. Chung, “Epileptic seizure tion Science and Engineering, Shandong University,
detection in grouped multi-channel EEG signal using ICA and wavelet Jinan, China.
transform,” in Proc. 2010 IEEE Int. Symp. Circuits Syst., 2010, pp. His research interests include biomedical signal
1388–1391. processing and pattern recognition.
Yinxia Liu received the B.E. degree in electronic in- Shuangshuang Chen received the B.E. degree from
formation engineering from China West Normal Uni- Qingdao University of Science and Technology,
versity, Nanchong, China, in 2010. She is currently Qingdao, China, in 2010. She is currently working
working toward the M.S. degree in the School of In- toward the M.S. degree in the School of Information
formation Science and Engineering, Shandong Uni- Science and Engineering at Shandong University,
versity, Jinan, China. Jinan, China.
Her research interests include biomedical signal Her research interests include information pro-
processing and machine learning. cessing and pattern recognition.