## 3 Classifier Training and Results
### Head Gesture Recognition Rates for T1 and T2 Testing Scenarios  
We also verified how the classifiers' accuracy depends on the type of testing scenario as defined in Section 2.1. For the causal system, the best results were obtained for test scenario \(T1\) (see Figure 7). The accuracy of all classifiers exceeded 90%. The results obtained for test scenario \(T2\) were distinctly inferior. For this testing scenario, the accuracy of the classifiers was below 90%. Again, the best classifiers were the SVM and the random forests. For the signal samples recorded directly from the IMU (vectors with six parameters), almost all classifiers' accuracies were above 90%. As is evident in Figure 8, except for the SVM, the best results were obtained for test \(T2\). Note that for the SVM classifier, the recognition accuracy for both tests was almost identical and exceeded 95%. Figure 8: Comparison of the classifiers’ accuracy obtained for test scenarios \(T1\) and \(T2\), i.e., for the test data recorder for individuals who did not record the training data (T_12_set). Classifiers accuracy for the test data collected directly from the accelerometer and gyroscope (vectors with six parameters). Figure 7: Comparison of the classifiers’ accuracy obtained for test scenarios \(T1\) and \(T2\) for the test data recorded for individuals who did not record the training data (T_12_set) and the \(SP\) training procedure (classifiers trained on the parameters of the IMU signals). We have also verified which head gestures were most often confused with one another for the classifiers which yielded the best results, i.e., for the SVM classifier with a 3 rd degree polynomial and regularization parameter \(C=1.0\) for the \(SP\) training procedure and for the SVM with an RBF kernel and \(C=10.0\) for the \(TDR\) training procedure. The results are presented as confusion matrices in Tables 1 and 2. These tables show the results obtained for the 12 trial participants who did not take part in training the classifiers. As shown in Table 3, the highest error rate was reported for pitch (5.5% of the gestures recognised as immobility). Further, considerably high error rates were noted for roll (4.6% of the gestures recognised as immobility). The best recognition rates were obtained for head immobility (92.6%). Interestingly, also for the immobility we have obtained the highest false positive recognitions. The sensitivity, specificity and F1 scores of the head gesture recognition rates are presented in Table 4. Note that the F1 score is defined as a harmonic average of the sensitivity and positive predictive value. It is a good measure of overall classifier performance. Note that F1-score, sensitivity and specificity rates are similar for different gestures, however, the specificity rates assume the highest values. For the SVM classifier trained on IMU signal samples (Table 5), the distribution of errors was different. For this case, the immobility was frequently and falsely recognized as yaw or as pitch (4.3% and 3.9% error rates respectively). Note here that both the sensitivity and specificity rates in Table 6 (classifiers trained on raw IMU signals) outperform the corresponding rates in Table 4 (classifiers trained on parametrized IMU signals). \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Pitch** & **Roll** & **Yaw** & **Immobility** \\ \hline Sensitivity & 92\% & 92\% & 91\% & 93\% \\ Specificity & 98\% & 98\% & 97\% & 96\% \\ F1-score & 92\% & 93\% & 92\% & 92\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Statistical measures showing detection results of head gestures for the SVM classifier with a 3 rd degree polynomial and \(C=1.0\) (the classifier trained on parametrized IMU signals).