TU Delft Shields Self-Driving Cars From Adversarial Attacks Without Retraining
Researchers show that averaging predictions over noisy inputs shields autonomous driving trajectory models from adversarial attacks without hurting normal accuracy.
ProTakeaways
- TU Delft applies randomized smoothing as a defense against adversarial attacks on autonomous driving trajectory predictors.
- Method averages predictions over Gaussian perturbed inputs, requiring no retraining of the base model.
- Two variants tested: adding noise to positions directly versus to underlying control inputs like acceleration and steering.
- On rounD with Trajectron++, adversarial ADE dropped from 6.34 m to 1.10 m under a 1 m attack budget.
- Clean accuracy was preserved or even improved, contradicting the usual accuracy robustness tradeoff.
- Code is open source, tested on Trajectron++ and ADAPT across L-GAP and rounD datasets.
Trajectory prediction sits at the heart of autonomous driving. If a self driving car cannot accurately guess where a neighboring vehicle is going, it either freezes up and gets rear ended or drives into trouble it should have anticipated. And it turns out that even the best prediction models can be fooled by tiny, physically plausible perturbations to the past positions they receive as input.
A team from TU Delft has now tested a defense that works without retraining the underlying model. Their approach adapts randomized smoothing, a technique that has already proven itself in image classifiers and language models, to the trajectory setting. The idea is disarmingly simple: inject Gaussian noise into the observed past trajectory, run the predictor many times, and average the results.
Why prediction models keep getting tricked
Recent work on adversarial attacks against motion forecasters has been sobering. Even under constrained and kinematically feasible attacks, most state of the art models still show significant degradation in performance, and these attacks transfer remarkably well between different models trained on similar datasets. That transferability is the scary part. An attacker does not need access to the exact model deployed in a target vehicle to craft an input that breaks it.
Countermeasures have lagged behind attacks. Beyond a recent method for detecting adversarial trajectories, systematic approaches to defending trajectory prediction models against adversarial attacks remain largely unexplored. That is the gap this paper targets.
Smoothing, in plain terms
Randomized smoothing replaces the raw model f(x) with a smoothed version that averages predictions in a small neighborhood around the input. Formally, the smoothed regressor is the expectation of f(x + noise) where the noise is Gaussian. In practice you cannot compute that expectation in closed form, so you approximate it with a Monte Carlo sum:
def smoothed_predict(f, x, sigma, N=20):
preds = []
for _ in range(N):
eps = np.random.normal(0, sigma, size=x.shape)
preds.append(f(x + eps))
return np.mean(preds, axis=0)The intuition is that adversarial attacks exploit sharp, high gradient regions of the model. Averaging over a noise ball flattens those regions out. The main advantage is that smoothed regressors inherit robustness properties against L_p norm attacks without any need to retrain the base regressor.
Two flavors: perturb positions or perturb controls
The authors propose two variants tailored to how trajectories are structured:
- Position based smoothing (pos): Gaussian noise is added directly to the observed x, y coordinates of the past trajectory.
- Control based smoothing (ctrl): Noise is added to the underlying control inputs, such as acceleration and steering, and then the trajectory is reconstructed through a dynamical model. This approach is theorized to have the advantage that the resulting trajectories are less likely to display dynamically infeasible inputs such as impossible sharp turns.
The control based version is essentially a higher order Ornstein Uhlenbeck process. Because the noise passes through vehicle dynamics before it hits the predictor, the perturbed inputs always look like something a real car could actually do.
What the experiments show
The team evaluated on two datasets: L-GAP, a driving simulator dataset where a vehicle performs a left turn across an oncoming ego agent, and rounD, a real world drone dataset of German roundabouts where the adversary tries to merge in front of the ego. Two base predictors were tested: Trajectron++ (a conditional variational autoencoder) and ADAPT (a transformer style multi agent forecaster). Attacks were generated using the kinematically constrained method from Schumann et al., with perturbation budgets of 0.25 m, 0.5 m, and 1.0 m.
The headline numbers on rounD with Trajectron++ are striking. The undefended model's average displacement error explodes from 0.116 m in the clean setting to 6.335 m under a 1 m attack. Adding control based smoothing with training and evaluation noise of 0.25 m drops that adversarial ADE to 1.104 m, roughly a 5.7x improvement, while clean ADE stays at 0.376 m.
A few broader findings emerged:
- Randomized smoothing improved ADE performance in all adversarial attack experiments across both models and both datasets.
- Smoothed models achieved comparable performance on the unperturbed data too, and in one case, ADAPT on rounD, even improved the baseline, contradicting the usual assumption that smoothing costs clean accuracy.
- Smoothing lowered the correlation between attack magnitude and prediction error, meaning larger attacks did not scale up the damage as steeply.
- Smaller noise variances (sigma = 0.25 m) generally worked best, balancing robustness with local accuracy.
What it is not good at
The results are not uniformly clean. The ideal smoothing approach is model dependent: ADAPT prefers control based smoothing, while Trajectron++ often does better with position based smoothing when noise is only applied at evaluation time. There is no single recipe that dominates. Training with smoothing helps Trajectron++ across the board but only helps ADAPT for the position based variant.
The paper also stops short of proving certified robustness. The authors note that future work should explore whether the probabilistic robustness guarantees generate tight useful prediction sets in the case of trajectory prediction. What you get today is strong empirical robustness, not a mathematical certificate.
Practical takeaways
The appeal here is operational. Randomized smoothing is a wrapper. You can bolt it onto an existing predictor with roughly N times the inference cost (N = 20 in the paper) and get meaningful robustness improvements. No new architecture, no adversarial training loop, no dataset relabeling.
The source code is available on GitHub, built on top of the authors' earlier STEP benchmarking platform for trajectory prediction. If you are already running Trajectron++ or ADAPT in a research or simulation stack, dropping in smoothing at evaluation time is a low effort experiment worth trying, especially if your downstream planner is sensitive to occasional prediction blowups from adversarial or simply out of distribution inputs.