Contrastive Trajectory Similarity Learning with Dual-Feature Attention

Yanchuan Chang, Jianzhong Qi, Yuxuan Liang, Egemen Tanin
10/11/2022
cs.DBcs.LG

Official code: changyanchuan/TrajCL (70 stars, Python, last commit 2025-07-16).

Abstract

Trajectory similarity measures act as query predicates in trajectory databases, making them the key player in determining the query results. They also have a heavy impact on the query efficiency.

Show full abstract

An ideal measure should have the capability to accurately evaluate the similarity between any two trajectories in a very short amount of time. Towards this aim, we propose a contrastive learning-based trajectory modeling method named TrajCL. We present four trajectory augmentation methods and a novel dual-feature self-attention-based trajectory backbone encoder. The resultant model can jointly learn both the spatial and the structural patterns of trajectories. Our model does not involve any recurrent structures and thus has a high efficiency. Besides, our pre-trained backbone encoder can be fine-tuned towards other computationally expensive measures with minimal supervision data. Experimental results show that TrajCL is consistently and significantly more accurate than the state-of-the-art trajectory similarity measures. After fine-tuning, i.e., to serve as an estimator for heuristic measures, TrajCL can even outperform the state-of-the-art supervised method by up to 56% in the accuracy for processing trajectory similarity queries.

View on arXivView PDF

Code Implementations(1)

Contrastive Trajectory Similarity Learning with Dual-Feature Attention (TrajCL) - ICDE 2023

7020Python, CythonOct 23, 20221 years ago
icdeicde2023spatio-temporaltrajcltrajectory-analysis+3 more

Similar Papers

Cite this paper

@article{chang2022contrastive,
  title  = {Contrastive Trajectory Similarity Learning with Dual-Feature Attention},
  author = {Yanchuan Chang and Jianzhong Qi and Yuxuan Liang and Egemen Tanin},
  year   = {2022},
  eprint = {2210.05155},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.05155}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.05155.svg)](https://codeofpaper.com/paper/2210.05155)

Discussion