# Classification of Sleep Stage with Biosignal Images Using Convolutional Neural Networks
## 5 Experimental Results
### Experiments  
We performed a set of experiments for the signal channels and domains. Experimentally, only the EEG and EOG signals were sufficient, and we used the two signals. The EEG signal should be included because it is vital under the AASM sleep scoring guidelines [5]. The experiments consisted of the following:  
* Exp1: Classification using EEG and EOG images in the time domains
* Exp2: Classification using EEG and EOG images in the frequency domains
* Exp3: Classification using EEG and EOG images in the time domain and frequency domain  
In Exp1 and Exp2, the two images (EEG and EOG) were concatenated vertically. The image was resized to 432 by 288 and used as an input for the CNN. In Exp3, the two images that were used in Exp1 and Exp2 were also concatenated horizontally. The image was also resized to 432 by 288 as an input. Exp1 verified the accuracy of sleep-stage classification using EEG and EOG images in the time domain as input to the CNN. After training the CNN, the accuracy of the training and validation set could be visualized. Figure 3 shows the accuracy of the training process for the numbers of epochs. After 10 epochs in the training, the CNN achieved 96% as the training set accuracy and 82% as the validation set accuracy. Table 2 shows the performance evaluation results of Exp1 for the testing data after training. The F1 score values were 59% for S1, 90% for S2, 100% for SWS, and 74% for R. As for the overall performance of Exp1, the weighted F1 score was 84% and the accuracy was 85%. Figure 4 is the confusion matrix of the cross-validation for Exp1. The row labels are the given classes of the testing data, and the column labels are the ones predicted by the CNN. The results indicate that the CNN was weak in detecting S1. It shows that S1 was correctly classified in only 47.9% of the cases, but that 36.7% of S2 and 15.3% of R were misclassified for the actual given S1. Figure 3: Training and validation set accuracy over epochs (Exp1). Exp2 verified the classification accuracy using EEG and EOG images in the frequency domain. Figure 5 shows the accuracy of the training process for the numbers of epochs. After 14 epochs in the training, the CNN achieves 90% as training set accuracy and 89% as validation set accuracy. Table 3 shows the performance evaluation results of Exp2. The F1 score values were 60% for S1, 90% for S2, 97% for SWS, and 84% for R, respectively. For the overall performance of Exp2, the weighted F1 score was 86% and accuracy was 86%. The results show that the performance of Exp2 is similar to that of Exp1. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Stage** & **Precision** & **Recall** & **F1 Score** & **Weighted F1 Score** & **Accuracy** \\ \hline S1 & 0.77 & 0.48 & 0.59 & & \\ S2 & 0.84 & 0.96 & 0.90 & & \\ SWS & 0.99 & 1.00 & 1.00 & & \\ R & 0.78 & 0.70 & 0.74 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Experiment results for test data (Exp1). Figure 4: Confusion matrix of the classification results (Exp1). Figure 5: Training and validation set accuracy over epochs (Exp2). Figure 6 is the confusion matrix of Exp2. The accuracy of classification for S1 is still low. A total of 48.3% of the given S1 set was correctly classified, but 34.7% of S2 and 17.0% of R were misclassified for the S1 set. Exp3 verifies the classification accuracy using EEG and EOG images in the time and frequency domains. The input for the CNN in Exp3 was resized by concatenating the images that were used in Exp1 and Exp2. Figure 7 shows the accuracy of the experiment for numbers of epochs. After 14 epochs, the CNN achieved a 98% training set accuracy and a 94% validation set accuracy. Table 4 shows the performance evaluation results of Exp3. The F1 score values were 84% for S1, 100% for S2, 100% for SWS, and 84% for R. As for the overall performance of Exp 3, the weighted F1 score was 94% and the accuracy was also 94%. Figure 8 is the confusion matrix of Exp. 3. The CNN is classified correctly except that S1 and R, or vice versa, are partially confused.