Short-term Road Traffic Flow Prediction based on LSTM and Transformer Models
DOI:
https://doi.org/10.61173/v8jczt67Keywords:
LSTM, Transformer, Short-term road flowAbstract
With the acceleration of urbanization, traffic congestion has become a prominent problem that hinders the operational efficiency of cities and affects the travel experience of residents. Accurate short-term traffic flow prediction is the support for intelligent transportation systems to achieve early prediction and congestion warning. Traditional prediction models have difficulty capturing the nonlinear and time-series dependent characteristics of traffic flow, resulting in limited prediction accuracy. This paper takes the 2-minute traffic flow data of the Creteil Ring Road in France from 7:00 to 9:00 as the research object. It adopts a Long Short-Term Memory (LSTM) and a Transformer model to preprocess traffic flow data, construct a standardized data set, and conduct comparative experiments on LSTM, Transformer models. The experimental results are presented intuitively through flow time series comparison diagrams, training loss curve diagrams, and model evaluation index comparison diagrams. The mean absolute error (MAE) of the LSTM model is 0.65, the root mean square error (RMSE) is 0.82, and the coefficient of determination(R²) reaches 0.9061. The predicted values are highly consistent with the actual traffic flow fluctuations, and the error distribution is concentrated. Research shows that compared with the Transformer model, the LSTM model has more advantages in short-term traffic prediction tasks. These models can provide precise data support for practical applications such as traffic signal timing optimization and route planning, and provide technical references for the efficient operation of intelligent transportation systems.
References
[1] Zhao S Z, Ni T H, Wang Y, et al. A new approach to the prediction of passenger flow in a transit system. Computers & Mathematics with Applications, 2011, 61(8),1968–1974.
[2] Chaoura C, Lazar H, Jarir Z. Traffic flow prediction at intersections: Enhancing with a hybrid LSTM-PSO approach. International Journal of Advanced Computer Science & Dean&Francis ISSN 2959-6157 Applications, 2024, 15(5).
[3] Kang Y. Short-term passenger flow prediction in urban rail transit based on hybrid deep learning models. Highlights in Science, Engineering and Technology, 2024.
[4] Xue Q, Zhang W, Ding M, Yang X, Wu J, Gao Z. Passenger flow forecasting approaches for urban rail transit: A survey. International Journal of General Systems, 2023, 52(8), 919–947.
[5] Sengupta A, Das A, Guler S I. Hybrid hidden Markov LSTM for short-term traffic flow prediction. arXiv preprint, 2023.
[6] Zhang Z, Yang H, Yang X. A transfer learning–based LSTM for traffic flow prediction with missing data. Journal of Transportation Engineering, Part A: Systems, 2023, 149(10),04023095.
[7] Jang H C, Chen C A. Urban traffic flow prediction using LSTM and GRU. Engineering Proceedings, 2024, 55(1),86.
[8] Shen S, Pan B, Xue G. A pretrained probabilistic transformer for city-scale traffic volume prediction. arXiv preprint, 2025.
[9] Wang F, Xin X, Lei Z, et al. Transformer-based Spatio- Temporal traffic prediction for access and metro networks. Journal of Lightwave Technology, 2024, 42(15),5204–5213.
[10] Liang J, Tan C, Yan L, et al. Interaction-aware trajectory prediction for safe motion planning in autonomous driving: A transformer-transfer learning approach. 2024.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 by the authors.

This work is licensed under a Creative Commons Attribution 4.0 International License.
