Open access peer-reviewed chapter

Epileptic Seizure Prediction

By Shaik Jakeer Hussain and Gurajapu Raja Sumant

Submitted: June 6th 2020Reviewed: September 12th 2020Published: December 2nd 2020

DOI: 10.5772/intechopen.94005

Downloaded: 244


Epilepsy is a nervous disease which causes seizures. Electroencephalography (EEG) gives complex information about the brain dynamics but its visual inspection is difficult and requires skilled interpreters. Source localization means identifying the area of the brain where a seizure can occur. In general, source localization is necessary for patients with a special condition in epilepsy, i.e. when their disease is resistant to drugs. One-third of the people having epilepsy are drug resistant and the latest anti-epileptic drugs cannot stop the seizures completely. Unexpected occurrence of seizure disturbs the quality of life and causes physical damage and thus epilepsy should be predicted. This study will use various signal processing methods to extract features by studying the pre-ictal and inter-ictal periods, localize the source and then finally predict epilepsy with the help of Artificial Neural Networks. The knowledge thus derived can help in preparing a wearable brain - computer interface.


  • electroencephalography (EEG)
  • epileptic seizure
  • neural networks
  • epileptic source
  • localization
  • epileptic seizure prediction

1. Introduction

Epileptic seizure detection deals with the process of detecting a seizure when it occurs. The need of the day is to take forward this work to eventually predict a seizure much before it is detected as it the very nature of the seizure that it is random. This chapter discusses various methods to do the same.

The cause of disorder will remain unexplained unless a complete cure is possible and available. Two practical engineering approaches are used to research in epilepsy. The first approach involves monitoring the brain activity on multiple scales which gives us a base to understand the generation of seizures. The second approach is to model the natural properties of the brain network and manipulate these for the modulation of seizure generation.

This work mainly concentrates on amalgamation of the above approaches towards developing a closed loop device which has a feedback of brain signals to the device so that it can control interventions that stop seizures.

The main objective in this chapter is a search for a precursor for seizure prediction mainly in the preictal phase as shown in the Figure 1. This may have form of an identifiable, significant pattern, feature or a pattern to extract the feature.

Figure 1.

Seizure prediction methodology.

Five techniques are used to achieve this objective. They are:

Using Lyapunov exponents.

Using Cross wavelets [1].

Fourier Bessel function [2].

Wavelets [3].

EMD [4].


2. Epileptic seizure prediction using cross wavelets, Lyapunov exponents and neural networks

A seizure prediction method to predict the transitions between Inter ictal and pre ictal states using cross wavelet and Lyapunov exponent features and neural network for binary classification had been proposed [1]. The CHB-MIT database was used.

2.1 Cross wavelet transform

The cross wavelet transform (XWT) of two time series xn and yn is defined as WXY = WXWY∗, where * denotes complex conjugation. We further define the cross wavelet power as WXY. The complex argument argWXYcan be interpreted as the local relative phase between xnand ynin time frequency space [1].

2.2 Lyapunov exponent

A mathematical function which detects chaos is the Lyapunov exponents. Lyapunov exponents are the average exponential rates of divergence or convergence of nearby orbits in phase space.


Where λiare ordered from largest to smallest.

2.3 Application of cross wavelets, Lyapunov exponents and neural networks in prediction

The data is divided into Preictal and interictal as per the information of expert. Three types of preictal data is considered for experimentation. The methods adopted for prediction system are as shown in the block diagram below (Figures 2 and 3):

Figure 2.

Block diagram of epilepsy prediction system using cross wavelets, Lyapunov exponents and neural networks.

Figure 3.

Block diagram showing flow of seizure prediction using wavelet.

The data is having 23 channels. The channels are selected as per standard bipolar montage, electrode placement and channel information is provided in Table 1 in which channels are divided as 11 pairs to calculate cross wavelet coefficients.

Pair NumberLeft side ElectrodesChannel NumberRight Side electrodesChannel Number
1Fp1 -F71Fp2-F813

Table 1.

Division of channels into 11 pairs to calculate cross wavelet coefficients.

where F:Frontal P:Posterior T:Temporal C:Central O:Occipital.

Cross wavelet features are extracted from 11 channel pairs which are applied to Feed forward Back propagation neural network having two layers with 11 input neurons as input layer and one output neuron as one output layer. +1 is assigned as target for pre ictal features and − 1 for inter ictal features. The network trained and tested for various feature vectors and the results are tabulated in Table 2.

DataTrue positive (TP)False positive(FP)Sensitivity (%)Specificity (%)
Preictal (1 min)152288x.4
Preictal (2 min)2956581.9
(5 min)
Inter Ictal9023496.36
Over all accuracy (%)90.3

Table 2.

Prediction performance of neural network with cross wavelet features.

The above table can be interpreted as follows:

For the consideration of interictal period, it is the TN and FN values which are taken into consideration as we need to minimize false alerts. It can be seen that the TN and FN values were 902 and 34 respectively with 96.36% specificity. The preictal data on the other hand had 88.05 sensitivity for 5 minutes data.

The lyapunov exponent is calculated from 23 channels, the extracted features are given to Feed forward back propagation neural network. 23 input nodes and one output node. The network is trained with preictal and interictal features the training performance is evaluated and results are tabulated in Table 3.

DataTrue positive (TP)False positive(FP)Sensitivity (%)Specificity (%)
Inter Ictal297-TN3-FN99
Overall accuracy (%)99.37

Table 3.

Prediction performance of neural network with lyapunov features.

From the above Table 3, we can notice that the number of TP values for preictal period is 180 whereas there were no FP and 100% sensitivity when prediction was done with lyapunov features. In comparison, the inter ictal period had shown 287 TN and 3 FN with 99% specificity. The overall accuracy was 99.37%.

3. Epileptic seizure prediction using wavelet transforms and neural networks

Feature extraction is done using DWT. EEG signals contain all the useful information below 30 Hz and for this reason 4 decomposition levels D1-D4 and one final approximation, A4 are chosen [3].

Based on EEG Ictal period marking of experts selected preictal and interictal periods. These data is decomposed using discrete wavelet transform [3]. Out of 7 sub bands selected three sub bands D2, D3, Dx. These decomposition details are mentioned in Table 4.

D64 -----86(THEETA)

Table 4.

Frequency bands and corresponding decomposition levels.

From these sub bands 4 features power, covariance, inter Quartile Range (IQR) and median absolute deviation (MAD) are extracted from 23 channels of pre ictal and interictal EEG data. Three channels are selected and the feature vector size is Equal to 36 = 3 (channels) x 3 (sub bands D2, D3, D4) x4 (features-power, covariance, IQR, and MAD) from each epochs of preictal and Interictal EEG data. These features are applied to feed forward back propagation neural network as shown in Figure 4. Two layers are used hidden layer 36 neurons and output layer having 36 neurons. It is binary classification target +1 is assigned for preictal (Epiliptic) data and − 1 is assigned to Inter Ictal (normal). Total 1588 epochs (1 second) are used for classification 800 for training and 788 used for testing. The performance is evaluated in terms of sensitivity, Specificity and Overall accuracy.

Figure 4.

Two types of data is chosen. First data has a time horizon of around 5 minutes for the pre-ictal period while the second has the time horizon for 10 minutes. The inter-ictal period is considered to be around 2 hours in order to nullify the post-ictal or seizure effects.

For comparison of performance, Elman Back propagation neural network is used. The performance of Elman Network is tabulated in Table 5. Sensitivity in Elman network is high, specificity and overall accuracy are low. By comparisons of two types of neural networks feed forward network having better overall performance as the overall accuracy is about 88.71% compared to 85.9% of Elman back propagation (Table 6).

(TP)(FP)Sensitivity(%)(TN)(FN)Specificity (%)Overall accuracy (%)

Table 5.

Elman back propagation neural network performance.

(TP)(FP)Sensitivity (%)(TN)(FN)Specificity (%)Overall accuracy(%)

Table 6.

Feed forward neural network performance.

4. Epileptic seizure prediction based on Fourier-Bessel function

Any signal can be represented in terms of Fourier Bessel series due to its decaying nature. An EEG signal is expanded into a Fourier Bessel series [2]. In this way, an EEG signal can be segmented and periods interictal and ictal are classified to predict the occurrence of seizure.

A 1–1 mapping exists between the frequencies and the coefficients. fs= 256 and n = 128 (number of Fourier Bessel Coefficients).

All the Figures 57 show the segmented bands of a seizure signal.

Figure 5.

First plot shows original signal followed by segmented EEG seizure signal of ictal period.

Figure 6.

First plot shows original signal followed by segmented EEG seizure signal of inter ictal period.

Figure 7.

First plot shows original signal followed by segmented EEG seizure signal of pre-ictal period.

The five features energy in each sub band, fmean, IQR and MAD are extracted from each sub band.

The Figure 8 shows the sum of all Bessel coefficients the preictal and interictal features are discriminating.

Figure 8.

Absolute sum of Bessel coefficients with red being Preictal and blue being Interictal EEG signals.

From the Figure 9 it can be observed that the feature, Median absolute deviation of Fourier Bessel coefficients for the Interictal and preictal are discriminating.

Figure 9.

MAD of coefficients with red being Preictal and blue being Interictal EEG signals.

The inter ictal and pre ictal data is prepared as per the information in Table 7. The calculated Fourier-Bessel Coefficients from inter ictal and pre ictal data is given to Neural Network with 64 input neurons, one output neuron and one hidden layer. The Feed Forward Back propagation algorithm was used as shown in Figure 10. The network is trained −1 as target for inter -ictal and + 1 for pre-ictal.

EEG Sub BandFrequency Range (Hz)Fourier-Bessel Coefficient(m)
LOW BETA13–1513–15
HIGH BETA15–3015–30
LOW GAMA30–6530–65
HIGH GAMA65–12065–120

Table 7.

Mapping of frequencies to the Fourier-Bessel coefficients.

Figure 10.

The neural network architecture used above contains three layers: 64 neuron input layer, 1 neuron output layer and a hidden layer in the middle which also has 64 neurons.

The trained network is simulated with Inter-ictal and Pre-ictal data. There was one epoch as false negative and zero epochs as false positives. The simulation results had garnered 150 epochs of inter -ictal and 150 epochs of pre-ictal data. Inter ictal period is used to study sensitivity where as the pre ictal data is used for specificity.

The number of false negative values should be low so that it should have high sensitivity. The specificity must be high with lower false positive values. From Table 8, it is observed that sensitivity, specificity and accuracy of the proposed method is superior and the seizure is predicted before 5 minutes for subject 1 (Table 9).

File NameFile Start TimeFile End TimeNumber of SeizuresSeizure start secondsSeizure End seconds

Table 8.

Seizure information of Subject-1 with timing in seconds.


Table 9.

Sensitivity, specificity and classification accuracy.

The inter-ictal and pre ictal data is prepared as per the information in Table 10. The trained network is simulated with inter-ictal and pre-ictal data. There were zero epochs as false negative and zero epochs as false positives.

File NameNumber of SeizuresSeizure Start(seconds)Seizure End(seconds)

Table 10.

Seizure information of Subject-2 with timing in seconds.

The simulation results of 150 epochs of inter-ictal and 150 epochs of pre-ictal data have been tabulated as above in Table 11.


Table 11.

Sensitivity, specificity and classification accuracy.

The number of false negative and false positive values was minimum due to the fact that the testing was done for shorter periods.

From Table 11 it is observed that for shorter periods under consideration seizure is predicted before 5 minutes for subject 2 with 100% accuracy.

5. Epileptic seizure prediction based on localization

The selection of data was done a bit different from the previous works. Care has been taken to reduce the effects of post seizure by taking a minimum gap of 2 hours in the inter-ictal period.

Using the EEG data as compiled from above, IMF’s are extracted using the EMD technique. Using these IMF’s, features such as Kurtosis, Inter-quartile range and Median Absolute Deviation are extracted. The following Figure 11 shows the steps involved in the study for prediction. The extracted features are used for training the Neural network and the results are tabulated.

Figure 11.

Steps involved in epileptic seizure prediction using epileptic zone. It is divided into three parts. 1) the first part extracted the IMF’s while in the second part 2) features are extracted from these IMF’s. These features are given as 3) input to the neural network in the third part.

For patient 8, source has been localized as discussed in the topic of source localization. It has been observed that 4 channels 6,8,20 and 21 have been the most significant channels. These channels are decomposed into 4 IMF’s out of which 3 significant features are extracted thus a total of 4x4x3 = 48 features are extracted.

600 preictal and interictal epochs of 2 second duration are considered respectively, which means 1200 epochs (600 + 600 = 1200) with 48 features add up to a total input vector of 1200x48 to the neural network. This is tabulated as shown below in Table 12.

CHANNELS4 (6,8,20 and 21)
FEATURES3 (MAD, IQR, Kurtosis)

Table 12.

An overview of the input vector to neural network.

The following results were obtained in this method (Table 13):

The concept is extended to all the patients whose source has been localized as shown in below Table 14.

The prediction method is run on the entire channels localized from the source as derived from Table 14. The results are as shown in the Table 13. The above results are obtained for data of short intervals (Table 15). A testing has been run for continues data whose results are as shown in the figures below.

True Positive(TN)False Negative(FP)Sensitivity (%)True Negative(TN)False Positive(FP)Specificity (%)Over all accuracy
[5 Min]2891196.332901096.6796.5
[10 Min]300100295598.3399.16

Table 13.

Sensitivity, specificity and classification accuracy using epileptic zone for prediction.

When a seizure free data is considered, there is a chance for false alarm. Consider the Figure 12 where the result of testing of continuous seizure free data is shown.

Figure 12.

The testing for continuous seizure data where seizure is predicted 30.4 min before onset.

This false positive problem in seizure free data cannot be taken as a chance for seizure. Thus a false alarm avoidance methodology should be used (Figures 13 and 14).

Figure 13.

A continuous seizure free data is used for testing. Since it is seizure free no transition should occur. There can be some spikes observed from the above zoomed in figure.

Figure 14.

Continuous seizure data with false positive values.

A continuous occurrence of around 10 can be ignored so that no false alarm is triggered. In the above Figures 9 and 10 continuous occurrences happen. Thus, it can be ignored.


6. Generalization of prediction

A new method is proposed for generalization of prediction. There are a few limitations using generalization of epileptic seizure prediction. One of the limitations is the variation issue. Focal seizures are particular to the part of the brain.

Generalization of seizure prediction is possible with the help of epileptic source localized perfectly with clinical support using PET, FMRI, etc. For this work, the results of source localization are used. Table 14 shows the results obtained from source localization. The data of these six patients are considered and a generalization is applied by averaging of the each level. The results obtained are as tabulated above in Table 16.

11, 5, 9, 13, 14, 15 and 21
21,12,15 and 9
31,4,6,8,14,20 and 21
52,3,9,15,19 and 23
86,8,20 and 21
245,6,20 and 21

Table 14.

Source localization results.

True Positive (TP)False Negative (FN)Sensitivity (%)True Negative (TN)False Positive (FP)Specificity (%)Over all accuracy

Table 15.

Sensitivity, specificity and classification accuracy using epileptic zone for prediction for all patients from source localization in Table 14.

SubjectsSensitivity (%)Specificity (%)Over all accuracy (%)

Table 16.

Sensitivity, specificity and over all accuracy obtained for generalization of prediction.

S NoAuthoryearData BaseAlgorithmPrediction TimeSpecificitySensitivityAccuracy
1Haddad, T [5]2014EEGgraph theory30 min72%
2Nai-Fu Chang [6]2012CHB-MITwavelet coherence70%
3Christopher J. James [7]2009ICA, Phase Synchronization35 min65–80%65–100%
4Maryann D’Alessandro [8]2003EEGintelligent genetic search process90.47%62.5%
5Leon D. Iasemidis [9]2003EEGLyapunov exponents71.7 min
6Piotr Mirowski [10]2009EEGcross correlation71%
7Chisci [11]2010Freiburg ECOGSVM classifier based on the Kalman filter,100%100%
8Dorai, Arvind [12]2010EEGLyapunov exponents65 seconds8x.17%
9Yang Zheng [13]2014EEGbivariate empirical mode decomposition
10Peyvand Ghaderyan [14]2014Freiburg EEGKNN-SVM86.1%91.11%
11present work2013CHB-MITLyapunov exponents2 min99%100%99.37%
12present work2013CHB-MITWavelets5 min100%91%88.71%
13present work2014CHB-MITFourier Bessel5 min100%99.33%99.6%
14present work2014CHB-MITLocalization-EMD-ANN5 min96.67%96.33%96.5%
15present work2014CHB-MITLocalization-EMD-ANN10 min/30 min98.33%100%99.16%

Table 17.

Comparison of prediction results.

From the above table it can be noticed that the sensitivity obtained by generalization is 81.7%, while the specificity is 76.2%. The overall prediction accuracy stands at 79.75%.

7. Summary of the conclusions

EMD proves to be a good technique for seizure prediction. The main distinguishing attribute of this work is that it has been able to forecast the seizure about 30 minutes in advance. This might be a result obtained due to the preictal period being much longer and the effects being nullified. The other existing prediction works were capable of only a few minutes. This gives the work much weight in the field of medicine as an alarm can be raised much well in advance and the life of a patient can be saved by alerting either the doctors or the patient himself to take necessary precautions. The concept of generalization can be improved with the help of other existing source localization techniques which make use of PET, FMRI, etc.

8. Comparisons of prediction results

The existing works for prediction using Lyapunov exponents as seen in “5” had a prediction time of 71.7 minutes. The present work done using Lyapunov exponents was able to achieve a staggering result of 2 minutes prediction time with 99% specificity, 100% sensitivity and an overall classification accuracy of 99.97%. “2” had got a classification accuracy of 70% using wavelet coherence. The present work achieved a classification accuracy of 88.71% with 100% specificity and 91% sensitivity. The present works using Fourier Bessel as well as the EMD techniques have got good results

The above table is an indicator that progressive improvement has taken place in both the prediction time and prediction accuracy after the employment of localization and selecting only certain electrodes of interest (Table 17). Most of the previous literature is incomplete and this work aimed to bridge the gap. There has been significant success achieved in this segment.

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Shaik Jakeer Hussain and Gurajapu Raja Sumant (December 2nd 2020). Epileptic Seizure Prediction, Epilepsy - Update on Classification, Etiologies, Instrumental Diagnosis and Treatment, Sandro Misciagna, IntechOpen, DOI: 10.5772/intechopen.94005. Available from:

chapter statistics

244total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

The Dynamic of EEG Characteristics in Epileptic Children during the Treatment with Valproic Acid

By Irma Khachidze

Related Book

First chapter

Implementation of TOF-PET Systems on Advanced Reconfigurable Logic Devices

By J. Torres, R. García, A. Aguilar, J. Soret, J. Martos, A.J. González, F. Sánchez, J.M. Benlloch and M.J. Rodríguez

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us