# Identification of Epileptic EEG Signals Using Convolutional Neural Networks
## 3 Simulation
For comparative analysis, we used the same data to train and test the SVM and NN models. We used the linear SVM with the linear kernel function. We also applied a three-layer NN structure with 18 hidden neurons and a Gaussian activation function. Several experiments were performed using the settings of the previous experiments. Table 3 includes comparative results of different models using the epilepsy data sets. As shown in the table, the value of the loss function for CNN was 0.013878 less than that of SVM, which was 0.25. Additionally, for NN, the loss function obtained was 0.1828. The accuracy result for SVM and NN was 75%, but that of CNN was 96.67%. The results obtained indicate the efficiency of using CNN in the identification of seizures. In the second simulation, the design was also performed utilizing cross-validation. The structure of CNN used in the simulation was the same as given in Table 1. Ten-fold cross-validation was utilized during simulation. The EEG data was split into 10 equal proportions. Nine out of 10 were utilized \begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer (Type)** & **Output Shape** & **Parameters** \\ \hline conv1d\_73 (Conv1D) & (4095, 32) & 128 \\ conv1d\_74 (Conv1D) & (4093, 32) & 3104 \\ max\_pooling1d\_28 & (MaxPooling (1364, 32)) & 0 \\ conv1d\_75 (Conv1D) & (1362, 64) & 6208 \\ conv1d\_76 (Conv1D) & (1360, 64) & 12,352 \\ max\_pooling1d\_29 & (MaxPooling (453, 64)) & 0 \\ conv1d\_77 (Conv1D) & (451, 128) & 24,704 \\ conv1d\_78 (Conv1D) & (449, 128) & 49,280 \\ max\_pooling1d\_30 & (MaxPooling (149, 128)) & 0 \\ conv1d\_79 (Conv1D) & (147, 256) & 98,560 \\ conv1d\_80 (Conv1D) & (145, 256) & 196,864 \\ global\_average\_pooling1d\_10 & (256) & 0 \\ dropout\_1(Dropout) & (256) & 0 \\ dense\_28 (Dense) & (32) & 8224 \\ dense\_29 (Dense) & (64) & 2112 \\ dense\_30 (Dense) & (3) & 195 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Description of the CNN structure. for training purposes and the remaining one portion was used for testing. The RMSprop learning algorithm was applied for training. The demonstrated accuracy, sensitivity and specificity values are averaged over ten simulations. Figure 4 depicts the value of loss function (curves that are shown at the bottom of the figure) and the value of accuracy (curves that are shown at the top of the figure) obtained from the training and validation data. Table 4 contains the results of the simulations of CNN using the cross-validation approach. The simulation was repeated 10 times. For the test data, the average accuracy rate is 98.67%, sensitivity is 97.67% and specificity is 98.83%. For comparative analysis, our experimental results were compared with the results of the same seizure classification problem performed by other authors. Table 5 includes the performances of different frameworks used for the detection of seizures. As shown in the table, the proposed model has good characteristics and its performance is higher compared to other frameworks. The proposed CNN is utilized for the classification of EEG signals into seizure, normal and preictal classes. The obtained results demonstrate high performance and good learning convergence of the proposed CNN framework. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Loss Function** & **Sensitivity (\%)** & **Specificity (\%)** & **Accuracy (\%)** \\ \hline Train & 3.8277 \(\times\) 10\({}^{-11}\) & 100 & 100 & 100 \\ \hline Validation & 0.0237 & 96.30 & 98.15 & 96.30 \\ \hline Testing & 0.013878 & 96.67 & 98.33 & 96.67 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation results. Figure 3: Simulation results of loss function and accuracy. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Loss Function** & **Sensitivity (\%)** & **Specificity (\%)** & **Accuracy (\%)** \\ \hline SVM & 0.25 & 79 & 75 & 75 \\ NN & 0.1828 & 80 & 70 & 75 \\ CNN & 0.013878 & 96.67 & 98.33 & 96.67 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparative results of different models.