# Multi-Class Sleep Stage Analysis and Adaptive Pattern Recognition
## 3 Results
Resulting regression coefficients point to an average increase of the length of the Wake stage by 2.7% per 10 years and a decrease of the length of the REM stage by 0.8% per 10 years. Figure 6 presents more detail analysis of the resulting lengths of the sleep stages [47] related to the age for the whole set of 184 individuals divided according to their diagnosis as determined by experienced neurologists. A well documented increase of the Wake stages and decrease of REM stages related to age is confirmed for healthy individuals and patients with sleep apnea. For patients with restless leg syndrome, no such distribution was observed. The summary of associated regression coefficients with their 95% confidence bounds are presented in Table 5. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Method** & **Parameters** & **Accuracy (\%)** & **Cross-Valid.** \\ \hline \(R\!-\!S1\!-\!S2\) & \(S1=3\) & 79.58 & 0.13 \\ Neural Net & \(S1=6\) & 87.08 & 0.10 \\ \((R\!=\!4,S2\!=\!5)\) & \(S1=10\) & 88.33 & 0.12 \\ \hline \(k\)-Nearest & \(k\!=\!3\) & 82.9 & 0.35 \\ Neighbour & \(k\!=\!5\) & 77.9 & 0.29 \\ \hline Decision Tree & & 85.7 & 0.14 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of the accuracy and cross-validation for classification of sleep features evaluated during the two-hour long observation and 30 s long time windows by the neural network, nearest neighbour, and decision tree models. Figure 4: Classification of sleep stages presenting (**a**) class selection for the 5-nearest neighbour method and (**b**) class boundaries of the computational model and two features evaluated as the mean power in selected frequency ranges (1–4 Hz, 4–8 Hz). Figure 5: The distributions of the lengths of the Wake and REM sleep stages related to age for the whole set of 184 individuals under study. Figure 6: Distributions of Wake and REM sleep stages related to age for (**a1,b1**) healthy individuals and patients with (**a2,b2**) sleep apnea; (**a3,b3**) restless leg syndrom; and (**a4,b4**) restless leg syndrom and sleep apnea. Table 6 presents the summary of the results for the individuals specified in Table 1 with 4 different diagnoses and their classification into three classes (C1: Wake, C2: NonREM, C3: REM). The learning performance was evaluated by the cross-entropy for given targets and network outputs. The last column of Table 6 presents cross-validation errors evaluated by the \(K\)-fold cross-validation method (for \(K=10\)). A comparison of the classification results was performed using  
1. the EEG channels only, with patterns evaluated as mean energies in 5 selected frequency bands (1-4, 4-8, 8-12, 12-16, 16-20 Hz),
2. additional features evaluated from the 4 frequency bands (0.05-0.2, 0.2-0.3, 0.3-0.4, 0.4-0.8 Hz) of the flow channel and 3 frequency bands (4-15, 15-30, 30-40 Hz) of the electro-oculogram channel. The values in Table 6 show nearly no difference between males and females and a slight improvement of the performance and accuracy of the neural network model using multimodal features consisting of 12 items instead of 5 EEG features associated with each segment. The results presented in Table 6 are based on the manual classification of the PSG records performed by an experienced neurologist incorporating his experience. The adaptive optimization of the network coefficients can be further performed for newly acquired records.