-
-
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.
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.
AI Model Used in SafeRide
SafeRide uses a free-tier computer vision model to analyze road images and detect signs of danger for two-wheeler riders. The model looks at the uploaded photo and identifies objects such as cars, buses, motorcycles, pedestrians, and traffic density, then helps estimate how risky the scene is for the rider.
Why this model
We chose this AI approach because SafeRide needed something that was:
- Fast
- Low cost
- Good enough for real-world road safety scenarios
Instead of building a complex custom model from scratch, we used an existing vision model through a free API. This let us focus on the product experience, risk scoring, and road safety impact.
What the model does
When a user uploads a road image, the model:
- Analyzes the scene visually.
- Detects vehicles and road conditions.
- Helps determine whether the scene is low, medium, or high risk.
- Returns a short result that SafeRide converts into a clear rider alert.
How SafeRide uses the output
SafeRide does not just show raw AI output. It converts the result into:
- A risk score from 0 to 100
- A color-coded alert:
- Green = low risk
- Orange = medium risk
- Red = high risk
- A short safety message like:
- “Safe to ride”
- “Slow down, low visibility detected”
- “High risk, vehicle close on the left”
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
Log in or sign up for Devpost to join the conversation.