-
-
user interface
-
heavy traffic road risk assessment
-
send alert to emergency contacts
-
clear road risk assessment
-
statistics - helps riders see how often they encounter high-risk situations, data could help city planners identify dangerous roads
-
history - users can review dangerous stretches over time and understand their own patterns.
PROJECT TECHNICAL REPORT: https://docs.google.com/document/d/1vUUbXoglPQH5qWdgX8uP9KsyLKn4hrWb/edit?usp=sharing&ouid=102015154029183078144&rtpof=true&sd=true
Inspiration
Riding scooters through Chengalpattu's narrow roads, I've seen close calls too many times cars merging from blind spots, dim streetlights hiding hazards. VisionCap (MIT Global AI Hackathon 2025 winner) inspired me: smart helmets detecting vehicles for cyclists. I wanted that same life-saving AI for India's 200M two-wheeler riders using just their phones, no hardware needed.
What it does
SafeRide analyzes road photos via browser camera/upload, uses free Hugging Face AI vision to detect:
- Vehicles approaching left/right ("CAR ON LEFT HIGH RISK!")
- Night/low-light conditions
- Heavy traffic density
Delivers color-coded alerts (red/orange/green), sound beeps, emergency mock-SMS, history tracking, stats dashboard. Tested on 50+ Indian road scenes: 85%+ accuracy spotting high-risk moments. SDG 3.6: Halve road deaths by 2030.
How we built it
Solo project:
Frontend: Nextjs + Tailwind
Backend: Node.js + Express
AI: Hugging Face Inference API (free tier)
Storage: localStorage
Flow: Photo → base64 → POST /analyze → Hugging Face vision model → parse JSON response → risk score → alert banner + history.
Challenges we ran into
- AI text parsing: Hugging Face returns free-text, not JSON. Fixed with regex + fallback logic.
- UI overflow: Red banners cut off long messages. Added scrollable containers.
- Rate limits: Free tier caps. Added loading spinners + retry logic.
- Indian traffic complexity: Mixed vehicles (autos, bikes, cows!). Trained prompt specifically for chaotic junctions.
Accomplishments that we're proud of
- Zero-cost stack: Built entirely on free APIs/tools.
- Real-world testing: Used actual Chengalpattu junction photos not stock images.
- Polish: History tab, stats dashboard, sound alerts, night mode toggle.
- 85% accuracy across 50 diverse road scenes.
- Demo-ready: Clean UI, test-image dropdown, emergency flow.
What we learned
- Model selection: Simple vision model + detailed cyclist-safety prompt = expert results.
- Regex parsing beats JSON parsing for unstructured AI responses.
- Local context wins: Tamil Nadu traffic patterns needed specific training examples.
- Hackathon MVP rule: Ship 1 perfect feature (risk alerts) > 5 half-baked ones.
What's next for SafeRide
- Real-time camera stream (WebRTC, 1fps analysis)
- Bluetooth earphone alerts for hands-free riding
- Tamil/Hindi voice alerts via Web Speech API
- Crash detection (phone accelerometer → auto-emergency)
- PWA install for offline use + push notifications
- Community map of high-risk junctions (crowdsourced)
SafeRide: Every second counts on Indian roads.
Built With
- axios-for-hugging-face-api-calls
- canvas-api
- css3
- filereader
- hugging-face-api
- localstorage
- multer-for-uploads
- nextjs
- regex
- responsive-mobile-first-design)-|-backend-(node.js-+-express.js-on-replit-with-/analyze-post-endpoint
- tailwind-css-with-camera-api
- vanilla-js
- web-audio-api
Log in or sign up for Devpost to join the conversation.