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

## Abstract

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.

### Keywords

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

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

### 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

### 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):

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 Number | Left side Electrodes | Channel Number | Right Side electrodes | Channel Number |
---|---|---|---|---|

1 | Fp1 -F7 | 1 | Fp2-F8 | 13 |

2 | Fp1-F3 | 5 | Fp2-F4 | 9 |

3 | T7-P7 | 3 | T8-P8 | 15 |

4 | C3-P3 | 7 | C4-P4 | 11 |

5 | P3-O1 | 8 | P4-O2 | 12 |

6 | P7-O1 | 4 | T8-O2 | 16 |

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.

Data | True positive (TP) | False positive(FP) | Sensitivity (%) | Specificity (%) |
---|---|---|---|---|

Preictal (1 min) | 152 | 28 | 8x.4 | — |

Preictal (2 min) | 295 | 65 | 81.9 | — |

Preicta (5 min) | 634 | 86 | 88.05 | — |

TN | FN | |||

Inter Ictal | 902 | 34 | 96.36 | |

Over all accuracy (%) | 90.3 |

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.

Data | True positive (TP) | False positive(FP) | Sensitivity (%) | Specificity (%) |
---|---|---|---|---|

Preictal | 180 | 0 | 100 | — |

Inter Ictal | 297-TN | 3-FN | — | 99 |

Overall accuracy (%) | 99.37 |

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.

DECOMPOSED SIGNAL | FREQUENCY BANDS(HZ) | DECOMPOSITION LEVEL |
---|---|---|

D1 | 128—256 | 1(NOISES) |

D2 | 64–128 | 2(HIGHGAMA) |

D3 | 32----64 | 3(GAMA) |

D4 | 16---32 | 4(BETA) |

D5 | 8-----16 | 5ALPHA) |

D6 | 4 -----8 | 6(THEETA) |

A6 | 0---4 | 6(DELTA) |

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.

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 (%) |
---|---|---|---|---|---|---|

296 | 4 | 98.6 | 381 | 107 | 78.1 | 85.9 |

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

273 | 27 | 91 | 462 | 62 | 87 | 88.71 |

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

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.

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.

EEG Sub Band | Frequency Range (Hz) | Fourier-Bessel Coefficient(m) |
---|---|---|

DELTA | 0–4 | 0–4 |

THEETA | 4–7 | 4–7 |

ALPHA | 7–13 | 7–13 |

LOW BETA | 13–15 | 13–15 |

HIGH BETA | 15–30 | 15–30 |

LOW GAMA | 30–65 | 30–65 |

HIGH GAMA | 65–120 | 65–120 |

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 Name | File Start Time | File End Time | Number of Seizures | Seizure start seconds | Seizure End seconds |
---|---|---|---|---|---|

chb01_01 | 11:42:54 | 12:42:54 | 0 | — | — |

chb01_03 | 13:43:04 | 14:43:04 | 1 | 2996 | 3036 |

chb01_15 | 01:44:44 | 2:44:44 | 1 | 1732 | 1772 |

TP | FN | Sensitivity | TN | FP | Specificity | TCA |
---|---|---|---|---|---|---|

149 | 01 | 99.33 | 150 | 0 | 100% | 99.6% |

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 Name | Number of Seizures | Seizure Start(seconds) | Seizure End(seconds) |
---|---|---|---|

chb24_13 | 1 | 3288 | 3304 |

chb24_14 | 1 | 1939 | 1966 |

chb24_15 | 1 | 3552 | 3569 |

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

TP | FN | SE | TN | FP | SP | TCA |
---|---|---|---|---|---|---|

150 | 0 | 100% | 150 | 0 | 100% | 100% |

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.

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.

FEATURE | VECTOR LENGTH |
---|---|

CHANNELS | 4 (6,8,20 and 21) |

INTRINSIC MODE FUNCTIONS | 4 levels |

FEATURES | 3 (MAD, IQR, Kurtosis) |

TOTAL FEATURE VECTOR | 4 X 4 X 3 = 48 |

PRE-ICTAL EPOCHS [2 SECOND] | 600 |

INTER-ICTAL EPOCHS [2 SECOND] | 600 |

TOTAL INPUT VECTOR TO NN | (1200 X 48 |

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] | 289 | 11 | 96.33 | 290 | 10 | 96.67 | 96.5 |

[10 Min] | 300 | — | 100 | 295 | 5 | 98.33 | 99.16 |

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.

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

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.

Patient | Channels |
---|---|

1 | 1, 5, 9, 13, 14, 15 and 21 |

2 | 1,12,15 and 9 |

3 | 1,4,6,8,14,20 and 21 |

5 | 2,3,9,15,19 and 23 |

8 | 6,8,20 and 21 |

24 | 5,6,20 and 21 |

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

[chb01] | 290 | 10 | 96.66 | 277 | 33 | 89 | 92.8 |

Chb02 | 282 | 18 | 94 | 290 | 10 | 96.66 | 95.3 |

Chb03 | 284 | 16 | 9x.66 | 288 | 12 | 96 | 95.3 |

Chb05 | 270 | 30 | 90 | 264 | 36 | 88 | 89 |

Chb24 | 288 | 12 | 96 | 286 | 14 | 95.33 | 95.6 |

Subjects | Sensitivity (%) | Specificity (%) | Over all accuracy (%) |
---|---|---|---|

Multiple(6) | 81.7 | 76.2 | 79.75 |

S No | Author | year | Data Base | Algorithm | Prediction Time | Specificity | Sensitivity | Accuracy |
---|---|---|---|---|---|---|---|---|

1 | Haddad, T [5] | 2014 | EEG | graph theory | 30 min | — | — | 72% |

2 | Nai-Fu Chang [6] | 2012 | CHB-MIT | wavelet coherence | — | 70% | ||

3 | Christopher J. James [7] | 2009 | — | ICA, Phase Synchronization | 35 min | 65–80% | 65–100% | — |

4 | Maryann D’Alessandro [8] | 2003 | EEG | intelligent genetic search process | 90.47% | 62.5% | ||

5 | Leon D. Iasemidis [9] | 2003 | EEG | Lyapunov exponents | 71.7 min | |||

6 | Piotr Mirowski [10] | 2009 | EEG | cross correlation | 71% | |||

7 | Chisci [11] | 2010 | Freiburg ECOG | SVM classifier based on the Kalman filter, | — | 100% | 100% | — |

8 | Dorai, Arvind [12] | 2010 | EEG | Lyapunov exponents | 65 seconds | 8x.17% | ||

9 | Yang Zheng [13] | 2014 | EEG | bivariate empirical mode decomposition | — | — | ||

10 | Peyvand Ghaderyan [14] | 2014 | Freiburg EEG | KNN-SVM | — | 86.1% | 91.11% | — |

11 | present work | 2013 | CHB-MIT | Lyapunov exponents | 2 min | 99% | 100% | 99.37% |

12 | present work | 2013 | CHB-MIT | Wavelets | 5 min | 100% | 91% | 88.71% |

13 | present work | 2014 | CHB-MIT | Fourier Bessel | 5 min | 100% | 99.33% | 99.6% |

14 | present work | 2014 | CHB-MIT | Localization-EMD-ANN | 5 min | 96.67% | 96.33% | 96.5% |

15 | present work | 2014 | CHB-MIT | Localization-EMD-ANN | 10 min/30 min | 98.33% | 100% | 99.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%.

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

## References

- 1.
Shaik.Jakeer Hussain, “Epileptic Seizure Preidction using Cross Wavelets,Laypunove Exponents and Neural Networks”, NCICN 2013 - 2.
Shaik.Jakeer Hussain and K.S.Rao, “A Neural Network Model for Predicting Epileptic Seizures based on Fourier-Bessel Functions”, International Journal of Signal Processing, Image Processing and Pattern Recognition. Vol.7, No.5 (2014), pp.299–308 - 3.
Shaik.Jakeer Hussain, “Epileptic Seizure Prediction Using Wavelet Transforms and Neural Networks”, PGP-ACM, NCIC, 2013, pp 14–18 - 4.
Shaik.Jakeer Hussain and K.S.Rao, “An Artificial Neural Network Model for Classification of Epileptic Using Huang-Hilbert Tranform”, International Journal on Soft Computing (IJSC), ISSN: 2229–6735 (Online); 2229–7103 - 5.
Haddad, Tahar, Larbi Talbi, Ahmed Lakhssassi, Ben-Hamida Naim, and Sadok Aouini. “Epilepsy seizure prediction using graph theory.” New Circuits and Systems Conference (NEWCAS), IEEE, 2014, pp. 293-296 - 6.
Chiang, Cheng-Yi, Nai-Fu Chang, Tung-Chien Chen, Hong-Hui Chen, and Liang-Gee Chen. “Seizure prediction based on classification of EEG synchronization patterns with on-line retraining and post-processing scheme.” Engineering in Medicine and Biology Society, EMBC, Annual International Conference of the IEEE, 2011, pp. 7564-7569 - 7.
James, Christopher J., and Disha Gupta. “Seizure prediction for epilepsy using a multi-stage phase synchrony based system.” Engineering in Medicine and Biology Society, EMBC, Annual International Conference, IEEE, 2009, pp. 25-28 - 8.
D'Alessandro, Maryann, Rosana Esteller, George Vachtsevanos, Arthur Hinson, Javier Echauz, and Brian Litt. “Epileptic seizure prediction using hybrid feature selection over multiple intracranial EEG electrode contacts: a report of four patients.” Biomedical Engineering, IEEE Transactions, 50(5), 2003, pp. 603-615 - 9.
Iasemidis, Leon D. “Epileptic seizure prediction and control.” Biomedical Engineering, IEEE Transactions, 50(5), 2003, pp. 549-558 - 10.
Mirowski, Piotr, Deepak Madhavan, Yann LeCun, and Ruben Kuzniecky. “Classification of patterns of EEG synchronization for seizure prediction.” Clinical neurophysiology, 120(11), 2009, pp. 1927-1940 - 11.
Chisci, Luigi, Antonio Mavino, Guido Perferi, Marco Sciandrone, Carmelo Anile, Gabriella Colicchio and Filomena Fuggetta. “Real-time epileptic seizure prediction using AR models and support vector machines.” Biomedical Engineering, IEEE Transactions, 57(5), 2010, pp. 1124-1132 - 12.
Dorai, Arvind, and Kumaraswamy Ponnambalam. “Automated epileptic seizure onset detection.” Autonomous and Intelligent Systems (AIS), International Conference, IEEE, 2010, pp. 1-4 - 13.
Zheng, Yang, Gang Wang, Kuo Li, Gang Bao, and Jue Wang. “Epileptic seizure prediction using phase synchronization based on bivariate empirical mode decomposition.” Clinical Neurophysiology, 125(6), 2014, pp. 1104-1111 - 14.
Ghaderyan, Peyvand, Ataollah Abbasi, and Mohammad Hossein Sedaaghi. “An efficient seizure prediction method using KNN-based undersampling and linear frequency measures.” Journal of neuroscience methods, 2014