Driver Fatigue Detection Using YOLOv5 with Genetic- Algorithm-Based Hyperparameter Optimization and Fine-Tuning Strategies

Authors

  • Hendri Darmawan Politeknik Elektronika Negeri Surabaya Author
  • Zulfa Muflihah Author
  • Giran Arisdi Author

DOI:

https://doi.org/10.68129/jeis.v1i2.7

Keywords:

Drowsiness detection, Fine-tuning, Genetic algorithm, Hyperparameter optimization, YOLOv5

Abstract

Driver fatigue is a major contributor to traffic accidents, injuries, and economic losses. This study proposes a computer-vision-based driver fatigue detection system using YOLOv5s to identify three facial states: normal, eye closed, and yawning. The model is fine-tuned from pre-trained COCO weights and evaluated under multiple training schemes, including full fine-tuning, partial layer freezing, and hyperparameter evolution based on a genetic algorithm. The dataset consists of 5,706 training images and 2,390 testing images compiled from self-recorded and public sources under varied lighting conditions. Experimental results show that the best model without evolution achieves an mAP of 0.887, while the best evolved model reaches an mAP of 0.888 and runs at 30 FPS on a CPU-based device. These findings indicate that the proposed model is sufficiently accurate, lightweight, and practical for early-warning deployment on low- resource edge devices in advanced driver assistance systems.

References

[1] J. M. Owens et al., "Prevalence of Drowsy Driving Crashes: Estimates from a Large-Scale Naturalistic Driving Study," Research Brief, AAA Foundation for Traffic Safety, Washington, D.C., Feb. 2018.

[2] A. Rahman, M. B. H. Hriday, and R. Khan, "Computer vision-based approach to detect fatigue driving and face mask for edge computing device," Heliyon, vol. 8, no. 10, 2022, Art. no. e11204, doi: 10.1016/j.heliyon.2022.e11204.

[3] L. Du, R. Zhang, and X. Wang, "Overview of two-stage object detection algorithms," J. Phys. Conf. Ser., vol. 1544, no. 1, 2020, Art. no. 012033, doi: 10.1088/1742-6596/1544/1/012033.

[4] T. Diwan, G. Anirudh, and J. V. Tembhurne, "Object detection using YOLO: challenges, architectural successors, datasets and applications," Multimedia Tools Appl., vol. 82, no. 6, pp. 9243–9275, 2023, doi: 10.1007/s11042-022-13644-y.

[5] F. D. H. Fikriyah, A. Nugroho, and A. F. Suni, "Eye Fatigue Detection in Vehicle Drivers Based on Facial Landmarks Features," REKAYASA J. Penerapan Teknol. dan Pembelajaran, vol. 19, no. 1, pp. 11–19, 2021, doi: 10.15294/rekayasa.v19i1.28699.

[6] S. B. Meshram and S. Bodkhe, "Fatigue Detection based on Image Eye Tracking and Detection for avoiding accidents on Roads," 2016.

[7] A. C. Phan, N. H. Q. Nguyen, T. N. Trieu, and T. C. Phan, "An efficient approach for detecting driver drowsiness based on deep learning," Appl. Sci., vol. 11, no. 18, Sep. 2021, Art. no. 8441, doi: 10.3390/app11188441.

[8] R. Ribani and M. Marengoni, "A Survey of Transfer Learning for Convolutional Neural Networks," in Proc. 32nd SIBGRAPI Conf. Graphics, Patterns Images Tutorials (SIBGRAPI-T), 2019, pp. 47–57, doi: 10.1109/SIBGRAPI-T.2019.00010.

[9] N. Ho and Y.-C. Kim, "Evaluation of transfer learning in deep convolutional neural network models for cardiac short axis slice classification," Sci. Rep., vol. 11, no. 1, 2021, Art. no. 1839, doi: 10.1038/s41598-021-81525-9.

[10] D. L. Shanthi and N. Chethan, "Genetic Algorithm Based Hyper-Parameter Tuning to Improve the Performance of Machine Learning Models," SN Comput. Sci., vol. 4, no. 2, 2022, Art. no. 119, doi: 10.1007/s42979-022-01537-8.

[11] T. Alzyadat, M. Yamin, and G. Chetty, "Genetic algorithms for the travelling salesman problem: a crossover comparison," Int. J. Inf. Technol., vol. 12, no. 1, pp. 209–213, 2020, doi: 10.1007/s41870-019-00377-9.

[12] M. Sonka, V. Hlavac, and R. Boyle, "Image pre-processing," in Image Processing, Analysis and Machine Vision, M. Sonka, V. Hlavac, and R. Boyle, Eds. Boston, MA, USA: Springer US, 1993, pp. 56–111, doi: 10.1007/978-1-4899-3216-7_4.

[13] C. Shorten and T. M. Khoshgoftaar, "A survey on Image Data Augmentation for Deep Learning," J. Big Data, vol. 6, no. 1, 2019, Art. no. 60, doi: 10.1186/s40537-019-0197-0.

[14] P. Jiang, D. Ergu, F. Liu, Y. Cai, and B. Ma, "A Review of Yolo Algorithm Developments," Procedia Comput. Sci., vol. 199, pp. 1066–1073, 2022, doi: 10.1016/j.procs.2022.01.135.

[15] S. Han, X. Dong, X. Hao, and S. Miao, "Extracting Objects' Spatial-Temporal Information Based on Surveillance Videos and the Digital Surface Model," ISPRS Int. J. Geo-Inf., vol. 11, no. 2, Feb. 2022, Art. no. 103, doi: 10.3390/ijgi11020103.

[16] A. C. Aqsa, H. Mahmudah, and R. W. Sudibyo, "Detection and Classification of Road Damage Using CNN with Hyperparameter Optimization," in Proc. 6th Int. Conf. Informatics Comput. Sci. (ICICoS), 2022, pp. 101–104, doi: 10.1109/ICICoS56336.2022.9930607.

[17] Erwin, "Improving Retinal Image Quality Using the Contrast Stretching, Histogram Equalization, and CLAHE Methods with Median Filters," Int. J. Image, Graphics Signal Process., vol. 12, no. 2, pp. 30–41, Apr. 2020, doi: 10.5815/ijigsp.2020.02.04.

[18] R. Fisher, S. Perkins, A. Walker, and E. Wolfart, "Contrast Stretching," The University of Edinburgh School of Informatics. [Online]. Available: https://homepages.inf.ed.ac.uk/rbf/HIPR2/stretch.htm. (Accessed: Nov. 27, 2022).

[19] J. Wu, X.-Y. Chen, H. Zhang, L.-D. Xiong, H. Lei, and S.-H. Deng, "Hyperparameter Optimization for Machine Learning Models Based on Bayesian Optimizationb," J. Electron. Sci. Technol., vol. 17, no. 1, pp. 26–40, 2019, doi: 10.11989/JEST.1674-862X.80904120.

[20] Z. S. Hernanda, H. Mahmudah, and R. W. Sudibyo, "CNN-Based Hyperparameter Optimization Approach for Road Pothole and Crack Detection Systems," in Proc. IEEE World AI IoT Congr. (AIIoT), 2022, pp. 538–543, doi: 10.1109/AIIoT54504.2022.9817316.

[21] F. J. P. Montalbo, "Truncating a densely connected convolutional neural network with partial layer freezing and feature fusion for diagnosing COVID-19 from chest X-rays," MethodsX, vol. 8, 2021, Art. no. 101408, doi: 10.1016/j.mex.2021.101408.

[22] Y. Zhong, J. Wang, J. Peng, and L. Zhang, "Anchor Box Optimization for Object Detection," in Proc. IEEE Winter Conf. Appl. Comput. Vision (WACV), 2020, pp. 1275–1283, doi: 10.1109/WACV45572.2020.9093498.

[23] J. Wang et al., "Toward surface defect detection in electronics manufacturing by an accurate and lightweight YOLO-style object detector," Sci. Rep., vol. 13, no. 1, 2023, Art. no. 7062, doi: 10.1038/s41598-023-33804-w.

[24] H. Darmawan, M. Yuliana, and Moch. Z. S. Hadi, "GRU and XGBoost Performance with Hyperparameter Tuning Using GridSearchCV and Bayesian Optimization on an IoT-Based Weather Prediction System," Int. J. Adv. Sci. Eng. Inf. Technol., vol. 13, no. 3, pp. 851–862, 2023, doi: 10.18517/ijaseit.13.3.18377.

[25] H. Darmawan, M. Yuliana, and Moch. Z. Samsono Hadi, "Realtime Weather Prediction System Using GRU with Daily Surface Observation Data from IoT Sensors," in Proc. Int. Electron. Symp. (IES), 2022, pp. 221–226, doi: 10.1109/IES55876.2022.9888468.

[26] G. Dai, L. Hu, J. Fan, S. Yan, and R. Li, "A Deep Learning-Based Object Detection Scheme by Improving YOLOv5 for Sprouted Potatoes Datasets," IEEE Access, vol. 10, pp. 85416–85428, 2022, doi: 10.1109/ACCESS.2022.3192406.

[27] A. Hussain, B. Barua, A. Osman, R. Abozariba, and A. T. Asyhari, "Low Latency and Non-Intrusive Accurate Object Detection in Forests," in Proc. IEEE Symp. Ser. Comput. Intell. (SSCI), 2021, doi: 10.1109/SSCI50451.2021.9660175.

Downloads

Published

2026-09-30

Issue

Section

Articles

How to Cite

[1]
H. Darmawan, Z. Muflihah, and G. Arisdi, “Driver Fatigue Detection Using YOLOv5 with Genetic- Algorithm-Based Hyperparameter Optimization and Fine-Tuning Strategies”, J. Electr. Intell. Syst., vol. 1, no. 2, pp. 8–18, Sep. 2026, doi: 10.68129/jeis.v1i2.7.