SARATHI
Unified Attention Monitoring for Transportation
Created on 21st June 2025
โข
SARATHI
Unified Attention Monitoring for Transportation
The problem SARATHI solves
๐ง The Problem It Solves
Weโve all been there โ driving late at night, eyes heavy, mind drifting. Or sitting in a long meeting, struggling to stay focused. Now imagine that same fatigueโฆ behind the wheel of a truck, or in the cockpit of a plane.
Fatigue is silent. It doesnโt knock before it takes control โ and sometimes, it takes lives.
Every year, thousands of road and aviation accidents happen simply because a driver or pilot was:
- ๐ด Tired
- ๐ต Distracted
- ๐ Or just not paying attention for a few seconds
And most vehicles still donโt have real-time, intelligent fatigue monitoring โ especially in low-cost environments.
โ What SARATHI Does
SARATHI acts like a digital co-pilot โ quietly watching, gently alerting, and always protecting.
Using just a regular webcam, SARATHI:
- ๐๏ธ Tracks eye movement and blinking patterns
- ๐ง Monitors head orientation
- ๐ง Detects unsafe posture from the side
If it senses the user is losing attention, it:
- ๐ Triggers a real-time audio + visual alert
- ๐ผ๏ธ Captures a screenshot of the alert moment
- ๐ Updates a live attention status dashboard
All in real-time โ no special hardware needed.
๐ Who Can Use SARATHI
- ๐ Long-distance or night-time drivers
- ๐ Fleet operators and public transport managers
- โ๏ธ Aviation pilots and co-pilots
- ๐ Emergency drivers (ambulance, fire)
- ๐งช Behavioral researchers studying attention
SARATHI doesnโt judge. It just watches over you โ like a caring co-pilot.
Because one moment of awarenessโฆ can save a lifetime.
Challenges we ran into
๐งโโ๏ธ Challenges I Ran Into
Building SARATHI in just 36 hours came with real engineering and design hurdles:
๐ Real-time Performance without GPU
We had to process live video frames using MediaPipe + OpenCV + Streamlit on a standard laptop without GPU support.
Balancing multiple models while maintaining real-time FPS was difficult. We solved this by:
- Optimizing frame logic and draw operations
- Tuning MediaPipe's confidence thresholds
- Minimizing I/O operations and memory usage
๐ง Accuracy vs False Alarms
Setting the right thresholds for eye closure (EAR), head tilt, and posture slouch was tricky. Too strict โ false positives. Too lenient โ unsafe.
We used:
- Temporal smoothing
- Manual testing on different faces & postures
- Frame-by-frame visual overlays to debug subtle changes
๐ Streamlit + OpenCV Syncing
Streamlit sometimes froze or lagged when handling:
- Frame updates
- Screenshot saving
- Alarm playback
We solved it by:
- Running logic inside a clean
main()control loop - Separating UI updates from processing logic
- Caching static assets
๐ฅ Side Posture Monitoring with a Single Cam
Unlike multi-cam systems, we had to extract side-body posture using only a single side-facing webcam. MediaPipe Pose had limitations depending on the userโs body angle.
We overcame this by:
- Relying on shoulder + hip landmarks
- Testing with varied upper-body positions
- Using threshold-based slouch detection
๐ Consistent Audio Alerts
Pygame audio alerts sometimes looped or lagged due to thread clashes. We wrote a minimal alert manager to:
- Prevent duplicate audio triggers
- Smooth playback using conditionals
- Stop the alarm when posture normalized
๐ช What Worked
- Careful performance profiling
- Testing with multiple body types and face positions
- Keeping the code modular, debug-friendly, and clean
These challenges made SARATHI stronger โ and more ready for the real world.
