Reliable bus arrival time predictions are central to Advanced Traveler Information Systems, helping passengers plan journeys and allowing transit agencies to manage resources and adjust schedules in real time. Most existing approaches, from historical averages and ARIMA to LSTM, ConvLSTM and XGBoost models, treat each route in isolation, overlooking the interconnectedness of routes that share bus stops and the influence of external factors on travel times.
This project represents the urban bus network as a graph in which bus stops are nodes and road segments between neighbouring stops are edges. Raw GPS trajectories are mapped to stops, missing stop times are imputed, abnormal trips are removed, and node features (bus line, hour of day, speed, whether the bus is at a stop or a shared stop, distance to the next stop) and edge features (distance and route multiplicity) are derived. Sequences of 12 consecutive graph snapshots are passed through GraphSAGE layers, selected after comparing several graph embedding methods, to learn spatially aware stop embeddings. A Gated Recurrent Unit then models temporal dependencies across the snapshots, and a fully connected layer predicts the travel time to the next stop, from which arrival times are derived. The model is evaluated on real-world transit data from New York City (MTA), Rio de Janeiro, Kuala Lumpur (RapidKL) and Kandy, Sri Lanka.
On single-route experiments, the proposed GNN+GRU model achieved the lowest errors on all three benchmark datasets, with an MAE of 20.82 s on NYC MTA (versus 60.60 s for ConvLSTM+XGBoost, 142.20 s for ConvLSTM and 142.80 s for a pure LSTM), 27.23 s on RapidKL (versus 67.80 s, 130.20 s and 116.40 s), and 2.30 s on Kandy (versus 108.60 s, 226.20 s and 157.20 s). Corresponding MSE values fell from 6,444 to 835.31 on NYC MTA and from 7,848 to 1,959.84 on RapidKL relative to the strongest baseline, ConvLSTM+XGBoost. Extending the model to multi-route settings improved accuracy further, with MAE of 1.60 s on Rio de Janeiro, 2.17 s on RapidKL and 6.08 s on NYC MTA (RMSE 3.50 s, 19.92 s and 13.37 s). Among graph embedding methods, GraphSAGE (MAE 1.60 s) outperformed GCN (2.00 s), message passing (6.47 s) and random features (8.10 s). An input-feature ablation study showed that GNN+GRU consistently outperformed GNN+LSTM, that normalisation and extracted features gave substantial gains, and that adding further collected data did not improve accuracy.
Graph-Based Arrival Time Model
A hybrid architecture that combines GraphSAGE spatial embeddings over bus-stop graphs with GRU-based temporal modelling, capturing dependencies between stops shared by multiple routes.
Multi-City Benchmark
A comprehensive comparison against LSTM, ConvLSTM and ConvLSTM+XGBoost baselines on real-world data from New York City, Rio de Janeiro, Kuala Lumpur and Kandy, together with graph embedding and input-feature ablation studies.
Real-Time Prediction Platform
An event-driven deployment and web application, BAT Transformers, that provides next-stop arrival predictions on an interactive map and origin-destination travel time estimates for every stop along a chosen route.
By demonstrating that models with spatial graph learning consistently outperform purely sequential approaches, the project underscores the importance of road network structure in bus arrival time forecasting and points to graph-based models as a promising direction for intelligent transportation systems. The deployed platform shows how accurate predictions can reduce waiting times, improve journey planning for commuters, and support more efficient public transport operations. A paper describing the work was submitted to the Moratuwa Engineering Research Conference (MERCon 2025).
Project poster presented at the Final Year Project Showcase 2025
High-level architecture: GraphSAGE spatial embeddings feeding a GRU for bus arrival time prediction
BAT Transformers web application for origin-destination travel time prediction
Pavan Pasindu Malshan
Undergraduate Researcher
Led the development and evaluation of the proposed GNN+GRU model for multi-route bus arrival time forecasting.
Bhashitha Viduranga
Undergraduate Researcher
Focused on training the deep learning models used to benchmark and refine bus arrival time prediction.
Sachini Ama
Undergraduate Researcher
Focused on training and evaluating existing baseline models such as LSTM, ConvLSTM and ConvLSTM+XGBoost.