Smart Pune Bus ETA Prediction System

Completed

Technologies Used:

Machine LearningPythonData AnalysisFastAPILeaflet.jsOpenStreetMap
Smart Pune Bus ETA Prediction System
ML-Based Smart Public Transportation Solution

πŸ”Ή Project Overview
ML-Based Smart Public Transportation Solution

πŸ”Ή Project Overview

The Smart Pune Bus ETA Prediction System is a full-stack, machine learning–based web application designed to predict accurate bus arrival times and improve passenger experience in public transportation systems. The project focuses on providing real-time insights such as ETA, route visualization, nearest bus stop, next available bus, and crowd level estimation without relying on GPS hardware, making it highly cost-effective for tier-2 cities.

The system combines machine learning, geospatial mapping, and modern web technologies to deliver a smart, scalable, and user-friendly public transport solution.

πŸ”Ή Problem Statement

Public bus passengers often face uncertainty due to:

Inaccurate or unavailable bus arrival timings

Lack of real-time route visualization

No information about missed buses or next available buses

Overcrowded buses during peak hours

High cost of GPS-based tracking systems for transport authorities

This project addresses these issues by using data-driven ETA prediction and open-source mapping tools.

πŸ”Ή Solution Provided

The system predicts bus arrival times using a machine learning regression model trained on historical route data, distance between stops, and time-based features. It provides passengers with:

Accurate ETA predictions

Interactive route visualization

Live bus position simulation (without GPS)

Nearest bus stop detection

Next available bus information

Crowd level estimation

Daily bus timetable

πŸ”Ή Key Features
🚍 ETA Prediction (Machine Learning)

Predicts Estimated Time of Arrival using ML

Considers route, distance, time of day, and peak hours

πŸ—ΊοΈ Route Visualization

Displays real road-based routes using Leaflet + OpenStreetMap

Uses OSRM for realistic road routing

πŸ”΅ Live Bus Tracking (Simulated)

Simulates real-time bus movement without GPS hardware

Updates bus position dynamically based on ETA progress

πŸ“ Nearest Bus Stop Finder

Uses browser geolocation

Calculates nearest stop using the Haversine formula

πŸ•’ Next Available Bus

Shows upcoming buses if the passenger misses a bus

Displays following buses for better planning

🚢 Crowd Level Prediction

Estimates crowd levels (Low / Medium / High)

Based on time-of-day and peak-hour logic

πŸ“… Bus Timetable

Displays daily bus schedules

Helps passengers plan journeys efficiently

πŸ”Ή Technologies Used
Frontend

HTML5

CSS3

JavaScript (Vanilla)

Backend

Python

FastAPI

Uvicorn

REST APIs

Machine Learning

Pandas

Scikit-learn / XGBoost (Regression model)

Joblib (Model serialization)

Mapping & Geospatial

Leaflet.js

OpenStreetMap

OSRM (Open Source Routing Machine)

Browser Geolocation API

Data

CSV datasets for routes and stops

πŸ”Ή System Architecture

User selects route, source, and destination (Frontend)

Request sent to FastAPI backend

ML model predicts ETA

Backend returns ETA, distance, and metadata

Frontend visualizes route and live bus movement

Additional APIs provide next bus, crowd level, and timetable

πŸ”Ή Project Structure
BusTracker/
β”‚
β”œβ”€β”€ backend/
β”‚   └── app.py
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ timetable.html
β”‚   β”œβ”€β”€ style.css
β”‚   └── script.js
β”‚
β”œβ”€β”€ ml/
β”‚   β”œβ”€β”€ train_model.py
β”‚   β”œβ”€β”€ eta_model.pkl
β”‚   └── dataset/
β”‚       └── pune_routes.csv
β”‚
└── requirements.txt

πŸ”Ή Key Skills Demonstrated

Full-stack web development

REST API design

Machine learning model development

Data preprocessing and feature engineering

Geospatial mapping and routing

Real-time simulation logic

Problem solving and system design

πŸ”Ή Impact & Benefits

Improves passenger convenience and planning

Reduces dependency on expensive GPS hardware

Scalable for other tier-2 cities

Cost-effective solution for public transport authorities

Demonstrates real-world ML and smart-city application

πŸ”Ή Future Enhancements

Integration with real GPS data

Mobile application (Android / iOS)

Real-time traffic data integration

Passenger feedback and rating system

Admin dashboard with analytics

Multi-city and multi-route support

πŸ”Ή Portfolio / Resume One-Line Summary

Developed an ML-based smart bus ETA prediction system with real-time route visualization, live bus simulation, and passenger-centric features using FastAPI, JavaScript, and open-source mapping tools.