About Drowsiness Alarm
A free, browser-based service that detects eye closure in real time and alerts you before fatigue causes harm.
Why We Built This
Drowsiness while working, studying, or driving is a serious safety risk — yet most people don't realize they're falling asleep until it's too late. Existing drowsiness detection hardware is expensive and requires installation. We built Drowsiness Alarm to give everyone free, instant access to reliable fatigue detection using just the webcam already in their computer.
All processing happens in the browser. Your camera footage never leaves your device, making the service both safe and instantly usable.
The Risks of Drowsiness
How the Technology Works
Google MediaPipe Face Mesh
MediaPipe Face Mesh is a lightweight machine learning pipeline that detects 468 facial landmarks in real time. It runs as WebAssembly directly in your browser, delivering near-native performance with no server round-trip. The model was trained on millions of diverse faces for robust detection across lighting conditions and appearances.
EAR — Eye Aspect Ratio
EAR measures the ratio of eyelid opening height to eye width using specific MediaPipe landmark points. When eyes are open, EAR is typically 0.25–0.40. When closed, it drops below 0.15. By sampling EAR 20+ times per second and comparing it to your personal threshold, the app distinguishes natural blinks (under 200 ms) from sustained closure caused by drowsiness.
Processing Pipeline
- Webcam frame captured (640×480 px, hidden video element)
- MediaPipe Face Mesh extracts 468 landmark coordinates
- EAR computed from 8 specific eyelid landmarks per eye
- Both eyes averaged; result compared to user threshold
- If EAR < threshold continuously for ≥ set seconds → alarm triggered
- Frame discarded — nothing is stored or transmitted
Drowsiness Prevention Tips
Adults need 7–9 hours of sleep per night. Consistent sleep debt compounds and severely impairs cognitive performance.
Bright light suppresses melatonin and keeps you alert. Work near a window or use a full-spectrum desk lamp.
Short movement breaks every 25–50 minutes improve blood circulation and sustained attention. Try the Pomodoro technique.
Even mild dehydration impairs alertness. Drink water regularly throughout the day.
Caffeine is most effective when timed to your alertness dips (typically early afternoon). Avoid it within 6 hours of bedtime.
Who Is This For?
Stay sharp during long video calls or screen work sessions
Stay awake during late-night study sessions and online lectures
Monitor fatigue during overnight shifts at a computer
Study drowsiness patterns and EAR-based fatigue detection