# Driver Drowsiness Detection using Computer Vision & ML
> Learn how to build a real-time driver drowsiness detection system using Mediapipe, Eye Aspect Ratio (EAR), and Python for improved road safety.

Tags: computer-vision, machine-learning, python, mediapipe, opencv, road-safety, ai-project
## Driver Drowsiness Detection Overview
* **Problem:** Drowsy driving causes ~20% of fatal accidents globally.
* **Technology:** Uses Mediapipe Face Mesh, OpenCV, and Python to monitor internal driver states.
* **Performance:** Achieves 91% accuracy at 20-30 FPS on standard CPUs.

## Core Methodology: Eye Aspect Ratio (EAR)
* EAR measures eye openness using 6 facial landmark points.
* **Threshold:** A value < 0.21 indicates a closed eye.
* **Temporal Analysis:** If EAR remains below the threshold for > 30 consecutive frames, a 'Drowsy' state is triggered.

## System Architecture
* **Input:** Real-time webcam video stream.
* **Processing:** Facial landmark localization (468 points) via Mediapipe.
* **Classification:** Rule-based ML binary classifier (Alert vs. Drowsy).
* **Alert:** Immediate audio notification via Pygame when fatigue is detected.

## Experimental Results
* **Drowsiness State:** Threshold < 0.16 for 32+ frames triggers the alarm.
* **Blink Detection:** Correctly identifies short eye closures (3 frames) to prevent false positives.
* **Hardware:** Runs efficiently on standard CPU without dedicated GPU requirements.
---
This presentation was created with [Bobr AI](https://bobr.ai) — an AI presentation generator.