Harnessing LSTM Networks for Traffic Flow Forecasting: A Deep Learning Approach

Authors

  • Ahmad Mustafa Department of Computer Systems Engineering UET Peshawar Peshawar, Pakistan
  • Khurram Shehzad Khattak Department of Computer Systems Engineering UET Peshawar Peshawar, Pakistan
  • Zawar Hussain Khan College of Computer Science and Engineering University of Ha’il Ha’il, KSA

Keywords:

Traffic Flow Prediction, LSTM, Deep Learning, Congestion, Intelligent Transportation System

Abstract

Accurate traffic flow forecasting in areas with different types of vehicles and varied driving behaviors is crucial for improving urban transportation systems and reducing congestion. In this paper, we introduce a Long Short-Term Memory (LSTM) approach to predict short-term traffic flow in such diverse conditions. Our model uses time-series data from real-world traffic sensors, capturing the patterns and dependencies that occur over time in mixed traffic environments. We tested the model using a dataset from seven days, with six days for training and one day for testing. The LSTM model achieved an R2 value of 0.96, a Mean Squared Error (MSE) of 2.82, and a Mean Absolute Error (MAE) of 1.13. These results demonstrate the effectiveness of LSTM networks in predicting traffic flow in complex traffic conditions, surpassing traditional machine learning models. This study provides valuable insights into using deep learning techniques for intelligent transportation systems (ITS).

References

T. A. G. Ali Zeb, Khurram S. Khattak, Muhammad Rehmat Ullah, Zawar H. Khan, “HetroTraffSim: A Macroscopic Heterogeneous Traffic Flow Simulator for Road Bottlenecks,” Futur. Transp, vol. 3, no. 1, pp. 368–383, 2023, doi: https://doi.org/10.3390/futuretransp3010022.

A. N. K. ALI ZEB, KHURRAM S. KHATTAK, AREEB AGHA, , ZAWAR H. KHAN, M. ATHAR JAVED SETH, “ON-BOARD DIAGNOSTIC (OBD-II) BASED CYBER PHYSICAL SYSTEM FOR ROAD BOTTLENECKS DETECTION,” J. Eng. Sci. Technol., vol. 17, no. 2, pp. 0906–0922, 2022, [Online]. Available: https://jestec.taylors.edu.my/Vol 17 Issue 2 April 2022/17_2_07.pdf

P. K. Baskar and H. Kaluvan, “Long short-term memory (LSTM) recurrent neural network (RNN) based traffic forecasting for intelligent transportation,” AIP Conf. Proc., vol. 2435, no. 1, Mar. 2022, doi: 10.1063/5.0083590/2823318.

D. Haputhanthri and A. Wijayasiri, “Short-term traffic forecasting using LSTM-based deep learning models,” MERCon 2021 - 7th Int. Multidiscip. Moratuwa Eng. Res. Conf. Proc., pp. 602–607, Jul. 2021, doi: 10.1109/MERCON52712.2021.9525670.

A. W. B. Dissanayake, O. Hemachandra, N. Lakshitha, D. Haputhanthri, “A Comparison of ARIMAX, VAR and LSTM on Multivariate Short-Term Traffic Volume Forecasting,” 28th Conf. Open Innov. Assoc. Fruct, 2021, [Online]. Available: https://www.researchgate.net/publication/351389331_A_Comparison_of_ARIMAX_VAR_and_LSTM_on_Multivariate_Short-Term_Traffic_Volume_Forecasting

R. Biju, S. U. Goparaju, D. Gangadharan, and B. Mandal, “Grid LSTM based Attention Modelling for Traffic Flow Prediction,” 2024 IEEE 99th Veh. Technol. Conf., pp. 1–7, Jun. 2024, doi: 10.1109/VTC2024-SPRING62846.2024.10683344.

Y. W. and S. L. Y. Gao, C. Zhou, J. Rong, “Short-Term Traffic Speed Forecasting Using a Deep Learning Method Based on Multitemporal Traffic Flow Volume,” IEEE Access, vol. 10, pp. 82384–82395, 2022, doi: 10.1109/ACCESS.2022.3195353.

S. M. Snineh, N. E. A. Amrani, M. Youssfi, O. Bouattane, and A. Daaif, “Detection of traffic anomaly in highways by using recurrent neural network,” 5th Int. Conf. Intell. Comput. Data Sci. ICDS 2021, 2021, doi: 10.1109/ICDS53782.2021.9626741.

Q. Chu, G. Li, R. Zhou, and Z. Ping, “Traffic Flow Prediction Model Based on LSTM with Finnish Dataset,” 2021 IEEE 6th Int. Conf. Intell. Comput. Signal Process. ICSP 2021, pp. 389–392, Apr. 2021, doi: 10.1109/ICSP51882.2021.9408888.

H. Bouchemoukha, M. N. Zennir, and A. Lahoulou, “Is Classical LSTM more Efficient than Modern GCN Approaches in the Context of Traffic Forecasting?,” Proc. - 2021 IEEE Int. Conf. Recent Adv. Math. Informatics, ICRAMI 2021, 2021, doi: 10.1109/ICRAMI52622.2021.9585940.

J. Zheng and M. Huang, “Traffic Flow Forecast Through Time Series Analysis Based on Deep Learning,” IEEE Access, vol. 8, pp. 82562–82570, 2020, doi: 10.1109/ACCESS.2020.2990738.

S. L. Rusul L. Abduljabbar, Hussein Dia, Pei-Wei Tsai, “Short-Term Traffic Forecasting: An LSTM Network for Spatial-Temporal Speed Prediction,” Futur. Transp, vol. 1, no. 1, pp. 21–37, 2021, doi: https://doi.org/10.3390/futuretransp1010003.

Q. Zhaowei, L. Haitao, L. Zhihui, and Z. Tao, “Short-Term Traffic Flow Forecasting Method with M-B-LSTM Hybrid Network,” IEEE Trans. Intell. Transp. Syst., vol. 23, no. 1, pp. 225–235, Jan. 2022, doi: 10.1109/TITS.2020.3009725.

A. Asif Khan, Khurram S. Khattak, Zawar H. Khan, Thomas Aaron Gulliver, “Edge Computing for Effective and Efficient Traffic Characterization,” Sensors, vol. 23, no. 23, p. 9385, 2023, doi: https://doi.org/10.3390/s23239385.

Downloads

Published

2025-05-23

How to Cite

Ahmad Mustafa, Khurram Shehzad Khattak, & Zawar Hussain Khan. (2025). Harnessing LSTM Networks for Traffic Flow Forecasting: A Deep Learning Approach. International Journal of Innovations in Science & Technology, 7(7), 329–337. Retrieved from https://journal.50sea.com/index.php/IJIST/article/view/1354