Lightweight Facial Feature-Based Drowsiness Detection Using Haar Cascade, EAR, MAR, and KNN

Authors

DOI:

https://doi.org/10.29207/resti.v10i5.7190

Keywords:

drowsiness detection, eye aspect ratio, Haar cascade, k-nearest neighbor, mouth aspect ratio

Abstract

Vehicle accidents globally are heavily caused by driver fatigue, highlighting the need for automated fatigue detection systems. This research introduces an efficient method to detect driver fatigue using facial geometric features. The proposed method integrates Haar Cascade to locate faces, followed by the extraction of Eye Aspect Ratio (EAR) together with Mouth Aspect Ratio (MAR) metrics, which are then classified through the K-Nearest Neighbor (KNN) algorithm. The experiment utilized a total collection of 2,468 facial samples structured across Open, Closed, Yawn, and No Yawn categories, which were subsequently grouped into “Drowsy” and “Not Drowsy” classes. Model evaluation was performed via Stratified 10-Fold Cross-Validation. The results show that the classifier obtained a mean accuracy rate of 88.2% ± 2.6% with an AUC of 0.93, confirming robust classification effectiveness. These findings position the integrated geometric-feature approach as a systematically validated classical baseline for driver monitoring research. While this study does not empirically measure hardware latency, the stable classification performance suggests that EAR and MAR features provide a reliable foundation for evaluating the performance-to-complexity trade-offs of more advanced models in resource-constrained environments.

Downloads

Download data is not yet available.

References

[1] C. Dewi, R. C. Chen, C. W. Chang, S. H. Wu, X. Jiang, and H. Yu, “Eye Aspect Ratio for Real-Time Drowsiness Detection to Improve Driver Safety,” Electron., vol. 11, no. 19, 2022, doi: https://doi.org/10.3390/electronics11193183.

[2] A. A. Ramadana Lubis, S. I. Purnama, and M. A. Afandi, “Haar Cascade-Based Drowsiness Detection System for Computer Vision Applications,” Techno.Com, vol. 22, no. 3, pp. 589–598, 2023, doi: https://doi.org/10.33633/tc.v22i3.8425.

[3] P. Vishesh, S. Raghavendra, S. K. Jankatti, and V. Rekha, “Eye Blink Detection Using CNN to Detect Drowsiness Level in Drivers for Road safety,” Indones. J. Electr. Eng. Comput. Sci., vol. 22, no. 1, pp. 222–231, 2021, doi: http://doi.org/10.11591/ijeecs.v22.i1.pp222-231.

[4] S. Mujahidin, A. Ripaldi, B. Nugroho, and R. Paninggalih, “Development of Drowsiness Detection System for Drivers using Haar Cascade Classifier and Convolutional Neural Network,” IJCSAM (International J. Comput. Sci. Appl. Math., vol. 10, no. 2, pp. 108–112, 2024, doi: http://dx.doi.org/10.12962%2Fj24775401.v10i2.21955.

[5] B. Y. P. Arun Babu , G. Vidya Vyshnavi, D. Sai Kumar, S. Sameer Basha, “Detecting Human Driver Drowsiness,” vol. 13, no. 4, pp. 1077–1082, 2024, doi: http://dx.doi.org/10.17148/IJARCCE.2024.134159.

[6] A. Altameem, A. Kumar, R. C. Poonia, S. Kumar, A. Khader, and J. Saudagar, “Early Identification and Detection of Driver Drowsiness by Hybrid Machine Learning,” IEEE Access, vol. 9, pp. 162805–162819, 2021, doi: https://doi.org/10.1109/ACCESS.2021.3131601.

[7] Y. Albadawi, A. AlRedhaei, and M. Takruri, “Real-Time Machine Learning-Based Driver Drowsiness Detection Using Visual Features,” J. Imaging, vol. 9, no. 5, 2023, doi: https://doi.org/10.3390/jimaging9050091.

[8] S. Baul, M. R. Rana, and F. Bente Alam, “A Real-time Light-weight Computer Vision Application for Driver’s Drowsiness Detection,” Int. J. Eng. Manuf., vol. 14, no. 2, pp. 23–33, 2024, doi: https://doi.org/10.5815/ijem.2024.02.02.

[9] S. Winarno, F. Alzami, M. Naufal, H. Al Azies, and M. A. Soeleman, “EfficientNet-KNN for Real-Time Driver Drowsiness Detection via Sequential Image Processing,” IIETA, vol. 30, no. 7, pp. 1703–1713, 2025, doi: https://doi.org/10.18280/isi.300703.

[10] R. Kannan, P. Jahnavi, and M. Megha, “Driver Drowsiness Detection and Alert System based on Visual Analysis using Machine Learning,” 2023 IEEE Int. Conf. Integr. Circuits Commun. Syst. ICICACS 2023, no. April, 2023, doi: https://doi.org/10.1109/ICICACS57338.2023.10100316.

[11] I. Veritawati, F. Maspiyanti, R. Mastra, E. Fernando, and A. Murtako, “Comparison of Classification Algorithms in Bamboo Distribution Mapping for Identification of Industrial Supporting Raw Materials,” JOIV Int. J. Informatics Vis., vol. 9, no. 4, p. 1792, Jul. 2025, doi: http://dx.doi.org/10.62527/joiv.9.4.3072.

[12] K. Eldora, E. Fernando, and W. Winanti, “Comparative Analysis of KNN and Decision Tree Classification Algorithms for Early Stroke Prediction: A Machine Learning Approach,” J. Inf. Syst. Informatics, vol. 6, no. 1, pp. 313–338, Mar. 2024, doi: https://doi.org/10.51519/journalisi.v6i1.664.

[13] S. Handayaningsih and A. Ardiansyah, “Missing Data Imputation using K-Nearest Neighbour for Software Project Effort Prediction,” J. Inform., vol. 16, no. 1, p. 19, 2022, doi: http://doi.org/10.26555/jifo.v16i1.a23494.

[14] D. Kurniadi, E. Fernando, A. Fauziyah, and A. Mulyani, “Improving Low-Light Face Recognition using DeepFace Embedding and Multi-Layer Perceptron,” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 9, no. 5, pp. 1047–1055, Oct. 2025, doi: https://doi.org/10.29207/resti.v9i5.6797.

[15] D. R. Rochmawati, “Deteksi Wajah Dengan Metode Haar Cascade Menggunakan Opencv ( Face Detection With Haar Cascade Method Using Opencv ),” J. Tekomin, 2024, doi: https://doi.org/10.59820/tekomin.v3i1.293.

[16] M. N. Andrean et al., “Comparing Haar Cascade and YOLOFACE for Region of Interest Classification in Drowsiness Detection,” J. Media Inform. Budidarma, vol. 8, pp. 272–281, 2024, doi: https://doi.org/10.30865/mib.v8i1.7167.

[17] R. Florez, F. Palomino-quispe, R. J. Coaquira-castillo, J. C. Herrera-levano, T. Paixão, and A. B. Alvarez, “A CNN-Based Approach for Driver Drowsiness Detection by Real-Time Eye State Identification,” MDPI, 2023, doi: https://doi.org/10.3390/app13137849.

[18] W. Jia, M. Sun, J. Lian, and S. Hou, “Feature dimensionality reduction : a review,” Complex Intell. Syst., vol. 8, no. 3, pp. 2663–2693, 2022, doi: https://doi.org/10.1007/s40747-021-00637-x.

[19] M. Dreisig, M. H. Baccour, T. Schack, and E. Kasneci, “Driver Drowsiness Classification Based on Eye Blink and Head Movement Features Using the k-NN Algorithm,” 2020 IEEE Symp. Ser. Comput. Intell. SSCI 2020, pp. 889–896, 2020, doi: https://doi.org/10.1109/SSCI47803.2020.9308133.

[20] R. K. Dinata, H. Akbar, and N. Hasdyna, “Algoritma K-Nearest Neighbor dengan Euclidean Distance dan Manhattan Distance untuk Klasifikasi Transportasi Bus,” Ilk. J. Ilm., vol. 12, no. 2, pp. 104–111, 2020, doi: https://doi.org/10.33096/ilkom.v12i2.539.104-111.

[21] M. Rashid, M. Mustafa, N. Sulaiman, N. R. H. Abdullah, and R. Samad, “Random subspace K-NN based ensemble classifier for driver fatigue detection utilizing selected EEG channels,” Trait. du Signal, vol. 38, no. 5, pp. 1259–1270, 2021, doi: https://doi.org/10.18280/ts.380501.

[22] M. Sari and E. R. Jamzuri, “Hand Sign Recognition of Indonesian Sign Language System (SIBI) Using Inception V3 Image Embedding and Random Forest,” J. RESTI, vol. 9, no. 2, pp. 258–265, 2025, doi: https://doi.org/10.29207/resti.v9i2.6156.

[23] H. Fonda, “Klasifikasi Batik Riau Dengan Menggunakan Convolutional Neural Networks (Cnn),” J. Ilmu Komput., vol. 9, no. 1, pp. 7–10, 2020, doi: https://doi.org/10.33060/JIK/2020/Vol9.Iss1.144.

[24] M. R. A. Yudianto, K. Kusrini, and H. Al Fatta, “Analisis Pengaruh Tingkat Akurasi Klasifikasi Citra Wayang dengan Algoritma Convolitional Neural Network,” J. Teknol. Inf., vol. 4, no. 2, pp. 182–191, 2020, doi: https://doi.org/10.36294/jurti.v4i2.1319.

[25] M. Azhari, Z. Situmorang, and R. Rosnelly, “Perbandingan Akurasi, Recall, dan Presisi Klasifikasi pada Algoritma C4.5, Random Forest, SVM dan Naive Bayes,” J. Media Inform. Budidarma, vol. 5, no. 2, p. 640, 2021, doi: https://doi.org/10.30865/mib.v5i2.2937.

[26] T. Yang and Y. Ying, “AUC Maximization in the Era of Big Data and AI: A Survey,” ACM Comput. Surv., vol. 55, no. 8, 2022, doi: https://doi.org/10.1145/3554729.

[27] I. A. Fouad and F. E. Z. M. Labib, “Role of Deep Learning in Improving the Performance of Driver Fatigue Alert System,” Trait. du Signal, vol. 39, no. 2, pp. 577–588, 2022, doi: https://doi.org/10.18280/ts.390219.

[28] L. Yu, X. Yang, H. Wei, J. Liu, and B. Li, “Driver fatigue detection using PPG signal, facial features, head postures with an LSTM model,” Heliyon, vol. 10, no. 21, 2024, doi: https://doi.org/10.1016/j.heliyon.2024.e39479.

[29] V. Teodorescu and L. Obreja Brașoveanu, “Assessing the Validity of k-Fold Cross-Validation for Model Selection: Evidence from Bankruptcy Prediction Using Random Forest and XGBoost,” Computation, vol. 13, no. 5, 2025, doi: https://doi.org/10.3390/computation13050127.

[30] S. Widodo, H. Brawijaya, U. Bina, S. Informatika, and U. N. Mandiri, “Stratified K-fold cross validation optimation on machine learning for prediction,” SinkrOn, vol. 6, no. 4, pp. 2407–2414, 2022, doi: https://doi.org/10.33395/sinkron.v7i4.11792.

[31] K. A. Zweig, Big Data, Data Mining, and Machine Learning Value Creation for Business Leaders and Practition. 2022. doi: https://doi.org/10.7551/mitpress/13915.003.0010.

[32] M. A. Saleem et al., “Enhancing stroke risk prediction through class balancing and data augmentation with CBDA-,” pp. 1–19, 2025, doi: https://doi.org/10.1038/s41598-025-07350-6.

Downloads

Published

2026-10-13

Issue

Section

Computer Science Applications

How to Cite

Mulyani, A., Fernando, E., Kurniadi, D., & Fauziyah, A. J. (2026). Lightweight Facial Feature-Based Drowsiness Detection Using Haar Cascade, EAR, MAR, and KNN. Jurnal RESTI (Rekayasa Sistem Dan Teknologi Informasi), 10(5), 1435-1446. https://doi.org/10.29207/resti.v10i5.7190