Predicting where pedestrians will walk next is notoriously difficult. Human movement is influenced by scene geometry, social interactions, and hidden subjective intentions. Most modern approaches treat this as a sequence-to-sequence problem, using generative models (like Conditional VAEs or Diffusion models) to map high-dimensional features of past trajectories into a separate feature space for future trajectories.
However, this standard pipeline harbors a critical flaw: projecting past and future trajectories into completely different latent spaces creates a "feature space gap." This disconnect limits a model's ability to generalize to new scenes or adapt to novel movement patterns because it ignores the inherent spatio-temporal continuity between where a person was and where they are going.
To address this, researchers introduce TrajCLIP, a novel architecture that tackles pedestrian trajectory prediction by recognizing that past and future paths should exist in the same latent feature space. By combining contrastive learning to align these spaces and Idempotent Generative Networks (IGN) to map them, the model achieves state-of-the-art accuracy and excels in cross-scene generalization, few-shot learning, and real-time online adaptation.
Methodology
TrajCLIP introduces a unique pipeline to bridge the feature space gap and accurately forecast pedestrian movements:
- Dual-Domain Trajectory Encoder: Instead of relying solely on time-series data, the encoder fuses time-domain features (Spatio-Temporal Interaction Features, or STIF) with frequency-domain features (Scene-Agent Interaction Features, or SAIF). It uses Fast Fourier Transforms (FFT) and Butterworth filters to separate fine-grained agent movements from broader, shared scene interactions.
- CLIP Pairing Learning: Inspired by how CLIP aligns text and images, TrajCLIP uses contrastive learning to force the historical trajectory encoder and the future trajectory encoder to share the same latent feature space. A custom similarity metric based on velocity direction vectors serves as the label for this contrastive loss.
- Idempotent Generative Network (IGN): Once the spaces are aligned, an IGN (implemented as a Multi-Layer Perceptron) maps the past features to the future manifold. It uses "idempotent loss" (ensuring the mapping function applied twice yields the same result as applied once) and "tightness loss" to prevent the latent space from over-expanding, avoiding representation collapse.
- Adjacent Point Interpolation (API): To boost the model's ability to handle complex, multimodal distributions, TrajCLIP employs a custom data augmentation technique that interpolates between adjacent trajectory points to create synthetic training data.
Key Architectural Insights
A core "aha" moment of TrajCLIP is treating trajectory prediction not as a translation between two different languages, but as an extrapolation within the same language. Aligning past and future latent spaces preserves spatio-temporal continuity. Furthermore, unlike CVAEs or Diffusion models that rely on random noise sampling—which can lead to uncontrollable generated results—the IGN provides a deterministic, affine transformation. Ablation studies show that contrastive alignment provides massive boosts to IGNs, but only marginal boosts to diffusion/CVAE models due to their inherent randomness.
Experiments and Results
The authors evaluated TrajCLIP on three standard pedestrian trajectory prediction benchmarks: ETH-UCY (five outdoor scenes), SDD (Stanford Drone Dataset, capturing campus scenes from a bird's-eye view), and SNU (an indoor dataset featuring diverse movement patterns like strolling and staggering).
- State-of-the-Art Accuracy: TrajCLIP outperformed six recent top-tier models (including Trajectron++ and MID) on standard prediction tasks, reducing prediction error (ADE/FDE metrics) by up to 17% across the three datasets.
- Transfer Learning: In scene-to-scene transfer tasks (training on one scene, testing on an unseen one), TrajCLIP consistently beat baselines specifically designed for domain adaptation. In a 4-shot transfer task on the SNU dataset, it outperformed competitors by 8.7% to 40.6%.
- Online Adaptation: When deployed in a simulated online environment—updating the model sequentially as new data arrives—TrajCLIP adapted to new scenes 20% better than its offline baseline after just 100 steps.
- TrajCLIP-tiny: The authors also released a lightweight version that strips out the interpolation and reduces attention matrices. It requires 76.9% fewer parameters (only 3.45MB), runs inference in a blazing 0.06 seconds, and maintains highly competitive accuracy, making it ideal for edge deployment on robots or autonomous vehicles.
Limitations and Future Work
While TrajCLIP excels at modeling complex individual paths and unusual turns, it currently struggles with collision avoidance in highly complex, high-density environments. In crowded scenarios, the model occasionally predicts trajectories that deviate from the intended endpoint and collide with other agents. Future iterations will likely need to integrate explicit collision-avoidance constraints or advanced social-pooling mechanisms into the shared feature space to handle dense crowds safely.
Summary updated