mldata-scienceFeatured

    NextBus: Real-Time NYC Bus Arrival Time Prediction

    Accurate, scalable bus ETA forecasting using spatio-temporal deep learning

    NextBus: Real-Time NYC Bus Arrival Time Prediction

    Project Overview

    // The Problem

    Accurate bus arrival time prediction is challenging due to complex spatio-temporal dependencies, traffic congestion, irregular schedules, and large-scale streaming data. Traditional rule-based and statistical approaches struggle to capture non-linear interactions between routes, stops, and time-varying traffic conditions.

    // The Solution

    We developed NextBus, a real-time prediction framework that ingests live NYC MTA bus data and models both spatial and temporal dependencies using a Transformer-based spatio-temporal forecasting architecture. The system supports downstream stop forecasting and provides user-facing ETA predictions through a scalable web application.

    // The Impact

    NextBus improves ETA accuracy and user experience by reducing uncertainty in public transit planning. The project demonstrates how modern spatio-temporal deep learning models can be deployed end-to-end, from real-time data ingestion to user-facing prediction services, at city scale.

    architecture.md

    End-to-end real-time spatio-temporal forecasting system integrating live data ingestion, Transformer-based prediction models, and a web-based user interface.

    Data Cleaning, Feature Engineering & Sampling
    Spatio-Temporal Transformer Model (Spacetimeformer)
    FastAPI Prediction Service
    Firebase Firestore for State Management
    React-Based Frontend for ETA Visualization

    Tech Stack

    PythonPyTorchReact.jsFastAPIFirebase FirestoreSpatio-Temporal TransformersTime Series Forecasting

    Key Features

    • Real-time bus arrival time prediction for selected NYC routes and stops
    • Downstream stop forecasting along bus trajectories
    • Spatio-temporal modeling of bus movements and traffic patterns
    • Scalable backend with real-time data ingestion
    • User-friendly web interface for instant ETA queries

    Quick Info

    Categoryml, data-science
    Technologies7
    Features5