# A Hybrid Deep Learning Model for Short-Term Traffic Flow Pre-Diction Considering Spatiotemporal Features

^{*}

## Abstract

**:**

## 1. Introduction

- (1)
- Time dependence: the traffic flow at a given moment is usually correlated with various historical values [6]. One example is that a traffic jam on a road will inevitably affect its flow during commuters’ “rush” hours. As shown in Figure 1, the traffic flow of a road can be predicted based on its own recent flow and periodic flow.
- (2)
- Spatial dependence: the traffic condition of one road is affected by its adjacent roads or even indirectly connected roads. We can see from Figure 2 that the change in traffic flow is dominated by the topological structure of the traffic network. The traffic statuses of adjacent roads influence one another.

- (a)
- We study the traffic flow prediction problem under intelligent transportation and propose a novel hybrid deep-learning-based traffic flow prediction model to provide information and decision support for solving road congestion, thus helping the sustainable development of the city;
- (b)
- Aiming at the complex situation of traffic in the city, our proposed model uses GCN and Bi-LSTM to model the spatiotemporal dependence and periodicity of traffic data. Moreover, we design an attention layer for each component to make the proposed model focus on the information considered meaningful to the prediction result, sidelining auxiliary information;
- (c)
- The experimental results on a real-world traffic dataset indicate that our model has better prediction performance than those developed previously.

## 2. Related Work

## 3. Methodology

#### 3.1. Problem Formulation

#### 3.2. Overview of the Proposed Model

#### 3.3. Graph Convolutional Network for Spatial Dependence Modeling

#### 3.4. Bi-Directional LSTM for Temporal Dependence Modeling

#### 3.5. Attention Mechanism

#### 3.6. Output Layer

## 4. Performance Evaluation

#### 4.1. Dataset Description and Preprocessing

#### 4.2. Index of Performance

#### 4.3. Experiment Result

- (1)
- SVR: support vector regression;
- (2)
- LSTM: long short-term memory networks;
- (3)
- GCN: graph convolution network;
- (4)
- STGCN [31]: spatiotemporal graph convolution model, using ChebNet and a temporal convolution network to capture spatial and temporal dependencies;
- (5)
- ASTGCN [41]: attention-based spatiotemporal graph convolutional networks, using three of the same modules to model periodicity characteristics of traffic data, where each module contains several spatiotemporal blocks designed to capture spatial and temporal dependencies.

#### 4.4. Component Analysis

- (1)
- Base model: we do not remove any modules from the proposed model;
- (2)
- Without GCN: we remove the graph convolution operation to evaluate the ability to extract spatial features with the proposed model;
- (3)
- Without attention: this model is made without any attention mechanism;
- (4)
- Without day or week modules: we remove the daily and weekly components to evaluate the ability to extract periodicity features with the proposed model.

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Su, X.; Zheng, C.; Yang, Y.; Yang, Y.; Zhao, W.; Yu, Y. Spatial Structure and Development Patterns of Urban Traffic Flow Network in Less Developed Areas: A Sustainable Development Perspective. Sustainability
**2022**, 14, 8095. [Google Scholar] [CrossRef] - Wang, Z.; Chu, R.; Zhang, M.; Wang, X.; Luan, S. An Improved Hybrid Highway Traffic Flow Prediction Model Based on Machine Learning. Sustainability
**2020**, 12, 8298. [Google Scholar] [CrossRef] - Khan, N.U.; Shah, M.A.; Maple, C.; Ahmed, E.; Asghar, N. Traffic Flow Prediction: An Intelligent Scheme for Forecasting Traffic Flow Using Air Pollution Data in Smart Cities with Bagging Ensemble. Sustainability
**2022**, 14, 4164. [Google Scholar] [CrossRef] - Sumalee, A.; Ho, H.W. Smarter and more connected: Future intelligent transportation system. Iatss Res.
**2018**, 42, 67–71. [Google Scholar] [CrossRef] - Xu, X.; Huang, Q.; Zhu, H.; Sharma, S.; Zhang, X.; Qi, L.; Bhuiyan, M.Z.A. Secure service offloading for Internet of vehicles in SDN-enabled mobile edge computing. IEEE Trans. Intell. Transp. Syst.
**2020**, 22, 3720–3729. [Google Scholar] [CrossRef] - Ye, J.; Zhao, J.; Ye, K.; Xu, C. How to build a graph-based deep learning architecture in traffic domain: A survey. IEEE Trans. Intell. Transp. Syst.
**2020**, 23, 3904–3924. [Google Scholar] [CrossRef] - Lee, S.; Fambro, D.B. Application of subset autoregressive integrated moving average model for short-term freeway traffic volume forecasting. Transp. Res. Rec.
**1999**, 1678, 179–188. [Google Scholar] [CrossRef] - 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) IEEE, Wuhan, China, 11–13 November 2016; pp. 324–328. [Google Scholar]
- Williams, B.M.; Hoel, L.A. Modeling and forecasting vehicular traffic flow as a seasonal ARIMA process: Theoretical basis and empirical results. J. Transp. Eng.
**2003**, 129, 664–672. [Google Scholar] [CrossRef] - Hong, W.-C.; Dong, Y.; Zheng, F.; Wei, S.Y. Hybrid evolutionary algorithms in a SVR traffic flow forecasting model. Appl. Math. Comput.
**2011**, 217, 6733–6747. [Google Scholar] [CrossRef] - Ranjan, N.; Bhandari, S.; Zhao, H.P.; Kim, H.; Khan, P. City-wide traffic congestion prediction based on CNN, LSTM and transpose CNN. IEEE Access
**2020**, 8, 81606–81620. [Google Scholar] [CrossRef] - Cao, M.; Li, V.O.K.; Chan, V.W.S. A CNN-LSTM model for traffic speed prediction. In Proceedings of the 2020 IEEE 91st Vehicular Technology Conference (VTC2020-Spring), Antwerp, Belgium, 25–28 May 2020; IEEE: Antwerp, Belgium, 2020; pp. 1–5. [Google Scholar]
- Zhang, J.; Zheng, Y.; Qi, D. Deep spatio-temporal residual networks for citywide crowd flows prediction. In Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, San Francisco, CA, USA, 4–9 February 2017. [Google Scholar]
- Vlahogianni, E.I. Computational intelligence and optimization for transportation big data: Challenges and opportunities. Eng. Appl. Sci. Optim.
**2015**, 38, 107–128. [Google Scholar] - Koesdwiady, A.; Soua, R.; Karray, F. Improving traffic flow prediction with weather information in connected cars: A deep learning approach. IEEE Trans. Veh. Technol.
**2016**, 65, 9508–9517. [Google Scholar] [CrossRef] - Hamed, M.M.; Al-Masaeid, H.R.; Said, Z.M.B. Short-term prediction of traffic volume in urban arterials. J. Transp. Eng.
**1995**, 121, 249–254. [Google Scholar] [CrossRef] - Van Der Voort, M.; Dougherty, M.; Watson, S. Combining Kohonen maps with ARIMA time series models to forecast traffic flow. Transp. Res. Part C Emerg. Technol.
**1996**, 4, 307–318. [Google Scholar] [CrossRef] - Lihua, N.; Xiaorong, C.; Qian, H. ARIMA model for traffic flow prediction based on wavelet analysis. In Proceedings of the 2nd International Conference on Information Science and Engineering, Hangzhou, China, 4–6 December 2010; IEEE: Hangzhou, China, 2010; pp. 1028–1031. [Google Scholar]
- Ghosh, B.; Basu, B.; O’Mahony, M. Bayesian time-series model for short-term traffic flow forecasting. J. Transp. Eng.
**2007**, 133, 180–189. [Google Scholar] [CrossRef] - Okutani, I.; Stephanedes, Y.J. Dynamic prediction of traffic volume through Kalman filtering theory. Transp. Res. Part B Methodol.
**1984**, 18, 1–11. [Google Scholar] [CrossRef] - Kumar, S.V. Traffic flow prediction using Kalman filtering technique. Procedia Eng.
**2017**, 187, 582–587. [Google Scholar] [CrossRef] - Xu, D.; Wang, Y.; Jia, L.; Qin, Y.; Dong, H. Real-time road traffic state prediction based on ARIMA and Kalman filter. Front. Inf. Technol. Electron. Eng.
**2017**, 18, 287–302. [Google Scholar] [CrossRef] - Zhang, L.; Liu, Q.; Yang, W.; Wei, N.; Dong, D. An improved k-nearest neighbor model for short-term traffic flow prediction. Procedia-Soc. Behav. Sci.
**2013**, 96, 653–662. [Google Scholar] [CrossRef] - Tang, J.; Chen, X.; Hu, Z.; Zong, F.; Han, C.; Li, L. Traffic flow prediction based on combination of support vector machine and data denoising schemes. Phys. A Stat. Mech. Its Appl.
**2019**, 534, 120642. [Google Scholar] [CrossRef] - Zhang, L.; Alharbe, N.R.; Luo, G.; Yao, Z.; Li, Y. A hybrid forecasting framework based on support vector regression with a modified genetic algorithm and a random forest for traffic flow prediction. Tsinghua Sci. Technol.
**2018**, 23, 479–492. [Google Scholar] [CrossRef] - Dong, X.; Lei, T.; Jin, S.; Hou, Z. Short-term traffic flow prediction based on XGBoost. In Proceedings of the 2018 IEEE 7th Data Driven Control and Learning Systems Conference (DDCLS), Enshi, China, 25–27 May 2018; IEEE: Enshi, China, 2018; pp. 854–859. [Google Scholar]
- Yang, S.; Wu, J.; Du, Y.; He, Y.; Chen, X. Ensemble learning for short-term traffic prediction based on gradient boosting machine. J. Sens.
**2017**, 2017, 7074143. [Google Scholar] [CrossRef] - Wei, W.; Wu, H.; Ma, H. An autoencoder and LSTM-based traffic flow prediction method. Sensors
**2019**, 19, 2946. [Google Scholar] [CrossRef] [PubMed] - Luo, X.; Li, D.; Yang, Y.; Zhang, S. Spatiotemporal traffic flow prediction with KNN and LSTM. J. Adv. Transp.
**2019**, 2019, 4145353. [Google Scholar] [CrossRef] - Wu, Y.; Tan, H. Short-term traffic flow forecasting with spatial-temporal correlation in a hybrid deep learning framework. arXiv
**2016**, arXiv:1612.01022. [Google Scholar] - Yu, B.; Yin, H.; Zhu, Z. Spatio-temporal graph convolutional networks: A deep learning framework for traffic forecasting. arXiv
**2017**, arXiv:1709.04875. [Google Scholar] - Li, Y.; Yu, R.; Shahabi, C.; Liu, Y. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. arXiv
**2017**, arXiv:1707.01926. [Google Scholar] - Zhao, L.; Song, Y.; Zhang, C.; Liu, Y.; Wang, P.; Lin, T.; Deng, M.; Li, H. T-gcn: A temporal graph convolutional network for traffic prediction. IEEE Trans. Intell. Transp. Syst.
**2019**, 21, 3848–3858. [Google Scholar] [CrossRef] - Song, C.; Lin, Y.; Guo, S.; Wan, H. Spatial-temporal synchronous graph convolutional networks: A new framework for spatial-temporal network data forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 914–921. [Google Scholar]
- Zheng, H.; Lin, F.; Feng, X.; Chen, Y. A hybrid deep learning model with attention-based conv-LSTM networks for short-term traffic flow prediction. IEEE Trans. Intell. Transp. Syst.
**2020**, 22, 6910–6920. [Google Scholar] [CrossRef] - Siami-Namini, S.; Tavakoli, N.; Namin, A.S. The performance of LSTM and BiLSTM in forecasting time series. In Proceedings of the 2019 IEEE International Conference on Big Data (Big Data), IEEE, Los Angeles, CA, USA, 9–12 December 2019; pp. 3285–3292. [Google Scholar]
- Baldi, P.; Brunak, S.; Frasconi, P.; Soda, G.; Pollastri, G. Exploiting the past and the future in protein secondary structure prediction. Bioinformatics
**1999**, 15, 937–946. [Google Scholar] [CrossRef] - Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. In Proceedings of the Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; pp. 5998–6008. [Google Scholar]
- Huber, P.J. Robust estimation of a location parameter. In Breakthroughs in Statistics; Springer: New York, NY, USA, 1992; pp. 492–518. [Google Scholar]
- Chen, C.; Petty, K.; Skabardonis, A.; Varaiya, P.; Jia, Z. Freeway performance measurement system: Mining loop detector data. Transp. Res. Rec.
**2001**, 1748, 96–102. [Google Scholar] [CrossRef] - Guo, S.; Lin, Y.; Feng, N.; Song, C.; Wan, H. Attention based spatial-temporal graph convolutional networks for traffic flow forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019; Volume 33, pp. 922–929. [Google Scholar]
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2019; Volume 32, pp. 8024–8035. [Google Scholar]
- Tian, C.; Chan, W.K. Spatial-temporal attention wavenet: A deep learning framework for traffic prediction considering spatial-temporal dependencies. IET Intell. Transp. Syst.
**2021**, 15, 549–561. [Google Scholar] [CrossRef]

**Figure 9.**The visualization of prediction results. (

**a**) prediction horizon of 5 min. (

**b**) prediction horizon of 15 min. (

**c**) prediction horizon of 30 min. (

**d**) prediction horizon of 60 min.

**Figure 10.**Performance of different variants of proposed model. (

**a**) comparison of MAE. (

**b**) comparison of RMSE. (

**c**) comparison of MAPE.

Dataset | Nodes | Edges | Length of Dataset | Time Range | Number of Features |
---|---|---|---|---|---|

PeMS04 | 307 | 340 | 16,992 | 1 January 2018 to 28 February 2018. | traffic flow average occupancy average speed |

Model | Dataset | PeMS04 | ||
---|---|---|---|---|

Metrics | MAE | MAPE (%) | RMSE | |

SVR | 28.96 | 19.23 | 45.21 | |

LSTM | 27.54 | 18.96 | 42.54 | |

GCN | 25.06 | 17.04 | 38.67 | |

STGCN | 22.83 | 14.62 | 35.79 | |

ASTGCN | 21.94 | 14.23 | 32.76 | |

Our Model | 20.00 | 13.95 | 32.41 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 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

**MDPI and ACS Style**

Zhou, S.; Wei, C.; Song, C.; Fu, Y.; Luo, R.; Chang, W.; Yang, L.
A Hybrid Deep Learning Model for Short-Term Traffic Flow Pre-Diction Considering Spatiotemporal Features. *Sustainability* **2022**, *14*, 10039.
https://doi.org/10.3390/su141610039

**AMA Style**

Zhou S, Wei C, Song C, Fu Y, Luo R, Chang W, Yang L.
A Hybrid Deep Learning Model for Short-Term Traffic Flow Pre-Diction Considering Spatiotemporal Features. *Sustainability*. 2022; 14(16):10039.
https://doi.org/10.3390/su141610039

**Chicago/Turabian Style**

Zhou, Shenghan, Chaofan Wei, Chaofei Song, Yu Fu, Rui Luo, Wenbing Chang, and Linchao Yang.
2022. "A Hybrid Deep Learning Model for Short-Term Traffic Flow Pre-Diction Considering Spatiotemporal Features" *Sustainability* 14, no. 16: 10039.
https://doi.org/10.3390/su141610039