Source-linked AI summary
Revisiting Spatial-Temporal Similarity: A Deep Learning Framework for Traffic Prediction
Huaxiu Yao, Xianfeng Tang, Hua Wei, Guanjie Zheng, Zhenhui Li
TL;DR
Traffic prediction requires modeling spatial dependencies and temporal dynamics, but prior methods assume static spatial relationships and strict periodicity. STDN addresses these gaps with flow gating and periodically shifted attention, and evaluations on two large-scale datasets show that it outperforms state-of-the-art methods.
Problem
Traffic prediction must capture complex spatial dependencies and temporal dynamics, while existing methods overlook changing spatial relationships and shifting periodic behavior.
Method
STDN uses flow gating to model dynamic spatial similarity and periodically shifted attention to capture long-term periodic information with temporal shifting.
Results
Evaluation on two large-scale datasets shows that STDN outperforms state-of-the-art methods.
Takeaways & Limitations
STDN provides a unified framework for modeling dynamic spatial similarity and temporal periodic similarity in traffic prediction.
Abstract
from arXiv · showhide
Traffic prediction has drawn increasing attention in AI research field due to the increasing availability of large-scale traffic data and its importance in the real world. For example, an accurate taxi demand prediction can assist taxi companies in pre-allocating taxis. The key challenge of traffic prediction lies in how to model the complex spatial dependencies and temporal dynamics. Although both factors have been considered in modeling, existing works make strong assumptions about spatial dependence and temporal dynamics, i.e., spatial dependence is stationary in time, and temporal dynamics is strictly periodical. However, in practice, the spatial dependence could be dynamic (i.e., changing from time to time), and the temporal dynamics could have some perturbation from one period to another period. In this paper, we make two important observations: (1) the spatial dependencies between locations are dynamic; and (2) the temporal dependency follows daily and weekly pattern but it is not strictly periodic for its dynamic temporal shifting. To address these two issues, we propose a novel Spatial-Temporal Dynamic Network (STDN), in which a flow gating mechanism is introduced to learn the dynamic similarity between locations, and a periodically shifted attention mechanism is designed to handle long-term periodic temporal shifting. To the best of our knowledge, this is the first work that tackles both issues in a unified framework. Our experimental results on real-world traffic datasets verify the effectiveness of the proposed method.
Introduction
Traffic prediction must capture spatial dependencies and temporal dynamics, but existing methods often treat spatial relationships as static and periodic behavior as strictly repeating. STDN addresses both limitations with flow gating and periodically shifted attention, and experiments show consistent improvement over state-of-the-art methods.
- Limitations: Existing traffic-prediction methods model spatial dependency from historical similarity, producing static relationships despite location dependencies changing over time.For example, residential-business relationships may be strong in the morning but weak in the late evening.
- Limitations: Traffic data exhibit daily and weekly periodicity, but peak times shift across days, making strict periodic assumptions inadequate.Weekday peaks may vary from 4:30pm to 6:00pm.
- STDN: STDN combines local CNN and LSTM components with flow-gated CNNs to model dynamic spatial similarity and periodically shifted attention to capture long-term temporal shifts.The hierarchical LSTM also handles sequential dependency.
- STDN: The flow gating mechanism explicitly models dynamic spatial similarity by controlling information propagation among nearby locations.It uses traffic flow information to determine how spatial information is constrained.
- STDN: The periodically shifted attention mechanism jointly uses long-term periodic information and temporal shifting.It is designed to capture periodic information without requiring traffic sequences to repeat exactly.
- Evaluation: Experiments on several real-world traffic datasets show that STDN is consistently better than other state-of-the-art methods.The evaluation uses large-scale public NYC taxi and bike-sharing datasets.
Related Work
Traffic prediction research has progressed from classical time-series models and contextual features to deep architectures for spatial and temporal dependencies. However, prior approaches generally model only selected aspects or fail to jointly capture complex nonlinear spatial-temporal relations, motivating STDN’s unified treatment of dynamic similarities.
- Classical and contextual methods: Classical traffic-prediction methods include ARIMA, Kalman filtering, external context features, and explicit spatial information.Examples of context include venue types, weather conditions, and event information.
- Research gap: Prior methods fail to model complex nonlinear space-time relations or do not consider spatial and temporal dependencies simultaneously.This limitation persists across methods that explicitly model only one dependency and methods using broader spatial-temporal architectures.
- Deep learning methods: Deep learning studies use fully connected layers, convolutional structures, or recurrent neural networks to model different traffic-prediction inputs or dependencies.These lines respectively fuse context, capture spatial correlation, or model sequential dependency.
- Joint spatial-temporal methods: Several convolutional LSTM, multi-view, and graph-based models jointly or separately address spatial-temporal prediction.The multi-view model integrates LSTM, local-CNN, and semantic network embedding.
- STDN: STDN jointly handles dynamic spatial similarity and temporal periodic similarity through flow gating and periodically shifted attention mechanisms.The two mechanisms correspond to spatial and temporal similarity, respectively.
Notations and Problem Formulation
The formulation represents a city as a grid of regions and divides time into continuous intervals, defining traffic volumes and flows from trip departures and arrivals. Given observations through interval t, the task is to predict start and end traffic volumes at interval t + 1.
- Spatial and temporal representation: The city is divided into an a × b grid containing n = a × b regions, while the observation period is divided into m equal-length continuous intervals.Regions are indexed by {1, 2, . . . , n}.
- Traffic volume: Start and end traffic volume for a region counts trips departing from or arriving in that region during a fixed time interval.These quantities describe region-level traffic observations.
- Traffic flow: Traffic flow records trips starting in region i during interval t and ending in region j during interval τ.Aggregated flows describe movements between region pairs across time intervals.
- Traffic flow: Traffic flow reflects both region-wise connectivity and the propagation of individuals through the city.The paper illustrates traffic volume and flow together in Figure 1(c).
- Prediction task: Given data through time interval t, traffic volume prediction targets the start and end volumes at time interval t + 1.This is the stated traffic volume prediction problem.
Spatial-Temporal Dynamic Network
STDN combines local spatial-temporal modeling with flow gating and periodically shifted attention to capture dynamic spatial similarity, short-term sequence information, and shifted long-term periodicity.
- STDN uses local CNN and LSTM components to model spatial dependency and short-term temporal sequential dependency.
- STDN represents each target region and its neighbors as an S × S two-channel image containing start and end traffic volumes.Stacked historical flow matrices provide the flow-gating component with past interactions among surrounding regions.
- Traffic flow explicitly controls information propagation between regions, allowing the flow gating mechanism to capture dynamic spatial dependency.The model constructs local spatial flow images from inflow and outflow matrices and applies flow gates within convolutional layers.
- The model predicts start and end traffic volumes simultaneously through a unified multi-task component.Its loss balances the influence of the two predicted volume types with parameter λ.
- The periodically shifted attention mechanism selects neighboring intervals from previous days, uses attention to weight them, and preserves daily sequential information with LSTM.It addresses temporal shifting such as different peak times across days rather than assuming strict periodicity.
Experiment
Experiments on NYC taxi and bike datasets show that STDN outperforms competing baselines, while ablations support its flow gating and periodically shifted attention mechanisms.
- Datasets: The experiments use large-scale NYC taxi and bike-sharing datasets, with each dataset divided into 40 training days and 20 testing days.NYC-Taxi contains 22,349,490 records, while NYC-Bike contains 2,605,648 records.
- Preprocessing: The city is partitioned into 10×20 regions, using 30-minute intervals and normalized traffic volume and flow for sliding-window prediction.Testing samples with volume values below 10 are filtered before evaluation.
- Performance Comparison: STDN achieves the lowest RMSE and MAPE on both NYC-Taxi and NYC-Bike datasets, significantly outperforming all competing baselines.Each baseline was run 10 times, with means and standard deviations reported alongside a Student t-test.
- Performance Comparison: STDN outperforms traditional time-series and regression methods that overlook spatial context, nonlinear temporal dependencies, or dynamic spatial relationships.The comparison includes HA, ARIMA, Ridge, LinUOTD, and XGBoost.
- Effectiveness of Flow Gating Mechanism: Flow-gating variants outperform LSTN, while flow gating performs better than simply adding traffic flow as features, supporting explicit dynamic spatial modeling.The results are reported for NYC-Taxi and NYC-Bike in Figure 3.
- Effectiveness of Periodically Shifted Attention Mechanism: Separating long- and short-term information improves performance, and PSAM further improves results by capturing temporal shifting; STDN adds the benefit of flow gating.These comparisons are reported for NYC-Taxi and NYC-Bike in Figure 4.
Conclusion and Discussion
The paper proposes STDN to model dynamic spatial and temporal periodic similarity in traffic prediction. Evaluation on two large-scale datasets shows that the proposed model outperforms state-of-the-art methods.
- Conclusion and Discussion: STDN tracks dynamic spatial similarity with flow gating and temporal periodic similarity with periodically shifted attention.The authors identify other spatial-temporal prediction problems and model explainability as future directions.