# An Intelligent Real-Time Driver Activity Recognition System Using Spatio-Temporal Features
## 4 Results and Evaluation
### Evaluation of the LRCN Model Based on Seven-Fold Cross Validation  
In this subsection, the driver activity for all 31 drivers was evaluated based on _k-fold_ (_k_ ranges from one to seven) cross-validation to check the generalization ability of the model on new datasets. Therefore, the dataset is divided into seven subsets or folds base on the number of drivers. As such, each time, one of the seven subsets was used as a testing set, and the rest were put together to form a training set. Note that the training and testing sets in each iteration never originated from the same driver. Thus, the model receives completely unseen data as a testing set. In this way, the model can be evaluated effectively to determine the predictive ability on various unseen datasets. In each fold, both RGB and IR images are considered in the training as well as the testing set, so that the model can learn to recognize the driver's activity without limitations of time for both day- and nighttime conditions. From the results acquired in the above section of the experiment, we observed that the model hyperparameters exhibited symptoms of high variance, which confirms the overfitting of the unified LRCN model. Therefore, the hyperparameters were carefully analyzed and modified, and finally set as proposed parameters (see Section 3.6). Tables 2 and 3 illustrate the classification results assessed using cross-validation for each fold and the overall performances of the models for RGB and IR images, respectively. The performance of the model was determined by averaging the seven-fold cross-validation. Fold-1 to Fold-7 represent the seven-fold cross validation. For multi-class classification, alongside accuracy, it is good practice to evaluate the model with additional evaluation metrics to further assess the model's robustness. Therefore, an additional three standard performance indicators, namely, precision, recall, and F\({}_{1}\)-score, were computed for each fold and used to determine the average output. The precision is the ratio of the true positives to the total of the true positives and false positives (when the model predicts non-distracted driving while it is actually getting distracted). The recall is the ratio of the true positive to the summation of the true positives and false negatives (when the classifier does not detect non-distracted driving). In this sense, recall and precision are complementary and this characterization manifests useful information when they are mingled using the \(F_{1}\).score, which shows the harmonic mean of the precision and recall. According to the results shown in Tables 2 and 3, it can be seen that there is a clear accuracy difference in each fold. This is mainly because the model in each iteration receives various unseen data. In particular, the highest fold accuracy of the model for RGB and IR images was 94.6% and 96.7%, respectively. In contrast, the lowest accuracy is observed in fold four and fold two for RGB and IR images, respectively. In Table 4, the recognition result for each label is reported. For RGB images, texting resulted in the highest F\({}_{1}\) score. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Metrics** & **Fold-1** & **Fold-2** & **Fold-3** & **Fold-4** & **Fold-5** & **Fold-6** & **Fold-7** & **Average** \\ \hline Accuracy (\%) & 90.1 & 85.60 & 88.6 & 78.7 & 94.6 & 92.9 & 90.6 & 88.7 \\ Precision (\%) & 86.7 & 82.7 & 85.9 & 83.7 & 95.6 & 89.4 & 91.6 & 87.9 \\ Recall (\%) & 82.3 & 81.9 & 87.7 & 87.2 & 93.8 & 88.3 & 88.1 & 87.0 \\ F\({}_{1}\)-Score (\%) & 83.5 & 80.1 & 86.2 & 82.8 & 94.6 & 88.6 & 89.4 & 86.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The performance metric measures (Accuracy, Precision, Recall, and F1 score) based on seven-fold cross validation for RGB images.