# Drowsiness Transitions Detection Using a Wearable Device
## 4 Results
### MSPC-PCA Analysis
The most common for the heart rate variability was between 6 to 9 points of control, whereas for the accelerometer, it was 2 to 4. When the number of out-of-control points reached in both sets of data are compared (in  
Figure 8: Transitions and Out-of-Control Points (**a**) Number of Drowsiness Transitions. (**b**) Heart Rate Variability Out-of-Control Points. (**c**) Accelerometer Out-of-Control Points. (**d**) Out-of-Control Points in Both Heart Rate Variability and Accelerometer. other words, the heart variability and accelerometer at the same time), there are 39.62% with 1 point in common, 11.32% with 2 points, and 7.55% with 3 or 4 points. This means that 41.51% does not have any point in common. The next step was to evaluate the presence of a transition in which the points are out of control due to both heart rate variability and accelerometer. Therefore, considering the results achieved, only 14.29% of the common out-of-control points actually have a drowsiness transition. With this analysis, it is clear that improvements need to be made. Hence, the suggestion is to identify the out-of-control points for heart rate variability and compare them with the video in case of a transition; otherwise, check if it is possible to anticipate or delay a defined transition. Figure 9 presents the new drowsiness classification, for both participants 15 and 21, with the respective rectification. The blue line represents the first drowsiness classification, and the orange line is the improved classification using the methodology presented. For participant 15, the first three out-of-control points occurred before the video recording. In the last two points, it was possible to identify a drowsiness transition, and for that reason, the drowsiness classification was modified. When it comes to participant 21, only the first out-of-control point occurred before the video recording, and at the remaining points, there was also a transition from drowsiness. To evaluate the proposed method's performance, the precision and recall metrics were computed. Contextually, it is intended to check the ability of the out-of-control points to actually represent a drowsiness transition, which is known as precision. On the other hand, it is also intended to verify the ability to detect real drowsiness transitions, which represents the recall metric. So, precision and recall can be expressed as Equations (9) and (10), respectively. \[\text{Precision}=\frac{\text{Out-of-Control Point}\cap\text{Real Transitions}}{\text{Total Number of Out-of-Control Points}} \tag{9}\]  
\[\text{Recall}=\frac{\text{Real Transitions}\cap\text{Out-of-Control Point}}{\text{Total Number of Transitions}} \tag{10}\]  
The results achieved are presented in Table 5. For the first drowsiness classification, the precision and recall values were equal to 0.37 and 0.21, respectively. However, with the improved classification, precision was equal to 0.83 and recall to 0.47. It is perceptible that using the proposed methodology it was possible to improve the drowsiness classification and achieve better results. \begin{table}
\begin{tabular}{l c c} \hline \hline
**Drowsiness Classification** & **Precision** & **Recall** \\ \hline First Classification [21] & 0.37 & 0.21 \\ Improved Classification & 0.83 & 0.47 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Precision and Recall Metrics. Figure 9: Drowsiness Classification Improvements. (**a**) participant 15. (**b**) participant 21.