Hierarchical Dynamic Spatio-Temporal Graph Convolutional Networks with Self-Supervised Learning for Traffic Flow Forecasting
Abstract
:1. Introduction
2. Related Work
2.1. Traditional Traffic Flow Prediction Methods
2.2. Deep Learning-Based Traffic Flow Prediction Methods
2.3. Graph Convolutional Networks
3. Preliminaries
4. Methods and Materials
4.1. Graph Construction Module
4.1.1. Construction of the Spatio-Temporal Dynamic Graph
4.1.2. Regional Graphs
Algorithm 1. Graph structure cluster analysis. |
Input: Adjacency matrix (), num_clusters () 1: Applied clustering: KMeans.fit () 2: Gets cluster assignment: cluster_labels = KMeans.predict () 3: Data initialization: new_adj_matrix, cluster_count 4: for i = 1; i < .shape[0]; i++ do 5: for j = 1; j < .shape[1]; j++ do 6: Perform cluster analysis according to Equations (9)–(14). 7: end for 8: end for 9: cluster_i = cluster_labels[i] 10: cluster_j = cluster_labels[j] 11: if cluster_i == cluster_j: 12: new_adj_matrix[cluster_i, cluster_j] += adj_matrix[i, j] 13: cluster_count[cluster_i] += 1 14: end if Output: New adjacency matrix (). |
4.2. Feature Learning Module
4.2.1. Dynamic Spatio-Temporal Feature Learning
4.2.2. Regional Feature Learning
4.2.3. Self-Supervised Learning
4.3. Loss Function
5. Results
5.1. Datasets
- PeMSD4: This dataset contains traffic flow data from 307 detectors, collected at a frequency of every 5 min for a total data duration of 59 days. The data were collected between January and February 2018;
- PeMSD8: This dataset was provided by 170 detectors, collected at the same frequency of every 5 min, with a total data duration of 62 days, covering the period from July to August 2016.
5.2. Experimental Settings
- (1)
- Mean absolute error:
- (2)
- Root mean square error:
- (3)
- Mean absolute percentage error:
5.3. Result Comparison
5.4. Experimental Results
5.5. Ablation Experiments
- (1)
- w/o cluster: The ablation results show that this variant exhibits a significant degradation in performance on the PeMSD4 and PeMSD8 datasets. Specifically, the MAE increased from 18.53 to 18.64 on the PEMSD4 dataset and from 14.35 to 14.50 on the PEMSD8 dataset, suggesting that the use of proximity-based rather than clustering to construct the area graph fails to capture cross-area semantic relationships effectively, leading to an increase in prediction error. The lack of clustering analysis affects the model’s ability to capture cross-regional traffic flows, making the construction of the area graph less accurate.
- (2)
- w/o compare: The ablation results show a decrease in model performance after omitting the self-supervised learning module. For example, the MAE on the PEMSD4 dataset increases from 18.53 to 18.57 and the RMSE increases from 30.64 to 31.05, highlighting the importance of comparative learning in capturing and integrating dynamic graph features. Without this mechanism, the model is unable to exploit the mutual information between the two graph networks effectively, resulting in lower prediction accuracy.
- (3)
- w/o RDGC: The results show a significant decrease in model performance after removing the recursive dynamic graph convolution module. Specifically, on the PEMSD4 dataset, the MAE improves to 24.82 and the RMSE reaches 38.97. This result suggests that the RDGC module is crucial for capturing spatio-temporal variations in the features of the dynamic graphs, and its absence significantly affects the model’s ability to understand and process the dynamic relationships.
- (4)
- w/o GCN: The use of simple graph convolution instead of Chebyshev polynomial-based graph convolution resulted in a decrease in performance. On the PEMSD4 dataset, the MAE is 18.62 and the RMSE is 31.07, indicating that Chebyshev polynomial-based graph convolution has a significant advantage in extracting features from the region graph and captures the complex relationships among regions more accurately.
- (5)
- w/o Attention: Models that did not use the attention mechanism performed poorly. On the PEMSD4 dataset, the MAE was 18.59 and the RMSE was 30.90, highlighting the importance of the attention mechanism in the construction of the dynamic graphs, which effectively adjusts the importance of the dynamic information to increase the predictive power of the model.
6. Discussion
6.1. Parametric Analysis
6.2. Computation Cost
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Jing, L.; Wei, G. A Summary of Traffic Flow Forecasting Methods. J. Highw. Transp. Res. Dev. 2004, 21, 82–85. [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]
- Drucker, H.; Burges, C.J.; Kaufman, L.; Smola, A.; Vapnik, V. Support vector regression machines. In Proceedings of the Annual Conference on Neural Information Processing Systems, Denver, CO, USA, 2–5 December 1996; Volume 9, pp. 155–161. [Google Scholar]
- Cover, T.M.; Hart, P.E. Nearest neighbor pattern classification. IEEE Trans. Inf. Theory 1953, 13, 21–27. [Google Scholar] [CrossRef]
- Krizhevsky, A.; Sutskever, I.; Hinton, G. ImageNet Classification with Deep Convolutional Neural Networks. In Proceedings of the Annual Conference on Neural Information Processing Systems, Lake Tahoe, NV, USA, 3–6 December 2012; Volume 25. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long Short-term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Mnih, V.; Heess, N.; Graves, A.; Kavukcuoglu, K. Recurrent Models of Visual Attention. In Proceedings of the Annual Conference on Neural Information Processing Systems, Montreal, QC, Canada, 8–13 December 2014; Volume 3. [Google Scholar]
- Bai, S.; Kolter, J.Z.; Koltun, V. An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling. arXiv 2018, arXiv:1803.01271. [Google Scholar]
- Zhao, W.; Gao, Y.; Ji, T.; Wan, X.; Ye, F.; Bai, G. Deep Temporal Convolutional Networks for Short-Term Traffic Flow Forecasting. IEEE Access 2019, 7, 114496–114507. [Google Scholar] [CrossRef]
- Kipf, T.N.; Welling, M. Semi-Supervised Classification with Graph Convolutional Networks. arXiv 2016, arXiv:1609.02907. [Google Scholar]
- Wang, J.; Chen, Q. A traffic prediction model based on multiple factors. J. Supercomput. 2020, 77, 2928–2960. [Google Scholar] [CrossRef]
- Hu, Y.; Peng, T.; Guo, K.; Sun, Y.; Gao, J.; Yin, B. Graph transformer based dynamic multiple graph convolution networks for traffic flow forecasting. IET Intell. Transp. Syst. 2023, 17, 1835–1845. [Google Scholar] [CrossRef]
- Sui, Y. An Efficient Short-Term Traffic Speed Prediction Model Based on Improved TCN and GCN. Sensors 2021, 21, 6735. [Google Scholar] [CrossRef]
- Shi, T.; Yuan, W.; Wang, P.; Zhao, X. Regional Traffic Flow Prediction on multiple Spatial Distributed Toll Gate in a City Cycle, 2021. In Proceedings of the IEEE 16th Conference on Industrial Electronics and Applications (ICIEA), Chengdu, China, 1–4 August 2021; pp. 94–99. [Google Scholar]
- 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. [Google Scholar]
- Liu, L.; Cao, Y.; Dong, Y.; Li, M.E. Attention-Based Multiple Graph Convolutional Recurrent Network for Traffic Forecasting. Sustainability 2023, 15, 4697. [Google Scholar] [CrossRef]
- Zhang, H.; Chen, L.; Cao, J.; Zhang, X.; Kan, S.; Zhao, T. Traffic Flow Forecasting of Graph Convolutional Network Based on Spatio-Temporal Attention Mechanism. Int. J. Automot. Technol. 2023, 24, 1013–1023. [Google Scholar] [CrossRef]
- Zhang, Q.; Chang, W.; Yin, K.T.M. Attention-Based Spatial-Temporal Convolution Gated Recurrent Unit for Traffic Flow Forecasting. Entropy 2023, 25, 938. [Google Scholar] [CrossRef] [PubMed]
- Shen, B.; Liang, X.; Ouyang, Y.; Liu, M.; Zheng, W.; Carley, K.M. StepDeep: A Novel Spatial-temporal Mobility Event Prediction Framework based on Deep Neural Network. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, London, UK, 19–28 August 2018. [Google Scholar]
- Wang, H.; Li, Z. Region Representation Learning via Mobility Flow. In Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, Singapore, 6–10 November 2017. [Google Scholar]
- Zhao, L.; Song, Y.; Zhang, C.; Liu, Y.; Li, H. T-GCN: A Temporal Graph Convolutional Network for Traffic Prediction. IEEE Trans. Intell. Transp. Syst. 2019, 21, 3848–3858. [Google Scholar] [CrossRef]
- Wu, Z.; Pan, S.; Long, G.; Jiang, J.; Zhang, C. Graph WaveNet for Deep Spatial-Temporal Graph Modeling. arXiv 2019, arXiv:1906.00121. [Google Scholar]
- Bai, L.; Yao, L.; Li, C.; Wang, X.; Wang, C. Adaptive Graph Convolutional Recurrent Network for Traffic Forecasting. In Proceedings of the Annual Conference on Neural Information Processing Systems, Online, 6–12 December 2020; Volume 33, pp. 17804–17815. [Google Scholar]
- Kalman, R.E. A New Approach to Linear Filtering and Prediction Problems. J. Fluids Eng. 1959, 82, 35–45. [Google Scholar] [CrossRef]
- Cheng, G.; Yang, C.; Yao, X.; Guo, L.; Han, J. When Deep Learning Meets Metric Learning: Remote Sensing Image Scene Classification via Learning Discriminative CNNs. IEEE Trans. Geosci. Remote Sens. 2018, 56, 2811–2821. [Google Scholar] [CrossRef]
- Saon, G.; Tueske, Z.; Bolanos, D.; Kingsbury, B. Advancing RNN Transducer Technology for Speech Recognition. In Proceedings of the ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Toronto, ON, Canada, 6–11 June 2021. [Google Scholar]
- Gu, Y.; Tinn, R.; Cheng, H.; Lucas, M.; Usuyama, N.; Liu, X.; Naumann, T.; Gao, J.; Poon, H. Domain-Specific Language Model Pretraining for Biomedical Natural Language Processing. ACM Trans. Comput. Healthc. 2020, 3, 1–23. [Google Scholar] [CrossRef]
- Lin, Z.; Feng, J.; Lu, Z.; Li, Y.; Jin, D. DeepSTN+: Context-Aware Spatial-Temporal Neural Network for Crowd Flow Prediction in Metropolis. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019; pp. 1020–1027. [Google Scholar]
- Zhang, J.; Zheng, Y.; Qi, D. Deep Spatio-Temporal Residual Networks for Citywide Crowd Flows Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, San Francisco, CA, USA, 4–9 February 2016. [Google Scholar]
- Yao, H.; Tang, X.; Wei, H.; Zheng, G.; Li, Z. Revisiting Spatial-Temporal Similarity: A Deep Learning Framework for Traffic Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019. [Google Scholar]
- Ye, J.; Sun, L.; Du, B.; Fu, Y.; Xiong, H. Coupled Layer-wise Graph Convolution for Transportation Demand Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020. [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]
- Li, F.; Feng, J.; Yan, H.; Jin, G.; Yang, F.; Sun, F.; Jin, D.; Li, Y. Dynamic Graph Convolutional Recurrent Network for Traffic Prediction: Benchmark and Solution. ACM Trans. Knowl. Discov. Data 2023, 17, 1–21. [Google Scholar] [CrossRef]
- Chung, J.; Gulcehre, C.; Cho, K.H.; Bengio, Y. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. arXiv 2014, arXiv:1412.3555. [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]
- Liang, G.; U, K.; Ning, X.; Tiwari, P.; Nowaczyk, S.; Kumar, N. Semantics-Aware Dynamic Graph Convolutional Network for Traffic Flow Forecasting. IEEE Trans. Veh. Technol. 2023, 72, 7796–7809. [Google Scholar] [CrossRef]
- Bao, Y.; Huang, J.; Shen, Q.; Cao, Y.; Ding, W.; Shi, Z.; Shi, Q. Spatial–Temporal Complex Graph Convolution Network for Traffic Flow Prediction. Eng. Appl. Artif. Intel. 2023, 121, 106044. [Google Scholar] [CrossRef]
- Qi, T.; Li, G.; Chen, L.; Xue, Y. ADGCN: An Asynchronous Dilation Graph Convolutional Network for Traffic Flow Prediction. IEEE Internet Things J. 2021, 9, 4001–4014. [Google Scholar] [CrossRef]
- Zheng, C.; Fan, X.; Wang, C.; Qi, J. GMAN: A Graph Multi-Attention Network for Traffic Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 1234–1241. [Google Scholar]
- Wang, Y.; Jing, C.; Xu, S.; Guo, T. Attention based spatiotemporal graph attention networks for traffic flow forecasting. Inf. Sci. 2022, 607, 869–883. [Google Scholar] [CrossRef]
- Wei, S.; Hu, D.; Wei, F.; Liu, D.; Wang, C. Traffic flow prediction with multi-feature spatio-temporal coupling based on peak time embedding. J. Supercomput. 2024, 80, 23442–23470. [Google Scholar] [CrossRef]
- Xu, J.; Huang, X.; Song, G.; Gong, Z. A coupled generative graph convolution network by capturing dynamic relationship of regional flow for traffic prediction. Clust. Comput. 2024, 27, 6773–6786. [Google Scholar] [CrossRef]
- Xu, J.; Li, Y.; Lu, W.; Wu, S.; Li, Y. A heterogeneous traffic spatio-temporal graph convolution model for traffic prediction. Phys. A Stat. Mech. Its Appl. 2024, 641, 129746. [Google Scholar] [CrossRef]
- Gao, M.; Wei, Y.; Xie, Y.; Zhang, Y. Traffic Prediction with Self-Supervised Learning: A Heterogeneity-Aware Model for Urban Traffic Flow Prediction Based on Self-Supervised Learning. Mathematics 2024, 12, 1290. [Google Scholar] [CrossRef]
- Sun, H.; Tang, X.; Lu, J.; Liu, F. Spatio-Temporal Graph Neural Network for Traffic Prediction Based on Adaptive Neighborhood Selection. Transp. Res. Rec. 2024, 2678, 641–655. [Google Scholar] [CrossRef]
- Ma, Y.; Lou, H.; Yan, M.; Sun, F.; Li, G. Spatio-temporal fusion graph convolutional network for traffic flow forecasting. Inf. Fusion 2024, 104, 102196. [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]
- Chen, C.; Petty, K.; Skabardonis, A. Freeway performance measurement: Mining loop detector data. Transp. Res. Rec. J. Transp. Res. Board 2000, 1748, 96–102. [Google Scholar] [CrossRef]
- Zivot, E.; Wang, J. Vector Autoregressive Models for Multivariate Time Series; Springer: New York, NY, USA, 2003. [Google Scholar]
- Li, M.; Zhu, Z. Spatial-Temporal Fusion Graph Neural Networks for Traffic Flow Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Online, 2–9 February 2021. [Google Scholar]
- Fang, Z.; Long, Q.; Song, G.; Xie, K. Spatial-Temporal Graph ODE Networks for Traffic Flow Forecasting. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, Singapore, 14–18 August 2021. [Google Scholar]
- Chen, Y.; Segovia-Dominguez, I.; Gel, Y.R. Z-GCNETs: Time Zigzags at Graph Convolutional Networks for Time Series Forecasting. In Proceedings of the 38th International Conference on Machine Learning, Online, 18–24 July 2021. [Google Scholar]
- Choi, J.; Choi, H.; Hwang, J.; Park, N. Graph Neural Controlled Differential Equations for Traffic Forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, Online, 22 February–1 March 2022. [Google Scholar]
- Wang, S.; Dai, H.; Bai, L.; Liu, C.; Chen, J. Temporal Branching-Graph Neural ODE without Prior Structure for Traffic Flow Forecasting. Eng. Let. 2023, 31, 1534. [Google Scholar]
- Yu, X.; Bao, Y.; Shi, Q. STHSGCN: Spatial-temporal heterogeneous and synchronous graph convolution network for traffic flow prediction. Heliyon 2023, 9, e19927. [Google Scholar] [CrossRef]
Datasets | Nodes | Rate | Time Steps | Time Range | Tpye |
---|---|---|---|---|---|
PEMSD4 | 307 | 16,992 | 5 min | 2018.01–2018.02 | Volume |
PEMSD8 | 170 | 17,856 | 5 min | 2016.07–2016.08 | Volume |
Model | PEMSD4 | PEMSD8 | ||||
---|---|---|---|---|---|---|
MAE | RMSE | MAPE | MAE | RMSE | MAPE | |
HA | 38.03 | 59.24 | 27.88% | 34.86 | 59.24 | 27.88% |
ARIMA | 33.73 | 48.80 | 24.18% | 31.09 | 44.32 | 22.73% |
VAR | 24.54 | 38.61 | 17.24% | 19.19 | 29.81 | 13.10% |
T-GCN | 23.10 | 34.68 | 18.16% | 19.96 | 28.89 | 16.96% |
STGCN | 23.64 | 36.43 | 14.70% | 19.00 | 28.70 | 11.32% |
ASTGCN | 21.38 | 33.83 | 14.18% | 18.25 | 28.06 | 11.64% |
STSGCN | 21.19 | 33.65 | 13.90% | 17.13 | 26.80 | 10.96% |
ST-CGCN | 20.78 | 33.62 | 13.71% | 17.84 | 26.43 | 10.63% |
Graph WaveNet | 24.89 | 39.66 | 17.29% | 18.28 | 30.05 | 12.15% |
STFGNN | 20.48 | 32.51 | 16.77% | 16.94 | 26.25 | 10.60% |
AGCRN | 19.83 | 32.26 | 12.97% | 15.95 | 25.22 | 10.09% |
STGODE | 20.84 | 32.82 | 13.77% | 16.81 | 25.97 | 10.62% |
Z-GCNETs | 19.50 | 31.61 | 12.78% | 15.76 | 25.11 | 10.01% |
STG-NCDE | 19.21 | 31.09 | 12.76% | 15.45 | 24.81 | 9.92% |
TBC-GNODE | 19.61 | 31.52 | 13.19% | 15.77 | 24.92 | 9.64% |
STHSGCN | 19.50 | 31.39 | 12.89% | 15.50 | 24.51 | 9.95% |
STFGCN | 18.95 | 30.90 | 12.36% | 15.23 | 24.35 | 9.83% |
SDSC | 18.53 | 30.64 | 12.22% | 14.35 | 23.60 | 9.49% |
PEMSD4 | SDSC | w/o Cluster | w/o Compare | w/o RDGC | w/o GCN | w/o Attention |
MAE | 18.53 | 18.64 | 18.57 | 24.82 | 18.62 | 18.59 |
RMSE | 30.64 | 30.75 | 31.05 | 38.97 | 31.07 | 30.90 |
MAPE | 12.22% | 12.41% | 12.49% | 17.04% | 12.42% | 12.45% |
PEMSD8 | SDSC | w/o Cluster | w/o Compare | w/o RDGC | w/o GCN | w/o Attention |
MAE | 14.35 | 14.50 | 14.43 | 20.00 | 14.43 | 14.46 |
RMSE | 23.60 | 24.05 | 23.84 | 31.65 | 23.71 | 23.75 |
MAPE | 9.49% | 9.51% | 9.54% | 12.84% | 9.64% | 9.61% |
Dataset | Models | Computation Time | |
---|---|---|---|
Training (s/Epoch) | Inference (s) | ||
PEMSD4 | AGCRN | 6.5 | 1.1 |
STGODE | 35.2 | 4.1 | |
STG-NCDE | 118.6 | 12.3 | |
SDSC | 124.3 | 12.8 | |
PEMSD8 | AGCRN | 3.9 | 0.5 |
STGODE | 22.3 | 2.1 | |
STG-NCDE | 43.2 | 4.3 | |
SDSC | 45.4 | 4.6 |
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. |
© 2024 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
Wei, S.; Song, Y.; Liu, D.; Shen, S.; Gao, R.; Wang, C. Hierarchical Dynamic Spatio-Temporal Graph Convolutional Networks with Self-Supervised Learning for Traffic Flow Forecasting. Inventions 2024, 9, 102. https://doi.org/10.3390/inventions9050102
Wei S, Song Y, Liu D, Shen S, Gao R, Wang C. Hierarchical Dynamic Spatio-Temporal Graph Convolutional Networks with Self-Supervised Learning for Traffic Flow Forecasting. Inventions. 2024; 9(5):102. https://doi.org/10.3390/inventions9050102
Chicago/Turabian StyleWei, Siwei, Yanan Song, Donghua Liu, Sichen Shen, Rong Gao, and Chunzhi Wang. 2024. "Hierarchical Dynamic Spatio-Temporal Graph Convolutional Networks with Self-Supervised Learning for Traffic Flow Forecasting" Inventions 9, no. 5: 102. https://doi.org/10.3390/inventions9050102
APA StyleWei, S., Song, Y., Liu, D., Shen, S., Gao, R., & Wang, C. (2024). Hierarchical Dynamic Spatio-Temporal Graph Convolutional Networks with Self-Supervised Learning for Traffic Flow Forecasting. Inventions, 9(5), 102. https://doi.org/10.3390/inventions9050102