Python 3 (ipykernel)
Driver Drowsiness Monitor
Built at Western AIA real-time driver monitor that runs on a webcam and a laptop, flagging drowsiness and distraction. Built by a five-person team and presented at CUCAI 2026. I built the camera and facial-landmark pipeline.
- Python
- OpenCV
- MediaPipe Face Mesh
- YOLOv8
- NumPy
In [1]:
team.summary()Out[1]:
- team
- Western AI
- members
- Arik Singh Dhaliwal, Satvik Garimella, Anthony Liao, Abel Alexander, Nathan Feng
- presented
- CUCAI 2026
- my_role
- camera + facial landmark pipeline
- speed
- ~24 FPS
How it works
- Drowsiness: MediaPipe eye landmarks give the Eye Aspect Ratio (EAR). A closure over 1.5 s triggers the alert.
- Distraction: a YOLOv8n-cls classifier trained on StateFarm images, smoothed over a 10-frame window.
- Fusion: both combine into one risk level: OK, MONITOR, WARNING or CRITICAL.
My part
The camera, landmark detector and main loop, plus hardening the eye signal: two thresholds so it doesn't flicker, EMA smoothing, and resets when the face is lost.
In action


Results
- 24 FPS in real time, and prolonged eye closure reliably escalated to CRITICAL.
- Distraction was harder: 97% accuracy but only 35% precision and 30% recall, due to class imbalance and the gap between dataset images and a live webcam.
- The 10-frame window and fusion still gave steadier warnings than either signal alone.
In [2]:
distraction_model.plot_metrics()Out[2]:
Accuracy hides the problem: distracted frames are rare, so the model is right 97% of the time while catching only 30% of them.