Revisiting Spatial-Temporal Similarity: A Deep Learning Framework for Traffic Prediction

Huaxiu Yao, Xianfeng Tang, Hua Wei, Guanjie Zheng, Zhenhui Li

Abstract

Accurate traffic prediction is vital for smart city applications but remains challenging due to complex spatial-temporal dependencies. Traditional models often rely on static spatial relationships and strict periodicity, failing to capture the dynamic nature of urban movement. This paper introduces the Spatial-Temporal Dynamic Network (STDN), which incorporates a Flow Gating Mechanism to model dynamic spatial similarity and a Periodically Shifted Attention Mechanism to address temporal shifting. Evaluations on NYC taxi and bike datasets demonstrate that STDN significantly outperforms state-of-the-art baselines.

Introduction

Predicting city-wide traffic patterns—such as taxi demand or bike-sharing volume—is a cornerstone of urban planning. However, existing deep learning approaches frequently oversimplify the problem by assuming stationary spatial dependence and strict periodicity. The Spatial-Temporal Dynamic Network (STDN) addresses these limitations by explicitly modeling the dynamic interactions between regions and the inherent shifts in daily traffic peaks.

Problem Statement: The Limitations of Static Models

Most current models suffer from two primary flaws:

  1. Stationary Spatial Dependence: They assume relationships between locations are fixed (e.g., based on Euclidean distance). However, connectivity between a residential and business district varies drastically between rush hour and midnight.
  2. Strict Periodicity: They assume traffic patterns repeat identically every 24 hours. In reality, "rush hour" is fluid; accidents, weather, or events can shift peak volume by significant margins.
Visualizing temporal shifting: peak traffic hours vary across different days and weeks.

As illustrated in the figure above, peak traffic times are not fixed. A model expecting a peak at 9:30 AM every Monday will fail if the actual peak shifts to 11:00 AM or 1:00 PM on other days.

The STDN Framework

The STDN architecture integrates several components to handle these complexities:

Local Spatial-Temporal Network (LSTN)

Instead of global processing, STDN uses Local CNNs to extract spatial features from a region's immediate neighborhood, minimizing noise from distant areas. These features are then processed by LSTMs to capture short-term temporal dependencies.

Flow Gating Mechanism (FGM)

FGM is a core innovation that uses real-time traffic flow (movement from A to B) to "gate" spatial information. High flow between regions opens the gate, allowing for stronger information propagation. This enables the model to learn dynamic similarity based on actual movement rather than static geography.

Periodically Shifted Attention Mechanism (PSAM)

To address temporal shifting, PSAM employs an attention mechanism over a window of time from previous days. Rather than looking at a single fixed timestamp, it scans surrounding intervals to identify shifted peaks, ensuring the model remains robust to daily variations.

The architecture of STDN, featuring the flow gating and shifted attention components.

Experimental Evaluation

The authors tested STDN using two large-scale New York City datasets: NYC-Taxi (22 million records) and NYC-Bike (2.6 million trajectories). The city was discretized into a $10 \times 20$ grid with 30-minute aggregation intervals.

Key Results

STDN consistently outperformed state-of-the-art baselines like ST-ResNet and DMVST-Net:

  • NYC-Taxi: STDN achieved an RMSE of 24.10 for start volume, compared to 25.74 for the next best model.
  • NYC-Bike: STDN reached an RMSE of 8.85, setting a new benchmark for bike-sharing volume prediction.

Ablation studies confirmed that both FGM and PSAM are essential. Removing the Flow Gating Mechanism or the Shifted Attention component resulted in a measurable decrease in prediction accuracy across all metrics.

Conclusion

The STDN framework represents a significant step forward in traffic prediction by moving beyond rigid spatial and temporal assumptions. By using traffic flow as a proxy for dynamic similarity and implementing an attention mechanism to handle temporal shifts, STDN provides a more accurate and robust solution for urban mobility forecasting.

Summary updated

BibTeX
@inproceedings{yao2019revisiting,
  author = {Huaxiu Yao and Xianfeng Tang and Hua Wei and Guanjie Zheng and Zhenhui Li},
  title = {{Revisiting Spatial-Temporal Similarity: A Deep Learning Framework for Traffic Prediction}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33015668},
}
Figure