Continuous Trajectory Generation Based on Two-Stage GAN

Wenjun Jiang, Wayne Xin Zhao, Jingyuan Wang, Jiawei Jiang

Introduction

Generating synthetic human mobility data is vital for urban planning, epidemic modeling, and privacy preservation. However, existing methods face three major hurdles:

  1. Lack of Continuity: Most models generate a sequence of points that do not form a connected path on a real-world road network, limiting their utility for traffic simulations.
  2. Ignoring Domain Knowledge: Purely "model-free" neural networks often ignore the underlying logic of human movement, such as the tendency to take efficient routes.
  3. Error Accumulation: Stochastic generators often suffer from a "drift" effect; if the model makes one wrong turn early on, the rest of the trajectory becomes increasingly unrealistic as errors compound.

Methods: The TS-TrajGen Framework

The authors introduce TS-TrajGen, a framework that treats trajectory generation as a search problem guided by a Generative Adversarial Network (GAN).

The TS-TrajGen architecture featuring an A*-inspired generator and a dual-reward discriminator.

A*-Inspired Generator

Instead of a standard RNN, the generator mimics the A* search algorithm's cost function: $f(l_j) = g(l_j) + h(l_j)$.

  • $g$ function (observed cost): Uses an LSTM with self-attention to learn the patterns of the current partial path.
  • $h$ function (expected cost to destination): Uses a Graph Attention Network (GAT) to understand the road network's structure and estimate the remaining distance.

Dual-Reward Discriminator

To provide better feedback, the discriminator provides two types of rewards:

  • Sequential Reward: Evaluates if the time-series patterns look "real" using Monte Carlo search.
  • Mobility Yaw Reward: A spatial reward based on Dynamic Time Warping (DTW) that penalizes the generator if it deviates too far from the logical spatial path toward the destination.

Two-Stage Generation

To prevent error accumulation, the model first generates a coarse "regional" trajectory using partitioned city blocks. It then uses that regional path as a guide to generate the fine-grained, road-level continuous path.

Datasets

The model was evaluated on two massive real-world datasets map-matched to OpenStreetMap:

  • BJ-Taxi: GPS data from 15,642 Beijing taxis over one week.
  • Porto-Taxi: A Kaggle dataset featuring 435 taxis in Porto, Portugal. Preprocessing removed loops and abnormally short trips, resulting in nearly 1.6 million trajectories for training and testing.

Key Insights

  • Search as Generation: Human mobility is essentially a heuristic search. By forcing the neural network to follow the $f = g + h$ structure of A*, the model inherently respects the goal-oriented nature of travel.
  • Topological Constraints: By building "topological adjacency" directly into the linear layers, the authors ensure the model cannot suggest a road segment that isn't physically connected to the current one.
  • The "Yaw" Signal: Standard GANs often provide a sparse signal. The "Mobility Yaw Reward" provides a dense gradient, telling the generator exactly how it is straying from a realistic path in 2D space.

Key Results

TS-TrajGen significantly outperformed state-of-the-art baselines (like SeqGAN, MoveSim, and TrajGen) across several metrics.

Density heatmaps comparing real data with synthetic data generated by TS-TrajGen and other baselines.
  • Macro-Similarity: In the BJ-Taxi dataset, it improved "Distance" and "Radius of Gyration" metrics by over 97% compared to the next-best model.
  • Micro-Similarity: It achieved drastically lower (better) scores in Hausdorff distance and DTW, indicating the generated paths closely match the specific shapes of real trips.
  • Downstream Utility: In a "Next-Location Prediction" case study, a model trained only on TS-TrajGen's synthetic data achieved ~90% of the performance of a model trained on real data, whereas competing generators struggled to reach 50%.

Limitations and Future Work

While TS-TrajGen is highly effective, the paper notes a few areas for growth:

  • Computational Complexity: The framework involves multiple complex components (GATs, LSTMs, and Monte Carlo search), requiring significant compute power for large-scale networks.
  • Static Factors: The current model focuses on spatial-temporal patterns but doesn't explicitly account for dynamic external factors like real-time traffic congestion or weather.
  • Personalization: Future iterations could be tuned to simulate specific user profiles or transport modes (e.g., delivery drivers vs. commuters).

Summary updated

BibTeX
@inproceedings{jiang2023continuous,
  author = {Wenjun Jiang and Wayne Xin Zhao and Jingyuan Wang and Jiawei Jiang},
  title = {{Continuous Trajectory Generation Based on Two-Stage GAN}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i4.25557},
}
Figure