Abdullah Naeem

All work

Driver drowsiness detection

A system that watches a driver through an ordinary webcam and raises an alert when their eyes stay shut or the yawns start piling up. It runs on a laptop with no GPU, because that's what a real car would have.

What
Final-year project, Forman Christian College
When
2026
Built with
Python, PyTorch, TensorFlow, OpenCV, MediaPipe, MobileNetV2, FastAPI
Code
GitHub repository with setup instructions

The problem

Fatigue is behind a large share of road crashes, and most cars on the road have no driver monitoring at all. The system had to be cheap (one webcam), non-intrusive (nothing worn), and quiet: a monitor that alarms every time someone blinks or talks gets switched off.

Data

Frames are downsampled to 320×240 before inference to keep the pipeline fast on a CPU.

Architecture

  1. Face landmarksMediaPipe extracts 468 facial landmarks per frame, giving the eye and mouth aspect ratios (EAR, MAR).
  2. Two CNN classifiersSeparate MobileNetV2 models for eye state and yawning, each fine-tuned in two phases of transfer learning.
  3. Double-lock checkThe CNN's prediction must agree with the geometric EAR/MAR measurement before it counts.
  4. Temporal decisionA 60-frame smoothing window ignores single-frame blips. Eyes closed for 7 seconds raises a critical alert; 2 or more yawns within 2 minutes raises a fatigue alert.

A FastAPI backend streams the driver's state over WebSockets to a live dashboard, and a confirmed alert emails a supervisor automatically.

Results

Accuracy and speed against targets
MeasureTargetAchieved
Eye-state accuracy, MRL test set96%99%
Yawn accuracy, YawDD90%96%
Frame rate on CPU–40+ FPS
End-to-end latency–under 50 ms

Grad-CAM heatmaps confirmed the models look at the eyes and mouth, not at background or lighting cues that happen to correlate with the labels.

Where it breaks

Next case study: PsychConnect telepsychology platform