Long-Term Traffic Prediction Using Deep Learning Long Short-Term Memory
Abstract
Highlights
- A novel integrated approach is presented for long-term hourly traffic predictions, based on LSTM, that shows good performance and accuracy, with high fidelity in periodicity and variability across diverse traffic profiles in California.
- By leveraging Fourier Transform, the sliding window approach, and K-means, the presented approach expands the traditional LSTM, capturing traffic hourly pattern and flow intensity over a year’s time frame.
- Accurate long-term hourly prediction is critical for a sustainable and resilient transportation system and therefore deserves more attention and research efforts.
- The present study makes good strides toward the use of sophisticated ML models for long-term traffic forecasts, an area still widely unexplored.
Abstract
1. Introduction
- The team proposes a two-level ML methodology for long-term traffic prediction that leverages k-means clustering, long short-term memory (LSTM) neural networks, and FT. The technique is scalable and can be applied to large datasets, making it suitable for analyzing traffic volumes across extensive road networks or regions.
- The team evaluates the proposed method on a real-world large-scale traffic dataset collected from the U.S. Travel Monitoring Analysis System (TMAS) database, enhancing its practical relevance and potential impact on transportation planning and management. The availability of such data, rich and comprehensive, motivates the development of the modeling approach presented here.
2. Methods and Data
2.1. Data Collection
2.2. Methodology
3. Experimental Setup
3.1. Dataset Description
3.2. Hyperparameter Optimization
3.3. Experiments
4. Results and Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
ML | Machine Learning |
LSTM | Long Short-Term Model |
References
- Patella, S.; Scrucca, F.; Asdrubali, F.; Carrese, S. Carbon Footprint of autonomous vehicles at the urban mobility system level: A traffic simulation-based approach. Transp. Res. Part D Transp. Environ. 2019, 74, 189–200. [Google Scholar] [CrossRef]
- Anda, C.; Erath, A.; Fourie, P.J. Transport modelling in the age of big data. Int. J. Urban Sci. 2017, 21 (Suppl. S1), 19–42. [Google Scholar] [CrossRef]
- Krishna, K.; Murty, M.N. Genetic K-means algorithm. IEEE Trans. Syst. Man Cybern. Part B 1999, 29, 433–439. [Google Scholar] [CrossRef] [PubMed]
- Torre-Bastida, A.I.; Del Ser, J.; Laña, I.; Ilardia, M.; Bilbao, M.N.; Campos-Cordobés, S. Big Data for transportation and mobility: Recent advances, trends and challenges. IET Intell. Transp. Syst. 2018, 12, 742–755. [Google Scholar] [CrossRef]
- Chan, R.K.C.; Lim, J.M.-Y.; Parthiban, R. Missing traffic data imputation for artificial intelligence in intelligent transportation systems: Review of methods, limitations, and challenges. IEEE Access 2023, 11, 34080–34093. [Google Scholar] [CrossRef]
- Anitha, E.B.; Aravinth, R.; Deepak, S.; Jotheeswari, R.; Karthikeyan, G. Prediction of road traffic using naive bayes algorithm. Int. J. Eng. Res. Technol. 2019, 7, 1–4. [Google Scholar]
- Chen, Z.; Wen, J.; Geng, Y. Predicting future traffic using hidden markov models. In Proceedings of the 2016 IEEE 24th International Conference on Network Protocols (ICNP), Singapore, 8–10 November 2016. [Google Scholar]
- Zhao, S.-X.; Wu, H.-W.; Liu, C.-R. Traffic flow prediction based on optimized hidden Markov model. J. Phys. Conf. Ser. 2019, 1168, 052001. [Google Scholar] [CrossRef]
- Chen, C.; Hu, J.; Meng, Q.; Zhang, Y. Short-time traffic flow prediction with ARIMA-GARCH model. In Proceedings of the 2011 IEEE Intelligent Vehicles Symposium (IV), Baden, Germany, 5–9 June 2011. [Google Scholar]
- Dissanayake, B.; Hemachandra, O.; Lakshitha, N.; Haputhanthri, D.; Wijayasiri, A. A Comparison of ARIMAX, VAR and LSTM on Multivariate Short-Term Traffic Volume Forecasting. In Proceedings of the Conference of Open Innovations Association, FRUCT, 2021, Moscow, Russia, 27–29 January 2021. [Google Scholar]
- Mir, Z.H.; Filali, F. An adaptive Kalman filter based traffic prediction algorithm for urban road network. In Proceedings of the 2016 12th International Conference on Innovations in Information Technology (IIT), Al-Ain, United Arab Emirates, 28–30 November 2016. [Google Scholar]
- Lin, G.; Lin, A.; Gu, D. Using support vector regression and K-nearest neighbors for short-term traffic flow prediction based on maximal information coefficient. Inf. Sci. 2022, 608, 517–531. [Google Scholar] [CrossRef]
- Toan, T.D.; Truong, V.-H. Support vector machine for short-term traffic flow prediction and improvement of its model training using nearest neighbor approach. Transp. Res. Rec. 2021, 2675, 362–373. [Google Scholar] [CrossRef]
- Kumar, K.; Parida, M.; Katiyar, V.K. Short term traffic flow prediction in heterogeneous condition using artificial neural network. Transport 2013, 30, 397–405. [Google Scholar] [CrossRef]
- Sharma, B.; Kumar, S.; Tiwari, P.; Yadav, P.; Nezhurina, M.I. ANN based short-term traffic flow forecasting in undivided two lane highway. J. Big Data 2018, 5, 48. [Google Scholar] [CrossRef]
- Liu, Z.; Du, W.; Yan, D.-M.; Chai, G.; Guo, J.-H. Short-term traffic flow forecasting based on combination of k-nearest neighbor and support vector regression. J. Highw. Transp. Res. Dev. 2018, 12, 89–96. [Google Scholar] [CrossRef]
- Kuang, L.; Hua, C.; Wu, J.; Yin, Y.; Gao, H. Traffic Volume Prediction Based on Multi-Sources GPS Trajectory Data by Temporal Convolutional Network. Mob. Netw. Appl. 2020, 25, 1405–1417. [Google Scholar] [CrossRef]
- Zhang, X.-L.; He, G.-G. Forecasting approach for short-term traffic flow based on principal component analysis and combined neural network. Syst. Eng. Theory Pract. 2007, 27, 167–171. [Google Scholar] [CrossRef]
- Zhang, X.; Huang, K.; Liu, C.; Xu, X. Urban Short—Term Traffic Flow Prediction Algorithm Based on CNN-LSTM Model. In Proceedings of the 2023 3rd International Conference on Consumer Electronics and Computer Engineering (ICCECE), Guangzhou, China, 6–8 January 2023. [Google Scholar]
- Fu, R.; Zhang, Z.; Li, L. Using LSTM and GRU neural network methods for traffic flow prediction. In Proceedings of the 2016 31st Youth Academic Annual Conference of Chinese Association of Automation (YAC), Wuhan, China, 11–13 November 2016. [Google Scholar]
- Zhao, Z.; Chen, W.; Wu, X.; Chen, P.C.; Liu, J. LSTM network: A deep learning approach for short-term traffic forecast. IET Intell. Transp. Syst. 2017, 11, 68–75. [Google Scholar] [CrossRef]
- Gu, Y.; Lu, W.; Xu, X.; Qin, L.; Shao, Z.; Zhang, H. An improved Bayesian combination model for short-term traffic prediction with deep learning. IEEE Trans. Intell. Transp. Syst. 2019, 21, 1332–1342. [Google Scholar] [CrossRef]
- Sun, H.; Liu, H.X.; Xiao, H.; Ran, B. Short Term Traffic Forecasting Using the Local Linear Regression Model. 2002. Available online: https://escholarship.org/uc/item/540301xx (accessed on 12 May 2024).
- Han, L.; Huang, Y.S. Short-term traffic flow prediction of road network based on deep learning. IET Intell. Transp. Syst. 2020, 14, 495–503. [Google Scholar] [CrossRef]
- Christodoulou, A.; Christidis, P. Evaluating congestion in urban areas: The case of Seville. Res. Transp. Bus. Manag. 2021, 39, 100577. [Google Scholar] [CrossRef]
- Koźlak, A.; Wach, D. Causes of traffic congestion in urban areas. Case of Poland. In Proceedings of the SHS Web of Conferences, Istanbul, Turkey, 28 June–1 July 2018. [Google Scholar]
- Mei, H.; Ma, A.; Poslad, S.; Oshin, T.O. Short-Term Traffic Volume Prediction for Sustainable Transportation in an Urban Area. J. Comput. Civ. Eng. 2015, 29, 04014036. [Google Scholar] [CrossRef]
- Guo, Q.; Benyun, S.; Wan, Y. Matrix-based long-term traffic flow prediction. Transp. Lett. 2024, 1–12. [Google Scholar] [CrossRef]
- He, Z.; Chow, C.-Y.; Zhang, J.-D. STCNN: A spatio-temporal convolutional neural network for long-term traffic prediction. In Proceedings of the 2019 20th IEEE International Conference on Mobile Data Management (MDM), Hong Kong, China, 10–13 June 2019. [Google Scholar]
- Wang, Z.; Su, X.; Ding, Z. Long-term traffic prediction based on lstm encoder-decoder architecture. IEEE Trans. Intell. Transp. Syst. 2020, 22, 6561–6571. [Google Scholar] [CrossRef]
- Xu, M.; Di, Y.; Ding, H.; Zhu, Z.; Chen, X.; Yang, H. AGNP: Network-wide short-term probabilistic traffic speed prediction and imputation. Commun. Transp. Res. 2023, 3, 100099. [Google Scholar] [CrossRef]
- Park, S.; Kim, M.; Kim, J. Hourly Long-Term Traffic Volume Prediction with Meteorological Information Using Graph Convolutional Networks. Appl. Sci. 2024, 14, 2285. [Google Scholar] [CrossRef]
- Lin, H.-T.C.; Dai, H.; Tseng, V.S. Short-Term and Long-Term Travel Time Prediction Using Transformer-Based Techniques. Appl. Sci. 2024, 14, 4913. [Google Scholar] [CrossRef]
- Berlotti, M.; Di Grande, S.; Cavalieri, S. Proposal of a Machine Learning Approach for Traffic Flow Prediction. Sensors 2024, 24, 2348. [Google Scholar] [CrossRef]
- Guo, X.; Zhang, Q.; Jiang, J.; Peng, M.; Zhu, M.; Yang, H.F. Towards explainable traffic flow prediction with large language models. Commun. Transp. Res. 2024, 4, 100150. [Google Scholar] [CrossRef]
- Touvron, H.; Martin, L.; Stone, K.; Albert, P.; Almahairi, A.; Babaei, Y.; Bashlykov, N.; Batra, S.; Bhargava, P.; Bhosale, S. Llama 2: Open foundation and fine-tuned chat models. arXiv 2023, arXiv:2307.09288. [Google Scholar] [CrossRef]
- Yu, H.; Wu, Z.; Wang, S.; Wang, Y.; Ma, X. Spatiotemporal recurrent convolutional networks for traffic prediction in transportation networks. Sensors 2017, 17, 1501. [Google Scholar] [CrossRef]
- Jia, Y.; Wu, J.; Xu, M. Traffic flow prediction with rainfall impact using a deep learning method. J. Adv. Transp. 2017, 2017, 6575947. [Google Scholar] [CrossRef]
- Chen, L.; Zheng, L.; Yang, J.; Xia, D.; Liu, W. Short-term traffic flow prediction: From the perspective of traffic flow decomposition. Neurocomputing 2020, 413, 444–456. [Google Scholar] [CrossRef]
- Zhang, Y.; Zhang, Y.; Haghani, A. A hybrid short-term traffic flow forecasting method based on spectral analysis and statistical volatility model. Transp. Res. Part C Emerg. Technol. 2014, 43, 65–78. [Google Scholar] [CrossRef]
- Sun, Z.; Hu, Y.; Li, W.; Feng, S.; Pei, L. Prediction model for short-term traffic flow based on a K-means-gated recurrent unit combination. IET Intell. Transp. Syst. 2022, 16, 675–690. [Google Scholar] [CrossRef]
- FHWA. US Traffic Volume Data. 2023. Available online: https://www.fhwa.dot.gov/policyinformation/tables/tmasdata/ (accessed on 15 January 2022).
- FHWA. HPMS Public Release of Geospatial Data in Shapefile Format. 2020. Available online: https://www.fhwa.dot.gov/policyinformation/hpms/shapefiles_2017.cfm (accessed on 15 January 2022).
- FHWA. Highway Performance Monitoring System Field Manual. 2018. Available online: https://www.fhwa.dot.gov/policyinformation/hpms/fieldmanual/page01.cfm#toc244584302 (accessed on 15 January 2022).
- Akhtar, M.; Moridpour, S. A Review of Traffic Congestion Prediction Using Artificial Intelligence. J. Adv. Transp. 2021, 2021, 8878011. [Google Scholar] [CrossRef]
- Fabregas, A.C.; Gerardo, B.D.; Tanguilig, B.T., III. Enhanced initial centroids for k-means algorithm. Int. J. Inf. Technol. Comput. Sci. 2017, 1, 26–33. [Google Scholar] [CrossRef]
- Tan, P.-N.; Steinbach, M.; Kumar, V. Data mining cluster analysis: Basic concepts and algorithms. Introd. Data Min. 2013, 487, 533. [Google Scholar]
- Anderberg, M.R. Cluster Analysis for Applications: Probability and Mathematical Statistics: A Series of Monographs and Textbooks; Academic Press: Cambridge, MA, USA, 2014; Volume 19. [Google Scholar]
- Li, R.; Hu, Y.; Liang, Q. T2F-LSTM method for long-term traffic volume prediction. IEEE Trans. Fuzzy Syst. 2020, 28, 3256–3264. [Google Scholar] [CrossRef]
- Trinh, H.D.; Giupponi, L.; Dini, P. Mobile traffic prediction from raw data using LSTM networks. In Proceedings of the 2018 IEEE 29th Annual International Symposium on Personal, Indoor and Mobile Radio Communications (PIMRC), Bologna, Italy, 9–12 September 2018. [Google Scholar]
- Yang, B.; Sun, S.; Li, J.; Lin, X.; Tian, Y. Traffic flow prediction using LSTM with feature enhancement. Neurocomputing 2019, 332, 320–327. [Google Scholar] [CrossRef]
- Hachemi, M.L.; Ghomari, A.; Hadjadj-Aoul, Y.; Rubino, G. Mobile traffic forecasting using a combined FFT/LSTM strategy in SDN networks. In Proceedings of the 2021 IEEE 22nd International Conference on High Performance Switching and Routing (HPSR), Paris, France, 7–10 June 2021. [Google Scholar]
- Ali, Y.A.; Awwad, E.M.; Al-Razgan, M.; Maarouf, A. Hyperparameter Search for Machine Learning Algorithms for Optimizing the Computational Complexity. Processes 2023, 11, 349. [Google Scholar] [CrossRef]
- Akiba, T.; Sano, S.; Yanase, T.; Ohta, T.; Koyama, M. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Anchorage, AK, USA, 4–8 August 2019. [Google Scholar]
- Shekhar, S.; Bansode, A.; Salim, A. A Comparative study of Hyper-Parameter Optimization Tools. In Proceedings of the 2021 IEEE Asia-Pacific Conference on Computer Science and Data Engineering (CSDE), Brisbane, Australia, 8–10 December 2021. [Google Scholar]
- Hanifi, S.; Cammarono, A.; Zare-Behtash, H. Advanced hyperparameter optimization of deep learning models for wind power prediction. Renew. Energy 2024, 221, 119700. [Google Scholar] [CrossRef]
- Khan, A.; Fouda, M.M.; Do, D.T.; Almaleh, A.; Rahman, A.U. Short-Term Traffic Prediction Using Deep Learning Long Short-Term Memory: Taxonomy, Applications, Challenges, and Future Trends. IEEE Access 2023, 11, 94371–94391. [Google Scholar] [CrossRef]
- Abbas, Z.; Al-Shishtawy, A.; Girdzijauskas, S.; Vlassov, V. Short-term traffic prediction using long short-term memory neural networks. In Proceedings of the 2018 IEEE International Congress on Big Data (BigData Congress), San Francisco, CA, USA, 2–7 July 2018. [Google Scholar]
- Liu, Y.; Zheng, H.; Feng, X.; Chen, Z. Short-term traffic flow prediction with Conv-LSTM. In Proceedings of the 2017 9th International Conference on Wireless Communications and Signal Processing (WCSP), Nanjing, China, 11–13 October 2017. [Google Scholar]
- Zhao, Y.; Zhou, X. K-means clustering algorithm and its improvement research. J. Phys. Conf. Ser. 2021, 1873, 012074. [Google Scholar] [CrossRef]
- Hanafi, N.; Saadatfar, H. A fast DBSCAN algorithm for big data based on efficient density calculation. Expert Syst. Appl. 2022, 203, 117501. [Google Scholar] [CrossRef]
- Khan, K.; Rehman, S.U.; Aziz, K.; Fong, S.; Sarasvady, S. Dbscan: Past, present and future. In Proceedings of the Fifth International Conference on the Applications of Digital Information and Web Technologies (ICADIWT 2014), Chennai, India, 17–19 February 2014. [Google Scholar]
- de Moura Ventorim, I.; Luchi, D.; Rodrigues, A.L.; Varejão, F.M. Birchscan: A sampling method for applying Dbscan to large datasets. Expert Syst. Appl. 2021, 184, 115518. [Google Scholar] [CrossRef]
- Karim, A.; Adeli, H. Incident detection algorithm using wavelet energy representation of traffic patterns. J. Transp. Eng. 2002, 128, 232–242. [Google Scholar] [CrossRef]
LSTM Hyperparameters | Values | Description |
---|---|---|
Lr | 0.001 | Training learning rate |
ep | 25 | Training epochs |
Dropout | 0.22 | Dropout layer |
Loss | MSE Loss | Mean squared error loss |
Batch size | 64 | Batch size |
LSTM layer 1 size | 128 | The size of the first LSTM layer in the architecture |
LSTM layer 2 size | 128 | The size of the second LSTM layer in the architecture |
Clusters | Median Absolute Error | Mean Absolute Error | Root Mean Squared Error |
---|---|---|---|
Cluster 1 | 51.1 (5.8%) | 79.8 (7.7%) | 114.3 (10.4%) |
Cluster 2 | 228.7 (7.1%) | 334.3 (10.3%) | 478.7 (15.5%) |
Cluster 3 | 264.4 (7.5%) | 417.4 (10.8%) | 626.9 (18.8%) |
Cluster | Model | Median Absolute Error | Mean Absolute Error | Root Mean Squared Error |
---|---|---|---|---|
1 | With Fourier and Previous Year | 48 (4.28%) | 58.86 (4.82%) | 79.32 (5.76%) |
With Previous Year Only | 2184.9 (154.5%) | 1968.1 (206.7%) | 2272.8 (259.7%) | |
Forecast with Fourier Only | 1290.55 (99.32%) | 1271.1 (99.2%) | 1481.9 (99.2%) | |
Forecast without Fourier and Previous Year | 647.0 (62.1%) | 780.2 (89.9%) | 952 (132.2%) | |
2 | With Fourier and Previous Year | 258.6 (3.3%) | 684.0 (9.29%) | 1504.4 (19.3%) |
With Previous Year Only | 695.1 (11.8%) | 1032.6 (16.3%) | 1436.4 (29.4%) | |
Forecast with Fourier Only | 8628.1 (95.6%) | 7606.0 (93.4%) | 8297.4 (93.8%) | |
Forecast without Fourier and Previous Year | 6261.1 (67.8%) | 5314.5 (62.3%) | 5994.4 (64.8%) | |
3 | With Fourier and Previous Year | 913.5 (16.6%) | 1334.8 (25.3%) | 1815.6 (39.1%) |
With Previous Year Only | 2517.9 (45.2%) | 2591.1 (56.2%) | 3083.2 (73.2%) | |
Forecast with Fourier Only | 1507.5 (27.2%) | 2444.3 (37.6%) | 3574.1 (47.9%) | |
Forecast without Fourier and Previous Year | 3627.4 (43.2%) | 3465.2 (99.47%) | 3888.9 (163.1%) |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Toba, A.-L.; Kulkarni, S.; Khallouli, W.; Pennington, T. Long-Term Traffic Prediction Using Deep Learning Long Short-Term Memory. Smart Cities 2025, 8, 126. https://doi.org/10.3390/smartcities8040126
Toba A-L, Kulkarni S, Khallouli W, Pennington T. Long-Term Traffic Prediction Using Deep Learning Long Short-Term Memory. Smart Cities. 2025; 8(4):126. https://doi.org/10.3390/smartcities8040126
Chicago/Turabian StyleToba, Ange-Lionel, Sameer Kulkarni, Wael Khallouli, and Timothy Pennington. 2025. "Long-Term Traffic Prediction Using Deep Learning Long Short-Term Memory" Smart Cities 8, no. 4: 126. https://doi.org/10.3390/smartcities8040126
APA StyleToba, A.-L., Kulkarni, S., Khallouli, W., & Pennington, T. (2025). Long-Term Traffic Prediction Using Deep Learning Long Short-Term Memory. Smart Cities, 8(4), 126. https://doi.org/10.3390/smartcities8040126