HAAR CASCADE ALGORITHM FOR MICROSLEEP DETECTION

Norkhushaini Awang1* and Ahmad Mirza Azhar2


1*2Faculty of Computer & Mathematical Sciences,
Universiti Teknologi MARA, 40450 Shah Alam Selangor,
Malaysia

1*This email address is being protected from spambots. You need JavaScript enabled to view it., 2This email address is being protected from spambots. You need JavaScript enabled to view it.



ABSTRACT

 

Drowsy driving, particularly due to microsleep episodes, is a significant cause of traffic accidents, with existing solutions being often too costly or limited for widespread adoption. This project addresses this critical gap by developing a cost-effective, real-time Internet of Things (IoT)-based anti-microsleep alarm system. The system's development followed a fourstage process: Planning, Design, Development, and Evaluation. During the development phase, the system was built in Python using OpenCV and dlib for real-time facial analysis and the Haar Cascade algorithm for efficient facial feature detection. Key metrics like the Eye Aspect Ratio (EAR) and lip distance were monitored to identify signs of drowsiness and yawning. A comprehensive feedback loop was implemented using MQTT for communication between the Python backend and a Node-RED dashboard, with eSpeak and the Slack API providing aural and textual alerts. A finding from the evaluation, however, was a sensitivity to environmental factors as the distance between the driver and the camera increased, the system's accuracy in detecting drowsiness, yawning, and microsleep declined, leading to an increased risk of false negatives. Based on these results, future research should focus on enhancing the core algorithm to be more resilient to variable lighting and distance, thereby reducing false positives and negatives. Further work is also recommended to explore the system's integration with vehicle-specific infrastructure, develop more scalable data storage solutions, and conduct extensive long-term testing to validate its performance in diverse realworld driving conditions, which will pave the way for its commercial viability and broader adoption.

 


Keywords: Driver Safety, Haar Cascade Algorithm, Internet of Things (IoT), Microsleep Detection, Node-RED, Real-time Monitoring

 

Published On: 1 October 2025

 

Full Download