BayesSim: adaptive domain randomization via probabilistic inference for robotics simulators

Fabio Ramos, Rafael Carvalhaes Possas, Dieter Fox

Introduction

The "reality gap" remains a primary obstacle in transferring robotic policies from simulation to the real world. While simulators have become increasingly sophisticated, they inevitably rely on simplified physics and uncertain parameters, such as friction coefficients or object masses. Domain Randomization (DR) addresses this by training agents across a broad distribution of simulated environments. However, manually tuning these distributions is often inefficient and sub-optimal.

BayesSim introduces a principled framework to automate this process. By treating the simulator as a black-box generative model, BayesSim employs likelihood-free Bayesian inference to estimate the posterior distribution of simulation parameters based on a limited set of real-world observations.

Methodology: Likelihood-Free Inference

The core challenge in tuning simulators is that the likelihood function—the probability of observing a real-world trajectory given specific simulator parameters—is typically intractable. BayesSim bypasses this by using Likelihood-Free Inference (LFI).

Technical Contributions

  1. Mixture Density Random Fourier Networks (MDRFN): To approximate the posterior distribution $p(\theta | x_{real})$, the authors utilize Random Fourier Features (RFF). This approach provides a more stable and accurate approximation of complex distributions compared to standard deep neural networks, especially when data is sparse.
  2. Gaussian Mixture Posteriors: The framework outputs a Gaussian Mixture Model (GMM). This is crucial for capturing multi-modality, where different physical configurations (e.g., a heavy short pole vs. a light long pole) might result in similar observed behaviors.
  3. Trajectory Compression: High-dimensional robot trajectories are compressed into a set of sufficient statistics (e.g., mean, variance, and autocorrelation) to facilitate efficient inference.
BayesSim captures multi-modal posteriors, identifying multiple physical configurations that explain observed behavior.

Experimental Evaluation

The authors evaluated BayesSim across several benchmarks, including OpenAI Gym control tasks and complex physics simulations like the Fetch Push and Slide tasks.

Posterior Accuracy and Robustness

BayesSim consistently outperformed traditional baselines such as Rejection Approximate Bayesian Computation (ABC) and $\epsilon$-Free inference. As shown in the friction estimation task, BayesSim produces a significantly more "peaked" and accurate posterior around the true value.

Comparison of BayesSim (RFF) against baseline methods. BayesSim provides a more precise estimate of the true friction coefficient.

In the Fetch Slide task—a challenging open-loop manipulation problem—policies trained on the BayesSim-derived posterior achieved higher rewards and lower variance than those trained on a broad, uninformative uniform prior. This demonstrates that a "just right" distribution, informed by real-world data, is superior to blind randomization.

Conclusion and Future Work

BayesSim provides a robust, sample-efficient method for bridging the reality gap. By embracing uncertainty and multi-modality, it allows for more reliable Sim2Real transfer. Future research directions include automating the selection of sufficient statistics through representation learning (e.g., LSTMs) and extending the framework to handle visual domain randomization, such as lighting and texture variations.

Summary updated

BibTeX
@inproceedings{ramos2019bayessim,
  author = {Fabio Ramos and Rafael Carvalhaes Possas and Dieter Fox},
  title = {{BayesSim: adaptive domain randomization via probabilistic inference for robotics simulators}},
  booktitle = {Robotics: Science and Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=1nXJeG_0YNK},
}
Figure