← Blog/blog/ev-diffusion-wasserstein-blind-spot

The EV generator that scored better than real data

A delivery route is not just a bag of battery-current readings. A current spike during a steep climb and the same spike after the truck parks have identical histograms—and radically different operational meaning.

Ramesh and colleagues build a conditional diffusion model that samples plausible EV battery-current trajectories from velocity and ambient temperature. Their strongest result is striking: generated-versus-real Wasserstein distance is lower than a real-versus-real reference. The model may be useful; the number alone cannot prove the timing is right.

01

Generate a distribution, not one average drive

The target is a conditional distribution of battery-current sequences. A latent encoder maps fast-changing velocity and slow-changing temperature into a 512-by-16 representation. A temporal U-Net then starts from Gaussian noise and denoises for 1,000 steps while receiving that context.

This matters because a deterministic regressor trained with ordinary error tends toward a conditional mean: useful for a point forecast, but liable to smooth away alternative acceleration and regenerative-braking events. Diffusion instead permits several trajectories under the same route context.

Study detailValueMeaning
Usable trips11,945After missing-value filtering
Vehicles9Open commercial-fleet telemetry
Sampling1 HzBattery and driving measurements
Sequence length512Every trip interpolated to a fixed length
Split70 / 15 / 15Train / validation / test
Diffusion steps1,000Cosine noise schedule
Paper-reported data and model setup.
02

The headline distribution metric

One-dimensional 1-Wasserstein distance sorts two samples and measures how far probability mass must move to match them. For equal sample counts, it is the mean absolute gap between corresponding sorted values. The TypeScript core below also handles unequal sample sizes exactly; the compact three-language version shows the equal-size case.

def wasserstein_equal_samples(left, right):
    a = sorted(left)
    b = sorted(right)
    return sum(abs(x - y) for x, y in zip(a, b)) / len(a)

def mean_absolute_error(actual, generated):
    return sum(abs(x - y) for x, y in zip(actual, generated)) / len(actual)
Paper-reported Wasserstein distances on normalized current values. Lower is better; generated-versus-real is 65.9% below the real-versus-real reference.
Paper-reported relative improvement of latent conditioning over direct condition injection. These are reductions in each metric, not absolute scores.
03

A perfect score for the wrong chronology

Sorting is precisely the attraction—and the blind spot. It makes the metric insensitive to the order of readings. In the illustrative tested example below, the green trajectory contains exactly the same values as the purple one but moves the largest discharge spike from step 2 to step 5.

actualreordered
Illustrative synthetic trajectories computed by the tested core. Their value distributions match exactly, but their events occur at different times.
Illustrative metric comparison from the same core values. Pooled Wasserstein is exactly zero; time-aligned Wasserstein and MAE both detect the displaced events.
04

The paper already hints at the escape route

The authors do not rely on Wasserstein distance alone: they also report MAE, RMSE, short-time Fourier-transform distance, example trajectories, and ten-sample uncertainty bands. They explicitly state that distributional fidelity is insufficient for deployment and call for closed-loop evaluation inside routing and planning.

Two preprocessing choices deserve equal attention. First, all trips are interpolated to 512 points, so physical duration is represented only indirectly. Equal normalized positions can correspond to different elapsed times. Second, nine vehicles and two conditioning channels cannot span payload, road grade, traffic, vehicle identity, battery health, and route-specific weather.

05

What to probe next

  • Report Wasserstein distance per matched time step and per route context, not only after pooling values.
  • Test peak timing, duration, ramp rates, autocorrelation, and integrated watt-hours.
  • Preserve real elapsed time or evaluate variable-length trajectories directly.
  • Split by vehicle and route to measure transfer beyond familiar fleet identities.
  • Run the generator inside a routing policy and score missed-charge and infeasible-route decisions.

The Transformer page helps unpack the conditioning encoder, while the neural-network page shows the regression machinery behind pointwise baselines. The broader lesson is model-agnostic: a metric is a declaration of what errors are allowed to disappear.

References

  1. Hemanth Neelgund Ramesh, André Snoeck, Chyi-Fu Hong, Shijing Sun (2026). Conditional Diffusion Models for Energy-Efficient Driving. arXiv preprint, cs.LG
  2. Jonathan Ho, Ajay Jain, Pieter Abbeel (2020). Denoising Diffusion Probabilistic Models. NeurIPS 2020