Generic and Dynamic Graph Representation Learning for Crowd Flow Modeling

Liangzhe Han, Ruixing Zhang, Leilei Sun, Bowen Du, Yanjie Fu, Tongyu Zhu

Abstract

Crowd flow modeling is essential for urban planning, yet traditional methods rely on discrete time snapshots, leading to information loss and task-specific limitations. We present GDCF (Generic and Dynamic Graph Representation Learning for Crowd Flow), a framework that treats traffic as a continuous transaction stream. By employing a two-phase encoder-decoder architecture with virtual nodes, GDCF learns universal node embeddings capable of solving multiple tasks—such as inflow, outflow, and origin-destination (OD) flow prediction—simultaneously. Experimental results on massive real-world datasets show that GDCF significantly outperforms state-of-the-art task-specific models.

Introduction

Predicting the movement of people between urban locations, such as subway stations or taxi zones, is a cornerstone of modern traffic control. Conventional approaches typically discretize time into fixed intervals (e.g., 15-minute snapshots) and apply Computer Vision or Graph Neural Network (GNN) techniques. However, this discretization ignores the precise sequence and temporal "burstiness" of individual transactions, resulting in significant information loss. Furthermore, most existing models are designed for single tasks, lacking the generality needed for diverse urban sensing applications.

Comparison of snapshot-based models vs. the GDCF continuous-time approach.

Methodology

GDCF addresses these challenges through a two-phase training strategy focused on learning generic, continuous-time representations.

Phase 1: Self-Supervised Representation Learning

The core of GDCF is an encoder-decoder structure that processes raw, timestamped transactions. The Encoder maintains a dynamic memory for each node, updated via a decay mechanism that prioritizes recent activity. To capture macro-level spatial patterns, an Adaptive Global Relation (GR) Module utilizes "virtual nodes" to group stations with similar functional roles, regardless of physical distance. The Decoder then attempts to reconstruct the cumulative transaction flow between nodes, ensuring that the learned embeddings capture essential spatio-temporal dynamics.

Phase 2: Downstream Task Training

The pre-trained node embeddings are retrieved to power simple Multi-Layer Perceptrons (MLPs) tailored to specific downstream tasks, such as inflow, outflow, or OD flow prediction. This modularity allows a single set of representations to power multiple applications without a total model redesign.

The two-phase GDCF framework: self-supervised representation learning followed by downstream task training.

Experiments and Results

The framework was evaluated on two large-scale datasets: BJSubway (279 million transactions) and NYTaxi (38 million transactions).

GDCF consistently outperformed baselines like XGBoost, GEML, and TGN. On the BJSubway dataset, GDCF achieved an Inflow Mean Absolute Error (MAE) of 78.97, a substantial improvement over XGBoost's 103.92. For complex OD flow prediction, GDCF reduced error by nearly 23% compared to the DNEAT model. Notably, the model demonstrated high data efficiency; performance with only 7 days of training data in Phase 2 was comparable to using 42 days, highlighting the information density of the Phase 1 embeddings. Furthermore, the generality of the representations was validated by applying subway-trained embeddings to travel time estimation, where they continued to outperform baseline models.

Discussion and Conclusion

GDCF demonstrates that continuous-time modeling captures fine-grained temporal dynamics missed by discrete methods. The use of virtual nodes effectively bridges spatial gaps, allowing the model to discover functional similarities between distant urban areas. While highly effective, future work should address potential computational bottlenecks in massive streaming environments and integrate formal privacy guarantees for sensitive transaction data. Overall, GDCF provides a robust, generic foundation for multi-purpose crowd flow modeling.

Summary updated

BibTeX
@inproceedings{han2023generic,
  author = {Liangzhe Han and Ruixing Zhang and Leilei Sun and Bowen Du and Yanjie Fu and Tongyu Zhu},
  title = {{Generic and Dynamic Graph Representation Learning for Crowd Flow Modeling}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i4.25548},
}
Figure