Örebro University's GAN Learns to Predict Rare Pedestrian Moves Others Miss
A self-conditioned GAN learns motion behavior clusters without labels, fixing the minority-class blind spot that plagues trajectory prediction models
ProTakeaways
- Core idea: A self-conditioned GAN discovers behavioral clusters in raw trajectory data without labels, then re-weights training to fix minority-class prediction failures.
- Mode collapse fix: By clustering discriminator features and over-sampling rare clusters, the method improves ADE/FDE on underrepresented trajectory types (e.g., workers, rare road agents).
- Context-free design: Uses only (x, y) coordinates -- no maps, scene images, or social graphs -- making it portable across environments.
- Three training settings: Weighted generator loss (wL2), weighted batch sampler (wB), and their combination; wL2+wB consistently wins on minority classes.
- Datasets: Validated on THÖR (human motion, 3 roles) and Argoverse (road agents, 3 types with intentional 5x class imbalance).
- Code available: pythor-tools open-sourced for THÖR preprocessing; model training recipe is fully described in the paper.
Predicting where a pedestrian or vehicle will be in the next few seconds is one of those problems that sounds simple until you try to build a system that works on everyone, not just the most common type of mover. A new paper from Örebro University tackles exactly that failure mode, using a self-conditioned GAN to automatically discover behavioral clusters in raw trajectory data and then use those clusters to train a fairer, more diverse forecaster.
The minority-class blind spot
Pedestrian trajectory prediction is a critical component of autonomous driving and intelligent urban systems, with deep learning now dominating the field by overcoming the limitations of traditional models in handling multi-modal behaviors and complex social interactions. The dominant approach today is to use a GAN as the generator of plausible future paths. GANs are attractive because they can produce a distribution of futures rather than a single deterministic line.
But there is a well-documented catch. Autonomous vehicle decisions rely on multimodal prediction models that account for multiple route options and the inherent uncertainty in human behavior. However, models can suffer from mode collapse, where only the most likely mode is predicted, posing significant safety risks. In plain terms: if 80% of your training data is cars driving straight, your GAN will get very good at predicting straight-driving cars and quietly fail on everything else -- the pedestrian cutting diagonally, the inspector carrying boxes, the vehicle merging from a rare lane.
Mode collapse not only impedes the model's ability to eliminate uncertainty but also leads to inaccurate risk assessments. This is not a minor inconvenience. In safety-critical applications, the rare behaviors are often the most dangerous ones to miss.
What the paper does
The Context-free Self-Conditioned GAN for Trajectory Forecasting paper proposes a two-stage system. First, a self-conditioned GAN (originally designed for diverse image generation) is adapted to the 2D trajectory domain. The key insight is that the GAN's discriminator, as it learns to tell real trajectories from fake ones, naturally develops a feature space that groups similar motion patterns together. The paper clusters those features using k-Means to discover behavioral modes without any human-provided labels.
Second, those discovered clusters are used to re-weight training so the forecaster pays more attention to the rare, hard-to-predict modes. The authors call this a context-free approach because it uses only the raw (x, y) trajectory coordinates -- no map, no scene image, no social graph of nearby agents. That makes it more portable across environments.
The three training tricks
Once the self-conditioned GAN has labeled each trajectory with an unsupervised cluster ID, three training settings are introduced to improve the downstream forecaster:
- Weighted generator loss (wL2): The L2 reconstruction loss is scaled up for trajectories belonging to small, hard-to-predict clusters. The weight for cluster
icombines its intra-cluster ADE/FDE error and its relative size in the dataset. - Weighted batch sampler (wB): Training batches are sampled from a multinomial distribution that over-represents rare clusters, so the model sees more examples of uncommon behaviors per epoch.
- Combined (wL2+wB): Both techniques applied together, which consistently produces the best results on minority classes.
The weight formula balances three factors: how bad the error is in that cluster, how small the cluster is, and a regularization term to avoid over-fitting to outliers. Here is a simplified version of what that looks like in practice:
# Pseudo-code for cluster weight computation
for cluster_i in clusters:
w_i = (lambda_ADE * ADE_i / ADE_max
+ lambda_FDE * FDE_i / FDE_max
+ lambda_D * count_i / total_count)
# Higher w_i -> more emphasis during trainingHow the self-conditioned GAN actually works
The self-conditioned GAN is adapted from a CVPR 2020 image generation paper. In the trajectory version, the discriminator takes full trajectories (observed + ground truth) as input and encodes them with an MLP. As training progresses, those encoder features become semantically meaningful -- trajectories that look alike end up near each other in the feature space. The system periodically re-runs k-Means on those features to update the cluster assignments.
The generator then takes the observed portion of a trajectory plus a cluster ID (the mode) as input, and generates a predicted future. This is the self-conditioning: the generator is conditioned on an unsupervised label that the discriminator itself produced. Each mode indicates a different behavioral moving pattern in the discriminator's feature space.
Benchmarks and results
The method was evaluated on two datasets:
- THÖR: Human motion in an industrial-like environment. Trajectories are labeled by role: visitors (1,379 samples), workers (413), and inspector (260). The 13-cluster k-Means configuration was optimal.
- Argoverse: Road agent trajectories labeled as autonomous vehicles (2,600 samples), regular agents (2,600), and others (526 -- intentionally underrepresented by a factor of ~5x to simulate real-world imbalance). The 19-cluster configuration was optimal.
The key finding is where the gains show up. Our approach outperforms previous context-free methods in the least representative supervised labels while performing well in the remaining labels. On the THÖR dataset, the combined wL2+wB setting reduced ADE for workers (the smallest class) from 0.642 to 0.625 meters compared to the vanilla GAN baseline. On Argoverse, the others class -- the rarest -- saw ADE drop from 1.815 to 1.789 and FDE from 2.969 to 2.919 meters.
The paper also validates the cluster quality by comparing the self-conditioned GAN against a conditional GAN that uses ground-truth labels as conditions. The self-conditioned version approaches the performance of the oracle model, suggesting the discovered clusters genuinely capture meaningful behavioral structure.
What the clusters actually mean
One of the more interesting qualitative results is that the clusters are interpretable without any labels. In the THÖR dataset, cluster 9 groups trajectories moving left-to-right and cluster 10 groups right-to-left movers. In Argoverse, one cluster captures long-distance highway-style runs while another captures short, slow maneuvers. This structure emerges purely from the discriminator's feature space -- no human annotation required.
Where it falls short
The method has real limitations worth knowing before reaching for it:
- No context awareness: Ignoring maps, scene images, and social interactions is a deliberate design choice for portability, but it means the model cannot use lane markings, crosswalks, or crowd dynamics that context-aware methods exploit.
- Overall metrics can regress: On Argoverse, forcing the model to focus on rare classes hurt aggregate ADE/FDE. The trade-off is explicit: you improve minority-class performance at a small cost to the majority.
- Cluster count is a hyperparameter: The optimal number of clusters (13 for THÖR, 19 for Argoverse) was found via grid search. There is no automatic way to determine this.
- GAN training instability: GAN can generate sharp, realistic trajectories, but their adversarial training is notoriously unstable, prone to mode collapse and divergence, and requires careful tuning.
Who should care
This work is most relevant for teams building trajectory forecasters for environments with naturally imbalanced behavior distributions -- think warehouse robots that mostly see workers walking straight but occasionally encounter inspectors with unusual paths, or autonomous vehicles that need to handle the rare-but-dangerous merging maneuver as reliably as the common lane-keep. The context-free design also makes it attractive for deployment in novel environments where map data is unavailable or unreliable.
The authors released pythor-tools, an open-source Python package for preprocessing the THÖR dataset, which includes downsampling, linear interpolation of missing detections, and trajectory smoothing. The main model code is not separately released, but the paper provides enough detail to reimplement the approach. The real contribution here is less a plug-and-play library and more a training recipe: if you already have a GAN-based forecaster, the weighted loss and weighted sampler ideas can be grafted onto it with modest engineering effort.