Diffusion Model for GPS Trajectory Generation

Yuanshao Zhu, Yongchao Ye, Xiangyu Zhao, James J. Q. Yu

Abstract

GPS trajectory data is essential for urban analytics but poses significant privacy risks. Generating synthetic trajectories that maintain the statistical properties of real-world mobility without compromising individual privacy is a major challenge. This paper introduces DiffTraj, the first framework to apply diffusion probabilistic models (DPMs) to GPS trajectory generation. DiffTraj treats trajectory synthesis as a reverse denoising process, utilizing a specialized 1D-CNN-based Traj-UNet and a Wide & Deep conditioning module to capture complex spatial-temporal features. Experimental results on large-scale datasets from Chengdu and Xi’an demonstrate that DiffTraj significantly outperforms existing GAN and VAE baselines in terms of fidelity, utility, and visual realism.

Introduction

The proliferation of location-aware devices has led to an explosion of GPS trajectory data, which serves as a cornerstone for urban planning, traffic management, and location-based services. However, this data is inherently sensitive; individual trajectories can often be deanonymized, revealing private habits and locations. To mitigate these risks, researchers have turned to synthetic trajectory generation.

The goal is to create synthetic datasets that mimic the complex spatial-temporal distributions of real human mobility while ensuring privacy. Human mobility is influenced by numerous factors, including road network constraints, regional functions, and temporal dynamics, making it highly stochastic. Traditional generative models, such as Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs), often struggle to capture these nuances, frequently producing "blurry" or unrealistic trajectories that fail to support accurate downstream analysis.

Methodology

DiffTraj leverages Diffusion Probabilistic Models (DPMs) to model the distribution of trajectories. The framework operates through two main stages: a forward diffusion process that gradually adds Gaussian noise to real trajectories, and a reverse denoising process that learns to reconstruct clean trajectories from noise.

Overview of the DiffTraj framework, showing the forward and reverse diffusion processes and the internal Traj-UNet architecture.

Architectural Innovations

To effectively handle trajectory data, DiffTraj introduces several key components:

  • Traj-UNet: Unlike standard Recurrent Neural Networks (RNNs) that may struggle with long-sequence dependencies, DiffTraj employs a 1D-CNN-based UNet. This architecture uses residual blocks and skip connections to efficiently capture multi-scale spatial-temporal features.
  • Wide & Deep Conditioning: To ensure generated trips are contextually relevant (e.g., accounting for departure time and regional characteristics), a "Wide & Deep" structure is used. The Wide component processes numerical features like velocity, while the Deep component embeds categorical features like region IDs.
  • Classifier-Free Guidance: A guiding parameter ($\omega$) allows for a trade-off between sample quality and diversity, ensuring the model covers the full spectrum of city-wide movement patterns.
  • Efficient Sampling: By implementing a non-Markovian sampling approach, the authors reduced the required denoising steps from 500 to 100, achieving an 80% reduction in computation time with minimal impact on quality.

Experimental Evaluation

The model was evaluated using massive real-world datasets from Didi Chuxing, covering millions of trajectories in Chengdu and Xi’an.

Key Results

DiffTraj demonstrated superior performance across multiple metrics:

  • Fidelity: It achieved the lowest Density Error and highest Pattern Score, indicating a superior ability to preserve global geographic distributions and semantic similarities compared to baselines like TrajGAN and Diffwave.
  • Utility: Traffic prediction models (e.g., AGCRN) trained on DiffTraj-generated data performed nearly as well as those trained on real data (MSE of 4.55 vs. 4.33 in Chengdu), proving its viability as a privacy-preserving replacement.
  • Visual Realism: Visualizations confirm that DiffTraj accurately recovers road network structures, even in areas with sparse data.
Visual comparison of trajectories generated by various models against real data. DiffTraj shows the highest fidelity in recovering the underlying road network.

Transfer Learning

A notable finding was the model's transferability. A model pre-trained on Chengdu data could be effectively adapted to Xi’an using only 5% of the target city's data, suggesting that DiffTraj learns fundamental primitives of urban mobility that transcend specific city layouts.

Conclusion and Future Work

DiffTraj represents a significant step forward in synthetic mobility data generation. By framing trajectory synthesis as a diffusion process, it captures the inherent stochasticity of human movement more effectively than previous methods.

Future work includes addressing the current limitation of fixed sequence lengths and explicitly incorporating road network graph constraints to ensure perfect alignment with physical infrastructure. Additionally, integrating formal Differential Privacy (DP) guarantees would further strengthen the privacy protections offered by the framework.

Summary updated

Abstract

With the deployment of GPS-enabled devices and data acquisition technology, the massively generated GPS trajectory data provide a core support for advancing spatial-temporal data mining research. Nonetheless, GPS trajectories comprise personal geo-location information, rendering inevitable privacy concerns on plain data. One promising solution to this problem is trajectory generation, replacing the original data with the generated privacy-free ones. However, owing to the complex and stochastic behavior of human activities, generating high-quality trajectories is still in its infancy. To achieve the objective, we propose a diffusion-based trajectory generation (Diff-Traj) framework, effectively integrating the generation capability of the diffusion model and learning from the spatial-temporal features of trajectories. Specifically, we gradually convert real trajectories to noise through a forward trajectory noising process. Then, Diff-Traj reconstructs forged trajectories from the noise by a reverse trajectory denoising process. In addition, we design a trajectory UNet (Traj-UNet) structure to extract trajectory features for noise level prediction during the reverse process. Experiments on two real-world datasets show that Diff-Traj can be intuitively applied to generate high-quality trajectories while retaining the original distribution.
BibTeX
@inproceedings{zhu2023diffusion,
  author = {Yuanshao Zhu and Yongchao Ye and Xiangyu Zhao and James J. Q. Yu},
  title = {{Diffusion Model for GPS Trajectory Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=0CD8YTBo3i},
}
Figure