Advanced AI Safety Technology

How Driver Safety AI Works

Learn about the technology, algorithms, and safety measures behind our drowsiness detection system

Technologies Used
Built with modern web technologies and AI frameworks

MediaPipe Face Mesh

Google's state-of-the-art ML solution for detecting 468 facial landmarks in real-time

Next.js 16 & React 19

Modern React framework with server-side rendering and optimal performance

Client-Side Processing

All ML computations run in your browser - no data is sent to servers

Real-Time Analysis

60 FPS processing with optimized algorithms for instant detection

Detection Methodology
Multi-factor analysis for accurate drowsiness detection

Eye Aspect Ratio (EAR)

Monitors eye openness and blink patterns

The system tracks 6 key landmarks around each eye to calculate the Eye Aspect Ratio. When eyes are open, EAR is high. During drowsiness, eyes partially close, causing EAR to drop below a threshold.

Threshold: EAR < 0.25 for 2+ seconds
Detects: Eye closure, micro-sleeps, reduced blink rate

Mouth Aspect Ratio (MAR)

Identifies yawning as a fatigue indicator

Yawning is a strong indicator of drowsiness. The system measures mouth opening by analyzing the vertical distance between lips relative to mouth width. Frequent yawns significantly increase risk score.

Threshold: MAR > 0.6 for sustained duration
Tracks: Yawn frequency, duration, and patterns

Head Pose Estimation

Detects nodding and loss of head control

Drowsy drivers often experience head nodding or drifting. The system analyzes the spatial relationship between nose, eyes, and facial center to estimate head angle and detect abnormal movements.

Threshold: Head angle deviation > 25 degrees
Detects: Forward/backward tilt, left/right lean
Risk Scoring Algorithm
How we calculate and categorize drowsiness levels

The risk score is calculated using a weighted combination of all detection factors. Each metric contributes to the overall score, which determines the alert level.

Scoring Formula

Eye Closure Score:min(time / 3 × 40, 40)
Yawn Score:min(count / 3 × 30, 30)
Head Angle Score:min(angle / 25 × 30, 30)
Total Risk Score:Sum of all scores (0-100)
Safe0-39% - Normal driving conditions, no intervention needed
Warning40-69% - Mild drowsiness detected, increased monitoring
Critical70-100% - High drowsiness risk, immediate alerts triggered
Frequently Asked Questions
Common questions about the drowsiness detection system