https://github.com/dhanushi2620/real-time-drowsiness-detection
A real-time driver drowsiness detection system using Convolutional Neural Networks (CNN) and OpenCV. It detects eye closure and triggers an alarm if eyes remain closed for 10 seconds, helping to prevent accidents caused by fatigue.
https://github.com/dhanushi2620/real-time-drowsiness-detection
cnn deep-learning drowsiness-detection image-classification machine-learning opencv python real-time
Last synced: 2 months ago
JSON representation
A real-time driver drowsiness detection system using Convolutional Neural Networks (CNN) and OpenCV. It detects eye closure and triggers an alarm if eyes remain closed for 10 seconds, helping to prevent accidents caused by fatigue.
- Host: GitHub
- URL: https://github.com/dhanushi2620/real-time-drowsiness-detection
- Owner: Dhanushi2620
- Created: 2025-05-15T16:26:37.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-15T17:16:18.000Z (about 1 year ago)
- Last Synced: 2025-08-30T06:41:55.505Z (10 months ago)
- Topics: cnn, deep-learning, drowsiness-detection, image-classification, machine-learning, opencv, python, real-time
- Language: Jupyter Notebook
- Homepage:
- Size: 3.87 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π΄ Real-Time Drowsiness Detection using CNN
This project uses **Convolutional Neural Networks (CNN)** and **OpenCV** to monitor a driverβs eyes in real-time and trigger an alert if drowsiness is detected. If the eyes remain closed for 10 seconds continuously, a **beep alarm** sounds to wake the driver and prevent potential accidents.
---
## π Project Objective
The main objective is to build an intelligent real-time system that:
- Monitors eye state (open or closed) using a webcam.
- Uses a trained CNN model for eye classification.
- Triggers an audio alarm if the driver's eyes are closed for more than 10 seconds.
---
## π Features
- ποΈ Real-time eye state detection (open/closed)
- π§ CNN-based classification model
- β±οΈ 10-second threshold-based alert system
- π Beep alarm sound for drowsiness alert
- π₯οΈ Works with webcam for live monitoring
---
## π οΈ Tech Stack
- Python π
- OpenCV π·
- TensorFlow / Keras (for CNN) π§
- Google Colab (development environment) π»
- NumPy
---
## π§ Model Overview
- **Model Type:** Convolutional Neural Network (CNN)
- **Input:** Eye region images (grayscale)
- **Output:** Binary classification β Open (0) or Closed (1)
- **Training Data:** Eye state dataset (custom or open dataset like `mrlEyeDataset`)
- **Performance:** High accuracy on test set with real-time inference
---
## πΌοΈ Demo
### ποΈ Eye States


---
## π How It Works
1. Webcam captures real-time video.
2. Face and eyes are detected using OpenCV.
3. Each eye image is fed into the trained CNN.
4. If both eyes are closed:
- A timer starts.
- If closed for β₯10 seconds β Alarm sounds.
- If eyes open β Timer resets.
---
## π¦ Installation
You can run this project on Google Colab or locally:
### βΆοΈ On Google Colab:
- Upload the notebook and required files.
- Run all cells.
---
π Results
- Model Accuracy: 92%
- Drowsiness Detection Delay: <1s real-time
- Use Case: Vehicle driver alertness monitoring
---
πββοΈ Author
- Dhanushi
- B.Tech CSE | ML Enthusiast | [LinkedIn](https://www.linkedin.com/in/dhanushi-gupta-b3b397215/)