# AI- and Deep Learning-Powered Driver Drowsiness Detection Method Using Facial Analysis
## 4 Result and Discussion
### Evaluating All Models using Health Informatics Dataset  
Testing a model using a dataset with unknown properties is critical for testing its generalizability and predictive skills. Validating the model with unknown data assures that it can perform well with fresh inputs, showcasing its utility and capacity to generalize. This technique also helps reveal any weaknesses or deficiencies that may have been ignored during training, allowing for improvements in the model's resilience. In this work, the performance of the three models--the CNN, MobileNet, and VGG16--was tested using several measures, including accuracy, precision, recall, and the F1-score. The MobileNet model outperformed the others with an accuracy of 91.98%, followed by the CNN at 59.54% and VGG16 at 53.81%. MobileNet also obtained the greatest F1-score, suggesting a greater classification accuracy for sleepiness detection in the Health Informatics dataset. MobileNet is the best choice for detecting tiredness from facial features due to its strong balance of recall and precision, which is critical for safety-sensitive applications like driver monitoring. \begin{table}
\begin{tabular}{l c c c c} \hline
**Features** & **Predicted Yawn** & **Predicted No Yawn** & **Predicted Closed Eye** & **Predicted Open Eye** \\ \hline Actual Yawn & 28 & 3 & 0 & 0 \\ \hline Actual No Yawn & 0 & 13 & 0 & 0 \\ \hline Actual Closed Eye & 0 & 1 & 99 & 9 \\ \hline Actual Open Eye & 1 & 0 & 5 & 103 \\ \hline \end{tabular}
\end{table} 
Table 2: The confusion matrix of the MobileNet model with the testing dataset. \begin{table}
\begin{tabular}{l c c c c} \hline
**Model** & **Accuracy Score** & **Precision** & **Recall** & **F1-Score** & \\ \hline MobileNet & 92.75\% & 0.93 & 0.93 & 0.93 \\ \hline CNN & 65.27\% & 0.78 & 0.67 & 0.64 \\ \hline VGG16 & 53.43\% & 0.47 & 0.53 & 0.47 \\ \hline \end{tabular}
\end{table} 
Table 3: Performance metrics for different models using Kaggle test set. Table 4 shows the different evaluation metrics (accuracy, precision, recall, and F1-score) for each model with the unseen Health Informatics dataset. The usefulness and effectiveness of using machine learning models in real-world contexts are significantly influenced by their computational and training times. The allocation of resources, the viability, and the responsiveness of applications can all be strongly impacted by the model choice. The tradeoffs between model complexity, accuracy, and computational efficiency are usefully illuminated by these contexts. The significance of considering computation and training time for the performance analysis of different models are as follows:  
* Resource Allocation: Allocating proper hardware resources is aided by the comprehension of processing time. Faster models may be able to run on more resource-constrained hardware, whereas complex models with longer inference periods may need more powerful hardware. * Real-Time Applications: Models with quicker inference times are favoured for applications demanding real-time answers. In industries like autonomous vehicles and the medical field, prompt detection and reaction are essential. * Scalability: Training time has an impact on scaling. Research and development are accelerated through faster training models that allow for quick experimentation and prototyping. * Cost-Effectiveness: The long-term training of complicated models might result in increased infrastructure expenditures. The best models for resource optimization are those with quick training times. * Model Selection: In situations when numerous models produce accuracy that is comparable, shorter inference or training times may be key determinants in selecting the best model. Table 5 displays the computational and training times with different datasets utilized for this investigation. The MobileNet model demonstrated the best computation timing.