TerrainForge: Physics-Grounded Road Geometry Editing for Counterfactual Autonomous Driving
Organizations: Rochester Institute of Technology · University of Macau · City University of Hong Kong
Abstract
Road geometry (e.g., crests, sags, and speed humps) and surface conditions (e.g., wet or icy pavement) affect how vehicles move, what drivers and onboard cameras observe, and how much clearance remains between vehicles. Editing these properties in a driving scene therefore requires corresponding changes in vehicle motion. Capturing these differences in a driving video requires a road edit to propagate to vehicle motion, camera viewpoint, and the clearance between vehicles. We present TerrainForge, a framework for generating road geometry-focused counterfactuals from reconstructed multi-vehicle driving episodes. A unified road model connects scene deformation with four-wheel vehicle dynamics, allowing crests, sags, speed humps, and friction changes to propagate through vehicle motion, camera viewpoint, and inter-vehicle clearance. Vehicle dynamics are evaluated against CarSim, and prescribed road geometry is verified in reconstructed Waymo scenes. Across 18 episodes, leaving surrounding vehicles on their recorded trajectories instead of recomputing their responses produces median peak differences in predicted ego-lead distance of 1.52 m for crests and 1.41 m for sags. We further simulate the ego response to 15,758 road edits across 983 braking episodes, pairing each edit with its safety outcomes relative to an unedited replay. These pairs train a first-stage screening surrogate that takes the original driving context and candidate road-edit parameters as input and predicts the resulting change in the ego's terminal gap. On held-out scenes, this prediction achieves 22-40% lower mean absolute error than predicting no change, so candidates can be screened cheaply before the full multi-vehicle rollout.
Figures & tables
| Experiment | Control input fixed across arms | Vehicle motion | Camera |
|---|---|---|---|
| CarSim (§ 4.1 ) | authored speed, steering, torque; identical in both simulators | 1 vehicle, re-solved | none |
| ZOD (§ 4.2 ) | measured speed and accelerations | half-car on the measured path | measured pose |
| Full chain, 109409 (§ 4.3 ) | frozen inferred torque | ego + 17 moving vehicles, path replayed | dynamic |
| Multi-vehicle bank (§ 4.3 ) | frozen inferred torque | 353 moving vehicles (ego included), path replayed | none |
| Video comparison (§ 4.4 ) | frames: none; response panel: speed tracking of recorded speed | frames: recorded schedule; panel: ego re-solved | kinematic |
| Surrogate bank (§ 4.5 ) | frozen inferred torque and steering | ego re-solved; target as recorded | none |
| Edit | No-change MAE | Ours MAE | Ratio | |
|---|---|---|---|---|
| SAG | [ , ] | [ , ] | ||
| Hump | [ , ] | [ , ] |
Appendix figures & tables32 assets
Supplementary material from the paper’s appendix.
Appendix
| Experiment | Re-simulated | Rendered as objects | Safety quantity |
|---|---|---|---|
| Waymo 109409 (video) | ego and moving vehicles; parked vehicles replayed | of tracked vehicles † | ego–lead gap; all-pair overlap check |
| Multi-vehicle bank ( episodes) | moving vehicles (ego included); parked vehicles, pedestrians, cyclists not modeled | none | ego–lead gap |
| Obstacle bank | ego only; target replayed | none | ego–target , , collision |
| Lateral bank | ego only | none | peak lateral and load quantities |
| Experiment | Control input fixed across arms | Vehicle motion | Camera | Checks |
|---|---|---|---|---|
| Scene 22 (App. E ) | prescribed: km/h, N m brake from s | ego re-solved; lead static | dynamic | one braking mechanism |
| Lateral edit (§ 4.3 ) | frozen inferred torque and steering | ego, re-solved | none | vertical lateral coupling |
| Screening, lateral (App. H ) | frozen inferred torque and steering; varied | ego, re-solved | none | labels for the surrogate |
| Suite | Cases | Role | Continuous error (RMSE) | Passed |
|---|---|---|---|---|
| Grade-zero regression | 19 | R | event pitch mean , max ; speed m/s | 19/19 |
| Development | 5 | F | lateral position – m; pitch – | 5/5 |
| Steered holdout | 3 | E | lateral position – m; pitch – ; speed – m/s | 3/3 |
| Low speed | 4 | E | speed – m/s; pitch – ; lateral position m | 4/4 |
| Vertical alignment | 4 | E | speed – m/s; pitch – ; heave – mm | 4/4 |
| Scene-supported SAG | 4 | E | speed m/s; pitch – ; lateral position – mm | 4/4 |
| Case | (%) | (m) | (m/s) | ( ∘ ) | (rad) | (N) | |
|---|---|---|---|---|---|---|---|
| 1 | 4 | 0.55 | 59.74 | 0.00077 | 0.0636 | 0.00083 | 14.59 |
| 2 | 6 | 0.40 | 20.00 | 0.00080 | 0.0652 | 0.00050 | 15.32 |
| 3 | 2 | 0.70 | 59.74 | 0.00019 | 0.0669 | 0.00020 | 11.11 |
| 4 | 5 | 0.85 | 74.68 | 0.00118 | 0.0667 | 0.00016 | 15.06 |
| Mean | – | – | – | 0.00073 | 0.0656 | 0.00042 | 14.02 |
| Case | RMSE [m] | Heading RMSE [mrad] | Yaw-rate NRMSE | Roll NRMSE |
|---|---|---|---|---|
| Sunken, brake-turn | ||||
| Hump, brake-turn | ||||
| SAG, sinusoidal steer | ||||
| Gate |
| Test (3) | All (13) | |||||
|---|---|---|---|---|---|---|
| Quantity | Flat | Kin. | Full | Flat | Kin. | Full |
| World-frame pitch ( ∘ ) | 1.027 | 0.236 | 0.258 | 0.594 | 0.160 | 0.196 |
| Road-relative pitch ( ∘ ) | 0.140 | 0.145 | 0.168 | 0.120 | 0.119 | 0.136 |
| Heave (mm) | 2.35 | 2.49 | 3.11 | 2.60 | 2.70 | 3.42 |
| crest | sag | crest | sag | |
| Traversers responding | ||||
| Non-traversers changed | ||||
| Median peak of traversers (m/s) | ||||
| Median onset delay (s) | ||||
| Median (m) | [ , ] | [ , ] | [ , ] | [ , ] |
| 90th percentile of (m) |
| Case | VACE | Cosmos | LTX | Ours (px) |
|---|---|---|---|---|
| Sag | copy, | regenerated, | regenerated, | / |
| Crest | copy, | regenerated, | regenerated, | / |
| Uphill | copy, | regenerated, | regenerated, | / |
| Downhill | copy, | regenerated, | regenerated, | / |
| Weight | Diff. /255 | SSIM | RMSE (m) | Corr. | Ratio | Rule | Shift (px) |
|---|---|---|---|---|---|---|---|
| not met | / | ||||||
| met | / | ||||||
| (selected) | not met | / |
| Scene | Case | VACE | Cosmos | LTX | Generators, max (px) | Ours (px) |
|---|---|---|---|---|---|---|
| 150623 | Sag | / | ||||
| Crest | / | |||||
| 177619 | Sag | / | ||||
| Crest | / | |||||
| 398895 | Sag | / | ||||
| Crest | / |
| Quantity | Edit | Group | |||
|---|---|---|---|---|---|
| Lateral acceleration [m/s 2 ] | crest | curve | [ , ] | ||
| crest | control | [ , ] | |||
| sag | curve | [ , ] | |||
| sag | control | [ , ] | |||
| Minimum load ratio | crest | curve | [ , ] | ||
| crest | control | [ , ] |
| Target | Edit | No change | Closed-form prior | Boosted trees | MAE ratio | |
|---|---|---|---|---|---|---|
| sag | [ , ] | [ , ] | ||||
| hump | [ , ] | [ , ] | ||||
| sag | [ , ] | [ , ] | ||||
| hump | [ , ] | [ , ] |
| Model | AP | Recall@20% |
|---|---|---|
| Random ranking | 0.20 | 0.23 |
| Geometry-only logistic | 0.35 | 0.44 |
| Full-context logistic | 0.75 | 0.75 |
| Boosted trees | 0.85 | 0.80 |
| Peak quantity | Static trees | Summary trees | Sequence model |
|---|---|---|---|
| Sideslip angle | [ , ] | [ , ] | |
| Heading error | [ , ] | [ , ] | |
| Yaw-rate error | [ , ] | [ , ] | |
| Lateral acceleration | [ , ] | [ , ] | |
| Roll angle | [ , ] | [ , ] | |
| Roll rate | [ , ] | [ , ] |