Lontar - Template LONTAR KOMPUTER VOL. 11, NO. 3 DECEMBER 2020 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2020.v11.i03.p01 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 124 Epileptic Seizure Classification using Deep Batch Normalization Neural Network Adenuar Purnomoa1, Handayani Tjandrasaa2 aDepartment of Informatics, Institut Teknologi Sepuluh Nopember Jalan Raya ITS, Surabaya, Indonesia 1Adenuar.19051@mhs.its.ac.id 2handatj@its.ac.id Abstract 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 BN3), a BN3 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 BN3 architecture. The resulting model classifies the EEG signal as an epileptic seizure or non-seizure. The classification of epileptic seizures using Deep BN3 obtained pretty good results compared to other architectures used in this research, with an accuracy of 53.61%. Keywords: Deep BN3, Seizure, Epilepsy, Deep Learning, Neural Network. 1. 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]. Another research by Liu et al. proposed a different architecture than CNN to classify EEG signals, which is a combination of Batch Normalization (BN) and CNN called the Batch Normalization Neural Network (BN3) [12]. Research about the usage of Batch Normalization itself has been carried out several times, such as the proposal of merging the Deep Artificial Neural Network and BN [13], adding the Displaced Rectifier Linear Unit (DReLU) activation function in the BN3 [14]. Schindler’s research shows that a deep architecture is suited to a big dataset, and a shallow LONTAR KOMPUTER VOL. 11, NO. 3 DECEMBER 2020 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2020.v11.i03.p01 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 125 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 BN3). The Deep BN3 architecture is a BN3 architecture with a deeper layer inspired by deep CNN architecture to classify big epileptic seizures data accurately. The Deep BN3 architecture is deep CNN architecture added with Batch Normalization layer, an essential layer in BN3 architecture. This research’s contribution is to design deeper BN3 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 BN3 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 BN3 will be concluded as a good architecture if it can compete with another architecture. 2. Research Methods An overview of this research can be seen in Figure 1, starting from the dataset used, preprocessing, then classification using Deep BN3 architecture. Figure 1. Overview of the process for Epileptic Seizure Classification LONTAR KOMPUTER VOL. 11, NO. 3 DECEMBER 2020 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2020.v11.i03.p01 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 126 Figure 2. The International 10–20 Electrode System Featuring Modified Combinatorial Nomenclature (MCN). 2.1. Dataset The data used in this research is a dataset belonging to TUH (Temple University Hospital), The TUH EEG Seizure Corpus version 1.5. This dataset is recorded based on the International 10-20 Electrode System featuring Modified Combinatorial Nomenclature (MCN), shown in Figure 2, with a sampling rate of 250 Hz. The training set consists of 1185 sessions taken from 592 patients, of which 343 sessions were seizure sessions, while the testing set consists of 238 sessions taken from 50 patients with 108 sessions being seizure sessions. Both the training and testing set used in this research is only limited to sessions with seizures. 2.2. 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 ground- truth. 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. Table 1. Amount of Training data Class Before undersampling After undersampling Seizure 28640 28640 Non-seizure 308112 28640 LONTAR KOMPUTER VOL. 11, NO. 3 DECEMBER 2020 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2020.v11.i03.p01 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 127 Figure 3. Raw EEG from The TUH EEG Seizure Corpus version 1.5 Table 2. Amount of Testing data Class Before undersampling After undersampling Seizure 16998 16998 Non-seizure 108373 16998 2.3. Deep BN3 Architecture Deep BN3 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. 𝑤𝑡 = 𝑤𝑡−1 − 𝜂 �̂�𝑡 √�̂�𝑡+𝜖 (1) LONTAR KOMPUTER VOL. 11, NO. 3 DECEMBER 2020 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2020.v11.i03.p01 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 128 Figure 4. Deep BN3 Architecture Figure 5. An input image of the 26 channel signal 3. 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 BN3 architecture’s trained model with LONTAR KOMPUTER VOL. 11, NO. 3 DECEMBER 2020 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2020.v11.i03.p01 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 129 Figure 6. CNN Architecture Figure 7. BN3 Architecture Table 3. Accuracy, Sensitivity, and Specificity results of each architecture for the testing set Architecture Accuracy (%) Sensitivity (%) Specificity (%) Deep BN3 53.61 46.60 60.62 CNN 49.99 46.54 53.44 BN3 52.95 42.54 63.35 An overview of the CNN and BN3 architecture can be seen in Figures 6 and 7. The results of each architecture are shown in Table 3. Deep BN3 has the highest testing set accuracy, with 53.61% accuracy, and has the highest sensitivity with 46.6%. However, for specificity, the BN3 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 LONTAR KOMPUTER VOL. 11, NO. 3 DECEMBER 2020 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2020.v11.i03.p01 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 130 non-seizure. Figure 9 is an example of a misclassified seizure signal. The signal has seizure spikes, but the Deep BN3 and the CNN architecture classified it as a non-seizure signal. Meanwhile, only BN3 architecture classified it as a seizure signal. Table 4. Confusion Matrix of Deep BN3 Architecture Predicted Seizure Predicted Non-Seizure True Seizure 7921 9077 True Non-seizure 6694 10304 Table 5. Confusion Matrix of CNN Architecture Predicted Seizure Predicted Non-Seizure True Seizure 7911 9087 True Non-seizure 7915 9083 Table 6. Confusion Matrix of BN3 Architecture Predicted Seizure Predicted Non-Seizure True Seizure 7231 9767 True Non-seizure 6229 10769 Figure 8. The image of signal misclassified by the models of Deep BN3, and CNN Architecture 4. Conclusion The classification of Epileptic Seizure using Deep BN3 obtained a pretty good result. From the experiment, Deep BN3 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 BN3 architectures for the multi-class classification problem. LONTAR KOMPUTER VOL. 11, NO. 3 DECEMBER 2020 p-ISSN 2088-1541 DOI : 10.24843/LKJITI.2020.v11.i03.p01 e-ISSN 2541-5832 Accredited B by RISTEKDIKTI Decree No. 51/E/KPT/2017 131 References [1] WHO, “WHO Epilepsy Fact Sheet,” 2019. [Online]. Available: https://www.who.int/news- room/fact-sheets/detail/epilepsy. [Accessed: 11-Feb-2020]. [2] S. Roy, U. Asif, J. Tang, and S. Harrer, “Machine Learning for Seizure Type Classification: Setting the benchmark,” pp. 2–6, 2019. [3] H. Tjandrasa, S. Djanali, and F. X. Arunanto, “Feature extraction using combination of intrinsic mode functions and power spectrum for EEG signal classification,” Proc. - 2016 9th International Congress on Image and Signal Processing, Biomedical Engineering and Informatics, CISP-BMEI 2016, pp. 1498–1502, 2017. [4] H. Tjandrasa and S. Djanali, “Classification of EEG signals using single channel independent component analysis, power spectrum, and linear discriminant analysis,” in Lecture Notes in Electrical Engineering, 2016, vol. 387, pp. 259–268. [5] U. R. Acharya, S. Lih, Y. Hagiwara, J. Hong, and H. Adeli, “Deep convolutional neural network for the automated detection and diagnosis of seizure using EEG signals,” Computer in Biology and Medicine, vol. 100, no. July 2017, pp. 270–278, 2018. [6] S. Raghu, N. Sriraam, Y. Temel, S. V. Rao, and P. L. Kubben, “EEG based multi-class seizure type classification using convolutional neural network and transfer learning,” Neural Networks, vol. 124, pp. 202–212, 2020. [7] J. Birjandtalab, M. Heydarzadeh, M. Nourani, and A. Background, “Automated EEG-Based Epileptic Seizure Detection Using Deep Neural Networks,” no. 1, pp. 2–5, 2017. [8] I. Ullah, M. Hussain, E. Qazi, and H. Aboalsamh, “An automated system for epilepsy detection using EEG brain signals based on deep learning approach,” Expert Systems with Applications, vol. 107, pp. 61–71, 2018. [9] F. Achilles, F. Tombari, V. Belagiannis, A. M. Loesch, S. Noachtar, and N. Navab, “Convolutional neural networks for real-time epileptic seizure detection,” Computer Methods Biomechanics and Biomedical Engineering Imaging and Visualisations, vol. 6, no. 3, pp. 264–269, 2018. [10] N. D. Truong et al., “Convolutional neural networks for seizure prediction using intracranial and scalp electroencephalogram,” Neural Networks, vol. 105, pp. 104–111, 2018. [11] M. Hosseini, D. Pompili, K. Elisevich, and H. Soltanian-Zadeh, “Optimized Deep Learning for EEG Big Data and Seizure Prediction BCI via Internet of Things,” IEEE Transactions Big Data, vol. 3, no. 4, pp. 392–404, Dec. 2017. [12] M. Liu, W. Wu, Z. Gu, Z. Yu, F. F. Qi, and Y. Li, “Deep learning based on Batch Normalization for P300 signal detection,” Neurocomputing, vol. 275, pp. 288–297, 2018. [13] Y. Chen et al., “Texts With Deep Learning Approaches,” IEEE Transactions and Intelligent Transportation Systems, vol. PP, no. 8, pp. 1–10, 2018. [14] D. Macêdo, C. Zanchettin, A. L. I. Oliveira, and T. Ludermir, “Enhancing batch normalized convolutional networks using displaced rectifier linear units: A systematic comparative study,” Expert Systems with Applications, vol. 124, pp. 271–281, 2019. [15] A. Schindler, T. Lidy, and A. Rauber, “Comparing shallow versus deep neural network architectures for automatic music genre classification,” CEUR Workshop Proceedings, vol. 1734, pp. 17–21, 2016.