Detection of Epileptic Seizure Using Wavelet Analysis based Shannon Entropy, Logarithmic Energy Entropy and Support Vector Machine

Epilepsy is a prevalent condition, mainly affecting the nervous system of the human body. Electroencephalogram (EEG) is used to evaluate and examine the seizures caused due to epilepsy. The issue of low precision and poor comprehensiveness is worked upon using dual tree-complex wavelet transform (DT-CWT), rather than discrete wavelet transform (DWT). Here, Logarithmic energy entropy (LogEn) and Shannon entropy (ShanEn) are taken as input features. These features are fed to Linear Support Vector Machine (L-SVM) Classifier. For LogEn, accuracy of 100% for A-E, 99.34% for AB-E, and 98.67% for AC-E is achieved. While ShanEn combinations give accuracy of 96.67% for AB-E and 95.5% for ABC-E. These results showcase that our methodology is suitable for overcoming the problem and can become an alternate option for clinical diagnosis.


Introduction
Epilepsy is a neurological disorder, involving repeated seizures, where involuntary movement of entire or partial body happens. It often includes loss of consciousness, loss of bladder control. According to latest survey by the World Health Organisation [WHO], approximately 50 million worldwide have epilepsy, which makes it a widespread condition [1]. The widely used method for clinical diagnosis of neurological disorders including epilepsy is Electroencephalogram (EEG) [1]. Time-frequency domain and nonlinear analysis methods find prominence over time domain and frequency domain, due to superior results owing to the complex and non-linear nature of EEG signals. Discrete Wavelet Transform (DWT), a type of time-frequency domain analysis, has been commonly used for algorithmic research and efficiency [2]. This is used for epilepsy detection as a feature extractor which is required for finding accuracy corresponding to the data sets. Though, lack of shift invariance becomes a major drawback for feature extracted from DWT. Therefore, Dual Tree Complex Wavelet Transform (DT-CWT) methodology which ensures shift invariance as a crucial factor is proposed and dealt with in this paper. [3]. Dual Tree Complex Wavelet Transform (DT-CWT) based feature extraction methods namely ShanEn and LogEn is showcased in this paper for epileptic seizure detection [3]. Thereafter, they are classified using Support Vector Machine (SVM). The entire work and related coding has been performed with help of MATLAB [4,5]. The datasets are divided into five levels from Level 2 to Level 6 by DT-CWT. These datasets-A, B, C, D, E-is used for entropy values calculations. The values of ShanEn and LogEn is fed to Support Vector Machine (SVM) for classification into healthy, interictal and ictal. We have chosen a total of 15 cases based on complexity, practical significance and utility. For each case, data of class 1 and class 2 is divided into two halves. The first half of entropy values is taken as training set while, testing set being the second half. Therefore, cases considered in this paper are: -

Cases
Group 1 and Group 2 1.
Dataset A vs Dataset E.

2.
Dataset B vs Dataset E.

3.
Dataset C vs Dataset E.

4.
Dataset D vs Dataset E.

5.
Dataset A-B vs Dataset E.

6.
Dataset A-C vs Dataset E.

7.
Dataset A-D vs Dataset E.

8.
Dataset B-C vs Dataset E.

9.
Dataset B-D vs Dataset E.

10.
Dataset C-D vs Dataset E.

11.
Dataset A, B, C vs Dataset E.

12.
Dataset A, B, D vs Dataset E.

13.
Dataset A, C, D vs Dataset E.

14.
Dataset B, C, D vs Dataset E.

15.
Dataset A, B, C, D vs Dataset E.
The training dataset and testing dataset are fed into the SVM classifier, through which specificity, sensitivity and accuracy are calculated. This paper is further organized as: DT-CWT method used (elaborate study on proposed method), Procedure for evaluation, Results, Conclusion and References.

Data
The five datasets used in thesis is extracted from the Department of Epileptologie in Bonn which has clinics Germany. This clinical data (A-E) [ Dataset C, D and E signals are of epileptic patients. Both Set C and D are pre-ictal and recorded during seizure free period from different part of the brain. Dataset C is recorded before an epileptic attack onset from opposite hemisphere of the brain which has the hippocampal formation, whereas Dataset D is recorded before an attack from the epileptogenic zone of the scalp. Set E is recorded during ictal phase, when epileptic attack happens to a patient. The Analog EEG signal is converted to computer understandable Digital signal by a 12-bit ADC converter with a sampling frequency of 173.61Hz. Data acquisition system stores the information. A 128-channel amplifier system is used to record the signals [6]. EEG of normal person and epileptic person is shown in Figures 1a and 1b.

Methodology
The EEG dataset A to dataset E is decomposed into 6 sub subband signals. This is analyzed by DT-CWT instead of DWT. It is followed by analysis of Shannon (or Information) entropy and Logarithmic energy entropy. Thereafter, categorization into normal vs inter-ictal or ictal is done by feeding the stored values of entropies to Support Vector Machine Classifiers. Dual tree -complex wavelet transform There are significant advantages of DT-CWT over DWT making it a more suitable analysis method for EEG signals. Since, EEG signals are non-stationary and non-linear signals.
The property of approximate shift invariance and directional selectivity in two and higher dimensions prove advantageous for EEG signals. The implementation of DT-CWT signal processing method is done by MATLAB.
The disadvantages of DWT technique are-shift variance, aliasing effects, and wavelet oscillations. It represents EEG signals using multiscale properties. A signal x is broken into n sampling points, here high pass filter (h) has H, as high pass DWT coefficient and low pass filter(l) has L, as low pass DWT coefficient. The disadvantage of DWT is overcome by DT-CWT by implementation of two distinct 2-channel filter banks. Also, random selection of scaling and wavelet filter is not possible in DT-CWT. The wavelet and scaling function produced by wavelet and scaling filters, are approximate Hilbert transform for another tree [3].
In DT-CWT, dual tree of wavelet filters computes complex wavelet parameters into real and imaginary parts. Here, DT-CWT decomposes EEG signals into six level. Entropies-Shannon and Logarithmic energy are computed for the decomposed signals. Thereafter, the extracted entropy values are stored, divided into training dataset and testing dataset. This sets are fed to SVM classifiers to calculate sensitivity, specificity and accuracy. Therefore, wavelet generated from the complex-valued scaling function and trees are approximately analytic.

Entropies:
The randomness of signal is measured by entropy. In other words, it reflects quantity of information in the given signal [7]. The entropy is defined by: where finite discrete random variable, x=[x(0), x(1),....x(N-1)], p(x) denotes probability distribution function, and i indicates one of the discrete states. Hence, entropy is higher when discrete states have equal probability of occurrence. Shannon or Information Entropy was introduced by Claude Shannon in his paper. In simplistic terms, Shannon Entropy is number of binary digits required to encode a message, which depends on symbols and its frequency. Equation for Shannon or Information Entropy is: where pₓ represents the probability.
---(i) Converting from one logarithmic base to logarithmic base 2 is done by aforementioned formulae. Similarly, logarithmic energy entropy is given by, [7]

Support Vector Machines (SVM)
Support Vector Machines (SVM) is a supervised learning algorithm, under machine learning. It can be implemented for both classification and regression, but mainly finds usage in classification. SVM can be used for high dimensional feature vectors too [8]. It is a binary classifier model which aims to divide dataset into two classes [9]. This is done by finding a hyperplane using support vectors.
Hyperplane is a line which divides data into two classes with widest possible gap. Support vectors are data points nearest to hyperplane. Thus, any change in its location can alter the position hyperplane. The dataset close to hyperplane is noise sensitive, thereby hyperplane is kept far from data points. The margins determined by input vectors are the support vectors. A kernel function is applied, if the problem is not linearly separable. Kernel function such as linear, polynomial, radial basis and sigmoidal function are applied to support vectors, depending upon problem. This converts the support vector to linearly separable in transformed space [3]. In this paper, dataset is divided into-training set and testing set. The classifier is fed these sets to evaluate the desired parameters. When tested with unknown or random data points, it improves the methodology and gives better accuracies. Also, calculating average of accuracies achieved by various data makes the method more trustworthy.

Parameters
The parameters used to obtain the performance of the Support Vector Machine are given below: Specificity(SPE) [10] Sensitivity(SEN) [10] Classification Accuracy(CA) Their calculations are done as follows:

Results Obtained
The complete set of data from A to E, which was obtained from University of Bonn is decomposed using DT-CWT into six levels. However, level 2 to level 6 is useful and further analysed. Figure 2 represents the signal after DT-CWT application. The entropy is calculated for each set of data. It is observed that Set A and Set B have the highest entropy, Set C and Set D have entropies lower than A and B, while Set E has the least entropy values. We have considered a total of 15 cases for analysis, as specified earlier.
The entropy values are divided into two halves-training set and testing set, as class 1 and class 2. These values are stored in excel sheets, fed to the SVM classifiers to evaluate parameters of accuracy, specificity and sensitivity. Upon observation, it was noted that LogEn gave higher accuracy than ShanEn. It was also noted that for lower entropies, LogEn is better than ShanEn. This is done in MATLAB 2015b. There are 100 samples in each dataset of the Feature Vectors ranging from A to E, where 5 features for observations in each case below. In SVM, training and testing data both consisted of 50% of total observations. The SEN, SPE and Classification Accuracy Values are listed below. Table 2 shows when SVM classifies the feature vector using ShanEn. Table 3shows result using feature vector derived from LogEn.

Conclusion
DT-CWT technique has been implemented to study EEG signal and detect seizures. Shannon entropy and Logarithmic energy entropy are fed as input to Support Vector Machine classifier. It was noted that during epileptic seizures entropy values are lower than normal. This is due to more complex electrophysiological behaviour under normal circumstances for a healthy brain. Hence, the severity of epilepsy is determined by a lower entropy value. LogEn has been proved to work better with lower entropies as compared to ShanEn. Also, we have achieved 100% accuracy (CA) in case 1 of log entropy, and 96.67% in case 5 of Shannon Entropy. Hence, DT-CWT shows more promising DWT. This has the potential to be used in the medical field to study EEG signals.
In terms of further scope, other pre-processing methods can be considered, more patients dataset can be utilised for studies.