A Comparative Study of RNN, LSTM and GRU for Short-Term Traffic Speed Prediction
Abstract
Due to the complex and dynamic time patterns in the actual traffic system, accurate traffic speed prediction is still challenging. This study will focus on using deep learning sequence models to model short-term traffic dynamics. To achieve a fair and controllable comparison, three representative models, Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU), are implemented under a unified framework. The sliding window strategy is used to organize the input data into a multivariate time series, where historical observations of 12 time steps are used to predict future traffic speeds. All models share the same architecture design, which is composed of a stacked loop layer and a fully connected layer, ensuring the consistency of model capacity and training conditions. The training process is optimized by using the Adam algorithm with the mean square error as the loss function. Based on the comparative results, the best performing model was further analyzed through a series of controlled experiments. The system changes key hyperparameters, including hidden layer size, network depth and learning rate, to check their impact on prediction performance. This design allows the impact of model capacity and optimization dynamics to be evaluated in isolation. The experimental results show that under the short-term prediction setting, the simpler loop structure can obtain competitive or even superior performance compared with the more complex gating model.
References
- Box, G. E. P., & Jenkins, G. M. (1976).Time series analysis: Forecasting and control. Holden-Day.
- Fawaz, H. I., Forestier, G., Weber, J., Idoumghar, L., & Muller, P. A. (2019).Deep learning for time series classification: A review.Data Mining and Knowledge Discovery, 33(4), 917–963.
- Lim, B., Zohren, S., & Roberts, S. (2021).Time-series forecasting with deep learning: A survey.Philosophical Transactions of the Royal Society A, 379(2194).
- Ma, X., Tao, Z., Wang, Y., Yu, H., & Wang, Y. (2015). Long short-term memory neural network for traffic speed prediction using remote microwave sensor data. Transportation research part C: emerging technologies, 54, 187-197.
- GitHub. (2019). https: //github.com/liyaguang/DCRNN
- Rumelhart, D. E., Hinton, G. E., & Williams, R. J. (1986). Learning representations by back-propagating errors. Nature, 323(6088), 533–536.
- Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780.
- Cho, K., van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., & Bengio, Y. (2014). Learning phrase representations using RNN encoder-decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP) (pp. 1724–1734). Association for Computational Linguistics.
- Fu, R., Zhang, Z., & Li, L. (2016). Using LSTM and GRU neural network methods for traffic flow prediction. In 2016 31st Youth Academic Annual Conference of Chinese Association of Automation (YAC) (pp. 324–328). IEEE.
- Willmott, C. J., & Matsuura, K. (2005). Advantages of the mean absolute error (MAE) over the root mean square error (RMSE) in assessing average model performance. Climate Research, 30(1), 79–82.