Trajectory-based behavioural intention prediction faces environmental variation, and representations learned with a pooled contrastive objective may retain environment-specific regularities. We present CARE, a self-supervised trajectory-learning framework that couples temporally asymmetric contrastive views with an invariant-risk-minimisation (IRM)-style gradient penalty on environment-wise contrastive risks. Each input window yields an anchor, a partially masked positive view, and a temporally perturbed negative view. Masked reconstruction and observability-aware evidence consistency complement this objective by promoting temporal information retention under partial input. On an IMPTC-derived four-class intention task, CARE achieves 0.840 accuracy and 0.023 expected calibration error (ECE) under IID fine-tuning, and 0.806 accuracy with a Brier score of 0.308 on the reported held-out environment. Under frozen-encoder linear probing, reconstruction provides the largest individual held-out accuracy gain, whereas the complete objective yields the lowest held-out ECE (0.049) among tested variants. These results support the combined objective as a competitive representation-learning approach under the evaluated shift, while the IRM-style regulariser is not taken as evidence of formal invariance.
Figures & tables
Figure 1: CARE combines temporally asymmetric contrastive views with an environment-wise IRM-style penalty; reconstruction and evidence consistency provide auxiliary regularization. The architecture and computation graph are retained from the original manuscript.
Symbol
Meaning
X∈RL×F
input trajectory window, length L , feature dim F
xt∈RF
feature vector at time step t
Lp
past length, Lf=L−Lp future length
A,P,N
anchor, masked positive, corrupted negative views
M⊂{1,…,L}
masked time index set used to form P
ρ,b
mask rate, block length
Table 1: Notation.
Split
Samples
Unique IDs
Window length L
Past length Lp
Future length Lf
Stride S
Train
28272
3328
100
60
40
80
Test
8155
1065
100
60
40
80
Table 2: IMPTC BIP dataset overview and window construction settings.
Split
Straight
Left
Right
Stop
Train
15099 (53.41%)
2347 (8.30%)
2319 (8.20%)
8507 (30.09%)
Test
4761 (58.38%)
698 (8.56%)
677 (8.30%)
2019 (24.76%)
Table 3: Intention label distribution. Percentages are computed within each split.
Model
Acc
Worst group
ECE
NLL
Brier
CARE
0.840
0.800
0.023
0.453
0.233
DLinear
0.821
0.794
0.044
0.539
0.254
LiST
0.830
0.782
0.030
0.459
0.236
PatchTST
0.817
0.774
0.070
0.544
0.269
TCN
0.771
0.738
0.025
0.717
0.356
DAE
0.791
0.770
0.041
0.677
0.334
Table 4: IID results using stage two global finetuning. Higher is better for accuracy and worst group accuracy. Lower is better for calibration and probability quality metric. Best values per column are in bold.
Model
Acc
ECE
NLL
Brier
CARE
0.806
0.090
0.623
0.308
DLinear
0.794
0.095
0.756
0.333
LiST
0.785
0.070
0.622
0.312
PatchTST
0.779
0.124
0.719
0.350
TCN
0.741
0.039
0.773
0.396
DAE
0.774
0.053
0.753
0.377
Table 5: Representative leave one environment out results using stage two global finetuning. The held out environment is chosen from the largest environment groups due to long tailed environment distribution. Higher is better for accuracy. Lower is better for calibration and probability quality metrics. Best values per column are in bold.
Setting
Acc
Worst group
NLL
Brier
ECE
Base
0.783
0.755
0.695
0.342
0.040
REC
0.803
0.778
0.625
0.302
0.053
IRM
0.784
0.755
0.694
0.341
0.038
EVI
0.783
0.756
0.696
0.343
0.038
REC+IRM
0.792
0.768
0.661
0.327
0.028
REC+EVI
0.792
0.768
0.662
0.327
0.028
Table 6: IID component ablation with a frozen encoder (linear probing). Base denotes contrastive NCE; REC, IRM and EVI denote reconstruction, IRM-style regularisation and auxiliary evidence consistency. Best values per column are bold (Acc/worst-group Acc ↑ , NLL/Brier/ECE ↓ ).
Setting
Acc
NLL
Brier
ECE
Base
0.765
0.750
0.381
0.066
REC
0.779
0.720
0.356
0.068
IRM
0.765
0.746
0.380
0.073
EVI
0.765
0.749
0.381
0.070
REC+IRM
0.774
0.731
0.370
0.069
REC+EVI
0.774
0.731
0.370
0.070
Table 7: Held-out-environment component ablation with a frozen encoder (linear probing). Base denotes contrastive NCE; REC, IRM and EVI denote reconstruction, IRM-style regularisation and auxiliary evidence consistency. Best values per column are bold (Acc ↑ , NLL/Brier/ECE ↓ ).
Figure 2: UMAP visualisation of CARE encoder embeddings on the test split, coloured by the discrete environment ID (used by CARE for environment-aware learning and evaluation). Colours appear interleaved in this two-dimensional projection; this alone does not establish environment invariance. Environment IDs 2 and 3 are absent in the test split and therefore do not appear in the plot.
Figure 3: UMAP visualisation of CARE encoder embeddings on the test split, coloured by trajectory-level statistics of the x coordinate over each window ( L=100 ). Left: mean(x) ; right: std(x) . The smooth gradient in mean(x) suggests coherent geometric organisation, while localised high std(x) highlights windows with larger spatial variability.
Figure 4: UMAP projection of CARE encoder embeddings on the test split, coloured by ground-type context aggregated within each trajectory window ( L=100 ). Left: modal ground_type in the window. Right: number of unique ground_type values observed in the window, serving as a proxy for local context diversity. The dominant mode is consistent with typical VRU trajectories occurring on sidewalks or road surfaces. Colours remain largely interleaved across the manifold rather than forming isolated semantic islands, while regions with higher context diversity concentrate locally and align with areas of higher motion variability in other statistics, providing interpretable context cues without the representation being driven by discrete ground-type labels.
Trajectory representation learning develops compact embeddings of ordered paths for comparing, predicting, retrieving, and acting from movement histories.
James Watt School of Engineering, University of Glasgow, Glasgow, G12 8QQ, United Kingdom · School of Computing Science, University of Glasgow, Glasgow, G12 8QQ, United Kingdom