Pre-Training Trajectory Encoders to Beat the Decision Tree at One Percent Labels

When labels are very scarce, deep models for GPS trajectories still lose to a decision tree. On GeoLife transportation-mode identification, the task of telling walking from biking, bus, car and train using GPS traces, the semi-supervised autoencoder SECA beat every deep and shallow baseline at 25% labels. Yet the same study found that at 10% labels a plain decision tree on hand-computed motion statistics (maximum speed, acceleration, jerk, and similar) beat all the deep models Semi-Supervised Deep Learning Approach for Transportation Mode Identification Using GPS Trajectory Data. The modern trajectory pre-training models, from masked Transformers to state space models, have never been tested in that regime. They are evaluated almost entirely with 100% of downstream labels. So nobody knows whether self-supervised pre-training removes the tree's advantage or only hides it.

We propose a pre-training objective built to remove it. A trajectory encoder sees a sequence of GPS points with some time windows hidden. For each hidden window it must predict, in its own learned feature space, the motion statistics that a human engineer would compute for that window: speed and acceleration quantiles, jerk, and heading change. The objective is meant to put everything the tree knows into the representation, plus the sequential context the tree cannot see, without any road map. The test is concrete. We trace label-efficiency curves from 1% to 100% on GeoLife and find the label fraction at which each pre-trained encoder first overtakes the tuned tree. We call this the crossover point, and we expect our objective to push it below what masked coordinate reconstruction or contrastive pre-training achieves.

Core Claim

The claim is that the choice of pretext task, the self-made prediction problem used for pre-training, decides how far down the label axis a trajectory encoder stays competitive. Pretext tasks that target motion statistics should beat pretext tasks that target raw coordinates or global invariance. Two pieces of evidence motivate this. Contrastive Pre-training of Spatial-Temporal Trajectory Embeddings argues that coordinate reconstruction misses sequence-level meaning, while contrastive losses throw away fine kinematic detail. In ECG signals, Self-supervised representation learning from 12-lead ECG data found that latent forecasting (Contrastive Predictive Coding, which predicts future segments in feature space) clearly beat instance-contrastive methods, and that the gains were largest on rare classes. We combine the two lessons. The objective is latent forecasting, and its targets are anchored to the very features that win in the low-label regime.

Formally, let $h_w$ be the encoder's contextual representation at the position of hidden window $w$. Let $\phi(x_w)$ be the standardized vector of hand-computed motion statistics of that window's true points. Let $g$ be a small prediction head. The loss is

$$ \mathcal{L} = \sum_{w \in M} \lVert g(h_w) - \phi(x_w) \rVert_2^2 + \lambda \, \mathcal{L}_{\text{CPC}}, $$

where $M$ is the set of hidden windows, $\mathcal{L}_{\text{CPC}}$ is the standard InfoNCE forecasting loss over future window embeddings, and $\lambda$ balances the two terms. The first term keeps the representation from discarding what the tree uses. The second term pushes it to model how motion changes over time.

Research Program

The encoder takes only raw coordinates, timestamps, and SECA's four-channel motion tensor (relative distance, speed, acceleration, jerk). It uses no map matching. This is deliberate. Walking and biking traces, maritime AIS tracks, and off-road movement have no reliable road graph. The road-based encoders Grid and Road Expressions Are Complementary for Trajectory Representation Learning (GREEN, which fuses grid and road-network views) and TrajMamba (a linear-time state space model aligned to POI and road text) depend on such a graph. They supply the architecture lessons but not the input assumptions.

We use a Mamba-style backbone, following TrajMamba's evidence that linear-time sequence models embed long GPS logs far faster than Transformers. We also run a Transformer of matched size to check that conclusions do not depend on the backbone. Pre-training uses GeoLife's 72,506 unlabeled segments together with the labeled segments with labels removed, after SECA's PELT-based segmentation. Downstream adaptation is decoupled from pre-training: linear probe, then full fine-tuning, at label fractions of 1, 2, 5, 10, 25 and 100%.

All splits are disjoint by user across GeoLife's 69 labeled users. Otherwise the same person's commute could appear in both train and test, and the low-label numbers would be inflated. Each fraction is drawn with five seeds, stratified by class.

The analysis has three parts. First, the crossover curves. Second, a probing test: can the frozen embedding linearly decode the tree's feature set (measured by R²), and does decodability predict low-label accuracy across pretext tasks? Third, a per-class breakdown, testing whether gains concentrate on the rare train and bike classes, as the ECG study found for minority diseases.

Baselines

The naive reference is the same encoder trained from scratch on each label fraction with no pre-training. The low-label threat is a decision tree, plus a gradient-boosted tree for fairness, on the standard hand-crafted motion features. Its tuning budget equals that of the neural models: the same number of validation-based hyperparameter trials, all on user-disjoint validation folds. On GeoLife, the original collection reported that a supervised decision tree reached "over 71%" mode accuracy, boosted by about 4% with graph post-processing GeoLife. SECA reports that the tree beat deep models at 10% but gives no number for that fraction. We will rerun it ourselves rather than quote one.

The strongest existing label-efficient method on this exact task is SECA. It reports 76.8% accuracy at 100% labels and 69.3% at 25% labels on GeoLife. SECA's numbers come from its own split, so we reimplement SECA on our user-disjoint splits with matched encoder width and compare there. We also report how our splits relate to its published split.

Pre-training ablations isolate the key ingredient. All of them use identical backbone, data, and pre-training steps:

Beating the baselines means two things. Our objective must have a strictly lower crossover point against the tuned tree than every ablation, with seed-level confidence intervals not overlapping. It must also exceed reimplemented SECA at 10% labels and below.

Why not just…?

Why not just use the decision tree on hand-crafted features? At 10% labels it is the strongest thing anyone has reported on GeoLife, per SECA, so it is the bar rather than a straw man. It works on fixed-length summaries, which cannot represent where transitions sit within a segment or how speed patterns evolve. SECA shows deep semi-supervised models overtaking shallow ones by 25%. If our encoder never crosses the tree below 10%, that is itself the finding, and we will report it as such.

Why not just concatenate the hand-crafted features onto an existing pre-trained embedding? This is the most serious threat. If contrastive embeddings plus the tree's features, fed to a linear head or a boosted tree, match our objective, then the contribution shrinks to a benchmark and a negative result about pretext design. We run exactly this hybrid with each ablated encoder at every label fraction. Our claim survives only if the learned objective beats the hybrid at 1–5%. The probing analysis then shows whether the advantage comes from features the encoder learned beyond $\phi$.

Why not just do semi-supervised pseudo-labeling or SECA-style joint training? SECA's joint autoencoder already beats a pseudo-label baseline (76.8% vs 75.4% at full labels). So we include reimplemented SECA directly rather than a weaker pseudo-labeler. Joint training also ties the representation to one task. We test the decoupled encoder on a second task without re-pre-training, which a joint model cannot do without retraining.

Why not just use the large pre-trained models such as TrajMamba, GREEN, or TrajCogn at low labels? All three require road networks or POI text. TrajCogn also carries an LLM backbone, and its data-efficiency test stopped at 20%. On walking and biking traces, map matching is ill-defined. Where maps do exist, as on Chengdu, we run GREEN at the same label fractions as a reference point, described below.

Proposed Experiments

The primary experiment is GeoLife mode identification on user-disjoint splits. We report accuracy and macro-F1 curves from 1% to 100% labels for every method above, with five seeds. The headline quantity is each method's crossover fraction against the tuned tree.

The second experiment tests the regression side of the contrastive-versus-kinematics tension. On Chengdu taxi travel time estimation, we subsample fine-tuning labels to the same fractions and measure mean absolute error. Here GREEN serves as a map-aware reference. It reports up to a 26.79% MAE reduction under full supervision, but no reported result was found on Lacuna for GREEN, TrajMamba, or any trajectory model on Chengdu at reduced label fractions. The prediction is that contrastive pre-training degrades fastest on this regression task, while our objective stays close to the map-aware model despite using no map.

The third experiment is a transfer check on maritime AIS-style anomaly detection, following the frozen-encoder protocol of Encoding Temporal and Spatial Vessel Context using Self-Supervised Learning Model. That work reports 92% accuracy on AIS shutdown detection without fixed label-fraction sweeps. We will run it only if comparable public AIS data can be obtained, and we will state that it is exploratory.

The result that would sink the proposal is the hand-crafted-feature hybrid matching our encoder at 1–5% labels on GeoLife. The result that would confirm it has three parts: a crossover point below 5% for our objective but not for any ablation, probe R² on the tree's features that tracks low-label accuracy across pretext tasks, and gains concentrated on the rare modes.