Skip to content

Repository files navigation

WakeGuard - AI Driver Drowsiness Detection System

An AI-powered driver drowsiness detection system that uses Computer Vision and Convolutional Neural Networks (CNNs) to monitor driver fatigue in real time by analyzing eye closure and yawning patterns.

Overview

WakeGuard is a real-time driver monitoring system developed to improve road safety by detecting signs of driver fatigue before accidents occur. The system processes live webcam footage, detects facial features, classifies eye and mouth states using trained CNN models, and issues alerts when drowsiness is detected.

Unlike hardware-intensive solutions, WakeGuard runs entirely on commodity hardware using open-source technologies, making it affordable and accessible.


Features

  • Real-time webcam monitoring
  • Eye state detection using CNN
  • Mouth/yawn detection using CNN
  • Drowsiness classification using:
    • Eye closure
    • Yawn frequency
    • PERCLOS (Percentage of Eye Closure)
  • Live status display (ALERT / DROWSY)
  • Audio warning system
  • Modular and extensible architecture

Tech Stack

  • Python
  • TensorFlow / Keras
  • OpenCV
  • NumPy
  • Haar Cascade Classifiers

Project Structure

WakeGuard/
│
├── models/
│   ├── eye_model.h5
│   ├── mouth_model.h5
│   └── wakeguard_cnn.h5
│
├── eye_model_train.py
├── mouth_model.py
├── frame_extractor.py
├── train.py
├── test.py
├── requirements.txt
└── README.md

Dataset

The training dataset used for this project is not included in this repository.

This is intentional because the dataset exceeds GitHub's repository size recommendations and storage limits.

If you wish to retrain the models:

  1. Download a suitable driver drowsiness dataset.
  2. Create a folder named:
dataset/
  1. Place the training images inside this folder.
  2. Run:
python train.py

The provided trained models can still be used for inference without retraining.


Installation

Clone the repository:

git clone https://github.com/<your-username>/WakeGuard.git

Install dependencies:

pip install -r requirements.txt

Running the Project

Run the detection script:

python test.py

The application will:

  • Open the webcam
  • Detect facial features
  • Monitor eye closure and yawning
  • Display the driver's status
  • Trigger an alert when drowsiness is detected

Models

The repository includes pretrained CNN models:

  • Eye Detection Model
  • Mouth/Yawn Detection Model
  • WakeGuard CNN Model

These allow the project to run immediately without requiring model training.


Methodology

The system follows the pipeline below:

  1. Capture live webcam frames
  2. Detect driver's face
  3. Extract eye and mouth regions
  4. Perform CNN inference
  5. Calculate drowsiness metrics
  6. Determine driver state
  7. Trigger warning if necessary

Results

The project successfully demonstrates:

  • Real-time facial monitoring
  • Accurate eye-state classification
  • Reliable yawn detection
  • Low-latency inference
  • Stable CPU-based execution

Current Limitations

  • Dataset not included due to GitHub storage limitations.
  • Performance decreases under poor lighting conditions.
  • Optimized primarily for frontal face orientation.
  • Designed for research and educational purposes.

Future Improvements

  • Low-light / infrared camera support
  • Improved head pose estimation
  • Mobile and embedded deployment
  • ADAS integration
  • Enhanced GUI
  • LLM-generated driver feedback
  • Multi-driver support

Repository Contents

Included:

  • Source code
  • Trained CNN models
  • Requirements file
  • Documentation

Not Included:

  • Training dataset
  • Virtual environment
  • Generated cache files

Author

Kevin Koruthu George

B.Tech Computer Science with Data Science

Vellore Institute of Technology


License

This project is intended for educational and research purposes.

About

AI-powered driver drowsiness detection system using Computer Vision, OpenCV and CNNs.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages