Improved Heterogeneous Spatiotemporal Graph Network Model for Traffic Flow Prediction at Highway Toll Stations
Abstract
1. Introduction
- (1)
- For the prediction of traffic flow at highway toll stations, an improved heterogeneous spatiotemporal graph network model is designed. This innovatively considers the contribution of upstream toll stations to the traffic flow at the target station, optimizing graph structure data by constructing a dynamic influence matrix and combining it with the covariance matrix between toll stations.
- (2)
- A deep learning model that integrates spatiotemporal attention mechanisms with encoder–decoder is proposed, incorporating external weather factors. With the help of the attention mechanism, dynamic weights are allocated to the target toll stations from multiple dimensions such as time series, spatial correlations, and external factors.
- (3)
- The performance of the proposed framework is verified based on actual traffic flow data. Experimental results show that this framework has significant advantages compared to five benchmark methods.
2. Related Studies
3. Preliminaries and Problem Definitions
4. Model Construction
4.1. Encoder Structure
4.1.1. Construction of Spatial Feature Learner
4.1.2. Construction of Temporal Feature Learner
- Adjacent temporal feature (time): The situation in which the current predicted period of traffic volume data in the stable change pattern of traffic flow at highway stations is affected by the adjacent previous period or periods. That is capturing the impact of the predicted time t.
- Trend temporal characteristics (days): Station traffic flow has a similar trend of change every 24 h, such as the appearance of morning and evening peaks at similar times, and the trend of change between peak and off peak is similar. Capture the degree impact of .
- Periodic time characteristics (weeks): The traffic flow at the station has a clear weekly pattern, and the traffic flow during the current predicted time period is influenced by the traffic flow situation of the previous week or weeks. Capture the degree to which is affected by .
4.1.3. Construction of External Feature Learner
4.2. Decoder Structure
| Algorithm 1. ST-ED-GAGGRU Pseudocode for task training algorithm |
| Input: Historical traffic data, Structure of Highway Station Map , Covariance matrix , influence probability matrix , weather condition: Output: Trained traffic predictor . //Model training 1. Repeat: epoch = epoch + 1 2. For each epoch extract from the training set 3. 4. 5. Until meet the conditions for stopping the strategy 6. Calculate the loss and iterate in reverse //Model prediction 7. for i++, i < n 8. 9. 10. end Output: |
5. Experimental Analysis
5.1. Dataset Description
5.2. Evaluation Metrics & Experimental Environment
5.3. Baseline Methods
5.4. Experimental Setting
5.5. Experimental Results
5.6. Ablation Experiment
- (1)
- Using traditional graph convolutional networks instead of graph attention networks (ST-ED_GCNGRU): This model replaces GAT, which involves spatial feature extraction, with GCN to achieve traffic prediction for the next time step of input data, while keeping other structures unchanged. Observe the dynamic correlation extraction effect of GAT on spatial features.
- (2)
- Not using spatial feature extractor (T_ED-GATGRU): This model removes the GAT module that involves spatial feature extraction and only fuses temporal and external environmental features. It still uses the ENCODER-DECODER structure to achieve traffic prediction for the next time step of input data, and observes the effectiveness of the model that only considers the correlation between temporal and external features.
- (3)
- Not using a temporal feature extractor (S_ED-GATGRU): This model removes the GRU module involved in temporal feature extraction, leaving other structures unchanged, to achieve traffic prediction for the next time step of input data. The model only considers spatial and external feature correlation effects.
- (4)
- Not using the external feature fusion module (ST_ED_GATGRU_nofusion): This model removes external feature data, does not consider spatiotemporal attention fusion, and maintains other structures to achieve traffic prediction for the next time step of input data. It only considers spatiotemporal features, does not perform feature fusion, and does not consider the correlation of external features.
6. Conclusions
- (1)
- In terms of case analysis, the traffic flow data of Chengdu-Chengyu Station on the Sichuan province highway was used for case experimental analysis and ablation experiments, and HA, ARIMA, SVR, LSTM, and ST-GCN were selected as baseline models. The experimental results show that the proposed model has RMSE, MAE, R2 values of 35.42, 17.57, and 0.74 for exit traffic flow prediction, and RMSE, MAE, R2 values of 37.06, 18.78, and 0.72 for entrance traffic flow prediction, respectively. This demonstrates the effectiveness of model construction and feature selection in this chapter.
- (2)
- In terms of ablation experiment analysis, the ST_ED_GATGRU model for exit traffic flow prediction performance improved by 0.26 in RMSE, 0.25 in MAE, and 1.35% in R2, and the ST_ED_GATGRU model for exit traffic flow prediction performance improved by 0.87 in RMSE, 0.08 in MAE, and 4.17% in R2. This study assesses the influence of distinct modules within the proposed model on the accuracy of the entire model.
- (3)
- In comparative experiments that only consider the influence of static physical space, it was found that in terms of exit flow prediction, the proposed model performance indicators RMSE and MAE decreased by 11.63% and 13.43%, while R2 increased by 12.16%. In terms of entrance flow prediction, the proposed model performance indicators RMSE and MAE decreased by 4.56% and 6.58%, while R2 increased by 11.11%. This illustrates the impact of dynamic spatiality on prediction results.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Naheliya, B.; Redhu, P.; Kumar, K. A Review on Developments in Evolutionary Computation Approaches for Road Traffic Flow Prediction: A Review on Developments in Evolutionary Computation Approaches for Road…: B. Naheliya et al. Arch. Comput. Methods Eng. 2025, 32, 1–25. [Google Scholar] [CrossRef]
- Khalil, R.A.; Safelnasr, Z.; Yemane, N.; Kedir, M.; Shafiqurrahman, A.; Saeed, N. Advanced Learning Technologies for Intelligent Transportation Systems: Prospects and Challenges. IEEE Open J. Veh. Technol. 2024, 5, 397–427. [Google Scholar] [CrossRef]
- Sattarzadeh, A.R.; Pathirana, P.N.; Huynh, V.T. Traffic State Estimation with Spatio-Temporal Autoencoding Transformer (STAT Model). IEEE Access 2025, 13, 87048–87067. [Google Scholar] [CrossRef]
- Wei, X.; Xia, D.; Li, Y.; Ao, Y.; Chen, Y.; Hu, Y.; Li, Y.; Li, H. Attention-based spatial-temporal synchronous graph convolution networks for traffic flow forecasting. Appl. Intell. 2025, 55, 516. [Google Scholar] [CrossRef]
- Song, L.; Ren, Q.; Zhou, Y. Spatio-Temporal Heterogeneous Graph Neural Network with Multi-view Learning for Traffic Prediction. In Proceedings of the International Conference on Pattern Recognition, Viña del Mar, Chile, 1–4 December 2025; Springer: Cham, Switzerland, 2025. [Google Scholar]
- Wang, R.; Xi, L.; Ye, J.; Zhang, F.; Yu, X.; Xu, L. Adaptive Spatio-Temporal Relation Based Transformer for Traffic Flow Prediction. IEEE Trans. Veh. Technol. 2025, 74, 2220–2230. [Google Scholar] [CrossRef]
- Wang, D.; Guo, G.; Ouyang, T.; Yu, D.; Zhang, H.; Li, B.; Jiang, R.; Xu, G.; Deng, S. A Lightweight Spatio-Temporal Neural Network With Sampling-Based Time Series Decomposition for Traffic Forecasting. IEEE Trans. Intell. Transp. Syst. 2025, 26, 8682–8693. [Google Scholar] [CrossRef]
- Rahimi, R.; Ravirathinam, P.; Ebtehaj, A.; Behrangi, A.; Tan, J.; Kumar, V. Global Precipitation Nowcasting of Integrated Multi-satellitE Retrievals for GPM: A U-Net Convolutional LSTM Architecture. J. Hydrometeorol. 2024, 25, 947–963. [Google Scholar] [CrossRef]
- Xia, D.; Shen, B.; Geng, J.; Hu, Y.; Li, Y.; Li, H. Attention-based spatial–temporal adaptive dual-graph convolutional network for traffic flow forecasting. Neural Comput. Appl. 2023, 35, 17217–17231. [Google Scholar] [CrossRef]
- Zhu, W.; Zhou, X.; Lan, S.; Wang, W.; Hou, Z.; Ren, Y.; Pan, T. A dual branch graph neural network based spatial interpolation method for traffic data inference in unobserved locations. Inf. Fusion 2025, 114, 102703. [Google Scholar] [CrossRef]
- Vlahogianni, E.I.; Karlaftis, M.G.; Golias, J.C. Short-term traffic forecasting: Where we are and where we’re going. Transp. Res. Part C Emerg. Technol. 2014, 43, 3–19. [Google Scholar] [CrossRef]
- Vol, N. Nonparametric statistics for stochastic processes. In Nonparametric Statistics for Stochastic Processes; Springer: Cham, Switzerland, 1998. [Google Scholar]
- Williams, B.M. Multivariate Vehicular Traffic Flow Prediction: Evaluation of ARIMAX Modeling. Transp. Res. Rec. J. Transp. Res. Board 2001, 1776, 194–200. [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. J. Transp. Res. Board 1999, 1678, 179–188. [Google Scholar] [CrossRef]
- Zhao, X.; Bi, R.; Yang, R.; Chu, Y.; Guo, J.; Huang, W.; Cao, J. Short-Term Traffic Flow Prediction Based on the Intelligent Parameter Adjustment K-Nearest Neighbor Algorithm. In International Conference on Artificial Intelligence and Soft Computing; Springer: Cham, Switzerland, 2020. [Google Scholar]
- Zhang, Y.; Xie, Y. Forecasting of Short-Term Freeway Volume with v-Support Vector Machines. Transp. Res. Rec. J. Transp. Res. Board 2007, 2024, 92–99. [Google Scholar] [CrossRef]
- Xie, Y.; Zhao, K.; Sun, Y.; Chen, D. Gaussian Processes for Short-Term Traffic Volume Forecasting. Transp. Res. Rec. J. Transp. Res. Board 2010, 2165, 69–78. [Google Scholar] [CrossRef]
- Sun, S.; Zhang, C.; Yu, G. A Bayesian Network Approach to Traffic Flow Forecasting. IEEE Trans. Intell. Transp. Syst. 2006, 7, 124–132. [Google Scholar] [CrossRef]
- Erfani, S.M.; Rajasegarar, S.; Karunasekera, S.; Leckie, C. High-dimensional and large-scale anomaly detection using a linear one-class SVM with deep learning. Pattern Recognit. 2016, 58, 121–134. [Google Scholar] [CrossRef]
- 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]
- Huang, W.; Song, G.; Hong, H.; Xie, K. Deep Architecture for Traffic Flow Prediction: Deep Belief Networks with Multitask Learning. IEEE Trans. Intell. Transp. Syst. 2014, 15, 2191–2201. [Google Scholar] [CrossRef]
- Yang, H.-F.; Dillon, T.S.; Chen, Y.-P.P. Optimized Structure of the Traffic Flow Forecasting Model With a Deep Learning Approach. IEEE Trans. Neural Netw. Learn. Syst. 2017, 28, 2371–2381. [Google Scholar] [CrossRef]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
- Hinton, G.E.; Osindero, S.; Teh, Y.-W. A Fast Learning Algorithm for Deep Belief Nets. Neural Comput. 2006, 18, 1527–1554. [Google Scholar] [CrossRef]
- Yang, D.; Li, S.; Peng, Z.; Wang, P.; Wang, J.; Yang, H. MF-CNN: Traffic Flow Prediction Using Convolutional Neural Network and Multi-Features Fusion. IEICE Trans. Inf. Syst. 2019, E102.D, 1526–1536. [Google Scholar] [CrossRef]
- 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; IEEE: Piscataway, NJ, USA, 2017. [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; IEEE: Piscataway, NJ, USA, 2016. [Google Scholar]
- Xiao, J.; Long, B. A multi-channel spatial-temporal transformer model for traffic flow forecasting. Inf. Sci. 2024, 671, 14. [Google Scholar] [CrossRef]
- Srivastava, N.; Devarakonda, R.; Ruthwik; Krishna, V.; Bharadwaj, B.; Gohil, B.N. Predicting Traffic Flow with Deep Learning. In International Conference on Soft Computing for Problem-Solving; Springer: Cham, Switzerland, 2024. [Google Scholar]
- Ma, Y.; Lou, H.; Yan, M.; Sun, F.; Li, G. Spatio-temporal fusion graph convolutional network for traffic flow forecasting. Inf. Fusion 2024, 104, 11. [Google Scholar] [CrossRef]
- Karim, A.; Nower, N. Probabilistic spatio-temporal graph convolutional network for traffic forecasting. Appl. Intell. 2024, 54, 7070–7085. [Google Scholar] [CrossRef]
- Jiang, S.; Zhu, M.; Li, J. Traffic Flow Forecasting Using a Spatial-Temporal Attention Graph Convolutional Network Predictor. In International Conference on Spatial Data and Intelligence; Springer: Cham, Switzerland, 2020. [Google Scholar]
- Gu, J.; Jia, Z.; Cai, T.; Song, X.; Mahmood, A. Dynamic Correlation Adjacency-Matrix-Based Graph Neural Networks for Traffic Flow Prediction. Sensors 2023, 23, 2897. [Google Scholar] [CrossRef]
- Kong, Y.; Li, L.; Zhang, K.; Ni, Q. Attention module-based spatial–temporal graph convolutional networks for skeleton-based action recognition. J. Electron. Imaging 2019, 28, 1. [Google Scholar] [CrossRef]
- Shao, Z.; Yao, X.; Wang, Z.; Gao, J. ST-MambaSync: The Complement of Mamba and Transformers for Spatial-Temporal in Traffic Flow Prediction. arXiv 2024, arXiv:2404.15899. [Google Scholar]
- Wu, Y.; Tan, H.; Qin, L.; Ran, B.; Jiang, Z. A hybrid deep learning based traffic flow prediction method and its understanding. Transp. Res. Part C Emerg. Technol. 2018, 90, 166–180. [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]
- Zheng, H.; Li, X.; Li, Y.; Yan, Z.; Li, T. GCN-GAN: Integrating Graph Convolutional Network and Generative Adversarial Network for Traffic Flow Prediction. IEEE Access 2022, 10, 94051–94062. [Google Scholar] [CrossRef]
- Hu, N.; Liang, W.; Zhang, D.; Xie, K.; Li, K.; Zomaya, A.Y. FedGCN: A Federated Graph Convolutional Network for Privacy-Preserving Traffic Prediction. IEEE Trans. Sustain. Comput. 2024, 9, 925–935. [Google Scholar] [CrossRef]















| Year | Authors | Model Approach |
|---|---|---|
| 2016 | Wu et al. [20] | A feature-level fusion model that utilizes CNN to capture the spatial features of traffic flow and two LSTMs to mine the short-term periodicity characteristics of traffic flow. |
| 2017 | Yu B et al. [31] | A novel deep learning framework, spatial temporal graph convolutional network (STGCN) to tackle the time series prediction problem in traffic domain. |
| 2018 | Wu et al. [36] | Constructing a fusion prediction model based on CNN_GRU. |
| 2019 | Z. Wu et al. [37] | A novel graph neural network architecture, Graph WaveNet, for spatial-temporal graph modeling. By developing a novel adaptive dependency matrix and learn it through node embedding. |
| 2019 | S. Guo et al. [34] | A novel attention based spatial-temporal graph convolutional network (ASTGCN) model to solve traffic flow forecasting problem. |
| 2020 | Jiang S et al. [32] | A novel attention-based graph neural network predictor (GAT) to forecast traffic flow. |
| 2022 | H. Zheng et al. [38] | A novel traffic flow prediction model named “graph convolution and generative adversative neural network” (GCN-GAN) to predict urban traffic flow. |
| 2023 | Gu J et al. [33] | A novel model named “dynamic correlation graph convolutional network” (DCGCN) for traffic forecasting. |
| 2024 | Shao Z et al. [35] | A multi-level multi-view augmented spatiotemporal transformer (Transformer) for traffic prediction. |
| 2024 | N Hu et al. [39] | A federated graph neural network with spatial information completion (FedGCN) for privacy-preserving traffic prediction. |
| Symbol | Definition |
|---|---|
| Historical traffic flow of k time slices | |
| Traffic feature matrix | |
| Road network graph | |
| Covariance matrix | |
| Influence probability matrix | |
| Output of encoder hidden layer | |
| Output of decoder hidden layer | |
| Final model output data |
| No. | Station | Mean | σ | Min | Max | Traffic Contribution Rate |
|---|---|---|---|---|---|---|
| 1 | 40 | 5135.92 | 3217.58 | 596 | 9500 | 3.32% |
| 2 | 62 | 1626.75 | 1245.96 | 85 | 3752 | 16.36% |
| 3 | 64 | 926.54 | 761.04 | 28 | 2210 | 3.77% |
| 4 | 66 | 1421.58 | 1012.66 | 140 | 3159 | 10.13% |
| 5 | 67 | 1425.71 | 1118.94 | 89 | 3356 | 10.69% |
| 6 | 70 | 569.17 | 410.92 | 64 | 1283 | 1.98% |
| 7 | 71 | 1417.75 | 1078.86 | 132 | 3342 | 5.77% |
| 8 | 73 | 1903.92 | 1477.89 | 176 | 4516 | 2.21% |
| 9 | 81 | 1388.96 | 1171.90 | 68 | 3540 | 2.77% |
| 10 | 141 | 918.58 | 702.35 | 104 | 2137 | 1.85% |
| 11 | 146 | 1977.83 | 1584.23 | 88 | 4864 | 1.80% |
| 12 | 830 | 889.13 | 681.70 | 60 | 1880 | 1.80% |
| 13 | 934 | 3272.17 | 2501.11 | 314 | 6944 | 2.88% |
| 14 | 951 | 2092.54 | 1788.58 | 200 | 6264 | 3.58% |
| Hardware Configuration | Parameters | Software Configuration | Parameters |
|---|---|---|---|
| CPU | Intel(R) Core(TM) i7 | Programming language | Python3.7 |
| Memory/hard disk | 64G/2T | Deep learning framework | TensorFlow 2.0 |
| Graphics card | NVIDIA GeForce GTX 1050 | Deep learning library | Keras 2.3 |
| database | Linux7.9 Oracle11g |
| Module | Hyperparameters | Values |
|---|---|---|
| ENCODER | Hidden nodes layer | 128 |
| DECODER | Hidden nodes layer | 128 |
| Graph Attention Network | Hidden nodes layer | 64 |
| The head of Attention | 4 | |
| Gate controlled cycle unit | Hidden nodes layer | 64 |
| Fully connected layer | Hidden nodes layer | 128 |
| Overall Model | Optimizer | SGD |
| Learning rate | 0.001 | |
| Epoch | 80 | |
| Decay rate | 0.95 | |
| Batch_size | 64 |
| Model | Exit Traffic | Entrance Traffic | ||||
|---|---|---|---|---|---|---|
| RMSE | MAE | R2 | RMSE | MAE | R2 | |
| HA | 54.67 | 28.93 | 0.42 | 53.26 | 28.04 | 0.43 |
| ARIMA | 53.38 | 27.64 | 0.27 | 53.19 | 27.24 | 0.28 |
| SVR | 53.07 | 27.13 | 0.46 | 52.23 | 27.06 | 0.47 |
| LSTM | 46.78 | 23.63 | 0.58 | 46.32 | 23.41 | 0.58 |
| ST_GCN | 41.09 | 21.53 | 0.63 | 45.28 | 22.36 | 0.61 |
| ST_ED_GATGRU | 35.42 | 17.57 | 0.74 | 37.06 | 18.78 | 0.72 |
| Model | Exit Traffic | Entrance Traffic | ||||
|---|---|---|---|---|---|---|
| RMSE | MAE | R2 | RMSE | MAE | R2 | |
| ST_ED_GATGRU | 35.42 | 17.57 | 0.74 | 37.06 | 18.78 | 0.72 |
| ST_ED_GCNGRU | 35.68 | 17.82 | 0.73 | 37.89 | 18.86 | 0.69 |
| T_ED_GATGRU | 36.43 | 18.17 | 0.7 | 37.98 | 18.94 | 0.68 |
| S_ED_GATGRU | 36.19 | 18.03 | 0.71 | 38.23 | 19.14 | 0.67 |
| ST_ED_GATGRU_nofusion | 36.75 | 18.24 | 0.68 | 38.54 | 19.29 | 0.65 |
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
Zhang, Y.; Chen, J.; Chen, F.; Gao, J. Improved Heterogeneous Spatiotemporal Graph Network Model for Traffic Flow Prediction at Highway Toll Stations. Sustainability 2025, 17, 7905. https://doi.org/10.3390/su17177905
Zhang Y, Chen J, Chen F, Gao J. Improved Heterogeneous Spatiotemporal Graph Network Model for Traffic Flow Prediction at Highway Toll Stations. Sustainability. 2025; 17(17):7905. https://doi.org/10.3390/su17177905
Chicago/Turabian StyleZhang, Yaofang, Jian Chen, Fafu Chen, and Jianjie Gao. 2025. "Improved Heterogeneous Spatiotemporal Graph Network Model for Traffic Flow Prediction at Highway Toll Stations" Sustainability 17, no. 17: 7905. https://doi.org/10.3390/su17177905
APA StyleZhang, Y., Chen, J., Chen, F., & Gao, J. (2025). Improved Heterogeneous Spatiotemporal Graph Network Model for Traffic Flow Prediction at Highway Toll Stations. Sustainability, 17(17), 7905. https://doi.org/10.3390/su17177905

