# Contrastive Trajectory Similarity Learning with Dual-Feature Attention

arXiv: https://arxiv.org/abs/2210.05155 · HTML: https://mlsanity.com/paper/2210.05155/

## Key facts

- Cited by 44 papers in the map (data through 14 Oct 2026).
- Builds on 27 of its 60 references that are in the map.
- First posted on arXiv 11 Oct 2022.

## Builds on (most cited first, 27 of 27)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [Deep Residual Learning for Image Recognition](https://mlsanity.com/paper/1512.03385/) (2015)
- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://mlsanity.com/paper/1810.04805/) (2018)
- [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://mlsanity.com/paper/2010.11929/) (2020)
- [Swin Transformer: Hierarchical Vision Transformer using Shifted Windows](https://mlsanity.com/paper/2103.14030/) (2021)
- [A Simple Framework for Contrastive Learning of Visual Representations](https://mlsanity.com/paper/2002.05709/) (2020)
- [Representation Learning with Contrastive Predictive Coding](https://mlsanity.com/paper/1807.03748/) (2018)
- [Momentum Contrast for Unsupervised Visual Representation Learning](https://mlsanity.com/paper/1911.05722/) (2019)
- [Layer Normalization](https://mlsanity.com/paper/1607.06450/) (2016)
- [Unsupervised Learning of Visual Features by Contrasting Cluster Assignments](https://mlsanity.com/paper/2006.09882/) (2020)
- [Billion-scale similarity search with GPUs](https://mlsanity.com/paper/1702.08734/) (2017)
- [Improved Baselines with Momentum Contrastive Learning](https://mlsanity.com/paper/2003.04297/) (2020)
- [SimCSE: Simple Contrastive Learning of Sentence Embeddings](https://mlsanity.com/paper/2104.08821/) (2021)
- [node2vec: Scalable Feature Learning for Networks](https://mlsanity.com/paper/1607.00653/) (2016)
- [Deep Graph Infomax](https://mlsanity.com/paper/1809.10341/) (2018)
- [Contrastive Multi-View Representation Learning on Graphs](https://mlsanity.com/paper/2006.05582/) (2020)
- [Graph Contrastive Learning with Adaptive Augmentation](https://mlsanity.com/paper/2010.14945/) (2020)
- [GCC: Graph Contrastive Coding for Graph Neural Network Pre-Training](https://mlsanity.com/paper/2006.09963/) (2020)
- [Understanding the Behaviour of Contrastive Loss](https://mlsanity.com/paper/2012.09740/) (2020)
- [DeCLUTR: Deep Contrastive Learning for Unsupervised Textual Representations](https://mlsanity.com/paper/2006.03659/) (2020)
- [Spatio-Temporal Graph Transformer Networks for Pedestrian Trajectory Prediction](https://mlsanity.com/paper/2005.08514/) (2020)
- [Transformer Networks for Trajectory Forecasting](https://mlsanity.com/paper/2003.08111/) (2020)
- [CERT: Contrastive Self-supervised Learning for Language Understanding](https://mlsanity.com/paper/2005.12766/) (2020)
- [MobTCast: Leveraging Auxiliary Trajectory Forecasting for Human Mobility Prediction](https://mlsanity.com/paper/2110.01401/) (2021)
- [When Do Contrastive Learning Signals Help Spatio-Temporal Graph Forecasting?](https://mlsanity.com/paper/2108.11873/) (2021)
- [Deep Spatially and Temporally Aware Similarity Computation for Road Network Constrained Trajectories](https://mlsanity.com/paper/2112.09339/) (2021)
- [Sub-trajectory Similarity Join with Obfuscation](https://mlsanity.com/paper/2106.03355/) (2021)

## Built on by (most cited first, 30 of 44)

- [Foundation Models for Time Series Analysis: A Tutorial and Survey](https://mlsanity.com/paper/2403.14735/) (2024)
- [Trajectory Data Management and Mining: A Survey from Deep Learning to the LLM Era](https://mlsanity.com/paper/2403.14151/) (2024)
- [More Than Routing: Joint GPS and Route Modeling for Refine Trajectory Representation Learning](https://mlsanity.com/paper/2402.16915/) (2024)
- [TrajFM: A Vehicle Trajectory Foundation Model for Region and Task Transferability](https://mlsanity.com/paper/2408.15251/) (2024)
- [MM-Path: Multi-modal, Multi-granularity Path Representation Learning -- Extended Version](https://mlsanity.com/paper/2411.18428/) (2024)
- [Urban Region Representation Learning with Attentive Fusion](https://mlsanity.com/paper/2312.04606/) (2023)
- [T-JEPA: A Joint-Embedding Predictive Architecture for Trajectory Similarity Computation](https://mlsanity.com/paper/2406.12913/) (2024)
- [Unraveling Spatio-Temporal Foundation Models via the Pipeline Lens: A Comprehensive Review](https://mlsanity.com/paper/2506.01364/) (2025)
- [Self-Supervised Representation Learning for Geospatial Objects: A Survey](https://mlsanity.com/paper/2408.12133/) (2024)
- [RED: Effective Trajectory Representation Learning with Comprehensive Information](https://mlsanity.com/paper/2411.15096/) (2024)
- [Holistic Semantic Representation for Navigational Trajectory Generation](https://mlsanity.com/paper/2501.02737/) (2025)
- [Blurred Encoding for Trajectory Representation Learning](https://mlsanity.com/paper/2511.13741/) (2025)
- [Grid and Road Expressions Are Complementary for Trajectory Representation Learning](https://mlsanity.com/paper/2411.14768/) (2024)
- [HiT-JEPA: A Hierarchical Self-supervised Trajectory Embedding Framework for Similarity Computation](https://mlsanity.com/paper/2507.00028/) (2025)
- [Towards Robust Trajectory Representations: Isolating Environmental Confounders with Causal Learning](https://mlsanity.com/paper/2404.14073/) (2024)
- [TrajCogn: Leveraging LLMs for Cognizing Movement Patterns and Travel Purposes from Trajectories](https://mlsanity.com/paper/2405.12459/) (2024)
- [Revisiting CNNs for Trajectory Similarity Learning](https://mlsanity.com/paper/2405.19761/) (2024)
- [UniTE: A Survey and Unified Pipeline for Pre-training Spatiotemporal Trajectory Embeddings](https://mlsanity.com/paper/2407.12550/) (2024)
- [TransferTraj: A Vehicle Trajectory Learning Model for Region and Task Transferability](https://mlsanity.com/paper/2505.12672/) (2025)
- [AMD: Adaptive Momentum and Decoupled Contrastive Learning Framework for Robust Long-Tail Trajectory Prediction](https://mlsanity.com/paper/2507.01801/) (2025)
- [PTrajM: Efficient and Semantic-rich Trajectory Learning with Pretrained Trajectory-Mamba](https://mlsanity.com/paper/2408.04916/) (2024)
- [Contrast & Compress: Learning Lightweight Embeddings for Short Trajectories](https://mlsanity.com/paper/2506.02571/) (2025)
- [Spatio-Temporal Trajectory Foundation Model - Recent Advances and Future Directions](https://mlsanity.com/paper/2511.20729/) (2025)
- [TSMini: A Simple Yet Highly Effective Trajectory Similarity Learning Model](https://mlsanity.com/paper/2502.00285/) (2025)
- [Towards Physics-informed Diffusion for Anomaly Detection in Trajectories](https://mlsanity.com/paper/2506.06999/) (2025)
- [CoMI-IRL: Contrastive Multi-Intention Inverse Reinforcement Learning](https://mlsanity.com/paper/2602.07496/) (2026)
- [TrajDLM: Topology-Aware Block Diffusion Language Model for Trajectory Generation](https://mlsanity.com/paper/2605.10020/) (2026)
- [Learning Spatio-Temporal Dynamics for Trajectory Recovery via Time-Aware Transformer](https://mlsanity.com/paper/2505.13857/) (2025)
- [Learning Generalized and Flexible Trajectory Models from Omni-Semantic Supervision](https://mlsanity.com/paper/2505.17437/) (2025)
- [TrajMamba: An Efficient and Semantic-rich Vehicle Trajectory Pre-training Model](https://mlsanity.com/paper/2510.17545/) (2025)

## Abstract (arXiv)

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. 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.
