Epileptic Seizure Prediction

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 antiepileptic 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.


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.

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.

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 W XY jj . The complex argument arg W XY ðÞ can be interpreted as the local relative phase between x n and y n in time frequency space [1].

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 λ i are ordered from largest to smallest.

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):    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.
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.
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.
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%.

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].  Table 2.
Prediction performance of neural network with cross wavelet features.

Prediction performance of neural network with lyapunov features.
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.
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 (featurespower, 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.
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).

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.   Table 6.
Feed forward neural network performance.
A1-1 mapping exists between the frequencies and the coefficients. f s = 256 and n = 128 (number of Fourier Bessel Coefficients).
All the Figures 5-7 show the segmented bands of a seizure signal. 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.

Epilepsy -Update on Classification, Etiologies, Instrumental Diagnosis and Treatment
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.
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.
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   proposed method is superior and the seizure is predicted before 5 minutes for subject 1 ( Table 9). 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.
The simulation results of 150 epochs of inter-ictal and 150 epochs of pre-ictal data have been tabulated as above in Table 11.
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.

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.
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 11. Sensitivity, specificity and classification accuracy.
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.
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.   Table 13. Sensitivity, specificity and classification accuracy using epileptic zone for prediction. Thisfalsepositiveprobleminseizurefreedatacannotbetakenasachancefor seizure. Thus a false alarm avoidance methodology should be used (Figures 13 and 14).

FEATURE
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.

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.
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%.

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.

Comparisons of prediction results
The existing works for prediction using Lyapunov exponents as seen in S.no "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%. S.no "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.

Author details
Shaik Jakeer Hussain 1 * and Gurajapu Raja Sumant 2 1 Vignan's Foundation for Science, Technology and Research (Deemed to be University), Guntur, India 2 Muffakham Jah College of Engineering and Technology (MJCET), Hyderabad, India *Address all correspondence to: jk.shaik@gmail.com © 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.