Predicting arrival time irregularities of transit buses in Toronto

City: Toronto, Canada
Organization: Faculty of Arts and Science, Trent University
Project Start Date: January 2018 (data collection)
Project End Date: September 2020 (paper published)
Reference: Alam, O., Kush, A., Emami, A. et al. Predicting irregularities in arrival times for transit buses with recurrent neural networks using GPS coordinates and weather data. J Ambient Intell Human Comput (2020). https://doi.org/10.1007/s12652-020-02507-9
Problem: Transit bus delays is a problem often faced by commuters. This study aims to model the transit bus arrival time irregularities at the stops along bus Route 8 and Route 28 of the Toronto Transit Commission (TTC). The study adopts Long Short-Term Memory (LSTM) model, which is a type of Recurrent Neural Network (RNN) model, for its prediction. The highlight of the study is the use of weather data to predict the arrival time irregularities along with other data such as historical bus arrival times, stop locations and bus schedules.
Technical Solution: Data preparation
  • The GPS data collected from TTC was used to extract feature such as bus direction, trip ID, bus stop sequence, distance travelled by a bus, stop ID and bus ID. Weather data was collected from a Toronto downtown weather station.
  • Using the historical data, bus arrival time irregularities (dependent variable) was calculated as the difference between actual arrival time and the scheduled arrival time at each bus stop.
  • The categorical variables are encoded using one-hot encoding and label encoding techniques.
Model training with LSTM
  • Using the 11 selected independent features and 1 dependent feature, LSTM model was built with 11 input neuron and 1 output neuron. The input to the LSTM model was a 3D matrix with sample size of 32, 4 time steps, and 12 features.
  • The model was recursively applied to find the features which did not increase the accuracy of the predictions. Stop ID and bus ID were removed, since they were not useful in improving the model performance.
  • The final tuned model revealed that LSTM model with 1 layer, 100 cells and a batch size of 32 was ideal.
LSTM model performance
  • The LSTM model prediction accuracy was compared with other models such as Artifcial Neural Network (ANN), Support Vector Regression (SVR), Autoregressive Integrated Moving Average (ARIMA) and historical averages. It was found that the model significantly outperformed other models in reducing the RMSE and MAPE error values.
  • The model was repeated without the weather data and the results showed that including the weather data reduced the model’s error by a range of 310% to 1.3% for varying data size.
RNN-LSTM hybrid model
  • Since the LSTM model’s prediction performance declined with higher volume of data, the weather data was separately modelled using RNN algorithm and combined with the LSTM model, which also included weather data along with other already mentioned features.
Hybrid model performance
  • The hybrid model’s performance improved by 562.38% along Route 8 and 873.85% along bus Route 28 when compared to the stand-alone LSTM model. The marginal decrease in model accuracy with increasing data volume was also significantly reduced in the hybrid model.
Datasets Used: The following data were collected for a period of 3 months (January 2018 to March 2018) along the two TTC bus routes, Route 8 and Route 28:
  • Dataset 1: Live Automatic Vehicle Locations (AVL) data of transit buses, collected every 20 seconds - 700,000 data points (Source: NextBus API)
  • Dataset 2: Bus schedules - 18,100 data points (Source: General Transit Feed Specification)
  • Dataset 3: Bus stop locations - 24 data points (Source: General Transit Feed Specification)
  • Dataset 4: Hourly weather data - 3624 data points (Source: Weather station near Downtown Toronto)
Outcome: Pre-solution performance
  • Initial data exploration revealed that more than 37% of the time the buses on the two routes were either delayed more than 5 min or arrived early by more than 5 min. In some cases the delay was more than 20 min.
Post-solution performance
  • The stand-alone LSTM model was able to increase the prediction accuracy by 48% for 50% of the data.
  • The hybrid RNN-LSTM model decreased the prediction error by more than 500% without any significant accuracy loss for increase in data, when compared to the stand-alone LSTM model.
  • Both the models explained the strong correlation between weather conditions and the bus arrival time prediction.
  • The model can be used to predict more accurate transit bus schedules and improve transit service strategies.
Issues that arose:
  • The LSTM model provided higher accuracy for lower volume of data. As the data volume increased, the accuracy of prediction decreased and the impact of weather on the prediction accuracy also decreased. This was later handled by using the hybrid RNN-LSTM model.
  • The LSTM model performance decreased as the prediction was made for multiple future stops of a bus from a particular bus stop. No clarification was provided whether this issue was handled by the hybrid model in the later stages.
Status: Terminated - Research completed (published September 2020)
Entered by: 30 October 2020: Krishna Pattabi Haridoss, krishna.haridoss@mail.utoronto.ca


CEM1002,
Civil Engineering, University of Toronto
Contact: msf@eil.utoronto.ca