An open API service indexing awesome lists of open source software.

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.

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

![Dashboard Preview](./open_eyes.png)
![Dashboard Preview](./closed_eyes.png)

---

## πŸ”„ 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/)