Abstract
Calculating trajectory similarity is a cornerstone of modern urban computing, yet traditional methods struggle with computational complexity and the inherent noise of real-world GPS data. This paper presents T-JEPA, a self-supervised framework that leverages a Joint-Embedding Predictive Architecture to learn robust trajectory representations. By predicting missing segments in a high-level latent space rather than reconstructing raw coordinates, T-JEPA captures semantic intent and spatial context. Experimental results across five diverse datasets demonstrate that T-JEPA significantly outperforms state-of-the-art contrastive learning methods, particularly in sparse and noisy environments.
Introduction
Trajectory similarity computation—the process of determining how closely two paths align—is essential for applications ranging from traffic management to location-based recommendation systems. Historically, this task relied on heuristic measures such as Hausdorff distance or Dynamic Time Warping (DTW). While effective for clean data, these methods are computationally expensive ($O(n^2)$) and sensitive to varying sampling rates and sensor noise.
Recent advancements have shifted toward deep learning, specifically contrastive learning. These models typically learn by comparing a trajectory to a manually augmented version of itself. However, these approaches often operate in low-level Euclidean space and depend on hand-crafted augmentation rules, which limits their ability to capture the high-level "semantic" context of a route. T-JEPA addresses these limitations by adopting a predictive architecture that operates entirely within a latent representation space.
Methodology
The Joint-Embedding Predictive Architecture
T-JEPA adapts the Joint-Embedding Predictive Architecture (JEPA) for spatial data. Unlike generative models that attempt to minimize reconstruction error in coordinate space, T-JEPA focuses on predicting the embeddings of masked trajectory segments. The architecture consists of three primary components:
- Target and Context Encoders: The framework employs two encoders to map trajectories into an abstract latent space. The Target encoder processes the complete trajectory to create a ground-truth representation, while the Context encoder processes a partial version where specific segments have been masked out.
- The Predictor ($D_\phi$): This module is tasked with predicting the latent representations of the missing segments using only the context embeddings and a mask token. By learning to predict in the representation space, the model ignores low-level GPS noise and focuses on the structural patterns of the movement.
The AdjFuse Module
To account for the geographic context of individual GPS points, the authors introduced the AdjFuse module. Recognizing that a single coordinate is less informative than its surrounding environment, AdjFuse utilizes a convolution-like sliding kernel to aggregate features from a point’s spatial neighbors. This is achieved using a pre-trained node2vec graph of the city grid, allowing the model to understand the local connectivity and regional characteristics of every GPS ping. This module is particularly effective for handling irregularly sampled or low-frequency data.
Experimental Setup
Datasets
The model was evaluated on five real-world datasets representing different movement patterns and sampling frequencies:
- High-Frequency GPS: Porto (1.3M taxi trips), T-Drive (Beijing taxi data), and GeoLife (user GPS logs).
- Sparse Check-in Sequences: Foursquare-TKY (Tokyo) and Foursquare-NYC (New York). These datasets present a significant challenge due to the sporadic nature of check-ins compared to continuous GPS tracking.
Task: Most Similar Trajectory Search
The primary evaluation metric was the "Most Similar Trajectory Search." In this task, trajectories are split into odd-indexed and even-indexed points; the model must then identify the even-indexed version of a path given its odd-indexed counterpart.
Results and Discussion
Performance in Sparse Environments
T-JEPA demonstrated a substantial advantage in sparse data scenarios. On the Foursquare datasets, T-JEPA outperformed the previous state-of-the-art model, TrajCL, by 2.92x in Tokyo and 2.51x in NYC in terms of mean rank. This suggests that the predictive latent task is far more effective at capturing the underlying intent of a user than simple coordinate-based contrastive learning.
Robustness to Noise and Down-sampling
When trajectories were intentionally distorted or down-sampled by 50%, T-JEPA maintained stable performance. While baseline models saw significant accuracy degradation as noise increased, T-JEPA’s reliance on latent patterns rather than raw coordinates provided a "buffer" against sensor inaccuracies.
Geometric Generalization
To test if the learned embeddings captured human-perceivable geometric properties, the researchers used the embeddings to approximate traditional heuristics like the Fréchet distance. T-JEPA achieved the highest hit ratios (HR@5), confirming that the model successfully learns the geometric essence of trajectories without being explicitly programmed to do so.
Conclusion and Future Work
T-JEPA represents a shift away from manual data augmentation toward automated, self-supervised representation learning for spatial data. By prioritizing latent prediction over raw reconstruction and incorporating regional spatial context via the AdjFuse module, the framework sets a new benchmark for trajectory similarity tasks.
Despite its success, the model faces challenges with complex closed-loop trajectories, where overlapping spatial features can confuse the encoders. Future research will explore the integration of external semantic data, such as Point-of-Interest (POI) labels and detailed road network graphs, to better distinguish between physically overlapping but semantically distinct paths.
Summary updated