SahYatri

SahYatri

AI-powered Bus Occupancy Monitoring and Public Transport Optimization

Created on 19th April 2025

β€’

SahYatri

SahYatri

AI-powered Bus Occupancy Monitoring and Public Transport Optimization

The problem SahYatri solves

The Problem it Solves

India's public transport system, especially its bus network, faces major challenges with unpredictable occupancy levels. Commuters are often unaware if a bus is overcrowded or has available seats, leading to delays, discomfort, missed buses, and even safety hazards due to overloading.

SahYatri addresses this issue through an affordable, AI-powered solution built using Raspberry Pi, a camera module, and a YOLO-based object detection model. It detects real-time seat occupancy inside buses by analyzing live video frames.

The data is then sent to a central server, where it is:

  • Visualized on a public-facing web dashboard and mobile app so commuters can plan their journey more efficiently.
  • Made available to transport authorities through a secure admin panel, providing:
    • βœ… Access to real-time webcam streams from each bus
    • πŸ“Š Live occupancy percentages
    • πŸ“ˆ Historical data analytics (e.g. peak hours, route congestion)
    • πŸ—ΊοΈ Route-wise occupancy heatmaps and underused bus analytics
    • 🚨 Early warnings for overcrowded buses (potential safety risks)

By giving passengers better visibility into current bus loads, and governments powerful analytics and control, SahYatri:

  • Reduces overcrowding and waiting time
  • Increases fleet efficiency by enabling dynamic rerouting
  • Helps in data-driven urban planning for public transport

🌍 Impact & Sustainability

SahYatri is an affordable, modular, and scalable solution that contributes to:

  • SDG 11: Makes public transport safer and more efficient (reducing overcrowding)
  • SDG 3: Helps prevent disease spread in public transport
  • SDG 9: Implements AI+IoT for smart mobility solutions
  • SDG 13: Encourages public transport use, reducing emissions

Challenges we ran into

⚠ Challenges We Ran Into

πŸ”’ 1. Ensuring Passenger Privacy

Since we capture frames inside public buses, protecting passenger identity was a top priority.
βœ… Solution: Raspberry Pi deletes each image right after uploading it to the detection server. No images are stored locally, ensuring full compliance with privacy concerns.

⚑ 2. Real-Time Detection Optimization

Running YOLOv5n or YOLOv4-tiny directly on the Raspberry Pi was too resource-heavy and caused delays.
βœ… Solution: Offloaded all AI processing to a cloud server. The Pi now only sends frames; the server returns real-time occupancy percentages.

πŸ”„ 3. Seamless System Synchronization

Keeping the occupancy data in sync across the Pi, backend, mobile app, and dashboard in near real-time was a challenge.
βœ… Solution: Designed efficient REST APIs, used fast DB indexing, and built lightweight microservices for better scalability and low-latency updates.

🧠 4. Storing History and Mobile Sync

Allowing users and admins to view past occupancy trends without lag required a balance between performance and storage.
βœ… Solution: Integrated Neon DB with raw SQL queries and smart indexing to enable fast lookups and ~1-second delay for live updates.

πŸ“Ά 5. Location Without GPS

Our GPS module failed, but we still needed to display real-time bus location on the dashboard.
βœ… Solution: Used IP-based geolocation from the server and integrated Google Maps API to estimate and display approximate location on the map.

Discussion

Builders also viewed

See more projects on Devfolio