← Back to Research

Risk-Aware Generation of Static Highway Scenarios for Autonomous Vehicle Testing

Qijie He · Advisor: Prof. Ziyuan Pu

Southeast University · 2026 Master's Thesis

Three highway scenes generated by Topo-DiffRoad and rendered in 3D
Three scenes generated by Topo-DiffRoad and lifted to 3D. Left: a mainline curve on a downgrade. Middle: a ramp with a 24.8°/100 ft curve on a +5.5% grade. Right: a full interchange combining mainline and ramps.

TL;DR: Most scenario generators for autonomous-vehicle testing change the traffic and keep the road fixed. I generate the road itself. Topo-DiffRoad produces realistic highway mainlines, ramps and interchanges with controllable risk geometry (curvature, grade, vertical curves) and exports them straight to CARLA. In closed-loop tests, these roads caused far more tracking errors and lane departures than existing test maps.

Motivation

Simulation-based testing of autonomous vehicles (AVs) mostly varies the dynamic parts of a scene: cut-ins, pedestrians, aggressive drivers. The road usually stays a fixed background. On highways, though, the road itself is a major risk factor. At high speed and with long braking distances, sharp horizontal curves, steep grades and short vertical curves amplify small control errors into lane departures and crashes.

Existing road generators mostly target urban intersections and cannot control these alignment properties directly. That leaves a gap: there was no way to generate realistic highway roads that are risky by design, which is exactly what is needed to stress-test AV control stacks.

Approach

The work closes the loop from crash data to test scenarios: identify which road features drive crashes, generate roads with those features, and verify in simulation that the generated roads really are harder to drive.

1. Real highway data

I built a dataset of 1,937 highway scenes from OpenStreetMap covering the full freeway networks of Washington, Oregon and California. It has three scene types: 1,228 mainline segments, 382 ramp junctions and 327 complex interchanges. Interchanges were located by clustering motorway-junction nodes with DBSCAN. Each scene was cropped, projected to UTM and resampled to fixed-length centerlines.

2. Topo-DiffRoad: a two-stage conditional diffusion model

Generating a multi-road interchange in a single diffusion pass tends to produce misaligned endpoints and broken connections. I therefore split generation into topology and geometry:

Both stages use DDPM with v-prediction and a cosine noise schedule.

3. From risk factors to a drivable 3D scene

Risk factors identified from crash-frequency modelling (see the related project below) enter the pipeline at three levels:

Risk factor How it controls generation
Horizontal curvature, scene type Condition vector of the diffusion model
Grade, vertical-curve length Rule-based elevation profile following AASHTO design standards, sampled inside crash-derived high-risk ranges
Lane count, lane width Cross-section parameters written into the OpenDRIVE file

The output is a standard .xodr file that loads directly into CARLA or SUMO, with elevations aligned at every junction.

4. Closed-loop testing in CARLA

To isolate the effect of road geometry, I ran single-vehicle closed-loop tests: no other traffic, a fixed vehicle (Tesla Model 3) at 72 km/h, and two lateral controllers, LQR (optimal control) and Stanley (geometric feedback). Generated scenes were compared against DiffRoad (a state-of-the-art road generator), CARLA Town04/06 and CommonRoad real-road scenarios.

Results

Realistic, topologically valid roads

Generated road layouts compared with real roads and DiffRoad
Real roads (top), DiffRoad (middle) and Topo-DiffRoad (bottom). The gap is largest for interchanges, where the two-stage design keeps road connections coherent.
Model HD ↓ JSD length ↓ JSD spacing ↓ JSD curvature ↓ Smoothness ↓
CGAN 8.329 0.693 0.567 0.339 5.612
VAE 1.685 0.286 0.053 0.454 0.0375
DiffRoad 0.731 0.038 0.026 0.102 0.00073
Topo-DiffRoad 0.737 0.032 0.023 0.057 0.00005

Topo-DiffRoad matches the real distributions of road length, point spacing and curvature most closely. Curvature JSD drops by 44% compared with DiffRoad, and centerlines are about 15× smoother. Hausdorff distance is on par with DiffRoad.

Harder for controllers to drive

CARLA sequence: the test vehicle drifts out of its lane on a generated curve
A generated curve in CARLA. The vehicle builds up lateral offset after entering the bend and crosses the lane boundary.

More safety-critical events

Share of test scenes that triggered a lane departure
Under the LQR controller, every generated scene triggered at least one lane departure (56 events in total), compared with 13 for DiffRoad, 7 for CARLA Towns and 0 for CommonRoad. The more robust Stanley controller departed less often everywhere: 10.3% of generated scenes, compared with 5.3% for DiffRoad, 8.9% for CARLA Towns and 0% for CommonRoad.

My role

Sole author of the thesis. I designed and built the OSM data pipeline, the Topo-DiffRoad model, the rule-based 3D and OpenDRIVE generator, and the CARLA evaluation framework and metrics.

Limitations and next steps

The risk factors and thresholds used here come from my crash-frequency modelling work: Traffic Crash Data Augmentation with Multi-type Variables using Hybrid VAE-Diffusion Generative Neural Networks for Enhancing Crash Frequency Modeling, Accident Analysis and Prevention, 2026 (co-first author). It used SHAP on the augmented crash model to identify curvature, grade and vertical-curve length as key risk factors for high-crash highway segments.