Introduction
Predicting citywide traffic flow—the inflow and outflow of vehicles in specific regions—is a cornerstone of modern smart city management. However, deep learning models often struggle with the inherent complexity of urban environments, specifically spatial and temporal heterogeneity.
Spatial heterogeneity refers to the distinct "personalities" of urban areas. For instance, a residential neighborhood exhibits a vastly different traffic distribution compared to a major transportation hub. Temporal heterogeneity describes how traffic patterns shift dynamically across different time periods, such as the contrast between a Monday morning rush hour and a holiday evening. Traditional models often use a "one-size-fits-all" approach, which biases predictions toward high-volume areas and fails to capture shifting temporal rhythms.
Proposed Methodology: ST-SSL
To address these challenges, we introduce ST-SSL (Spatio-Temporal Self-Supervised Learning), a framework that integrates adaptive graph augmentation and auxiliary self-supervised tasks into a standard spatio-temporal backbone.
The framework is built upon three primary pillars:
- Adaptive Graph Augmentation: Unlike random masking, ST-SSL calculates a "heterogeneity degree" between regions. It adaptively masks less relevant volumes and modifies graph topology by pruning edges between dissimilar neighbors and adding edges between distant but functionally similar regions (e.g., two different shopping malls).
- SSL for Spatial Heterogeneity: The model performs a "soft clustering" task, mapping regions into latent spaces corresponding to urban functions (e.g., residential, business). By predicting these assignments as an auxiliary task, the model learns region-specific representations without requiring manual land-use labels.
- SSL for Temporal Heterogeneity: A contrastive learning approach is used where region-level and city-level embeddings from the same time step are treated as "positive pairs," while those from different time steps are "negative pairs." This encourages the model to distinguish between different temporal states.
Experimental Evaluation
The model was evaluated on four real-world datasets: NYCBike1, NYCBike2, NYCTaxi, and BJTaxi. These datasets cover various time intervals (30 to 60 minutes) and spatial resolutions (grid sizes from $10 \times 20$ to $32 \times 32$).
Key Results
- State-of-the-Art Performance: ST-SSL consistently outperformed eight baselines, including GMAN and AGCRN. Notably, on the BJTaxi dataset, it achieved an 8% reduction in Mean Average Error (MAE) compared to the best baseline.
- Ablation Studies: Removing either the spatial or temporal SSL modules resulted in significant performance drops, confirming that modeling both types of heterogeneity is critical.
- Suburban Advantage: ST-SSL showed the most significant improvements in suburban areas. By modeling spatial heterogeneity, the model effectively transfers knowledge between globally similar regions, aiding performance in data-sparse areas.
Conclusion
ST-SSL demonstrates that heterogeneity should be treated as a feature rather than a hurdle. By using self-supervised learning to capture the unique signatures of different urban zones and time periods, the framework provides more accurate and robust traffic flow predictions. Future work will focus on making these components model-agnostic and incorporating external signals like weather and points-of-interest (POI) data to further refine functional clustering.
Summary updated