Research Article

Comparative Analysis of LSTM and PatchTST Models for Urban Street Traffic Time Series Forecasting

Wentao Hu1,*, Er Zhou2
1. Chongqing Technology and Business University
2. The University of British Columbia

* Corresponding author: [email protected]

Abstract

With the increasing complexity of urban traffic systems, reliable forecasting of road conditions has become an important requirement for congestion management and intelligent transportation applications. This study develops a multivariate and multi-horizon traffic speed forecasting framework using real-world traffic monitoring data collected from 75 street segments in Shenzhen, China. LSTM and PatchTST are selected as representative recurrent and Transformer-based forecasting models for comparative evaluation. Average travel speed is considered the prediction target, while traffic index, total sample travel length, and total sample travel time are incorporated as additional input variables. Historical observations from the previous 48 hours are used to forecast traffic speeds over three future horizons, including 30, 60, and 120 minutes. To increase the dependability of experimental outcomes, the dataset is split chronologically, and several random seeds are used. MAE, RMSE, MAPE, and R2 are used to assess the model's performance. According to the experimental findings, PatchTST consistently outperforms LSTM in predicting across all prediction horizons. The MAE values of PatchTST are 2.0710, 2.1960, and 2.3552 for 30-, 60-, and 120-minute forecasting tasks, corresponding to reductions of 6.81%, 7.86%, and 5.89% compared with LSTM. Meanwhile, PatchTST obtains R² values of 0.8886, 0.8795, and 0.8670, respectively. Although the forecasting accuracy of both models decreases with longer prediction horizons, PatchTST maintains relatively lower errors and better stability. The results indicate that the patch-based representation and attention mechanism provide advantages in capturing both local variations and long-term temporal dependencies in urban traffic sequences.

Keywords: Traffic speed prediction; LSTM; PatchTST; time series prediction; intelligent transportation
Published: August 24, 2026
DOI: 10.54254/2755-2721/2026.BA36282
Volume: ACE Vol.258
pp. 102-111
Download PDF

References

  1. Vlahogianni, E. I., Karlaftis, M. G., & Golias, J. C. (2014). Short-term traffic forecasting: Where we are and where we're going.Transportation Research Part C: Emerging Technologies, 43, 3–19.
  2. Lv, Y., Duan, Y., Kang, W., et al. (2015). Traffic flow prediction with big data: A deep learning approach.IEEE Transactions on Intelligent Transportation Systems, 16(2), 865–873.
  3. Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory.Neural Computation, 9(8), 1735–1780.
  4. Ma, X., Tao, Z., Wang, Y., et al. (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.
  5. Wu, P., Huang, Z., Pian, Y., et al. (2020). A combined deep learning method with attention-based LSTM model for short-term traffic speed forecasting.Journal of Advanced Transportation, 2020, Article 8863724.
  6. Vaswani, A., Shazeer, N., Parmar, N., et al. (2017). Attention is all you need. InAdvances in Neural Information Processing Systems(pp. 5998–6008).
  7. Nie, Y., Nguyen, N. H., Sinthong, P., et al. (2023). A time series is worth 64 words: Long-term forecasting with transformers. InProceedings of the International Conference on Learning Representations (ICLR).
  8. Wu, H., Hu, T., Liu, Y., et al. (2023). TimesNet: Temporal 2D-variation modeling for general time series analysis. InProceedings of the International Conference on Learning Representations (ICLR).
  9. Liu, Y., Hu, T., Zhang, H., et al. (2024). iTransformer: Inverted transformers are effective for time series forecasting. InProceedings of the International Conference on Learning Representations (ICLR).
  10. Shenzhen Municipal Bureau of Transport. (2021, April 21). Street real-time data [Data set].Shenzhen Open Data Portal. https://opendata.sz.gov.cn/data/dataSet/toDataDetails/29200_00403589