Weakly-supervised Temporal Path Representation Learning with Contrastive Curriculum Learning - Extended Version

Sean Bin Yang, Chenjuan Guo, Jilin Hu, Bin Yang 0002, Jian Tang, Christian S. JensenarXiv 2022 · DOI

Abstract

Effective smart-city applications require sophisticated models capable of understanding "Temporal Path Representations" (TPRs)—embeddings that capture both the static geometry of a route and its time-dependent traffic dynamics. This paper introduces WSCCL, a framework that leverages inexpensive "weak labels" (e.g., peak vs. off-peak hours) and a curriculum-based contrastive learning strategy to generate versatile TPRs. Experimental results across three real-world datasets demonstrate that WSCCL outperforms state-of-the-art supervised and unsupervised methods in tasks such as travel-time estimation and path recommendation, while significantly improving data efficiency.

1. Introduction

In the context of urban mobility, a path is more than a sequence of coordinates; it is a dynamic entity. A highway segment at 8:00 AM during rush hour presents a fundamentally different environment for navigation and logistics than the same segment at 10:00 PM. To build effective AI tools for these environments, models need fixed-length vectors that encode both spatial geometry and temporal context.

2. The Challenge of Temporal Paths

Existing representation learning methods generally fall into two categories, both of which have significant drawbacks:

  1. Supervised Methods: These are often task-specific and require massive amounts of "strong labels" (e.g., exact travel times). They lack generalizability; a model optimized for travel-time estimation rarely performs well for path ranking.
  2. Unsupervised Methods: These are more generic but typically ignore temporal dynamics, treating road segments identically regardless of the time of day.
Figure 2: Comparison of travel times for the same route at 8:00 a.m. vs. 10:00 a.m., illustrating the temporal dynamics of urban paths.

WSCCL aims to bridge this gap by learning generic, time-aware representations without the need for expensive, task-specific labeled data.

3. The WSCCL Framework

The proposed Weakly-supervised Contrastive Curriculum Learning (WSCCL) framework is built upon three main pillars designed to create robust, multi-scale embeddings.

Figure 5: The WSCCL framework architecture, detailing the flow from Temporal Path Encoding to Contrastive Learning and the Curriculum selection process.

3.1 Temporal Path Encoder

The model utilizes a dual-embedding approach to capture spatial features (road type, lane count, and network topology via node2vec) and temporal features (time slots and day of the week). These inputs are processed through a Long Short-Term Memory (LSTM) network to capture the sequential dependencies of the path, resulting in a unified TPR vector.

3.2 Weakly-Supervised Contrastive (WSC) Learning

Instead of precise travel durations, WSCCL utilizes easily obtainable weak labels like "Morning Peak" or "Off-Peak." The contrastive learning objective trains the model to pull representations of the same path at the same time-of-day closer together (positive samples) while pushing away representations of different paths or the same path at different times (negative samples). This process incorporates both local (edge-level) and global (path-level) losses to ensure robustness.

3.3 Curriculum Learning

To handle the complexity of urban trajectories, the authors implement a "simple-to-hard" training strategy. An ensemble of "Expert" models scores the difficulty of training samples based on representation consistency. The framework then partitions data into stages, allowing the model to master consistent, simple paths before tackling high-variance, complex routes.

4. Experimental Setup and Datasets

The framework was evaluated on three large-scale real-world trajectory datasets with road networks sourced from OpenStreetMap:

  • Aalborg, Denmark: 28,370 paths from a two-year GPS study.
  • Harbin, China: 58,977 taxi-based paths.
  • Chengdu, China: 57,404 paths from Didi Chuxing.

5. Key Insights and Results

5.1 The Sufficiency of Weak Labels

A primary finding is that precise travel durations are not necessary for learning high-quality embeddings. Categorical context (e.g., "this is a peak-hour trip") provides sufficient signal for the contrastive loss to organize the embedding space effectively.

5.2 Performance Metrics

WSCCL was tested against 12 baselines across several downstream tasks:

  • Travel Time Estimation: On the Aalborg dataset, WSCCL achieved a Mean Absolute Error (MAE) of 31.66, significantly lower than the best supervised baseline, PathRank (37.09).
  • Path Ranking: The model demonstrated superior alignment with ground-truth rankings, achieving higher Kendall’s $\tau$ and Spearman’s $\rho$ scores than all competitors.
  • Data Efficiency: When used for pre-training, WSCCL allowed supervised models to reach peak performance using 30% less labeled data compared to training from scratch.

6. Conclusion and Future Work

WSCCL demonstrates that weakly-supervised contrastive learning, paired with a curriculum strategy, can produce highly effective and generalizable temporal path representations. Future research may explore incorporating more diverse weak labels, such as driver behavior or vehicle type, and improving the model's ability to adapt to real-time "black swan" events like accidents or sudden closures.

Summary updated

Abstract

In step with the digitalization of transportation, we are witnessing a growing range of path-based smart-city applications, e.g., travel-time estimation and travel path ranking. A temporal path(TP) that includes temporal information, e.g., departure time, into the path is fundamental to enable such applications. In this setting, it is essential to learn generic temporal path representations(TPRs) that consider spatial and temporal correlations simultaneously and that can be used in different applications, i.e., downstream tasks. Existing methods fail to achieve the goal since (i) supervised methods require large amounts of task-specific labels when training and thus fail to generalize the obtained TPRs to other tasks; (ii) through unsupervised methods can learn generic representations, they disregard the temporal aspect, leading to sub-optimal results. To contend with the limitations of existing solutions, we propose a Weakly-Supervised Contrastive (WSC) learning model. We first propose a temporal path encoder that encodes both the spatial and temporal information of a temporal path into a TPR. To train the encoder, we introduce weak labels that are easy and inexpensive to obtain and are relevant to different tasks, e.g., temporal labels indicating peak vs. off-peak hours from departure times. Based on the weak labels, we construct meaningful positive and negative temporal path samples by considering both spatial and temporal information, which facilities training the encoder using contrastive learning by pulling closer to the positive samples' representations while pushing away the negative samples' representations. To better guide contrastive learning, we propose a learning strategy based on Curriculum Learning such that the learning performs from easy to hard training instances. Experiments studies verify the effectiveness of the proposed method.
BibTeX
@misc{yang2022weakly,
  author = {Sean Bin Yang and Chenjuan Guo and Jilin Hu and Bin Yang and Jian Tang and Christian S. Jensen},
  title = {{Weakly-supervised Temporal Path Representation Learning with Contrastive Curriculum Learning - Extended Version}},
  year = {2022},
  eprint = {2203.16110},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.16110},
}
Figure