Deep transformer-based heterogeneous spatiotemporal graph learning for geographical traffic forecasting

Guangsi Shi, Linhao Luo, Yongze Song, Jing Li, Shirui PaniScience 2024

TL;DR

This paper introduces TSTGNN, a novel deep learning model that uses transformers and adaptive graph structures to improve geographical traffic forecasting. By effectively capturing both long-term temporal patterns and dynamic spatial relationships, TSTGNN achieves state-of-the-art results on several real-world traffic datasets.

What Problem Does This Paper Address?

Accurate traffic forecasting is crucial for urban planning, traffic management, and overall efficiency of transportation systems. While deep learning has shown promise, existing models struggle with two key challenges:

  1. Capturing long-term temporal dependencies: Traffic patterns can evolve over extended periods, and many models fail to effectively learn these long-term trends, especially when dealing with large historical datasets.
  2. Modeling dynamic and heterogeneous spatial dependencies: The relationships between different traffic sensors (e.g., roads or intersections) are not static. They change based on traffic conditions, road network updates, and other dynamic factors. Furthermore, these relationships can be complex and "heterogeneous," meaning they don't always follow simple rules. Existing graph-based models often rely on fixed graph structures, which limits their ability to adapt to these dynamic and complex spatial interactions.

Methods

The TSTGNN model tackles these challenges with a two-pronged approach:

  • Temporal Transformer for Long-Term Dependencies: Instead of relying on traditional methods or simple data fusion, TSTGNN employs a temporal transformer architecture. This architecture, inspired by advancements in natural language processing, uses a self-attention mechanism to weigh the importance of different time steps in the historical data. This allows it to effectively capture long-term temporal patterns without being limited by sequential processing constraints.
  • Adaptive Normalized Graph Structures for Dynamic Spatial Dependencies: To address the limitations of static graphs, TSTGNN introduces adaptive normalized graph structures within its graph convolution layers. This means the graph structure isn't fixed but can adapt as information flows through the network and across different layers. A novel layer normalization technique is also used to dynamically learn and adjust the spatial relationships between sensors, enabling the model to better capture heterogeneous and evolving spatial dependencies. This approach allows the model to adapt to diverse traffic scenarios and complex interactions.

Datasets

The study utilizes four widely recognized public datasets from the Caltrans Performance Measurement System (PeMS):

  • PeMSD3: Sacramento area traffic data.
  • PeMSD4: Oakland area traffic data.
  • PeMSD7: Los Angeles area traffic data.
  • PeMSD8: Fontana area traffic data.

These datasets contain geographical traffic sensor data, and the paper uses them for both single-step and multi-step traffic forecasting tasks. The datasets are split into training, validation, and testing sets with a 5-minute interval between consecutive time points.

Key Insights and Ideas

  • Transformers are powerful for temporal traffic data: The paper demonstrates that transformer architectures, when applied to traffic time series, can effectively capture long-term dependencies without needing complex data fusion techniques.
  • Dynamic graphs are essential for accurate spatial modeling: Relying on fixed spatial relationships between traffic sensors is insufficient. Adaptive graph structures that change based on context are crucial for capturing real-world traffic dynamics.
  • Heterogeneity in spatial relationships matters: The model's ability to adapt to different types of spatial relationships (e.g., based on distance, traffic flow change rate, or temporal trends) is key to its improved performance.
  • Layer normalization enhances adaptability: The proposed layer normalization mechanism plays a vital role in refining representations and adapting to dynamic spatial relationships across different layers of the network.

Key Results

The TSTGNN model achieved state-of-the-art results across the four PeMS datasets for both one-step and multi-step traffic forecasting. The paper highlights:

  • Improved Accuracy: Quantitative results presented in Table 2 show TSTGNN consistently outperforming numerous baseline methods (including ARIMA, STGCN, DCRNN, Graph WaveNet, StemGNN, and others) in terms of Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Mean Absolute Percentage Error (MAPE). For instance, on PeMSD3, TSTGNN achieved an MAE of 15.51, RMSE of 26.78, and MAPE of 15.06%, which were the lowest among all tested models.
  • Robustness: Visualizations in Figure 3 demonstrate that TSTGNN's predictions closely follow the true traffic patterns, even during significant fluctuations, while other models exhibit offsets or distortions.
  • Effective Spatial and Temporal Modeling: Figure 4 visualizes how the model assigns attention scores to different nodes, showing it prioritizes nodes with strong spatiotemporal relationships, even if they are not spatially adjacent. This confirms its ability to capture complex dependencies.

Limitations and Future Work

The authors acknowledge a few limitations and suggest future directions:

  • Real-world Data: While the model performed well on public datasets, further testing and improvement on more diverse and potentially noisier real-world data are suggested.
  • Computational Complexity: The paper notes that while the model is effective, its computational complexity could be further optimized in future work.
  • Hyperparameter Tuning: The ablation studies and parameter sensitivity analyses indicate that while the model is generally robust, specific optimal values for hyperparameters exist for different datasets, suggesting potential for more fine-tuned optimization.

Summary updated

BibTeX
@inproceedings{shi2024deep,
  author = {Guangsi Shi and Linhao Luo and Yongze Song and Jing Li and Shirui Pan},
  title = {{Deep transformer-based heterogeneous spatiotemporal graph learning for geographical traffic forecasting}},
  booktitle = {iScience},
  year = {2024},
  doi = {10.1016/j.isci.2024.110175},
}
Figure