Detection of Epilepsy using Wavelet Decomposition of EEG and SVM

—EEG continues to play a central role in diagnosis and management of patients with seizure disorders—along with the other diagnostic techniques developed over the last 30 or so years— it is a convenient and also an inexpensive way to demonstrate the physiological conditions of abnormal cortical excitability that underlie epilepsy. Epilepsy is neurological disorder in which nerve cell activity in the brain becomes disturbed and hence causes physical convulsion, loss of awareness, confusion, blurry vision, or visual hallucinations. A seizure is a disruption of the electrical communication between neurons. A seizure usually affects how a person appears or acts for a short time. Many unusual things can occur during a seizure. Whatever the brain and body can do normally can also occur during a seizure. In this article, we propose an EEG signal classification method based on Discrete Wavelet Transform (DWT) and Support Vector Machine (SVM). In the first stage, EEG signals are decomposed by DWT to calculate approximation and detail coefficients. In the second stage, values of the approximation and detail coefficients are calculated for the chosen features. The features used here are Standard deviation, mean, Minimum, Maximum, Energy and Approximate Entropy. These value are then used for training and testing of Support Vector Machine. The output of tetset enables us to classify the signals as epileptic and normal.


INTRODUCTION
Epilepsy is a central nervous system disorder.During epilepsy, nerve cell activity in the brain becomes disturbed, causing physical convulsion, loss of awareness, confusion, blurry vision, or visual hallucinations.A seizure is a disruption of the electrical communication between neurons.The seizures occur because of a sudden surge of electrical activity in the brain since there is an overload of electrical activity in the brain.This causes a temporary disturbance in the connections between brain cells.During a seizure the patient's brain becomes "halted" or "mixed up".A person is said to have epilepsy if the person experiences two or more unprovoked seizures separated by at least 24 hours.
Epilepsy and seizures may develop in any person at any age.Seizures and epilepsy are more probable in young children and older people.New cases of epilepsy are most common during the first year of life.Epilepsy occurs mostly to children below the age of 10 and then becomes stable.After age 55, the rate of new cases of epilepsy starts to increase when people develop strokes, brain tumors, Alzheimer's disease, which all can cause epilepsy.
EEG, discovered by R. Caton is considered to be the most utilized signal to clinically assess brain activities.As EEG signals carry lots of information which may represent brain activities, many research have been done in this field and advanced signal processing methods and new techniques have been applied to analyse the EEG signals.The framework of these researches is to find a criterion which can characterize the brain activities.The criterion is usually a feature extracted from the EEG signals and can be used to predict the change of the state.
EEG signal can be categorized to different bands based on ranges.Frequency below 4Hz is the Delta band.Theta lies in the range of 4Hz to 8Hz and Alpha wave lies between 8Hz to 13Hz.Beta waves lie within 14Hz to 32Hz where beyond 32Hz lies the Gamma wave.Each of these frequency bands corresponds to different activities carried out by the subject.The different bands of frequencies contain certain information of different brain activities.However, the information contained within the EEG signal cannot be directly analysed by a human.
Various methods are applied to calculate the characterizing features, including linear analysis, nonlinear dynamic analysis, time domain analysis, phase synchronization, frequency-domain analysis, time-frequency analysis, etc. [3].Feature extraction plays an important role in the analysis of EEG signals, because the performance of features can affect the final results.According to different feature extraction methods, different EEG features can be obtained from the recorded EEG signals.In the early studies, researchers usually used waveform decomposition methods to extract features, these features including: amplitude, amplitude average, duration, half-wave duration, sharpness ratios, slope attributes of half-waves and so on; even 'raw' EEG data was used as features; these methods can be regarded as an extension of expert's 'visual identification'.Scott B. Wilson reviewed these methods in [5].In fact, due to the visual apparent messiness of EEG patterns, the information we can obtain from these features is very limited.In order to do more precise EEG analysis, complex feature extraction methods are needed.With the ability of providing a representation of the signals in both the time and frequency domains, wavelet transform method was proposed, and suits the analysis of EEG signals well.
In the frequency domain, seizure is detected based on the irregularities in the frequency-domain characteristics of the normal and epileptic EEG.Since the EEG is non-stationary it is befitting to use the time-frequency domain methods.Wavelet transforms is one of those methods.It does not impose the pseudo-stationarity assumption on the data like the time-and frequency-domain methods.WT can be used to analyse the signal in both time and frequency domain.Hence it is possible to precisely capture and localize features in the epileptic spikes which are used in the classification of signals.

A. EEG Dataset
The data base for the EEG analysis used in this paper has been obtained from the EEG database got from Bonn University.The normal, pre-ictal (background) and epileptic are the three sets of data each containing 100 single channel EEG segments of 23.6-sec duration.The EEG segments in sets A and B were taken from surface EEG recordings that were carried out on five healthy volunteers with eyes open and closed separately.Sets C, D, and E originated from EEG extracts of presurgical diagnosis, sets C and D contain only activity measured during seizure free intervals.
The normal and epileptic subjects were the two sets of EEG data used as the experimental data set in this work.These data sets were widely used in the literature.The first set of EEG data corresponds to normal subjects is taken from the surface of EEG recordings from five healthy relaxed and awaken state subjects with eyes open.The next step is to obtain the epileptic EEG signal taken from five different epileptic patients, recorded during the occurrence of the seizures from intracranial electrodes.The time series of the acquisition system have the spectral bandwidth which ranges from 0.5 to 85 Hz.Then the data is written continuously after a 12bit analog-to-digital conversion at a sampling rate of 173.61 Hz with band pass filter settings (12 dB / octave).The band limited EEG is decomposed using db-4 wavelet up to 4th level.The levels obtained after decomposition are d1, d2, d3, d4, d5, d6, d7, d8 and an approximation level a8.The levels which are useful to obtain epileptic data and the components retained are a8 (0-4Hz), d4 (4-8Hz), d3 (8-15Hz), d2 (15-30Hz), d1 (30-60Hz).Reconstructions of the five components using the inverse wavelet transform approximately correspond to the five physiological EEG sub bands delta, theta, alpha, beta, and gamma.The features are then extracted from the bands of the two data sets A and D. One for an epileptic person and the other for a normal person.

III. FEATURE EXTRACTION
The feature extraction is done after the wavelet decomposition.The bands which are obtained are used to extract the features.The MATLAB application is used to extract and determine the features from the various types of electroencephalography (EEG) signals.
The selected features are approximate entropy(ApEn), Standard Deviation, Minimum, Maximum, Energy og the signals.

A. Approximate entropy
Approximate entropy (ApEn) is a consistency statistic that quantifies the unpredictability of fluctuations in a time series such as an instantaneous EEG time series.ApEn reflects the likelihood that similar patterns of observations will not be repeated again similar fashion.A time series containing many repetitive patterns has a comparatively small ApEn; a more complex (i.e., less predictable) process has a higher ApEn.Given a sequence , SN consisting of N instantaneous EEG measurements , the values are chosen for the two input parameters, and , to compute the approximate entropy, ApEn(SN,m,r) , of the available sequence.The second parameters, , specifies the pattern length, and the third, , defines the criterion of similarity.
where Cim(r) is the fraction of patterns of length m that resemble the pattern of the same length that begins at interval i

B. Standard Deviation
C. Standard deviation is a measure of the dispersion of a set of data from its mean.The data has higher deviation if the data is more spread.Standard deviation is calculated as the square root of variance.The std deviation of epileptic EEG would be higher.

D. Maximum and Minimum
The maximum and minimum values of the EEG signals are obtained.Variations are found in the epileptic EEG since there are spikes during seizures.Since they are accurate and have the ability to deal with a large number of predictors, more biomedical applications use Support Vector Machines which maps the input patterns into a higher dimensional feature space through some nonlinear mapping chosen previously.A linear decision surface is then constructed in this high dimensional-feature space.Thus, Support Vector Machine(SVM) is a linear classifier in the parameter space, but as a result of the nonlinear mapping of the space of the input patterns into the high-dimensional feature space it becomes a nonlinear classifier .The SVM separates the data with hyper plane and extend this to nonlinear boundaries using kernel trick.The method's name derives from the support vectors.They are lists of the predictor values taken from cases that lie closest to the decision boundary separating the classes. (2) (3) The support vector classifier has many advantages.Nonlinear boundaries can be used without much extra computational attempt.Its performance is also very competitive with other methods.A drawback is that the problem complexity is of the order of the number of samples and not of the order of the dimension of the samples.

V RESULTS
Feature extraction is done using discrete wavelet transform.EEG signals were decomposed up to level eight using daubechies wavelet of order 4. Wavelet coefficients were computed.Mean, Standard Deviations, Approximate Entropy, Maximum and Minimum of the wavelet coefficients were estimated.Fourier transform is not suitable to EEG signal due to its nonstationary nature.Classification is done using SVMs which use the kernel trick to classify the available EEG signals as epileptic and non epileptic EEG.

Fig. 4
Fig. 4 Sub band decomposition of wavelet transform

Table 4 . 1
Average Values of Different Bands IV CLASSIFICATION The classification of the data of EEG signals in feature spaces is required to draw a boundary between two or more classes and they are labelled based on the features measured.In a multidimensional feature space this boundary takes the form of a separating hyperplane.The best hyperplane with maximum distance from all the classes has to be obtained.Several clustering and classification techniques have been developed within the last forty years.Artificial neural network, fuzzy logic, hidden Markov modeling, and support vector machine are popular among them.

Fig 5
Fig 5 Wavelet decomposition of a sample epileptic EEG

Fig 6
Fig 6 Output of SVM Classifier for normal EEG Signal

Fig 7
Fig 7 Output of SVM Classifier for epileptic EEG Signal