Haar cascade algorithm for microsleep detection - Awang, Norkhushaini; Azhar, Ahmad Mirza (Universiti Teknologi MARA, 2025)
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 real-world driving conditions, which will pave the way for its commercial viability and broader adoption.