Abstract
Predicting transport supply and demand is a critical task in urban planning and logistics. While Graph Neural Networks (GNNs) have become the standard for modeling spatial dependencies, they typically rely on static, heuristic-based graph structures. This paper presents a novel approach using Neural Relational Inference (NRI) to treat the graph structure as a latent variable. By learning dynamic, data-driven connections within a Variational Auto-Encoder (VAE) framework, the proposed model achieves state-of-the-art performance on NYC taxi demand and California traffic speed datasets. Furthermore, the learned adjacency matrices provide interpretable insights into urban dynamics, such as congestion propagation and temporal variations in zone interactivity.
Introduction
Predicting transport metrics like taxi demand or traffic speed is challenging due to complex, non-Euclidean spatial dependencies. For instance, a residential area and a central business district may be geographically distant yet highly interdependent during morning commute hours. Traditional Graph Neural Networks (GNNs) address this by modeling zones as nodes in a graph. However, these models usually require a predefined adjacency matrix based on simple heuristics, such as physical proximity or historical correlation. These static graphs are often biased and fail to capture the evolving nature of urban interactions. This research addresses the "graph inference" problem by enabling models to learn optimal, time-varying connections directly from data.
Methodology
The authors adapt the Neural Relational Inference (NRI) framework, which conceptualizes the graph structure as a latent variable within a Variational Auto-Encoder (VAE).
The architecture consists of three primary components:
- The Encoder: This module processes historical transport data alongside global features (e.g., weather, time) to predict a distribution over potential edges. It utilizes the Gumbel-Softmax trick to sample discrete edges while maintaining differentiability for backpropagation.
- The Latent Space: Here, the model samples a graph representing the most probable dependencies for a specific time step, effectively "unboxing" the hidden relational structure.
- The Decoder: A recurrent GNN, specifically utilizing Gated Recurrent Units (GRUs), uses the sampled graph to generate future state predictions.
A key innovation is the use of Bayesian Priors. Unlike purely black-box models, this framework allows for the integration of domain knowledge. For example, a "local prior" can suggest that nearby zones are likely connected, while still allowing the data to override this assumption if stronger long-range correlations exist.
Datasets and Evaluation
The model was rigorously tested on two benchmark datasets:
- NYC Yellow Taxi Data (2019): Comprising 84 million trips across 66 Manhattan zones, the task involves predicting hourly pickups and dropoffs.
- PEMS (Performance Measurement System): This dataset contains traffic speed data from 325 sensors in the California Bay Area, with the goal of predicting speeds at 15, 30, and 60-minute intervals.
Results and Discussion
The NRI-based approach consistently outperformed traditional heuristic-based GNNs and standard baselines. In the NYC Taxi task, the NRI model with a Dynamic Time Warping (DTW) prior achieved a Mean Absolute Error (MAE) of 17.65, significantly lower than the 19.41 of a fully connected graph and the 22.80 of a standard local-neighbor graph. Similarly, for 60-minute traffic speed predictions in the PEMS dataset, NRI achieved an MAE of 1.78, surpassing the well-known DCRNN baseline (2.07). Notably, the model achieved these results using much sparser graphs than "full" models, proving that smarter, data-driven connections are more effective than simply increasing connectivity.
Dynamic Connectivity and Interpretability
One of the most significant advantages of this method is its interpretability. The model learns that urban relationships are inherently dynamic.
As shown in the analysis of NYC data, the "edge probability"—representing the strength of inferred connections—fluctuates according to temporal patterns. It remains high during predictable weekday rush hours and dips during weekends. This suggests the model prioritizes information exchange when patterns are most impactful for minimizing prediction loss. Furthermore, the model exhibits "congestion-seeking" behavior in traffic scenarios. When a sensor detects a bottleneck, the model dynamically expands its receptive field to distant sensors to capture how the congestion propagates.
Practical Considerations
Implementation revealed that the encoder can be sensitive to noise. For the NYC dataset, the authors found it necessary to pre-train the encoder for 30 epochs using only the KL divergence component of the loss function to ensure convergence. While inferring a graph at every time step increases computational complexity compared to static models, the gains in performance and interpretability justify the overhead.
Conclusion
By replacing static heuristics with a learnable, latent graph structure, this work provides a more flexible and accurate framework for mobility prediction. The NRI model not only improves performance but also offers a window into the functional connectivity of cities. Future work may explore meta-learning applications, where models trained on data-rich environments like New York City could be transferred to cities with sparse sensor networks.
Summary updated