## 5 Sleep Stages Classification Using DL Models
### DL Techniques Used in Automatic Sleep Stage Classification  
The development of a program diagnostic tool (PDT) for automatic sleep stage classification using DL techniques is shown in Figure 6. First, PSG recordings have to be pre-processed to achieve standardization or normalization. Depending on the requirement and architecture of the proposed DL model, additional steps to convert the PSG recordings into the right input format is required; for example, converting one-dimensional (1D) signals into a two-dimensional (2D) format to train 2D-CNN models. Subsequently, the pre-processed signals are split into training, validation, and testing sets. The training set is used to train the model, the validation set is to fine-tune the model, and the testing set is used to evaluate the model's performance. A well-trained model can accurately classify PSG recordings into the five sleep stages. Figure 5: Examples of electroencephalography (EEG) signals in different sleep stages. Figure 6: Programmed diagnostic tool (PDT) block diagram with DL for automated sleep stage classification. Figure 7 illustrates the number of times each sleep database had been used by studies for automated sleep stage classification using DL techniques, from 2010 to 2020. The DL methods and accuracy obtained from the respective sleep databases are summarized as follows: Sleep-EDF (Table 1), expanded Sleep-EDF (Table 2), MASS (Table 3), MIT-BIH, and SHHS (Table 4), and studies that used the remaining two sleep databases (ISRUC and UCD) and private datasets are listed in Table 5. With the exception of three studies [60; 61; 62], which classified sleep into four stages, all automated sleep stage classification studies, in Tables 1-5, followed the AASM guidelines [21] and classified sleep into five stages. In studies with sleep databases following the R and K rules [51], (i.e., Sleep-EDF, expanded Sleep-EDF, UCD, SHHS, and MIT-BIH), the S3 and S4 stages were often combined manually before pre-processing the PSG signals. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Author** & **Signals** & **Samples** & **Approach** & \
\begin{tabular}{c} **Tools/Programming** \\ **Languages** \\ \end{tabular} &
\begin{tabular}{c} **Accuracy (\%)** \\ \end{tabular} \\ \hline [PERSON] et al. [63] 2020 & EEG & 15,188 & attention CNN & – & 93.7 \\ [PERSON] et al. [64] 2019 & EEG & 41,900 & CNN & – & 92.5 \\ [PERSON] et al. [65] 2019 & EEG & 15,188 & 1D-CNN & Keras & 90.8 \\ [PERSON] et al. [66] 2013 & EEG & 2880 & Elman RNN & – & 87.2 \\ [PERSON] et al. [67] 2019 & EEG & 10,280 & RNN-LSTM & MATLAB & 86.7 \\ [PERSON] et al. [68] 2017 & EEG & – & CNN & – & 84.5 \\ [PERSON] et al. [69] 2019 & EEG & 42,308 & CNN-BiRNN & TensorFlow & 84.3 \\ [PERSON] et al. [70] 2020 & EEG & 42,308 & CRNN & PyTorch & 83.9 \\ [PERSON] et al. [71] 2020 & EEG & – & CNN & – & 83.6 \\ [PERSON] et al. [72] 2017 & EEG & 41,950 & CNN-BiLSTM & TensorFlow & 82.0 \\ [PERSON] et al. [73] 2019 & EEG & – & Multi-task CNN & TensorFlow & 81.9 \\ [PERSON] et al. [74] 2017 & EEG & – & CNN & – & 81.3 \\ [PERSON] et al. [75] 2018 & EEG & – & 1-max CNN & – & 79.8 \\ [PERSON] et al. [76] 2018 & EEG & – & Attentional RNN & – & 79.1 \\ [PERSON] et al. [65] 2019 & EOG & 15,188 & 1D-CNN & Keras & 89.8 \\ [PERSON] et al. [65] 2019 & EEG + EOG & 15,188 & 1D-CNN & Keras & 91.2 \\ [PERSON] et al. [77] 2020 & PSG signals & – & DNN & – & 86.1 \\ [PERSON] et al. [73] 2019 & EEG + EOG & – & Multi-task CNN & TensorFlow & 82.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of automated sleep stage classification approaches with DL applied to PSG recordings in Sleep-EDF dataset. Figure 7: Pie chart representation of the frequency in which each sleep database was used in automated sleep stage classification studies. The total number of studies was 47, as listed in Tables 1–5. * Summary statistics: using various databases for sleep stage classification.