**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 j j *WXY* . The complex argument argð Þ *WXY* can be interpreted as the local relative phase between *xn* and *yn* in 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.

$$\lambda\_i = \lim\_{t \to \infty} \log\_2 \frac{p\_i(t)}{p\_i(0)} \tag{1}$$

Where *λ<sup>i</sup>* are 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.*


#### **Table 1.**

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

#### *Epilepsy - Update on Classification, Etiologies, Instrumental Diagnosis and Treatment*


#### **Table 2.**

*Prediction performance of neural network with cross wavelet features.*


#### **Table 3.**

*Prediction performance of neural network with lyapunov features.*

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

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

*Epileptic Seizure Prediction DOI: http://dx.doi.org/10.5772/intechopen.94005*


#### **Table 4.**

*Frequency bands and corresponding decomposition levels.*

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

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


**Table 5.**

*Elman back propagation neural network performance.*


**Table 6.**

*Feed forward neural network performance.*

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