Implementation of a Drowsiness Detection System in Four-Wheel Vehicle Drivers Using OpenCv

Authors

  • Farhan Riqi Ma’ajid Universitas Muhammadiyah Sumatera Utara
  • Al-Khowarizmi Universitas Muhammadiyah Sumatera Utara

DOI:

https://doi.org/10.62123/enigma.v3i1.109

Keywords:

Drowsiness Detection, EAR, CNN, MediaPipe FaceMesh, OpenCV

Abstract

Drowsiness while driving is one of the triggers of traffic accidents. This study proposes a non-invasive and economical computer vision-based real-time drowsiness detection system. The system combines Eye Aspect Ratio (EAR) to assess eye openness, Convolutional Neural Network (CNN) for open/closed eye classification, and MediaPipe FaceMesh for stable facial landmark extraction. The dataset is taken from Kaggle (Open and Closed classes, totaling 1,452 images) and processed through grayscale conversion, normalization, 64×64 pixel resizing, and augmentation. Drowsiness detection is triggered when EAR <0.25 and CNN classifies both eyes as closed for ±2 consecutive seconds; visual/audio alarms are automatically activated. Test results on 218 images show excellent performance with only 1 misclassification (≈99.5% accuracy), with no false alarms for the open eye class. The system is implemented as a Flask-based web application for easy cross-device access. These findings demonstrate an efficient visual approach that is feasible to be integrated as a driving safety feature.

Downloads

Download data is not yet available.

References

[1] G. Zhang, K. K. W. Yau, X. Zhang, and Y. Li, “Traffic accidents involving fatigue driving and their extent of casualties,” Accid Anal Prev, vol. 87, pp. 34–42, 2016.

[2] A. Moradi, S. S. H. Nazari, and K. Rahmani, “Sleepiness and the risk of road traffic accidents: A systematic review and meta-analysis of previous studies,” Transp Res Part F Traffic Psychol Behav, vol. 65, pp. 620–629, 2019.

[3] A. T. Kashani, M. R. Moghadam, and S. Amirifar, “Factors affecting driver injury severity in fatigue and drowsiness accidents: a data mining framework,” J Inj Violence Res, vol. 14, no. 1, p. 75, 2022.

[4] S. Saleem, “Risk assessment of road traffic accidents related to sleepiness during driving: a systematic review,” Eastern Mediterranean Health Journal, vol. 28, no. 9, pp. 695–700, Sep. 2022, doi: 10.26719/emhj.22.055.

[5] Y. Albadawi, M. Takruri, and M. Awad, “A review of recent developments in driver drowsiness detection systems,” Sensors, vol. 22, no. 5, p. 2069, 2022.

[6] I. Stancin, M. Cifrek, and A. Jovic, “A review of EEG signal features and their application in driver drowsiness detection systems,” Sensors, vol. 21, no. 11, p. 3786, 2021.

[7] B. Fu, F. Boutros, C.-T. Lin, and N. Damer, “A survey on drowsiness detection–modern applications and methods,” IEEE Transactions on Intelligent Vehicles, 2024.

[8] E. Magán, M. P. Sesmero, J. M. Alonso-Weber, and A. Sanchis, “Driver drowsiness detection by applying deep learning techniques to sequences of images,” Applied Sciences, vol. 12, no. 3, p. 1145, 2022.

[9] M. I. B. Ahmed et al., “A deep-learning approach to driver drowsiness detection,” Safety, vol. 9, no. 3, p. 65, 2023.

[10] S. Davanathan, N. S. A. M. Taujuddin, and S. Sari, “Driving fatigue detection system using Haar cascade technique,” Evolution in Electrical and Electronic Engineering, vol. 5, no. 1, pp. 436–442, 2024.

[11] J. More, D. Sutar, R. Sequeira, and V. Chavan, “Eye detection using haar cascade classifier,” International Research Journal of Engineering and Technology (IRJET), vol. 8, no. 05, pp. 2356–2395, 2021.

[12] V. Viswanatha, A. C. Ramachandra, G. L. Reddy, A. V. S. T. Reddy, B. P. K. Reddy, and G. B. Kiran, “An Intelligent Camera Based Eye Controlled Wheelchair System: Haar Cascade and Gaze Estimation Algorithms,” in 2023 International Conference on Applied Intelligence and Sustainable Computing (ICAISC), IEEE, 2023, pp. 1–5.

[13] M. N. Andrean et al., “Comparing haar cascade and yoloface for region of interest classification in drowsiness detection,” Jurnal Media Informatika Budidarma, vol. 8, no. 1, pp. 272–281, 2024.

[14] A. P. Sunija, S. Kar, S. Gayathri, V. P. Gopi, and P. Palanisamy, “Octnet: A lightweight cnn for retinal disease classification from optical coherence tomography images,” Comput Methods Programs Biomed, vol. 200, p. 105877, 2021.

[15] I. Topaloglu, “Deep learning based convolutional neural network structured new image classification approach for eye disease identification,” Scientia Iranica, vol. 30, no. 5, pp. 1731–1742, 2023.

[16] T. J. Jun et al., “TRk-CNN: transferable ranking-CNN for image classification of glaucoma, glaucoma suspect, and normal eyes,” Expert Syst Appl, vol. 182, p. 115211, 2021.

[17] Aman and A. L. Sangal, “Drowsy alarm system based on face landmarks detection using mediapipe facemesh,” in Proceedings of First International Conference on Computational Electronics for Wireless Communications: ICCWC 2021, Springer, 2022, pp. 363–375.

[18] S. A. Jakhete and N. Kulkarni, “A comprehensive survey and evaluation of MediaPipe Face Mesh for human emotion recognition,” in 2024 8th International Conference on Computing, Communication, Control and Automation (ICCUBEA), IEEE, 2024, pp. 1–8.

[19] S. Singh, R. Verma, and A. K. Singh, “Image filtration in Python using openCV,” Turkish Journal of Computer and Mathematics Education, vol. 12, no. 6, pp. 5136–5143, 2021.

[20] U. Sharma, T. Goel, and J. Singh, “Real-time image processing using deep learning with opencv and python,” J Pharm Negat Results, pp. 1905–1908, 2023.

Downloads

Published

2025-10-28

How to Cite

Ma’ajid, F. R., & Al-Khowarizmi. (2025). Implementation of a Drowsiness Detection System in Four-Wheel Vehicle Drivers Using OpenCv. Electronic Integrated Computer Algorithm Journal, 3(1), 28–32. https://doi.org/10.62123/enigma.v3i1.109