## 3 Results  
### Subject Position  
Table 1 shows the results of the classification of the position using the tested classifiers considering the validation dataset. The best tested classifiers reached an overall accuracy of 89.9% on the validation set, the ANN, and it was considered for the final implementation for the following analysis.  
Figure 7 shows the results of the classification of the position using the ANN classifier. The overall accuracy is about 95.5% for the training set, about 89.9% for the validation set, about 86.1% for the test set, and about 94.0% for all datasets.  
Figure 7: Confusion matrix of the performances of the position classification (Artificial Neural Network (ANN) algorithm), considering the training dataset, the validation dataset, the test dataset, and all datasets. The recognized classes are (i) not on bed, (ii) supine position, (iii) lying on the left side, (iv) lying on the right side, (v) prone position, and (vi) movement.  
\begin{table}
\begin{tabular}{l c} \hline \hline
**Classifiers** & **Accuracy** \\ \hline ANN & 89.9\% \\ KNN & 86.7\% \\ SVM & 82.2\% \\ Decision Tree & 80.2\% \\ Naive Bayes & 71.1\% \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparison table of accuracy for five tested classifiers: Artificial Neural Network (ANN), K-Nearest-Neighbors (KNN), Support Vector Machines (SVM), decision tree, and naive Bayes. The accuracy is evaluated on the validation set.  
\begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline
**Name** & **BR\({}_{m}\) Real** & **BR\({}_{p}\) Real** & **BR\({}_{m}\) Smart-Bed** & **BR\({}_{p}\) Smart-Bed** & **RMSE** & **R** & \(p\)**-Value** \\ \hline subject 1 & 33.17 & 157.44 & 27.89 & 179.24 & 9.2 & 0.83 & \textless{}0.001 \\ subject 2 & 22.02 & 53.16 & 21.46 & 68.79 & 5 & 0.8 & \textless{}0.001 \\ subject 3 & 26.06 & 118.57 & 22.82 & 136.65 & 8.6 & 0.75 & \textless{}0.001 \\ subject 4 & 37.82 & 280.16 & 24.03 & 132.78 & 20 & 0.47 & \textless{}0.01 \\ subject 5 & 39.53 & 229.30 & 32.41 & 153.66 & 13 & 0.72 & \textless{}0.001 \\ subject 6 & 27.73 & 190.72 & 18.37 & 83.92 & 17 & 0.34 & \textless{}0.05 \\ subject 7 & 28.51 & 263.34 & 25.44 & 183.30 & 13 & 0.64 & \textless{}0.001 \\ \hline \hline \end{tabular}
\end{table}
Table 2: For each subject were reported the means of breathing rate estimated with the smart bed (BR\({}_{m}\) Smart-Bed) and reference cannula signal (BR\({}_{m}\) Real), the variances of the breathing rate estimated with smart bed (BR\({}_{p}\) Smart-Bed) and reference cannula signal (BR\({}_{p}\) Real), the root mean squared error (RMSE), the Pearson’s correlation coefficients (R), and the correspondent \(p\)-valueues (\(p\)-value).  
Figure 8: For each subject, the following information are reported: on the left, the waveform (waveform, black line) and estimated breathing rate (BR real, red line) of the reference breathing signal obtained from the sensorized nasal cannula with the estimated breathing rate (BR smart bed, blue line) obtained from smart bed are shown. On the right, the corresponded scatter plots of estimated BR from the smart bed and reference signal are shown together with the diagonal identity lines and [PERSON]’s coefficient of correlation (R). The units of waveforms are the logical levels of the analog-to-digital converter of an acquisition board used to acquire the reference breathing signal.