Neural-Sim: Learning to Generate Training Data with NeRF

Yunhao Ge, Harkirat S. Behl, Jiashu Xu, Suriya Gunasekar, Neel Joshi, Yale Song, Xin Wang, Laurent Itti, Vibhav Vineet

Abstract

Training robust computer vision models requires vast amounts of labeled data, a process that is often prohibitively expensive or logistically challenging. While synthetic data offers a scalable alternative, the "sim-to-real gap"—the discrepancy between rendered images and real-world distributions—remains a significant hurdle. Neural-Sim introduces a fully differentiable synthetic data pipeline that leverages Neural Radiance Fields (NeRFs) to generate training data on-demand. By employing a bilevel optimization framework, Neural-Sim automatically tunes rendering parameters such as pose, zoom, and lighting to minimize a model's loss on real-world validation data, effectively closing the sim-to-real gap through automated, data-driven simulation.

Introduction

In the field of computer vision, the performance of deep learning models is heavily dependent on the quality and diversity of the training data. Synthetic data, generated from 3D models, provides a potential solution to the high cost of manual labeling. However, traditional synthetic pipelines suffer from two primary issues: the domain gap, where synthetic images fail to match real-world test environments, and the inefficiency of manual tuning or random domain randomization.

Existing approaches often rely on human experts to hand-tune scene properties or use "black-box" domain randomization, which renders massive amounts of random data in hopes of capturing the necessary distribution. Neural-Sim proposes a shift from these manual or stochastic methods toward an automated, differentiable system that learns to generate the specific synthetic data required for a model to succeed on a target task.

Methodology: Bilevel Optimization with NeRFs

The core of the Neural-Sim framework is a bilevel optimization loop that treats the data generation process as a learnable component of the training pipeline. The system consists of two nested optimization loops:

  • The Inner Loop: A task model (such as a RetinaNet object detector) is trained using synthetic images generated by a NeRF.
  • The Outer Loop: The rendering parameters of the NeRF—including the distribution of camera poses, zoom levels, and illumination—are optimized to minimize the task model's loss on a small, representative validation set of real-world data.

By utilizing NeRFs as the underlying simulator, the pipeline becomes fully differentiable. This allows gradients from the final detection loss to be propagated back through the renderer to the scene parameters, enabling the system to "discover" the specific data distributions that best bridge the gap to the real world.

Technical Implementation

To make this end-to-end optimization computationally feasible, the authors introduced several key technical innovations:

  1. Differentiable Pose Sampling: Using a Gumbel-softmax reparameterization trick, the system can differentiate through the selection of discrete "pose bins," allowing it to learn which viewing angles are most beneficial for the model.
  2. Twice-Forward-Once-Backward (TFOB): To manage the memory overhead of storing Jacobian matrices for large object detectors, this strategy allows the system to compute gradients efficiently without exhausting GPU resources.
  3. Patch-wise Gradient Computation: By calculating gradients on smaller image patches rather than full-resolution frames, the pipeline maintains a manageable memory footprint during the optimization of complex scene parameters.

Experimental Evaluation

The researchers evaluated Neural-Sim across several benchmarks, including the standard YCB-Video dataset and ObjectNet. Additionally, they introduced YCB-in-the-Wild, a new dataset featuring six YCB objects captured via smartphone in diverse indoor environments (e.g., kitchens and living rooms) with manual labels for poses and bounding boxes.

Key Results

  • Accuracy Gains: On the YCB-in-the-Wild dataset, Neural-Sim Optimization (NSO) achieved significant performance boosts, with detection accuracy improving by 20% to 60% compared to non-optimized baselines.
  • Superiority over Black-Box Methods: NSO outperformed previous state-of-the-art "Learning to Simulate" (LTS) methods—which do not utilize differentiable rendering—by up to 58% on specific tasks.
  • Zero-Shot and Few-Shot Success: In evaluations on the YCB-Video dataset, adding optimized synthetic data provided a 4% to 13% lead over standard training methods, demonstrating the effectiveness of the approach in data-scarce scenarios.

Discussion and Insights

Neural-Sim demonstrates that NeRFs are more than just tools for novel view synthesis; they can serve as effective, data-driven simulators for training computer vision models. A striking finding of the study was the interpretability of the optimized distributions: the system naturally converged to match the biases of the test environment. For instance, if a test set primarily featured objects viewed from high angles, Neural-Sim automatically learned to generate more high-angle training images without human intervention.

Limitations and Future Work

While Neural-Sim represents a major step forward, it currently focuses on camera pose, zoom, and illumination. Future research may extend this to more complex parameters like material textures and object geometry. Additionally, while the bilevel optimization is effective, it remains computationally intensive. The authors suggest that exploring faster "proxy" networks for the rendering component could further accelerate the optimization cycle.

Conclusion

Neural-Sim provides a robust framework for closing the sim-to-real gap by making the data generation process differentiable and task-aware. By allowing the simulator to learn from the model's failures on real-world data, it moves computer vision closer to a future where high-quality training data is generated automatically and optimally for any given environment.

Summary updated

BibTeX
@inproceedings{ge2022neural,
  author = {Yunhao Ge and Harkirat S. Behl and Jiashu Xu and Suriya Gunasekar and Neel Joshi and Yale Song and Xin Wang and Laurent Itti and Vibhav Vineet},
  title = {{Neural-Sim: Learning to Generate Training Data with NeRF}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-20050-2\_28},
}
Figure