Epileptic Seizure Classification using Deep Batch Normalization Neural Network

Epilepsy is a chronic noncommunicable brain disease. Manual inspection of long-term Electroencephalogram (EEG) records for detecting epileptic seizures or other diseases that lasted several days or weeks is a time-consuming task. Therefore, this research proposes a novel epileptic seizure classification architecture called the Deep Batch Normalization Neural Network (Deep BN 3 ), a BN 3 architecture with a deeper layer to classify big epileptic seizure data accurately. The raw EEG signals are first to cut into pieces and passed through the bandpass filter. The dataset is very imbalanced, so an undersampling technique was used to produce a balanced sample of data for the training and testing dataset. Furthermore, the balanced data is used to train the Deep BN 3 architecture. The resulting model classifies the EEG signal as an epileptic seizure or non-seizure. The classification of epileptic seizures using Deep BN 3 obtained pretty good results compared to other architectures used in this research, with an accuracy of 53.61%.


Introduction
Epilepsy is a chronic noncommunicable brain disease. The number of people who have epilepsy worldwide is approximately 50 million. Five million people are diagnosed with epilepsy every year. It is estimated that epileptic people improve their condition with treatment, nearly 70% of the time [1]. Accurate classification of epileptic seizures plays a vital role in treating epilepsy patients [2]. Notably, manual inspection of long-term Electroencephalogram (EEG) records for detecting epileptic seizures or other diseases that lasted several days or weeks is a time-consuming task. The development of an automatic algorithm for the detection of epileptic seizures is needed to overcome this problem.
Recent research by Tjandrasa et al. classified the EEG signals using a combination of intrinsic mode function, and power spectrum feature extractor gave a maximum of 78.6% accuracy for five classes [3]. Tjandrasa et al. also classified EEG signals using single channel-independent component analysis, power spectrum, and linear discriminant analysis. They obtained a maximum accuracy of 94% for three classes [4]. Recent research by Acharya et al. [5], CNN 13 layers showed 88.67% accuracy using a dataset from the University of Bonn. Raghu et al. classified seizure types using CNN and transfer learning based on EEG alone without using motor symptoms, level of consciousness, or video EEG [6]. The application of CNN to the classification of epilepsy has been implemented in several recent studies, such as [7], [8], and [9]. Neonatal seizure detection using CNN with 26 neonates achieved a seizure detection rate of 77% [10]. Other research proposed the Internet of Things-based learning optimized for seizure prediction using big EEG data [11].
architecture is suited to a smaller dataset [15]. Since epilepsy EEG data is a big dataset, a deeper architecture may be better suited to classify big data. Therefore, this research proposes a novel epileptic seizure classification architecture called the Deep Batch Normalization Neural Network (Deep BN 3 ). The Deep BN 3 architecture is a BN 3 architecture with a deeper layer inspired by deep CNN architecture to classify big epileptic seizures data accurately. The Deep BN 3 architecture is deep CNN architecture added with Batch Normalization layer, an essential layer in BN 3 architecture. This research's contribution is to design deeper BN 3 networks, which was done by stacking uniform convolutions. The raw EEG signal is first cut into pieces and passed through the bandpass filter. The dataset is very imbalanced. The imbalanced dataset can result in a severe bias towards the majority class, reducing the classification performance and increasing the number of false negatives. So an undersampling technique was used to produce a balanced sample of data for the training and testing dataset. Undersampling is a technique to delete data in the majority class. Furthermore, Deep BN 3 architecture is trained using balanced data. The resulting model is then used to classify whether the tested EEG signal is an epileptic seizure or non-seizure. The testing data results are compared with the existing ground-truth to compute the confusion matrix's sensitivity, specificity, and accuracy. Deep BN 3 will be concluded as a good architecture if it can compete with another architecture.

Research Methods
An overview of this research can be seen in Figure 1, starting from the dataset used, preprocessing, then classification using Deep BN 3 architecture.

Dataset
The data used in this research is a dataset belonging to TUH (

Preprocessing
There are 26 channels used in both training and testing sets. The raw EEG signal seen in Figure  3 will initially be truncated every 2 seconds and then labeled according to the provided groundtruth. The EEG signal is then passed through a bandpass filter with a cut-off frequency of 0.5-44 Hz.
The undersampling technique will be carried out to produce balanced data for the training and testing sets. We balanced both training and testing sets because both sets are enormous and very unbalanced, with a non-seizure class around 20-25 times than seizure class. Therefore we must balance those data such that it can be appropriately classified. Otherwise, it will tend to classify closer to the class with more massive amounts of data. The details of class balancing for both training and testing sets are shown in Table 1 and Table 2.

Deep BN 3 Architecture
Deep BN 3 architecture used in this research can be seen in Figure 4. The first layer is the input layer. The inputs are the preprocessed signals that converted into a 2-dimensional image graphic, as shown in Figure 5. Then the batch normalization layer, continued by the convolutional layer with the filter size of 4 × 4, and the number of filters is 16. The next layer is the convolutional layer, the batch normalization layer, and the max-pooling layer, repeated four times. Each convolutional layer has a filter size of 4 × 4, and the number of filters is 16. Then the last max-pooling layer is followed by the fully connected layer. The dropout layer repeated twice with the fully connected layer's configuration output size is 32 for the first fully connected layer and 16 for the second and with both dropout value 0.5. Finally, the last layer is the fully connected layer with the softmax function to classify the input. The training configuration used in this research are maximum training epoch 200 epoch, initial learning rate 10 -3, and after 100 iterations the learning rate become 10 -4 . The training option used in this research is Adam optimizer. Adam weight update equation can be seen in (1), where is model weights, is the learning rate, is the epsilon and ̂, ̂are bias-corrected estimators for the first and second moments. After the training model is obtained, then the testing set will be classified using the training model.

Result and Discussion
The training process is carried out by building the model for each architecture. The model is trained using the training set. After carrying out the training process, the obtained model is tested using a testing set to obtain the seizure and non-seizure EEG signals' classification results. The classification results are visualized into a confusion matrix used to calculate the accuracy, sensitivity, and specificity. This research will compare three metrics obtained from the testing set using the Deep BN 3 architecture's trained model with  An overview of the CNN and BN 3 architecture can be seen in Figures 6 and 7. The results of each architecture are shown in Table 3. Deep BN 3 has the highest testing set accuracy, with 53.61% accuracy, and has the highest sensitivity with 46.6%. However, for specificity, the BN 3 architecture got the highest, at 63.35%. As we can see, the testing accuracy results of each architecture are only 50-55%. One of the key factors is that the subject in the testing set different from the training set. Suppose the signal between the training set and the testing set is different. In that case, the training set signal may have different extracted fundamental feature values than the testing set. The other factor, in this research's dropout value is high so it makes the training accuracy is not too high. The low accuracy in the training model causing low testing accuracy. The preprocessing step is also a factor that influences the low metric results of the three architectures. The different cutting processes can affect whether the spike from the seizure can be captured intact or only a piece of it within the cut's range. If the seizure spike in the data is only partly captured, it will affect the results. The undersampling technique used in this research is also one factor of why the accuracy is low. A better undersampling technique used may increase the accuracy results. The other factor in this research used a time-domain signal, so the key features can't be shown clearly, compared to the frequency domain used in research [3]. In research [3], the FFT and power spectrum usage used to have better results when there are 20 features extracted, which can be used in the future.
Tables 4, 5, and 6 is the confusion matrix of the testing set for each architecture. The deep BN3 architecture has better accuracy, shown by the sum of truly predicted seizure and true predicted

Conclusion
The classification of Epileptic Seizure using Deep BN 3 obtained a pretty good result. From the experiment, Deep BN 3 has the highest accuracy of 53.61% and the highest sensitivity of 46.6%. Compared to other architecture used in this research in specificity metric, the Deep BN3 architecture has only achieved the second-highest. Overall, it has better results than other architecture. Future works are needed to search for a different method to preprocess the raw signals to detect the key features more accurately. The usage of spectrogram or FFT maybe can detect the key features more accurately. Also, to try Deep BN 3 architectures for the multi-class classification problem.