Abstract
Trajectory Representation Learning (TRL) is critical for transforming raw GPS data into actionable insights. We present RED (Road-aware, Embedding-joint, Dual-objective), a novel self-supervised framework that leverages a Transformer-based Masked Autoencoder (MAE) to generate robust trajectory vectors. By integrating road network topology, temporal periodicity, and user-specific driving styles, RED achieves significant performance gains—up to 20%—over state-of-the-art models in tasks such as travel-time estimation and similarity search.
1. Introduction
The proliferation of GPS-enabled devices has generated vast amounts of trajectory data. TRL aims to map these variable-length sequences of coordinates into fixed-length mathematical vectors, facilitating efficient downstream tasks like route recommendation and traffic prediction. However, existing methods often overlook the underlying road network and contextual factors like time and user identity. Furthermore, standard random masking techniques used in self-supervised learning can inadvertently hide critical structural information, leading to suboptimal representations.
2. The RED Framework
RED addresses these limitations through three core innovations:
2.1 Road-aware Masking Strategy
Unlike traditional random masking, RED employs a road-aware strategy. It identifies "key paths"—segments characterized by significant length or high sampling density—and ensures they remain visible during training. By masking less critical "hot" segments, the model is forced to learn the essential "skeleton" of the trajectory, making it more resilient to noise.
2.2 Spatial-Temporal-User Joint Embedding
RED incorporates multi-faceted context into its embeddings:
- Spatial: A Graph Attention Network (GAT) captures the topology of the road network.
- Temporal: A "Time2vec" inspired encoding captures periodic patterns (e.g., weekday vs. weekend).
- User: Learnable embeddings for individual user IDs account for unique driving behaviors and preferences.
2.3 Dual-objective Learning and Architecture
The framework utilizes a Transformer-based MAE with a dual-objective:
- Local Pattern Learning: The Encoder predicts the next segment in a sequence.
- Global Structure Reconstruction: The Decoder reconstructs the entire trajectory from its masked representation.
To handle physical path nuances, the architecture includes virtual tokens ([START], [END], [EXTRACT]) and a specialized attention mechanism that weights segments based on physical distance and temporal intervals.
3. Experimental Evaluation
The researchers evaluated RED using four large-scale, real-world datasets: Porto (~860k trajectories), Rome (~80k), Chengdu (~4.4M), and Geolife (human mobility).
3.1 Performance Results
RED was compared against nine state-of-the-art baselines, including both RNN and BERT-based models. Key findings include:
- Accuracy: RED improved travel-time estimation accuracy by 7.03%, trajectory classification by 12.11%, and trajectory similarity computation by 20.02% over the best baselines.
- Efficiency: The Transformer-based architecture allows for parallel processing, resulting in inference speeds comparable to the fastest existing models and significantly outperforming traditional RNNs.
- Robustness: The model maintains high accuracy even with downsampled data, demonstrating the effectiveness of its joint embeddings in reconstructing missing information.
4. Conclusion
RED represents a significant advancement in TRL by effectively fusing road network awareness with spatial, temporal, and user context. While currently optimized for map-matched trajectories, future work will explore its application to "free-space" movements and multi-modal transportation systems.
Summary updated