Spatial-Temporal Graph ODE Networks for Traffic Flow Forecasting

Zheng Fang, Qingqing Long, Guojie Song, Kunqing Xie · DOI

Abstract

Spatial-temporal forecasting has attracted tremendous attention in a wide range of applications, and traffic flow prediction is a canonical and typical example. The complex and long-range spatial-temporal correlations of traffic flow bring it to a most intractable challenge. Existing works typically utilize shallow graph convolution networks (GNNs) and temporal extracting modules to model spatial and temporal dependencies respectively. However, the representation ability of such models is limited due to: (1) shallow GNNs are incapable to capture long-range spatial correlations, (2) only spatial connections are considered and a mass of semantic connections are ignored, which are of great importance for a comprehensive understanding of traffic networks. To this end, we propose Spatial-Temporal Graph Ordinary Differential Equation Networks (STGODE). Specifically, we capture spatial-temporal dynamics through a tensor-based ordinary differential equation (ODE), as a result, deeper networks can be constructed and spatial-temporal features are utilized synchronously. To understand the network more comprehensively, semantical adjacency matrix is considered in our model, and a well-design temporal dialated convolution structure is used to capture long term temporal dependencies. We evaluate our model on multiple real-world traffic datasets and superior performance is achieved over state-of-the-art baselines.

Introduction

Predicting traffic flow is notoriously difficult because it involves complex, multi-scale dependencies. A traffic jam at one intersection might affect a street miles away (long-range spatial), and morning rush hour patterns might repeat daily but shift slightly based on external events (long-term temporal).

Existing models usually stack shallow Graph Neural Networks (GNNs) to handle space and recurrent units to handle time. However, they face major hurdles. First, the "over-smoothing trap" in deep GNNs causes node representations to converge, making models effectively shallow and unable to capture long-range correlations. Second, isolated modeling of space and time misses intricate interactions. Finally, geographic bias often leads models to ignore "semantic" neighbors—distant areas that behave similarly regardless of physical distance.

Comparison of receptive fields between STGODE and STGCN, illustrating STGODE's ability to capture long-range spatial correlations and avoid the over-smoothing trap.

Methodology

STGODE treats traffic forecasting as a continuous dynamic system. By integrating Neural ODEs with graph tensors, the model captures long-range spatial-temporal dependencies synchronously. The framework utilizes three key innovations:

  • Tensor-based Neural ODEs: Instead of discrete layers, STGODE models the evolution of hidden states using an Ordinary Differential Equation. By representing traffic data as a 3D tensor (Nodes × Features × Time), the ODE solver updates spatial and temporal features together, allowing for much deeper effective layers.
  • Dual Adjacency Matrices: The model uses a standard Spatial Matrix (physical distance) and a Semantic Matrix created using Dynamic Time Warping (DTW). DTW identifies nodes with similar historical traffic shapes, allowing the model to share information between distant but functionally similar road segments.
  • The "Sandwich" Structure: Each STGODE layer consists of a tensor-based ODE solver placed between two Temporal Dilated Convolution (TCN) blocks. The TCNs expand the receptive field over time, while the ODE solver handles the complex spatial-temporal coupling.
The STGODE framework and layer architecture, showing the integration of TCN blocks and the tensor-based ODE solver.

Key Results and Insights

The model was evaluated on six large-scale, real-world traffic datasets from the Caltrans Performance Measurement System (PeMS). STGODE consistently outperformed state-of-the-art baselines like STGCN, DCRNN, and GraphWaveNet.

  • Accuracy: On the PeMSD7(L) dataset, STGODE achieved an RMSE of 5.98, significantly lower than STGCN (8.28) and STSGCN (6.88).
  • Robustness to Depth: As the number of layers increases, the performance of traditional models typically plummets due to over-smoothing. In contrast, STGODE’s performance remains stable, demonstrating its ability to handle long-range dependencies.
  • Semantic Importance: Ablation studies confirmed that the model performs significantly worse when only considering physical neighbors, proving that traffic patterns are driven by functional land use as much as by physical road connections.

Conclusion

STGODE provides a robust framework for traffic forecasting by treating the network as a continuous system. By breaking the depth barrier of traditional GNNs and incorporating semantic relationships, it captures the complex dynamics of urban traffic more effectively than discrete, shallow models. Future work may involve learning these graphs dynamically to account for real-time changes like accidents or construction.

Summary updated

BibTeX
@inproceedings{fang2021spatial,
  author = {Zheng Fang and Qingqing Long and Guojie Song and Kunqing Xie},
  title = {{Spatial-Temporal Graph ODE Networks for Traffic Flow Forecasting}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2021},
  doi = {10.1145/3447548.3467430},
}
Figure