TL;DR
This paper introduces a novel framework for jointly learning representations of road networks and trajectories. By employing a unified contrastive learning approach that considers both within-scale (road-road, trajectory-trajectory) and cross-scale (road-trajectory) relationships, the method captures richer semantic information than existing methods that treat these components separately. This leads to improved performance on various traffic-related downstream tasks.
What Problem Does This Paper Address?
Understanding urban mobility relies heavily on two key pieces of information: the static road network and the dynamic trajectories of moving objects (like vehicles). The road network provides the underlying structure and connectivity, while trajectories reveal actual movement patterns and semantics. However, most existing methods for learning representations of these two components work in isolation. They either focus solely on the road network's topology or on the sequential nature of trajectories, failing to leverage the crucial interdependencies between them. This "siloed" approach leads to incomplete representations that limit performance on downstream tasks like traffic speed prediction or travel time estimation. The paper aims to bridge this gap by developing a unified framework that jointly learns from both road networks and trajectories, capturing their complementary insights.
Methods
The core of the proposed method is a jointly contrastive representation learning framework. This framework integrates three types of contrastive losses:
- Road-Road Contrast: This within-scale contrast learns representations for individual road segments by comparing a segment with its contextual neighbors within the road network. Domain-specific augmentations are used to define these neighbors, considering both structural (direct connections) and transitional (frequently co-occurring segments in trajectories) relationships.
- Trajectory-Trajectory Contrast: This within-scale contrast learns trajectory representations by comparing an original trajectory with its augmented versions. Augmentations include traditional methods like random masking and replacement, as well as a novel "detour" augmentation where a portion of the trajectory is replaced by an alternative route connecting the same origin and destination.
- Road-Trajectory Cross-Scale Contrast: This is the paper's key innovation. It aims to bridge the gap between road segments and trajectories. Unlike standard node-graph contrastive learning (where a node must belong to a graph to be a positive pair), this method introduces a more flexible approach. It defines a RoadSegment-Trajectory (RS-T) distance that considers alternative routes. This distance metric helps identify road segments that are not directly on a trajectory but are still semantically related (e.g., on a plausible alternative path). This RS-T distance is then used to assign adaptive weights to positive road-trajectory pairs, allowing for a more nuanced and robust cross-scale contrast.
The framework uses a Graph Attention Network (GAT) for encoding road segments and a Transformer Encoder for encoding trajectories. These encoders are trained end-to-end using the combined contrastive losses.
Datasets
The paper uses two real-world car-hailing trip datasets from the cities of Xi'an and Chengdu, China. These datasets were obtained from the GAIA project and Didi company. GPS records were collected and map-matched to road segments from OpenStreetMap. Trajectories with fewer than two road segments or a duration less than one minute were filtered out.
Key Insights and Ideas
- Interdependence is Key: The most significant insight is that road networks and trajectories are not independent entities but rather deeply intertwined. Ignoring their interplay leads to suboptimal representations.
- Beyond Node-Graph Contrast: The paper highlights the limitations of traditional node-graph contrastive learning for this domain. The proposed RS-T distance offers a more flexible and domain-appropriate way to define positive road-trajectory pairs, acknowledging that real-world mobility involves alternative routes.
- Adaptive Weighting Matters: Using the RS-T distance to adaptively weight the road-trajectory contrastive loss is crucial. This allows the model to focus more on relevant road segments and trajectories, leading to better representation learning.
- Unified Framework Advantage: Jointly learning all three contrastive components (road-road, trajectory-trajectory, road-trajectory) in an end-to-end manner is more effective than sequential, two-step approaches, as it avoids error propagation and information loss.
Key Results
The proposed method, "Proposed," consistently outperforms several state-of-the-art baseline methods across four downstream tasks:
- Road Segment-Based Tasks:
- Road Label Classification: Achieved the highest Mi-F1 (0.637 for Chengdu, 0.729 for Xi'an) and Ma-F1 scores.
- Traffic Speed Inference: Achieved the lowest MAE (5.02 for Chengdu, 4.69 for Xi'an) and RMSE (7.08 for Chengdu, 6.85 for Xi'an) scores.
- Trajectory-Based Tasks:
- Trajectory Similarity Search: Achieved the lowest MR (8.87 for Chengdu, 9.54 for Xi'an) and highest HR@10 (0.928 for Chengdu, 0.912 for Xi'an) scores.
- Travel Time Estimation: Achieved the lowest MAE (163.6 for Chengdu, 179.5 for Xi'an) and RMSE (243.5 for Chengdu, 302.7 for Xi'an) scores.
Ablation studies confirmed that the road-trajectory contrast component (LST) is the most important for road segment tasks, while trajectory-trajectory contrast (LTT) is most important for trajectory tasks. The RS-T distance weighting (wr) was found to be the second most important component for road segment tasks, underscoring its value.
Limitations and Future Work
- Temporal Information: The authors acknowledge that the temporal aspect of trajectories is not fully utilized in the current model. Future work will involve incorporating temporal embeddings into trajectory representations.
- City-Specific Graphs: While the model is designed for generality, applying it to different cities might require updating the road network graphs (As and Ar) and potentially fine-tuning higher-level layers due to variations in city structures. This is considered a relatively low cost, similar to transfer learning.
Summary updated