Abstract
Urban flow forecasting is essential for modern traffic management and urban planning. While existing models leverage the periodic nature of urban mobility by fusing closeness, period, and trend components, they often overlook the dynamic temporal relationships between these features. This paper presents TERMCast, a novel architecture that explicitly models these inter-component relations using a Transformer-based module. By enforcing consistency between predicted flows and predicted relations, TERMCast achieves state-of-the-art accuracy across multiple real-world benchmarks.
Introduction
Predicting the movement of people and vehicles across city regions—urban flow—is a cornerstone of smart city infrastructure. Urban flow exhibits strong periodic patterns: traffic during today's rush hour is typically correlated with traffic from the previous hour (closeness), the same time yesterday (periodicity), and the same time last week (trend).
Traditional forecasting models typically process these three components in isolation and combine them at the final stage through "late fusion." However, this approach fails to capture the intrinsic temporal relations between them. For instance, the evolving relationship between 8 AM today, 8 AM yesterday, and 8 AM last week can provide critical context for predicting 9 AM today. TERMCast addresses this by shifting the focus from simple feature fusion to explicit relational modeling over time.
Methodology
The TERMCast architecture is composed of three primary modules designed to capture both immediate spatial-temporal dependencies and long-term relational patterns.
1. Short-Term Prediction Module
This module captures immediate spatial-temporal dependencies using standard Residual Units. It processes the "closeness" component (recent observations) to provide a foundational prediction of the urban flow.
2. Long-Term Relation Prediction Module
This core innovation models how inter-component relationships evolve. For each historical time step, the model concatenates closeness, period, and trend tensors, passing them through a Multi-Layer Perceptron (MLP) to generate a relation vector. A Transformer then processes the sequence of these vectors to predict the relation vector for the target time interval. This predicted relation is decoded into a flow tensor that supplements the short-term prediction.
3. Prediction Consistency Module
To ensure internal model consistency, a Consistency Loss is introduced. The final predicted flow is combined with historical period and trend data to infer a relation vector. The model then uses cosine similarity to force this inferred vector to match the one predicted by the Transformer, acting as a powerful regularizer.
The final output is a weighted fusion of the short-term prediction, the long-term relational prediction, and external metadata such as time of day and day of the week.
Experimental Evaluation
TERMCast was evaluated on three major real-world benchmarks: BikeNYC (bike-sharing data), TaxiNYC (taxi trip records), and TaxiBJ (Beijing taxicab GPS data).
Key Results
The model consistently outperformed state-of-the-art baselines, including STDN and VLUC-Net, across all datasets in terms of Root Mean Squared Error (RMSE) and Mean Absolute Error (MAE):
- BikeNYC: Achieved an RMSE of 5.729, outperforming VLUC-Net (5.831).
- TaxiNYC: Achieved an RMSE of 10.395, compared to VLUC-Net (10.654).
- TaxiBJ: Achieved an RMSE of 17.017, significantly better than STDN (17.826) and VLUC-Net (18.378).
Ablation studies confirmed the necessity of each module. Notably, removing the consistency loss led to a measurable performance drop, highlighting its role in aligning the model's internal representations.
Discussion and Conclusion
TERMCast demonstrates that the relationship between different periodicities is a valuable temporal sequence in its own right. By using Transformers to capture these meta-relations rather than raw flow values, the model achieves superior predictive power.
While the current model uses Residual Units for spatial features on a grid, future work could integrate Graph Neural Networks (GNNs) to better represent non-grid urban structures like road networks. Additionally, incorporating more diverse external data, such as weather and special events, remains a promising avenue for further improving forecasting accuracy.
Summary updated