Augmenting Differentiable Simulators with Neural Networks to Close the Sim2Real Gap

Eric Heiden, David Millard, Erwin Coumans, Gaurav S. SukhatmearXiv 2020

Introduction

In robotics, the "Sim2Real Gap" remains a significant hurdle. While simulators allow for safe and rapid iteration, they often fail to capture the messy realities of physical contact, non-linear friction, and actuator lag. Traditional analytical physics engines rely on fixed mathematical formulas that are robust but incomplete. Conversely, purely data-driven models require vast amounts of data and often ignore fundamental physical laws. This research proposes a hybrid simulation architecture that integrates neural networks directly into a differentiable physics engine to bridge this gap.

Methodology

The core innovation of this work is the "Neural Scalar," implemented within a differentiable C++ simulation framework. Unlike standard "residual physics" approaches that apply corrections only at the end of a simulation step, this architecture allows neural networks (NNs) to be inserted at any point within the physics calculation loops.

Comparison of simulation architectures and the internal logic of a hybrid node (Neural Scalar).

Technical Components

  • End-to-End Differentiability: By utilizing automatic differentiation (via dual numbers), the system can propagate gradients from a final trajectory error back to both neural network weights and physical parameters (e.g., mass or friction coefficients).
  • Fine-Grained Augmentation: Users can replace specific components—such as a friction model—with an NN while keeping gravity and inertia calculations analytical. This ensures the model remains grounded in physics where the math is reliable.
  • Optimization via Parallel Basin Hopping (PBH): To navigate the complex, non-convex landscape of physics optimization, the researchers employ PBH. This strategy runs multiple optimizers in parallel to avoid local minima and find the global best fit for the system parameters.

Experiments and Results

The framework was evaluated through two primary lenses: a Sim2Sim cube-throwing task and a real-world double pendulum dataset.

Sim2Sim: Cube Throwing

In the cube-throwing experiment, a "target" simulation used a complex contact model, while the hybrid simulator started with a simplified model. Initially, the simplified simulator failed significantly (e.g., the cube falling through the floor). However, after gradient-based optimization, the hybrid model learned to account for the missing dynamics.

Cube-throwing experiment results showing the alignment between true and estimated trajectories after optimization.

Real-World Validation

Using a public dataset of a double pendulum, the simulator was tasked with identifying physical properties like mass and link lengths. The system successfully tuned these parameters to match real-world motion, significantly reducing the Sim2Real gap compared to un-tuned analytical models. The gradient-based approach proved highly efficient, converging quickly once global optimization strategies were applied.

Discussion and Future Work

While the hybrid approach shows great promise, it currently allows NNs to act as "free agents," potentially violating laws like the conservation of energy. Future iterations aim to incorporate Hamiltonian or Lagrangian neural networks to enforce these constraints. Additionally, while the current system requires manual placement of NNs, future research will focus on automating the detection of model inaccuracies to insert "neural degrees of freedom" where they are most needed.

Summary updated

BibTeX
@misc{heiden2020augmenting,
  author = {Eric Heiden and David Millard and Erwin Coumans and Gaurav S. Sukhatme},
  title = {{Augmenting Differentiable Simulators with Neural Networks to Close the Sim2Real Gap}},
  year = {2020},
  eprint = {2007.06045},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.06045},
}
Figure