EEG CLASSIFICATION FOR EPILEPSY BASED ON WAVELET PACKET DECOMPOSITION AND RANDOM FOREST

EEG (electroencephalogram) can detect epileptic seizures by neurophysiologists in clinical practice with visually scan long recordings. Epilepsy seizure is a condition of brain disorder with chronic noncommunicable that affects people of all ages. The challenge of study is how to develop a method for signal processing that extract the subtle information of EEG and use it for automating the detection of epileptic with high accuration, so we can use it for monitoring and treatment the epileptic patient . In this study we developed a method to classify the EEG signal based on Wavelet Packet Decomposition that decompose the EEG signal and Random Forest for seizure detection. The result of study shows that Random Forest classification has the best performance than KNN, ANN, and SVM. The best combination of statisctical features is standard deviation, maximum and minimum value, and bandpower. WPD is has best decomposition in 5 th level.


Introduction
Epilepsy seizure is a condition of brain disorder with chronic noncommunicable that affects people of all ages.The intricate chemical changes in brain nerve cells lead to sudden activity of electric current and magnetic fields during seizures [1].EEG (electroencephalogram) can detect epileptic seizures by neurophysiologists in clinical practice with visually scan long recordings [2].
There are many various of EEG analysis and classification methods use the fact that the processing of information in the EEG signal as dynamical changes of the electrical activity [3].The challenge of study is how to develop a method for signal processing that extract the subtle information of EEG and use it for automating the detection of epileptic with high accuration, so we can use it for monitoring and treatment the epileptic patient.
In this study we developed a method to classify the EEG signal based on Wavelet Packet Decomposition that decompose the EEG signal and Random Forest for seizure detection.There are many research about EEG analysis and classification, they will be presented in section 2. In section 3 is the explanation of proposed method based on Wavelet Packet Decomposition, how to select the features and Random Forest for classification data.The results and discussion of research are presented in section 4, and finally the section 5 is conclussion of our study.The performance in detecting epilepsy has been evaluated using Wavelet Packet Decomposition (WPD), DWT, and Empirical Mode Decomposition (EMD) [4].DWT and WPD are wavelet based methods which the difference with EMD is EMD has no decrease in the number of features.Because WPD has developed DWT capabilities which WPD decomposes signal into both approximations and detail coefficients, it results better frequency resolution.It has been proved that overall accuracy in three classes case using Random Forest classifier and WPD to process signal results 99.66% where using DWT and EMD to process signal results 98.4% and 90.4% [4].For other dataset classification that has more than 3 classes case, WPD has lower accuracy than DWT [5].

Methods
The proposed method in this study is the classification of EEG signal based on Random Forest method, and the decomposition of signal EEG is based on Wavelet Packet Decomposition.
We select the statistical features from the coefficent's result in WPD. Figure 1 shows the block diagram of proposed method.

Dataset
The dataset of EEG was downloaded from The Epileptologie, Univertat Bonn.The dataset consists of 5 EEG records set, those are A, B, C, D, and E. Each EEG dataset contains 100 singlechannel brain, they were taken from different people recording process of dataset A and B were taken from healthy volunteers but with different conditions.Dataset A was recorded with open eyes but B with close eyes.Dataset C, D, and E were taken from epileptic patients.Same with A and B, the recording process of dataset C, D, and E were taken from different conditions.Dataset C was recorded from epileptic patients with no seizure and open eyes, but D with close eyes.Dataset E were taken from seizure epileptic patients.
As mentioned before, we can conclude that there are 200 healthy people's brain signal data, 200 epileptics with no seizure patient's brain signal data, and 100 seizure epileptic patient's brain signal data [6].

Mother Wavelet
To get information from EEG signals, there are tools called wavelets.Part of wavelets that is called Mother Wavelet has been used to extract frequency and time information smoother [12].Daubechies is one of orthogonal wavelet families that is able to get optimal set of EEG signal [13].Some researches have been found using DWT based on Daubechies 4 (db4) as mother wavelet.They show that db4 is commonly suitable for detecting epilepsy case [3].Yuna Sugianela, Qonita Luthfia Sutino, and Darlis Herumurti, EEG Classification 29

Wavelet packet decompostion
The wavelet packet decomposition (WPD) extends the capabilities of the WD (wavelet decomposition) and DWT (discrete wavelet transform).Whereas DWT decomposes the approximations records only, WPD does the decomposition of both approximation and detail records into sublevels.WD only partitions the frequency axis finely toward low frequency, and WPD is a generalized version, which also decomposes the high frequency bands that are kept intact in wavelet decomposition [4].
WPD applies a complete wavelet package tree, it delivers better frequency resolution for the signal being decomposed.Another benefit of the WPD is that it represents the reconstruction of the original signal by combining various decomposition level [4].In this study, daubechies4 (db4) mother wavelet function is used as previous research with DWT for detecting epilepsy .

Feature selection
Wavelet packet decomposition can be used for denoising and feature extraction [3].In this study, we select seven different statistical features for EEG classification, aiming at decreasing the dimensionality of dataset.The signal statistics are used in order to capture important information while keeping the low data dimensions.The seven statistical features are mean, standard deviation (Std), minimum value (Min), maximum value (Max), bandpower (Bp), skewness (Skw), and kurtosis (Krt).
In this experiment, we combine statistic features that have been mentioned.The number of features each combination used is 4 statistical features.There are 14 experimental combinations of statistical features performed.
The purpose of combining statistic features is to find the best accuracy between combinations made.Beside statistic features, we also evaluate the level of decomposition based on WPD.The number of sub-bands every level is 2 k , where k is

EEG classification based on random forest (RF)
Random forest (RF) are an ensemble-based learning technique for classification [7], consists of many individual classification trees, where each tree is a classifier by itself that is given a certain weight for its classification output.The classification outputs from all trees is used to determine the overall classification output is done by choosing the mode of all trees classification [8].
In the case of classification, a large number of classification trees is generated, whereby each tree is asigned an input vector sampled independently from the same distribution using bootstrap samples.In the present case, one third of the observations (out-of-bag (OOB) set) were used for cross-validation.The OOB data are also used to obtain estimates of feature importance.Specifically, during the forest building process, an internal unbiased estimate of the generalization error (OOB error) is generated and used to identify the most important features.The final OOB prediction is the average score achieved from the Yuna Sugianela, Qonita Luthfia Sutino, and Darlis Herumurti, EEG Classification 31 majority vote within the forest, excluding trees that included this observation during their training phase.The features that yield large score values are ranked as more important.The subset of the most important features was selected by sequential RF classification, i.e. by using labelled data to remove the least important feature in each run.By doing this, the minimum number of features required to achieve good classification accuracy was eventually selected [9].

Performance evaluation
In order to evaluate the proposed method, we use 10-fold cross-validation.This k-fold (in this study k=10) technique is implemented to create the training set and testing set for evaluation.With this technique, the feature vector set is divided into 10 subsets of equal size [10].Of the 10 subsets, a single subset is retained as the validation data for testing the model and the remaining (k-1 or 9 in this study) subsets are used as training data.Then, the cross-validation process is repeated 10 times (the folds), with each of the 10 subsets used exactly once as the validation data.The average accuracy across all 10 trials is computed for consideration.The accuracy (Acc) are defined as:

Results
In this study we use the dataset for input in WPD process.We decomposed the signal of dataset and selected statistical features from each coefisiens.We compared the number of level in signal decomposition.In this experiment, we applied different combination of statistical features.
There were 7 statistical features that selected in this study.From 7 features, we combined them into 4 for each experiment.There were 14 experiments of statistical features.In this study we got the best performance of statistical features combination.
The statistical features were used for classification process based on Random Forest method.We also compare the performance of Random Forest with other classification methods, i.e.ANN (Artificial Neural Network), KNN (Knearest Neighbor), and SVM (Support Vector Machine).

Comparison DWT and WPD decomposition with db4 mother wavelet
Daubechies4 (db4) mother wavelet function is used as previous research with DWT for detecting epilepsy.We also used db4 mother wavelet with WPD in this study.To compare the performa of DWT and WPD with db4, we try these decomposition methods to extract signal data and use them to classify data.We use statistical features from extracting data with the combination in Table 1.
The evaluation of classification use accuracy.In this comparison, we use the average value of accuracy from 14 statistical features combination.Table 2 shows that in KNN and ANN classification, DWT has better performance than WPD, but in SVM and Random Forest classification, WPD has better performance than DWT.

Evaluation of WPD's decomposition level
The number of decomposition level effects the number of features that are used for classification process.In this study we try 14 tests with different statistical features.From the experiment of decomposition level's number, we get the result that is shown in Table 3.The table presents that the February 2018 Related work Some research have proposed epilepsy diagnosis by using wavelet transformation (WT) for processing signal and feature extraction.Compared to Fourier Transform, WT has smoother representation, because it captures changes of EEG signals in details [3].Discrete Wavelet Transformation (DWT) is one of wavelet analysis used in common.DWT processes the EEG signal into approximations (low frequency) in every levels and detail coefficients (high frequency) only in first level.The output of this analysis is wavelet coefficients.Xie and Krishnan [11] proposed research to detect seizure and diagnose epilepsy using DWT for EEG signal feature extraction with Haar wavelet.

Figure 1 .
Figure 1.Block diagram of proposed method TP (true positive) was determined when the epilepsy signals classfication as epilepsy signal.FP (false positive) was determined when the normal signals are classification as epileptic signals.TN (true negative) was determined when the normal signals are classified as an epilepsy signals.FN (false negative) was determined when the epilepsy signals are classified as normal signal as ilustrated in the confusion matrix [11].

TABLE 5 COMPARISON
WITH OTHER CLASSIFICATION METHODS

32 Jurnal Ilmu Komputer dan Informasi (Journal of a Science and Information), volume
11, issue 1, February 2018 best performance of decomposition is in level 5.But in some test cases, we get the fact that there are 4 test cases that the accuration of 4 th level is less that the 5 th .Those test cases are combination of statistical features in number 4, 7, 9, and 14 in