Trajectory Representation Learning on Road Networks and Grids with Spatio-Temporal Dynamics

Stefan Schestakov, Simon GottschalkarXiv 2024 · DOI

Introduction

Trajectory data, consisting of GPS coordinate sequences from moving objects, is a cornerstone of modern urban planning and location-based services. However, raw trajectory data is often sparse, noisy, and irregular, making it challenging for downstream machine learning tasks. Trajectory Representation Learning (TRL) aims to map these complex sequences into low-dimensional embeddings that can be easily processed by AI models.

Existing TRL methods generally fall into two categories: grid-based methods, which capture spatial shapes but ignore road topology, and road-network-based methods, which respect traffic rules but may lose broader spatial context. Crucially, most models treat road networks as static, failing to account for time-varying traffic dynamics. This paper introduces TIGR, a framework that integrates grid and road network modalities while incorporating spatio-temporal dynamics.

Methodology: The TIGR Framework

TIGR (Integrating Grid and Road network modalities) employs a three-branch architecture to learn comprehensive trajectory representations in parallel.

The TIGR architecture features three parallel branches: Grid, Road, and Spatio-Temporal, optimized via contrastive learning.

Multi-Modal Representation

  1. Grid Branch: Encodes trajectories as sequences of grid cells to preserve global spatial structure and shape.
  2. Road Branch: Maps trajectories to road segments, capturing connectivity and motion constraints.
  3. Spatio-Temporal (ST) Branch: Extracts dynamic traffic patterns using graph convolutions over transition probabilities and sinusoidal time embeddings to capture periodic cycles like rush hours.

Technical Innovations

TIGR introduces several key components to enhance learning robustness:

  • Local Multi-Head Attention (LMA): Instead of global attention, LMA focuses on local windows, reflecting the high correlation of traffic conditions within nearby spatio-temporal regions.
  • Multi-Strategy Masking: The model uses random, consecutive, and truncation masking. Consecutive masking, in particular, forces the model to reconstruct entire journey segments, preventing simple interpolation and encouraging a deeper understanding of route logic.
  • Contrastive Learning: The framework is trained unsupervised by maximizing similarity between different "views" of the same trajectory both within and across modalities (intra-modal and inter-modal contrastive loss).

Experimental Evaluation

The model was evaluated on two large-scale taxi datasets: Porto (1.6M trajectories) and San Francisco (0.6M trajectories), with road networks sourced from OpenStreetMap.

Quantitative Results

TIGR demonstrates significant improvements over state-of-the-art baselines across multiple tasks, including Trajectory Similarity (TS), Travel Time Estimation (TTE), and Destination Prediction (DP).

Performance comparison (HR@1) on Porto and San Francisco datasets shows TIGR consistently outperforming existing baselines.

Key performance gains include:

  • Trajectory Similarity: Up to 43.22% improvement in Mean Rank on the San Francisco dataset.
  • Travel Time Estimation: A 16.65% reduction in error (MAPE).
  • Destination Prediction: Over 10% improvement in accuracy (Acc@1).

Discussion and Insights

The success of TIGR highlights the complementary nature of grid and road modalities. While grid-based methods are effective for travel time estimation due to their consistent spatial structure, road-based methods excel at trajectory similarity by respecting physical constraints. By integrating both, TIGR achieves superior performance. Furthermore, the inclusion of dynamic traffic speeds and transition probabilities allows the model to capture "travel semantics" that static models overlook.

Conclusion and Future Work

TIGR represents a significant step forward in TRL by bridging the gap between grid and road network modeling and accounting for temporal dynamics. While the model is highly effective, it relies on historical traffic data which may not be available in all regions. Future research could explore the generalization of this framework to other types of movement, such as pedestrian or drone trajectories, and investigate methods to reduce the computational overhead of the multi-branch architecture.

Summary updated

BibTeX
@misc{schestakov2024trajectory,
  author = {Stefan Schestakov and Simon Gottschalk},
  title = {{Trajectory Representation Learning on Road Networks and Grids with Spatio-Temporal Dynamics}},
  year = {2024},
  eprint = {2411.14014},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.14014},
}
Figure