← All projectsIndividual project · 2026

Generative imitation learning · Diffusion · Flow matching

NAVSIM
Planning.

Generate a trajectory.
Measure the tradeoff.

Two learned planners with a shared visual backbone, evaluated through NAVSIM. A study of sampling cost, driving scores, and the failure cases that an average can hide.

01 / A bounded comparison

Keep the backbone.
Change the generator.

How does the choice between denoising diffusion and flow matching change a driving planner’s accuracy, behavior, and sampling cost?

This individual project implements both methods behind the same camera encoder, ego-state encoder, and conditional temporal UNet. The work spans data preparation, model training, native NAVSIM integration, and an audited comparison with simpler baselines.

The strongest result is a measured tradeoff. On this validation subset, the default flow planner scored higher than default DDPM while taking less time to generate a trajectory. The ego-only baseline scored slightly higher than both, which keeps the value of visual and generative complexity an open question.

My role
Individual project · implementation, integration & evaluation with AI assistance
Core tools
PyTorch · NAVSIM · OpenScene · Docker
Study & latest review
September 16 study · October 25, 2026 review
Evaluation boundary
One-stage EPDMS · non-reactive log replay
Validation scenes386

Five driving logs · fixed log roles

Scored variants31

Baselines and sampling budgets

Training seeds3

42, 43, 44 · one fixed inference seed

02 / Camera & planned trajectories

See the road.
Inspect the forecast.

Ten recorded observations show how the same planners handle a left turn. Each camera frame carries the four-second paths that were exported and scored in the September study.

Blue is flow matching, orange is DDPM, green is the camera-free ego-status MLP, and white dashes trace the human driver’s recorded future. The top view and per-frame scores make the differences easier to inspect.

DDPM bends too sharply and scores zero on every frame. Flow stays closer to the recorded path and averages 0.85 EPDMS across these ten observations. The camera advances through the original driving log; each forecast is evaluated from its own observation.

Inspect this frame’s exact paths
How the camera overlays and playback were made

Recorded images, retained plans.

The clips draw seed-42 native exports over the log’s own front-camera images. Observations are about half a second apart. The car follows the recorded human drive, so this playback does not measure the planners controlling it in a loop.

Calibration with a ground-plane assumption.

Projection uses CAM_F0 intrinsics, lens distortion, and camera-to-ego geometry. The paths lie on an assumed flat plane at ego z = 0; road elevation and occlusion are not modeled. Field-of-view culling prevents distorted off-screen points from folding into view.

Camera view and model input.

The footage preserves the camera’s wide aspect ratio. The evaluated model resizes the whole image to 224 × 224. Top-view plots use metres; the supplied clips use fixed view windows, so a path may continue beyond the visible panel.

Two selected sequences.

The turn and straight-road clips come from one Las Vegas log. Their means describe those selected frames. The study’s 386-scene comparison remains the aggregate result, with no new training or scoring in this media update.

03 / Inside the sampler

From shared noise
to different paths.

Watch DDPM and flow refine the same initial random sample. These October replays rerun the retained checkpoints and expose their intermediate states.

The first clip uses DDPM’s worst seed-42 scene, the final observation of the left turn above. DDPM’s final path cuts the corner: the retained scorer records both an at-fault collision and a drivable-area failure. Flow scores 0.875 on this scene.

Hollow rings show the current noisy sample; solid lines show each model’s clean estimate. White dashes are the recorded future. The final trajectories match the original native exports exactly. The animation aligns sampling progress; its playback speed does not represent inference latency.

Worst cases are selected separately for each default seed-42 model, ordered by EPDMS, descending ADE, then scene token. Both sampler replays reset the agent’s CPU and CUDA random seeds to 42. Their final arrays have maximum absolute difference 0.0 from the retained exports; no trajectories were rescored.

04 / From observation to trajectory

One scene in.
Eight poses out.

A current front-camera image is resized to 224 × 224. ResNet-18 with GroupNorm and Spatial Softmax produces a 128-dimensional visual feature. A small MLP encodes eight ego-state values: planar velocity, acceleration, and route command.

The evaluated single-camera pathOne observation · one candidate
Front camera3 × 224 × 224
ResNet-18 + Spatial Softmax

128-D visual feature

Ego state8 values
Two-layer MLP

64-D state feature

Shared architectureConditional temporal UNet

192-D observation + timestep · FiLM conditioning

DDPMPredict Gaussian noise
100 reverse steps

Cosine schedule · training-range bounds

Flow matchingPredict path velocity
10 Euler steps

Linear interpolation · velocity = noise − data

Native NAVSIM trajectory8 × (x, y, heading)

Ego-local frame · 0.5-second spacing · four-second horizon

The UNet operates over trajectory time. During training, heading uses sine/cosine channels; train-only statistics normalize all four trajectory channels. Denormalization and atan2 recover the output poses.

The native agent adapter owns camera selection, preprocessing, checkpoint loading, and deterministic sampling. Exported trajectories pass through the upstream NAVSIM controller simulation and one-stage scoring functions. The evaluation checks every expected scene token and retains zero-score behavioral failures.

October source changes rescale surround-camera intrinsics to the cached 224 × 224 image, reject missing calibration, and guard BEV projection against stale raw-image intrinsics. Those paths remain experimental; the scored M4 results use the single-camera configuration.

05 / Make the comparison inspectable

Control the inputs.
Keep the differences.

01 / Match the shared parts

Same data and capacity.

DDPM and flow start each seed with identical encoder, ego-MLP, and UNet tensors. Both have 14,589,572 parameters and receive 5,000 optimizer updates. The logged budget includes short final batches, so the actual number of training examples also matches.

02 / Preserve the trained schedule

Fewer steps need valid jumps.

The DDPM sweep keeps its original 100-step cosine schedule and evaluates the posterior between selected noise levels. Tests check the Gaussian moments and exact full-grid parity. Flow varies its Euler step count with the same selected checkpoint.

03 / Keep selection separate

One checkpoint per seed.

Checkpoint selection uses the lowest full-validation ADE at 1,000-step intervals. Sampling sweeps reuse those weights. Native evaluation produces one candidate per observation with a fixed inference seed; it has no oracle trajectory selection.

04 / Audit the evaluator

Missing rows fail the run.

Token-set checks, finite-output checks, score reconstruction, and injected validator failures guard the comparison. The seed-42 default of each model family matches every native CLI score component within the 10⁻⁹ tolerance.

The methods retain different time-sampling distributions, targets, samplers, and DDPM clipping. An October review also identified unequal time-conditioning resolution: flow feeds times from 0 to 1 into an embedding designed for DDPM’s integer steps. The reported numerical ranks are 3 for flow and 29 for DDPM. M4 therefore compares these configured recipes; it does not isolate the training objective.

06 / Retained M4 study

Score the trajectory.
Time the whole prediction.

The study trains on 2,829 scenes from 33 logs and validates on 386 scenes from five disjoint logs. All come from one of 32 current-frame archives in the official navtrain pool. The reserved final subset remains unused.

Default samplers · mean ± sample SD across three training seeds · constant velocity runs once
PlannerEvaluationsEPDMS ↑ADE ↓Raw-input p50 ↓
Constant velocity10.36432.907 m0.06 ms
Ego-only MLP10.8051 ± 0.00300.623 ± 0.002 m0.09 ± 0.00 ms
Visual regression10.7892 ± 0.01460.770 ± 0.007 m10.37 ± 0.36 ms
Flow matching100.7989 ± 0.02710.676 ± 0.008 m21.17 ± 0.39 ms
DDPM1000.7654 ± 0.01631.520 ± 0.012 m133.57 ± 2.97 ms

ADE is mean Euclidean displacement from the logged future. EPDMS combines collision and driving-rule compliance with progress, time-to-collision, lane keeping, and comfort. The standard deviations describe training variation on the same logs; they are not confidence intervals for unseen drives.

The default tradeoff

Flow’s mean score is 0.0335 higher than DDPM’s. The ratio of their mean seed-level p50 latencies is 6.31×. This describes these configured planners and this local measurement.

04 / Fewer evaluations reduce latency, but the score response depends on the sampler.
Read the latency and score conditions

What the timer includes

Warm-cache JPEG read, decode and resize, prepared ego-state transfer, encoders, sampler or prediction head, denormalization, and the selected CPU trajectory. CUDA is synchronized at phase boundaries. Models that do not consume images skip image processing.

How timing was collected

Batch one on an NVIDIA RTX 5060 Ti; five warmups and 30 repeats on the first lexicographic validation scene. Scene construction, ego extraction, model initialization, RNG resets, and scoring are excluded. The shared desktop GPU had uncontrolled graphics activity.

What the score covers

All variants use the native export and upstream one-stage scoring path with non-reactive traffic replay. Extended comfort is available for 330 of 386 frames; upstream adjusts the weighting for the other 56. Scores use the enabled human-penalty filter.

Why the split matters

All five validation logs are from Las Vegas. They contain 346 straight, 27 turning, and 13 stationary scenes. Checkpoints were chosen on this validation set, so these scores remain validation results.

07 / Look below the average

A finite output can
still be a failure.

All 11,966 exported trajectories passed the completeness and numerical checks. The default DDPM nevertheless scored zero on every turning-category scene across all three training seeds.

Those 27 scenes are only a small part of the validation set. Reporting them separately exposes a failure that the overall 0.7654 score obscures. The categories come from logged future displacement and heading; they are reporting labels rather than official semantic scene types.

05 / Uneven scenario coverage makes subgroup results useful.

Lower imitation error can still score worse.

Another retained scene makes the metric distinction concrete. Constant velocity has an ADE of 0.849 m and an EPDMS of zero because it fails the no-at-fault-collision component. DDPM has a larger 2.280 m ADE but scores 1.0 in the same scene.

06 / A trajectory plot explains displacement error; the native scorer adds road and traffic context.

08 / Scope and next experiments

Useful evidence.
Bounded conclusions.

01

Test what the images contribute.

The ego-only MLP has the highest default mean score here. More varied logs and controlled camera ablations would clarify when visual input helps. Its strong result is a reason to keep simple baselines in the study.

02

Investigate the DDPM recipe.

Turning failures and the sharp 10-step degradation warrant a controlled follow-up. Removing training-range clipping from the same seed-42 DDPM raises diagnostic ADE to 491.743 m. That diagnostic is excluded from the ranking and exposes dependence on the prior.

03

Control time conditioning.

The source now supports an explicit flow time-embedding scale, saved in checkpoints. Its default remains 1.0 to preserve M4 behavior. A newly frozen, matched training study is needed to test whether changing that scale helps.

04

Expand the evaluation boundary.

The next evidence should come from an independent final split, additional geographies, multiple inference draws, and the full two-stage benchmark. The current results do not measure sequential interactive driving or deployment reliability.

Two separate driving projects

This project studies learned trajectory prediction and NAVSIM evaluation. Classical Control in CARLA explores Frenet planning and vehicle feedback control in an interactive simulator. They address different parts of autonomous driving and are evaluated separately.

09 / Evidence & reproducibility

Make each claim
traceable.

The scores, latency measurements, and plots remain the retained September 16 M4 study. October adds calibrated camera overlays and checkpoint sampling replays, plus source fixes for future experiments. Each new visual is tied to its scene, model outputs, and rendering inputs.

On October 25, the current source passed 101 distinct tests: 95 on CPU and the six CUDA-specific cases on GPU. The media review regenerated the aggregate data byte for byte, checked all 386 frames’ calibration against the raw logs, and verified the two sampler replays’ final arrays against the retained native exports.

Current inspected source: 9ccec38. The supplied media were produced from 3952803 on October 22 and reproduced on October 25. The original M4 experiment ran with local changes; its source archive and per-file hashes identify that executed code.

Credits

Individual project: Jerry Chang. Implementation and evidence generation used AI assistance. NAVSIM supplies the upstream data interfaces, baseline agents, simulation, and scoring. OpenScene / nuPlan provide the driving data; PyTorch and torchvision support the models. The camera views come from the recorded driving data; the charts show project outputs from the matching experiments.

Driving-data derivatives retain the nuPlan CC BY-NC-SA 4.0 license and additional dataset terms. Original data attribution ↗ · October media modifications ↗

NAVSIM Planning / Generative imitation learning

A prediction is a start.
Evidence makes it useful.

Explore control in CARLA Back to all projects