Mixed-Graph Neural Network for Traffic Flow Prediction by Capturing Dynamic Spatiotemporal Correlations

Xing Su, Pengcheng Li, Zhi Cai, Limin Guo, Boya ZhangISPRS Int. J. Geo Inf 2025 · DOI

TL;DR

This paper introduces a novel "Mixed-Graph Neural Network" (MGNN) for traffic flow prediction that dynamically captures both static and dynamic spatial correlations in road networks, alongside temporal correlations. By combining Graph Convolutional Networks (GCN) for static features and Graph Attention Networks (GAT) for dynamic features, and then feeding these into a Transformer encoder, the MGNN achieves state-of-the-art prediction accuracy on real-world datasets, particularly excelling in long-term forecasting.

What Problem Does This Paper Address?

Accurate traffic flow prediction is crucial for intelligent transportation systems, helping to manage congestion and improve travel efficiency. Existing methods often rely on fixed graph structures to model spatial relationships in road networks. However, this approach struggles to adapt to the dynamic nature of traffic, which can be influenced by real-time events like accidents or changing traffic conditions. This limitation hinders the ability to capture complex, time-varying spatial correlations, leading to suboptimal prediction accuracy, especially for longer prediction horizons.

Methods

The proposed Mixed-Graph Neural Network (MGNN) tackles this by employing a multi-stage approach:

  • Spatial Characteristics Extraction Layer: This is the core innovation. It uses a GCN to capture static spatial correlations (based on the fixed road network structure) and a GAT to capture dynamic spatial correlations (adapting to real-time traffic variations). These two streams are fused using a gating mechanism, allowing the model to dynamically weigh the importance of static versus dynamic spatial features. A residual connection is also employed to retain raw input information.
  • Temporal Characteristics Extraction Layer: A Transformer encoder is used here to model the temporal dependencies within the traffic flow data. The Transformer's self-attention mechanism is well-suited for capturing long-range temporal correlations, which is crucial for accurate forecasting.
  • Output Layer: A classical convolution layer is used to generate the final traffic flow predictions.

Datasets

The model was evaluated on five real-world traffic flow datasets:

  • PEMS03, PEMS04, PEMS07, PEMS08: These datasets are sourced from roadside sensors on California highways and are widely used in traffic flow prediction research. They provide traffic flow data collected every five minutes.
  • BJTaxi: This dataset consists of taxi GPS trajectories collected in Beijing, with data recorded every half hour.

Key Insights and Ideas

  • Dynamic Spatial Correlations Matter: The paper strongly emphasizes that static road network structures are insufficient. Capturing how traffic flows dynamically interact between adjacent road segments is key to improving prediction accuracy.
  • GCN + GAT Synergy: Combining GCN (for static) and GAT (for dynamic) is more effective than using either alone. GAT's attention mechanism allows it to adapt to changing traffic conditions, while GCN provides a stable baseline based on the network topology.
  • Transformer for Long-Term Temporal Patterns: The Transformer encoder proves highly effective at capturing long-range temporal dependencies, which is critical for accurate forecasting beyond immediate future steps.
  • Gating Mechanism for Feature Fusion: The gating mechanism intelligently blends the static and dynamic spatial features, allowing the model to learn the optimal balance for different traffic scenarios.
  • Robustness to Missing Data: The model demonstrates good robustness when faced with missing traffic data, a common issue in real-world scenarios.

Key Results

  • The proposed MGNN model consistently outperforms several state-of-the-art baseline models (including SVR, LSTM, STGNN, AGCRN, GWN, STGCN, ASTGCN, STSGCN, STFGNN, and STCDN) across all five datasets in terms of MAE, MAPE, and RMSE.
  • The model shows strong performance in long-term traffic flow prediction, with prediction accuracy remaining acceptable even for prediction intervals of 36 time steps (3 hours for PeMS, 18 hours for BJTaxi).
  • Ablation studies confirm the importance of each component: removing GAT led to a small accuracy decrease, removing GCN led to a larger decrease, and removing the Transformer encoder resulted in a significant drop in accuracy, especially for longer prediction intervals.

Limitations and Future Work

  • Ignoring Functional Characteristics: The current model only considers traffic flow and road network characteristics. The authors suggest incorporating functional characteristics of road segments in future work.
  • User Travel Routes: The paper proposes considering users' travel routes as an additional factor to improve prediction accuracy by better representing the links between road segments.

Summary updated

BibTeX
@article{su2025mixed,
  author = {Xing Su and Pengcheng Li and Zhi Cai and Limin Guo and Boya Zhang},
  title = {{Mixed-Graph Neural Network for Traffic Flow Prediction by Capturing Dynamic Spatiotemporal Correlations}},
  journal = {ISPRS Int. J. Geo Inf.},
  year = {2025},
  doi = {10.3390/ijgi14100379},
}
Figure