Abstract
Predicting city-wide spatio-temporal dynamics, such as traffic flow and ride-hailing demand, is critical for intelligent transportation systems. While Convolutional Neural Networks (CNNs) excel at local pattern recognition, they often fail to capture long-range global dependencies. Conversely, standard Transformers capture global relations but suffer from quadratic computational complexity. This paper presents ST-SAMPLENET, a transformer-based framework that integrates a Spatially Constrained Position Embedding (SCPE) and a lightweight region sampling strategy. ST-SAMPLENET achieves state-of-the-art accuracy while reducing computational costs by up to 40% through the elimination of redundant spatial information.
Introduction
Accurate spatio-temporal prediction is a cornerstone of smart city planning. Existing approaches typically rely on CNNs or Graph Convolutional Networks (GCNs). However, these methods are often limited by "neighborhood bias," failing to account for correlations between distant yet semantically similar urban regions (e.g., separate residential zones with synchronized peak hours). While Transformers offer a solution via self-attention mechanisms, their $O(N^2)$ complexity relative to the number of grid cells $N$ makes high-resolution modeling computationally prohibitive.
ST-SAMPLENET addresses this "Goldilocks" problem by balancing local detail with global context. It introduces a hierarchical spatial encoding and a Gumbel-Softmax-based sampling mechanism to focus computational resources on the most informative urban regions.
Methodology
The ST-SAMPLENET architecture consists of three primary components: a Multi-Modal Spatial Encoder, a Region Sampler, and a Temporal Encoder.
Spatially Constrained Position Embedding (SCPE)
Traditional Transformers treat all tokens as equidistant. SCPE incorporates spatial proximity by encoding positions at multiple granularities (e.g., 100m, 1km, and 5km). This hierarchical approach ensures the model prioritizes local interactions while maintaining the capacity to learn from distant hubs.
Lightweight Region Sampling
To mitigate the computational burden of global modeling, ST-SAMPLENET employs a Gumbel-Softmax sampling strategy. This allows the model to identify and prune redundant or low-activity regions (such as parks or water bodies) during the global attention phase. By reducing the number of active tokens, the complexity is lowered significantly without losing critical structural information.
Multi-Modal Integration
The spatial encoder processes not only historical traffic data but also semantic features (Points of Interest from OpenStreetMap) and temporal metadata (time of day, day of week). This multi-modal input allows the model to understand the underlying drivers of traffic patterns.
Experiments and Results
The model was evaluated on real-world datasets from Hannover, Dresden, and New York City, incorporating taxi trip data and floating car data.
Performance and Efficiency
ST-SAMPLENET outperformed state-of-the-art baselines, including ST-3DMDDN and BDSTN, by an average of 6.84% in RMSE and 6.75% in MAE. A key finding of the study is the relationship between the "Region Keep Ratio" and model performance.
As shown in the figure above, keeping approximately 80% of the regions serves as an optimal threshold. At this ratio, the model achieves better accuracy than the full-grid version (100% keep ratio) by filtering out noise and redundancy. Furthermore, the "efficient" variant of the model demonstrates that a 40% reduction in GFLOPS results in only a ~1% performance trade-off.
Discussion and Conclusion
The success of ST-SAMPLENET highlights two major insights:
- Redundancy as a Resource: Urban traffic data is highly redundant. Exploiting this through intelligent sampling allows for more efficient global modeling.
- Sampling as Regularization: The stochastic nature of the sampling process during training acts as a form of regularization, improving the model's robustness and generalization to unseen data.
While highly effective on grid-based data, future research will explore extending these hierarchical and sampling techniques to irregular graph-based road networks. ST-SAMPLENET represents a significant step toward deploying high-resolution, global-aware predictive models in resource-constrained smart city environments.
Summary updated