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.
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.
- 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
- Python
- TensorFlow / Keras
- OpenCV
- NumPy
- Haar Cascade Classifiers
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
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:
- Download a suitable driver drowsiness dataset.
- Create a folder named:
dataset/
- Place the training images inside this folder.
- Run:
python train.pyThe provided trained models can still be used for inference without retraining.
Clone the repository:
git clone https://github.com/<your-username>/WakeGuard.gitInstall dependencies:
pip install -r requirements.txtRun the detection script:
python test.pyThe 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
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.
The system follows the pipeline below:
- Capture live webcam frames
- Detect driver's face
- Extract eye and mouth regions
- Perform CNN inference
- Calculate drowsiness metrics
- Determine driver state
- Trigger warning if necessary
The project successfully demonstrates:
- Real-time facial monitoring
- Accurate eye-state classification
- Reliable yawn detection
- Low-latency inference
- Stable CPU-based execution
- 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.
- Low-light / infrared camera support
- Improved head pose estimation
- Mobile and embedded deployment
- ADAS integration
- Enhanced GUI
- LLM-generated driver feedback
- Multi-driver support
Included:
- Source code
- Trained CNN models
- Requirements file
- Documentation
Not Included:
- Training dataset
- Virtual environment
- Generated cache files
Kevin Koruthu George
B.Tech Computer Science with Data Science
Vellore Institute of Technology
This project is intended for educational and research purposes.