gradSim: Differentiable simulation for system identification and visuomotor control

J. Krishna Murthy, Miles Macklin, Florian Golemo, Vikram Voleti, Linda Petrini, Martin Weiss, Breandan Considine, Jérôme Parent-Lévesque, Kevin Xie, Kenny Erleben, Liam Paull, Florian Shkurti, Derek Nowrouzezahrai, Sanja Fidler

gradSim ($\nabla Sim$) is a unified, end-to-end differentiable framework that combines multiphysics simulation with differentiable rendering. It allows researchers to estimate complex physical properties—like elasticity and friction—and solve visuomotor control tasks directly from raw video sequences, eliminating the need for labor-intensive 3D supervision.

The Challenge of System Identification

In the quest to make robots and AI understand the physical world, we face a major hurdle: System Identification (SysID). If you observe a video of a bouncing ball, how do you estimate its mass or how "springy" it is?

Traditionally, solving this required "white-box" simulators that need precise 3D labels (trajectories in XYZ space) to calculate gradients. However, 3D labels are incredibly hard to obtain for complex systems like deformable solids or folding cloth. Conversely, "black-box" neural networks can learn from video but lack interpretability and struggle to generalize to new scenarios.

gradSim tackles this by asking a fundamental question: Can we create a simulator where we can backpropagate all the way from the color of a pixel in a video back to the physical mass of the object that generated it?

Methodology: A Unified Computation Graph

The core innovation of gradSim is its unified computation graph. It treats the entire process—from physics simulation to image formation—as a single differentiable function.

The gradSim pipeline
  1. Differentiable Physics Engine: Unlike many simulators that rely on particles, gradSim employs a mesh-based approach using Finite Element Methods (FEM). This allows it to accurately model rigid bodies, deformable solids, and thin-shell materials (like cloth) using Lagrangian mechanics.
  2. Differentiable Rendering: To bridge the 3D-to-2D gap, the authors integrate differentiable renderers (specifically SoftRas and DIB-R). These renderers replace the standard non-differentiable "hard" edges of triangles with smooth sigmoids, allowing gradients to flow from image pixels back to the 3D vertex positions.
  3. End-to-End Backpropagation: Because every step is differentiable, researchers can define a loss function directly in "image space" (e.g., Mean Squared Error between a real video frame and a simulated one). Standard gradient descent can then be used to update physical parameters or control policies.

Datasets and Evaluation

The authors evaluated gradSim across several challenging domains to test its versatility and accuracy.

Diverse physical systems simulated in gradSim
  • Rigid Body Dataset: A curated set of 10,000 simulated videos featuring 14 different object types, including primitive shapes (cones, cylinders) and complex meshes from ShapeNet and DexNet.
  • Deformable Objects: 100 instances of deformable beams, balls, and cloth used to test the recovery of Lamé parameters (elasticity).
  • Visuomotor Control Tasks: Custom environments including a 2D walker, a 3D soft-body gear (comprising 1,152 tetrahedral elements), and a cloth-manipulation task.

Key Insights and Results

  • Smooth Loss Landscapes: One of the most striking findings is that gradSim produces remarkably smooth loss landscapes. While gradient estimation methods like REINFORCE suffer from "noisy" landscapes with many local minima, gradSim’s analytical gradients provide a clear, direct path to the global optimum.
  • Vision Cues Help Physics: Counter-intuitively, adding shading and texture to the objects actually improved the speed of convergence. More visual detail provides more "signal" for the differentiable renderer to track, making the gradients more informative.
  • Competitive with 3D Supervision: The paper demonstrates that supervising with 2D pixels alone can achieve results competitive with—and sometimes better than—methods that have access to "perfect" 3D ground truth. Image-space supervision captures the holistic state of the scene better than a single center-of-mass coordinate.
  • Precision and Efficiency: In mass estimation tasks, gradSim achieved an absolute relative error of just $9.01 \times 10^{-5}$, outperforming ConvLSTM baselines by two orders of magnitude. Furthermore, despite the complexity of FEM and rendering, the system is highly optimized. It can simulate 10,000 tetrahedra at 1,500 steps per second, making it faster than real-time on modern GPUs.

Limitations and Future Work

While gradSim represents a major step forward, the authors note several areas for future improvement:

  • The "Tiny Mass" Problem: The current physics engine struggles with numerical stability for very light objects (under 100g).
  • Articulated Bodies: The framework does not yet support complex robotic arm structures with multiple prismatic or revolute joints.
  • Contact Discontinuities: While it handles simple contacts, "contact-rich" environments (like a box full of marbles) introduce many discontinuities that remain difficult for differentiable frameworks to navigate.
  • Sim-to-Real Gap: The experiments were conducted in simulation. Applying this to real-world video will require handling complex lighting, sensor noise, and unmodeled physical phenomena like air resistance.

Summary updated

BibTeX
@inproceedings{murthy2021gradsim,
  author = {J. Krishna Murthy and Miles Macklin and Florian Golemo and Vikram Voleti and Linda Petrini and Martin Weiss and Breandan Considine and Jérôme Parent-Lévesque and Kevin Xie and Kenny Erleben and Liam Paull and Florian Shkurti and Derek Nowrouzezahrai and Sanja Fidler},
  title = {{gradSim: Differentiable simulation for system identification and visuomotor control}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=c_E8kFWfhp0},
}
Figure