# Identification of Epileptic EEG Signals Using Convolutional Neural Networks
## 3 Simulation  
The CNN described above is utilized for epileptic seizure detection. We explored the Bonn University (BU) EEG database [18] and the CHB-MIT scalp EEG database [26] in this research. The first data were downloaded from the BU EEG database [18]. The BU data were obtained from five patients and each dataset comprises 100 EEG signals. Every signal is captured within 23.6 s. In the simulations, EEG signals are generated using the same 128 channel amplifier. The data is digitized at a resolution of 12 bits and of 173.6 samples per second. The acquisition system has a bandwidth of 0.5 Hz to 85 Hz. Every dataset has 4096 (23.5 \(\times\) 173.6) sampling points for 23.5 s. The total number of EEGsignals used in the simulation is 300; 100 normal signals (Set B), 100 preictal (Set D) and 100 seizures (Set E). After visual inspections, the signals are obtained from multichannel encephalogram recordings. The normal data set includes EEG signals obtained from five healthy instances, each of which contains 100 cases. The preictal file consists of 100 data obtained from five individuals with epilepsy who did not have epilepsy at the time of measurement. Similarly, the seizure class comprised 100 instances with the same subjects who had epilepsy at the time of data acquisition. Figure 2a-c depicts seizure, preictal and normal samples of EEG signals. As shown, EEG signals are high order non-linear and non-stationary signals that have a very complex structure. For the classification of such signals, the researchers try to extract basic distinguishing features and use these features for classification purposes. Analysis of the signals can sometimes be difficult. These processes are tedious and time-consuming. Hence, the accurate and fast identification of these signals is important. In this paper, a CNN is developed for the classification of EEG signals. The structure of the CNN used for the detection of seizures is presented in Table 1. The CNN includes four convolutional layers, global average pooling and the fully connected network. For CNN training, the dataset was divided into two: 90% and 10%. We utilized 90% of the available data for training while 10% of the available dataset was utilized for testing. From the 90% data assigned for  
Figure 2: Normal (**a**), preictal (**b**) and seizure (**c**) signals. training, 70% was used for training and 30% for validation. Formulas (1)-(4) were applied to find the output signals of the CNN. Using the CNN structure, RMSprop (5) algorithm and EEG signal, the learning of the weight parameters of CNN was performed. Keras, a powerful deep-learning library that runs on top of TensorFlow, was utilized for modelling. During training, the batch size for the data was selected as 100, and this was utilized for each of the training updates. Since the input data is a one-dimensional brain signal, the CNN model is designed to accept one-dimensional data of size 4096. Z-score normalization was applied for the scaling of each input signal and the enhancement of model generalization was realized. After obtaining the input data, the first convolutional operation was applied to the input data and then the second convolutional operation was applied to the result of the first convolutional operation. Afterwards, the pooling was applied to the outputs of the convolutional layer. Pooling decreases the dimensions of the data. Increasing the number of convolutional layers will allow us to obtain more deep features, but this also increases the computational time. The fully connected network with three layers is applied for classification purposes. The CNN was trained using 150 epochs. Figure 3 depicts the simulation results of loss function and accuracy. Table 2 depicts the simulation results of the CNN. During training, the value obtained for the loss function was \(3.8277\times 10^{-11}\). The value of the loss function obtained for validation data was 0.0237, and that for the test data was 0.013878. For the test data, the accuracy was 96.67%, specificity was 98.33%, and sensitivity was 96.67%.