Papers
Topics
Authors
Recent
Search
2000 character limit reached

MoCo-AIS: A Contrastive Learning Framework for Similarity Computation of Vessel Trajectories

Published 16 Jun 2026 in cs.AI | (2606.17978v1)

Abstract: Trajectory similarity is a fundamental task in analyzing mobility patterns, essential for applications such as route pattern extraction, mobility prediction, and anomaly detection. Traditional distance-based measures for computing similarity incur high computational cost, driving the adoption of lightweight learning-based approaches. Supervised methods rely on extensive labels derived from traditional distance measures and often reproduce these metrics, which limits generalization. While self-supervised learning addresses this issue through contrastive learning, it lacks a unified framework, making it difficult to compare deep learning (DL) models for consistent trajectory representation. Accordingly, this paper presents MoCo-AIS, a unified framework for learning vessel trajectory embeddings based on the Momentum Contrast (MoCo) paradigm, which formulates similarity learning through positive and negative trajectory pairs. Within this framework, we evaluate a diverse set of leading DL models on large-scale, real-world vessel-tracking AIS datasets that capture diverse navigation behaviors and operating conditions. Results demonstrate that our framework significantly improves similarity learning over existing baselines, while providing a benchmarking platform for evaluating trajectory representation models.

Summary

  • The paper introduces MoCo-AIS, a self-supervised contrastive learning framework that produces efficient and discriminative vessel trajectory embeddings.
  • It employs interchangeable encoder architectures and robust augmentation strategies to standardize similarity computation across complex AIS datasets.
  • Experimental results demonstrate up to 10,000x speedups and high retrieval accuracy compared to traditional methods in maritime analytics.

MoCo-AIS: A Contrastive Learning Framework for Similarity Computation of Vessel Trajectories

Introduction

The task of computing similarity between vessel trajectories is central to a wide range of maritime analytics, including traffic modeling, anomaly detection, mobility prediction, and behavior clustering. Traditional methods for trajectory similarity, such as Hausdorff distance and Dynamic Time Warping (DTW), are well-established but incur prohibitive computational costs, especially for large-scale AIS datasets with complex mobility patterns. Meanwhile, learning-based approaches, particularly those using deep neural networks, either rely heavily on labels derived from distance metrics or lack an interpretable benchmarking protocol, often leading to poor generalization and significant experimental heterogeneity.

MoCo-AIS addresses these deficiencies by introducing a modular, self-supervised contrastive learning framework for generalizable, efficient, and discriminative vessel trajectory embeddings. Building on the Momentum Contrast (MoCo) paradigm, MoCo-AIS standardizes both the learning and evaluation procedures for similarity computation, supporting interchangeable encoder architectures and robust augmentation strategies.

Distance-based trajectory similarity computation remains dominant in maritime applications due to its interpretability and rigorous geometric foundation. However, these methods are highly sensitive to noise, irregular sampling, and cannot scale to the volume of modern AIS data. Learning-based methods, especially those adopting supervised paradigms (e.g., NeuTraj, TrajSR, TrajGAT), reproduce their reference metrics, inheriting their limitations and biasing embeddings towards the surrogate measure. Self-supervised approaches, particularly contrastive learning (e.g., t2vec, TrajCL), circumvent label dependency but are rarely evaluated under a standardized protocol, and rarely offer insight into model generalization across regions and scales.

Maritime trajectory data present domain-specific challenges: sparsity, bursty transmission, environmental perturbations, and unrestricted movement spaces, in contrast to structured urban mobility datasets. MoCo-AIS is explicitly designed to address these via a unified pipeline that enforces architectural modularity, embedding space consistency, and strong negative sample diversity through momentum-updated encoders and dynamic memory queues.

Methodology

Data Representation and Augmentation

Trajectories are formulated as sequences of 2D geographic coordinates (longitude, latitude), preserving spatial and temporal order. Unlike many urban-focused models, kinematic attributes (e.g., SOG, COG) are omitted due to their high variance and local noise characteristics. The framework supports standardized data preprocessing, including noise removal, trip segmentation, resampling, and length-based filtering.

To generate positive pairs for contrastive learning, three augmentation strategies are employed: sub-trajectory extraction, geometric shape distortion, and trajectory simplification via the Ramer-Douglas-Peucker algorithm. This multi-augmentation approach ensures robust, semantically consistent embedding learning.

Encoder Architecture

MoCo-AIS implements a pluggable encoder system, supporting Bi-LSTM, Bi-GRU, Temporal Convolutional Networks (TCNs), and Transformers. Encoders ingest padded sequences with masking mechanisms to handle variability in sequence lengths. Projection heads map encoder outputs to a fixed-dimensional latent space, enabling flexible integration of diverse sequential modeling approaches.

In the Transformer variant, sinusoidal positional encodings are added to linear projections of the inputs, with masked mean pooling ensuring invariance to input length while retaining essential sequential information.

Contrastive Learning Framework

MoCo-AIS employs the InfoNCE loss to optimize intra-class compactness and inter-class separability. The momentum-updated key encoder and memory queue enable maintaining a large and diverse set of negatives, improving training efficiency and representation quality without incurring the computational overhead of large batches.

Formally, given query, positive key, and a queue of negatives, embeddings are pulled closer for positive pairs and pushed apart for negatives in the latent space. The contrastive objective is further stabilized by momentum parameter updates and careful temperature scaling.

Experimental Analysis

Datasets and Preprocessing

Evaluation is conducted on three comprehensive AIS datasets covering the East Coast (Nova Scotia/Maine), Chesapeake Bay, and Strait of Georgia, with each region containing over 10,000 trajectories and several million points, after rigorous preprocessing to ensure data integrity and representativeness.

Evaluation Protocol

Representation quality is assessed using Mean Rank (how close a query's augmented counterparts appear in retrieval) and Hitting Ratio (fractional overlap in neighborhoods between learned and distance-based rankings), providing complementary perspectives on discriminativeness and metric alignment.

Embedding Space Analysis

Visualization via t-SNE and PCA projects confirms that augmentations of the same trajectory are consistently compact, while inter-class (distinct trajectory) embeddings remain well-separated. This validates both the learned semantic structure and the effectiveness of the contrastive objective.

Numerical Results

  1. Retrieval Effectiveness: MoCo-AIS encoders achieve mean rank values consistently close to 1, even at large dataset scales (up to 9,000 evaluation trajectories), significantly outperforming traditional metrics and prior learning-based baselines. The Transformer encoder consistently offers the best discrimination; BiLSTM and BiGRU display slightly more robust convergence.
  2. Scalability: Computational cost for classical methods (Hausdorff, DTW) grows superlinearly, reaching days for 9K candidate sets. In contrast, MoCo-AIS encoders compute embeddings and pairwise similarities in seconds, achieving up to 10,000x speedups.
  3. Generalization: Cross-regional evaluation demonstrates that RNN-based encoders are more robust than TCN/Transformer for domain shifts, though performance degrades compared to in-region tests—highlighting the need for richer augmentation or domain adaptation.
  4. Alignment with Geometric Metrics: Learned neighborhood structure diverges from Hausdorff and DTW rankings. This is a known limitation of self-supervised contrastive learning; MoCo-AIS prioritizes semantic coherence over strict geometric consistency—a tradeoff with important implications for downstream applications.

Implications and Future Directions

MoCo-AIS standardizes and advances the state of vessel trajectory similarity by providing unified, pluggable, and self-supervised representation learning, with substantial practical and theoretical ramifications:

  • Practical: The framework enables near real-time, scalable similarity computation for operational maritime systems (e.g., anomaly detection, mobility prediction, large-scale retrieval), making previously infeasible analyses tractable for industry-scale datasets.
  • Theoretical: MoCo-AIS demonstrates the viability of modular contrastive frameworks as a benchmarking tool for sequential representation models, informing both architecture selection and augmentation policy for complex mobility data.
  • Methodological: The observed misalignment with geometric metrics implies new research directions, such as integrating geometric regularization or hybrid contrastive-objective designs to balance semantic and geometric similarity, and extending augmentation strategies to support greater negative diversity and region-invariance.
  • Generalization: While tailored for AIS, the modularity of MoCo-AIS enables its straightforward application to other mobility domains (urban, airborne, or animal tracking), with adjustments for domain-specific augmentation and encoder selection.

Conclusion

MoCo-AIS establishes a unified, computationally efficient framework for vessel trajectory similarity computation via contrastive self-supervised learning. Through modular encoder design, robust augmentation, and systematic benchmarking, it achieves strong scalability, generalization, and discriminative accuracy across complex AIS datasets. The insights regarding domain-specific generalization and the relationship between learned and geometric similarities provide fertile ground for further research, both for theoretical advancements and for deployment in operational maritime systems.

Citation: "MoCo-AIS: A Contrastive Learning Framework for Similarity Computation of Vessel Trajectories" (2606.17978)

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 3 likes about this paper.