Training autonomous vehicles (AVs) to handle "corner cases"—rare, dangerous events like a pedestrian darting out or a sudden multi-car pileup—is a massive challenge. Collecting real-world data for these scenarios is expensive, risky, and often impossible. While simulators like CARLA have been the industry standard, they often suffer from a "sim-to-real gap" where the graphics don't quite match the complexity of the real world.
MARS (Instance-aware, Modular and Realistic Simulator) is a new open-source framework that leverages Neural Radiance Fields (NeRFs) to create photorealistic, editable driving simulations directly from real-world data. By decomposing complex driving scenes into independent, modular foreground and background components, MARS allows researchers to edit vehicle trajectories and appearances with state-of-the-art photorealism, significantly narrowing the gap between simulation and reality.
Methodology: Compositional Rendering
Existing simulators generally fall into two camps: traditional graphics engines which lack photorealism, and data-driven methods like standard NeRFs which struggle with dynamic scenes. Standard NeRFs treat the entire world as a single entity; if you want to move a car in a reconstructed street, the car is typically "baked" into the background.
MARS addresses this through a compositional rendering pipeline. Instead of one giant network, it uses a "divide and conquer" strategy:
- Decomposition: The scene is split into a Background Node (the static environment) and multiple Object Nodes (individual cars, buses, etc.).
- Modularity: Users can swap different NeRF backbones. For example, a fast grid-based NeRF can be used for the vast background while specialized category-level models handle vehicles.
- Ray-Box Intersection: When rendering a frame, the system calculates where rays intersect with object bounding boxes to determine which nodes to sample.
- Compositional Rendering: Rays sample points from both the background and foreground nodes. These samples are merged and sorted by depth before being passed through a volume renderer to produce the final image, depth map, and semantic mask.
To ensure realism, MARS includes a Sky Model for infinite distances and a novel Conflict-free Sampling strategy. This strategy uses a regularization term to prevent the background NeRF from "accidentally" learning parts of a foreground car, which would otherwise leave "ghost" artifacts when the car is moved.
Experimental Results
The authors evaluated MARS on two primary benchmarks: KITTI (real-world data) and Virtual KITTI-2 (high-fidelity synthetic data). MARS sets a new bar for photorealism in driving simulation:
- State-of-the-Art Performance: On the KITTI dataset, MARS outperformed existing methods like NSG and SUDS in image reconstruction, achieving a PSNR of 29.06.
- Massive Gains on V-KITTI: In novel view synthesis on V-KITTI, MARS achieved a PSNR of 29.79, a significant leap over the previous best of 23.87.
- Multi-modal Output: Beyond RGB images, MARS produces high-quality depth maps and semantic segmentations, which are critical for training the full perception stack of an autonomous vehicle.
Discussion and Future Work
One of the biggest hurdles in compositional NeRFs is "background-foreground ambiguity." If the background model thinks a car is part of the road, removing that car leaves a hole. MARS's regularization term forces the background model to stay empty inside object bounding boxes during training, enabling true instance-level control. Because objects are modeled independently, MARS allows for "blessing" a scene with new behaviors: you can rotate a car, change its lane, or remove it entirely to see how an AV algorithm responds.
While impressive, MARS currently faces limitations in rendering speed and the modeling of dynamic reflections (e.g., sunlight glinting off a moving car). Future work will focus on improving rendering efficiency and capturing these view-dependent effects. By open-sourcing the code, the MARS team provides a modular playground to bridge the gap between the safety of simulation and the complexity of the real world.
Summary updated