Selecting Statistical Characteristics of Brain Signals to Detect Epileptic Seizures using Discrete Wavelet Transform and Perceptron Neural Network

Electroencephalogram signals (EEG) have always been used in medical diagnosis. Evaluation of the statistical characteristics of EEG signals is actually the foundation of all brain signal processing methods. Since the correct prediction of disease status is of utmost importance, the goal is to use those models that have minimum error and maximum reliability. In anautomatic epileptic seizure detection system, we should be able to distinguish between EEG signals before, during and after seizure. Extracting useful characteristics from EEG data can greatly increase the classification accuracy. In this new approach, we first parse EEG signals to sub-bands in different categories with the help of discrete wavelet transform(DWT) and then we derive statistical characteristics such as maximum, minimum, average and standard deviation for each sub-band. A multilayer perceptron (MLP)neural network was used to assess the different scenarios of healthy and seizure among the collected signal sets. In order to assess the success and effectiveness of the proposed method, the confusion matrix was used and its accuracy was achieved98.33 percent. Due to the limitations and obstacles in analyzing EEG signals, the proposed method can greatly help professionals experimentally and visually in the classification and diagnosis of epileptic seizures.


I. IntRoductIon
E PIlePsy is one of the most prevalent neurological disorders among people [1].It is estimated that 5 people are afflicted with epilepsy among each 1000 people.Epilepsy could be defined as a sudden change in the intracellular and extracellular potential difference.This definition implies that the type of neuron determines clinical demonstrations [2].The automatic diagnosis of epileptic convulsions has attracted the attention of clinicians and engineers since 1970.The automatic prediction of seizures is useful in drug delivery systems and neural stimulation simulation devices [3,4].An important issue in predicting epileptic convulsions is that they are predictable through analyzing the changes in the features of EEG signals that happen before the occurrence of seizures [5].Epileptic seizures prediction needs further analysis due to the following reasons [6]: 1. Generally, their results are not repeatable.In other words, their confidence rate is not certain.
2. The dependence of the result on sensitivity and inaccurate prediction rate is not taken into account.
3. Their efficiency is not mostly acceptable and has a high acceptance and rejection rate.

II. MateRIals and Methods
In an automatic epileptic convulsion detection system, a distinction should be made between the pre-convulsion, during convulsion, and post-convulsion EEG signals.Then, they should be analyzed [7].Some studies focused on single-channel EEG signals, while some others focused on multi-channel recorded EEG signals [8].This paper studied the epileptic and healthy signals of R. G. Andrzejak database from the University of Bonn [9] The placement design of surface electrodes is related to the 20-10 global system,is shown in Fig. 1.Therefore, the electrodes were named as follows [10,11]: FP1,FP2,F3,F4,C3,C4,P3,P4,F7,F8,T1,T2,T3,T5,T6,O1,O2,F2,P2 The frontal lobe, temporal lobe, parietal lobe, central lobe, and occipital lobe were named F, T, P, C, and O, respectively [12].The Fig. 2 describes the anatomy of the brain with different regions [10].6.In processing medical signals, it is vitally important to minimize existing noises and artifacts in order that they have the minimum effect on the feature extraction stage.In a wide-spreading spectrum, recorded EEG signals may contain technical and physiological noises [13].By taking into account the physiological aspects, such as the artifacts caused by electrooculography (EOG), electromyography (EMG), and electrocardiography (ECG), and by applying an appropriate preprocessing, frequencies higher than 60 Hz were considered as noises and filtered.

A. Features Extraction by DWT
It is vitally important to select features which can best describe EEG signals for diagnosing convulsion and categorization.Since EEG signals are non-stationary waves [11], wavelet transform was used in their estimation.This frequency processing tool extracts a set of transient and local signals in space and frequency domains [14][15][16] .Wavelet transform decomposes signals into a set of basic functions called wavelet.These functions are obtained by applying delays, contractions, and transfer them on a unique function called wavelet pattern.Continuous wavelets are the functions resulted from an odd function using delays and transfers.They are dependent on transfer parameter.In order to remove noises and generate a signal appropriate for decomposition, EEG signals were limited by a low-pass filter and impulse response.Compared to EEG signals, sub-bands have more accurate information about neurons activities.They may not be evident in the original signals due to specific changes.Therefore, decomposition is carried out.The discrete wavelet signal is analyzed in the form of different frequency value bands and different magnifications.Using signal decomposition, the discrete wavelet signal is decomposed into coarse approximations and detailed information.In fact, discrete wave transform (DWT) employs a set of functions called measurement functions and wavelet functions.They are dependent on low-pass and high-pass filters.Decomposing signals into various frequency bands is simply achievable through successive applications of high-pass filters (HPFs) and low-pass filters (LPFs) [17,18].This decomposition method is known as multi-resolution decomposition.This type of analysis is illustrated in detail is shown in Fig. 7.The number of decomposition levels is selected based on dominant frequency components of the signal [17].Selected levels maintain signal parts that highly correlate to the frequency related to signal classification in the wavelet.
The proposed method involves 4 layers and 5 frequency bands.It is due to the fact that higher order filters have fluctuations and lower order filters are rougher.Therefore, the signal was decomposed into D1-D4 details and the last estimation A4.Frequency sub-band values are shown in Table 1.Figures 8, 9    Having applied pre-processing and carried out required processes, the desired feature vector was obtained.Statistical features, such as the maximum, minimum average, and standard deviation of each sub-band were used.Feature extracted are shown in Table 2.

B. Classification by Neural Network
Several statistical models have been proposed for classification and prediction.Classifying and predicting disorders based on risk factors is one of the applications of artificial neural networks [19,20].Artificial neural networks are simply applicable to problems with no algorithmic solution, a complex algorithmic solution, and problems that are simple for people but difficult for computers [21].They are also useful as an alternative solution for problems that generally have statistical solutions, such as regression modeling, predicting time series, cluster analysis, discriminate analysis, statistical decision-making problems, process control, and estimating the conditional distribution [19,20].An artificial perceptron multi-layer neural network [22] with error back propagation algorithm was used for evaluating different states of EEG signals, such as healthy, convulsive, and epileptic states.Structure of Multilayer perceptron shown in Fig. 11.Having extracted desired statistical features using DWT, artificial neural network was used for classification.An artificial neural network with (12-15-3) structure and with sigmoid transfer function was designed and trained based on 80% of the available data.In the training phase, 80% of the collected data were used for training the artificial neural network.Having implemented the multi-layered perceptron (MLP) neural network using error back propagation learning (EBPL), having tested multiple layers and neurons, and having observed the errors, the most appropriate structure was selected.The most appropriate structure was (12-15-3), that is the network had four input variables for each category.The variables are the extracted statistical features, three output variables, and 15 neurons for maintaining the hidden layer.The output variable was defined based on three states, such as healthy, convulsive, and epileptic stages.Then, 20% of the available data were used for testing the neural network.In this phase, MLP with EBPL and (12-15-3) structure was used.For a more appropriate evaluation of results, feature and sensitivity were also calculated.

C. Analyzing System Performance using Confusion Matrix
Generally, in classification systems and disorder diagnosis systems, confusion matrix and receiving operating characteristic (ROC) curves are used for evaluating efficiency [23].For analyzing the confusion matrix of classification and disorder diagnosis, four states are defined: true positive (TP), true negative (TN), false positive (FP), and false  [24].Each variable has a specific meaning in confusion matrix.TP is the number of patients suffering from epilepsy who are correctly diagnosed by the computer system.FP is the number of patients with epilepsy who are incorrectly diagnosed as healthy by the computer system.TN is the number of convulsive patients and healthy people correctly diagnosed as healthy by the computer system.FN is the number of convulsive patients or healthy people incorrectly diagnosed as epileptic by the computer system.P is the number of patients correctly classified by the system.In other words, it is the number of epileptic patients who are diagnosed correctly.It is also the number of healthy, convulsive, or non-epileptic people correctly classified.N is the number of the people who are incorrectly classified.In other words, it is the number of epileptic patients who are incorrectly diagnosed as healthy, or the number of healthy or convulsive people incorrectly diagnosed as epileptic or convulsive.Using the defined concepts, the efficiency of the proposed method was analyzed and they were named as sensitivity, specificity, classification, and precision, respectively.System precision is a measure that determines system's capability in diagnosing and classifying epileptic patients (true patients) correctly.Accuracy is but another index for evaluating such systems.It includes a more generalized perspective and domain of patient's classification systems.It is equal to the ratio of all correctly diagnosed cases, whether healthy or unhealthy, to all correctly or incorrectly classified cases [22], [25][26][27][28].Sensitivity, Specificity, and Accuracy are defined as follows [10], [29,30].

III. Results
The following confusion matrix is obtained from applying the neural network on the test data.This set was a new one for the network and it was not trained by those data.Results show that the neural network worked correctly since healthy people and patients were correctly diagnosed.Predicting patients' condition based on the result in the training phase are shown in Table 3. Predicting patients' condition based on the result in the test phase are available in Table 4.For a better understanding, it is necessary to calculate the sensitivity and specificity of the proposed method.According to confusion matrix and Equations ( 2), (3), and (4), sensitivity, specificity, and precision of the neural network are as follows.The proposed classification system's sensitivity is 100%, which means the proposed system can diagnose all epileptic cases correctly.System's specificity was 97.1%, which is significant.It means that the proposed system could diagnose 98.33% and even a higher number of the convulsive cases correctly.Results of confusion matrix for classification of test data are shown in Table 5. (2) (3) (4) exploited the combination of wavelet and time for extracting features as the input data for support vector machine (SVM) [32].Abibullaevet all identified and presented various wavelet function for diagnosing convulsion and epilepsy, including ( bior1,3, Db5, Db2) [33].Adeli et al. analyzed EEG signals for detecting EEG changes based on correlation function; frequency domain features, frequency time analysis, entropy, and wavelet transform [14].Using chaos analysis, they divided the wavelets obtained from EEG signals into healthy and epileptic categories.Some other linear and non-linear methods were also used in predicting epileptic attacks [32], [34][35][36][37][38]. Results from various studies carried out using wavelet transform are shown in Table 6 [39].Another disadvantage of existing solutions is their low precision and high dispersion which leads into a weak diagnosis.It is due to the high number of effective variables in physiological systems [6].The aim of this study was to improve prediction results.Therefore, some changes were made to input and output variables.The type of selected wavelet function and variables were the reasons for a higher sensitivity and precision.Due to the limitation facing diagnosis systems, MLP structure was selected as the most appropriate artificial neural network structure with respect to the repetition of various conditions.The combination of artificial intelligence methods in classifying patterns, including artificial neural networks with wavelet transform resulted in an improved efficiency, agility, and diagnosis in the proposed method.

Iv. conclusIon
This paper aimed at proposing a new method for improving the precision of prediction and classifying different states of EEG signals into healthy, convulsive, and epileptic states.Using wavelet transform and MLP, sensitivity, specificity, and precision indexes were improved significantly.
. The data relate to three different categories:normal situation of the patient, pre-seizure and seizure.The collected EEG signals include 5 categories which, respectively, are called (A,B,C,D,E).Each of these categories includes 100 singlechannel signals with a length of 26.3 seconds.Category A: Surface EEG signal recorded from 5 healthy volunteers in a relaxed awake state with eyes open.

Fig. 1 .
Fig. 1.The pattern of surface electrodes placement following that of the universal system 20-10.

Fig. 3 ,
Fig. 3, 4 and 5 show healthy,convulsive and epileptic signals.The signal overlap healthy and epileptic shown in Fig.6.In processing medical signals, it is vitally important to minimize existing noises and artifacts in order that they have the minimum effect on the feature extraction stage.In a wide-spreading spectrum, recorded EEG signals may contain technical and physiological noises[13].By taking into account the physiological aspects, such as the artifacts caused by electrooculography (EOG), electromyography (EMG), and electrocardiography (ECG), and by applying an appropriate preprocessing, frequencies higher than 60 Hz were considered as noises and filtered.
, and 10 show the sub-bands resulted from the decomposition of healthy, convulsive, and epileptic signals using wavelet function Db4 in 4 levels.First, signals are decomposed into 5 levels.Then, level 5 approximation signal is removed.It has the lowest frequency band.It does not contain epileptic information, but contains noise information.Finally, the signal is reconstructed.

Frequency
Fig. 8.A healthy signal with Daubechies 4 at level 4.

taBle III PRedIctIng
PatIents' condItIon Based on the Result In the tRaInIng Phase Based on the Result In the test Phase (20 PeRcent of the saMPles, that Is 60 cases) [31]lts from implementing the proposed MLP artificial neural network yield the highest sensitivity and precision.Many researchers have used wavelet transform in diagnosing epilepsy.Shoeb et al. used wavelet decomposition for generating feature vector[31].Meier et al.