Abstract
Learning effective representations of paths in road networks is critical for various smart-city applications. However, existing methods either rely on expensive task-specific labels (supervised) or ignore the vital temporal dimension of traffic (unsupervised). This paper proposes WSCCL, a Weakly-Supervised Contrastive Curriculum Learning framework. WSCCL learns generic, time-aware Temporal Path Representations (TPRs) by leveraging inexpensive "weak labels" such as peak-hour metadata. Through a combination of a temporal path encoder, contrastive learning, and a curriculum-based training strategy, the framework produces embeddings that generalize across diverse tasks. Experimental results on three real-world datasets demonstrate that WSCCL outperforms state-of-the-art supervised models in tasks like travel-time estimation and path recommendation.
Introduction
In modern urban environments, a "path" is not merely a static sequence of coordinates; its functional characteristics are deeply tied to time. For instance, a highway segment during the 8:00 AM rush hour exhibits significantly different traffic behavior compared to the same segment at 10:00 PM. Capturing these temporal dynamics is essential for accurate modeling.
Current approaches to path representation learning face a dichotomy. Supervised methods require "strong labels"—such as exact travel times—which are costly to collect and often lead to task-specific models that lack generalizability. Conversely, unsupervised methods are more generic but typically treat road networks as static graphs, failing to account for time-varying traffic patterns. The challenge lies in developing a representation that is both generic and temporally sensitive without the need for high-density labeled data.
Methodology: The WSCCL Framework
The proposed WSCCL framework addresses these limitations through three integrated components: a temporal path encoder, weakly-supervised contrastive learning, and a curriculum learning strategy.
Temporal Path Encoder
The encoder fuses spatial and temporal features to create a comprehensive path embedding. Spatial features include road attributes (e.g., type, lanes) and network topology derived via node2vec. To model time, the authors construct a "temporal graph" where nodes represent discrete time slots and days of the week. This structure captures periodic traffic patterns and transitions. An LSTM layer then processes these fused features to maintain the sequential integrity of the path.
Weakly-Supervised Contrastive Learning (WSC)
Instead of regressing to exact values, WSCCL employs contrastive learning using "weak labels"—metadata that is easy to obtain, such as "Peak" or "Off-Peak" hours. The model learns by pulling together "positive samples" (the same path within the same time category) and pushing apart "negative samples" (different paths or the same path in different time categories) in the latent space. This dual-level contrastive loss operates at both the global (entire path) and local (individual edges) levels.
Curriculum Learning
To improve training stability, the framework adopts a curriculum learning approach. A "committee of experts"—multiple models trained on different data subsets—evaluates the difficulty of each path. Samples with high agreement among experts are deemed "easy" and introduced early in training, while "hard" samples with high disagreement are introduced later. This prevents the model from converging to poor local optima due to noisy or complex data.
Experimental Evaluation
The framework was evaluated using three large-scale trajectory datasets mapped to OpenStreetMap:
- Aalborg, Denmark: 28,370 paths from two years of GPS data.
- Harbin, China: 58,977 taxi trajectory paths.
- Chengdu, China: 57,404 paths from the Didi Chuxing GAIA initiative.
These datasets represent diverse urban layouts and traffic conditions, providing a rigorous test for the model's robustness.
Results and Discussion
WSCCL was benchmarked against state-of-the-art supervised and unsupervised models across three downstream tasks: Travel Time Estimation, Path Ranking, and Path Recommendation.
- Performance vs. Supervised Models: WSCCL consistently outperformed specialized supervised baselines. In the Aalborg travel-time estimation task, WSCCL achieved a Mean Absolute Error (MAE) of 31.66, significantly lower than the 37.09 achieved by the best supervised baseline, DeepGTT.
- Data Efficiency: Pre-training with WSCCL allows supervised models to reach peak performance using 30-40% less labeled data, highlighting the high information density of the learned TPRs.
- Ablation Studies: Removing curriculum learning or the local/global loss components resulted in marked performance declines, confirming the necessity of the multi-stage, multi-level design.
Conclusion
WSCCL demonstrates that "weak labels" like time-of-day categories provide sufficient signal for learning high-quality, generic path representations. By treating time as a topological feature and employing curriculum-based contrastive learning, the framework bridges the gap between expensive supervised methods and time-agnostic unsupervised ones. Future work may explore finer label granularity, such as weather or real-time congestion indices, and incorporate driver-specific behavioral patterns to further enhance representation accuracy.
Summary updated