Auto-Tuned Sim-to-Real Transfer

Yuqing Du, Olivia Watkins, Trevor Darrell, Pieter Abbeel, Deepak Pathak

Abstract

Policies trained in simulation often fail when transferred to the real world due to the 'reality gap' where the simulator is unable to accurately capture the dynamics and visual properties of the real world. Current approaches to tackle this problem, such as domain randomization, require prior knowledge and engineering to determine how much to randomize system parameters in order to learn a policy that is robust to sim-to-real transfer while also not being too conservative. We propose a method for automatically tuning simulator system parameters to match the real world using only raw RGB images of the real world without the need to define rewards or estimate state. Our key insight is to reframe the auto-tuning of parameters as a search problem where we iteratively shift the simulation system parameters to approach the real-world system parameters. We propose a Search Param Model (SPM) that, given a sequence of observations and actions and a set of system parameters, predicts whether the given parameters are higher or lower than the true parameters used to generate the observations. We evaluate our method on multiple robotic control tasks in both sim-to-sim and sim-to-real transfer, demonstrating significant improvement over naive domain randomization.

Introduction

Training robots in simulation offers a fast, safe, and cost-effective alternative to real-world data collection. However, the "reality gap"—the discrepancy between simulated physics/visuals and the real world—often causes policies to fail upon deployment. Traditional solutions like System Identification require precise, often difficult-to-obtain measurements using specialized sensors. Alternatively, Domain Randomization (DR) trains policies across a wide range of simulated environments, but defining these ranges requires significant expert intuition. If the range is too narrow, the policy fails to generalize; if too wide, it becomes overly conservative and performs poorly. This paper introduces a method to auto-tune simulation parameters using only raw camera observations, bypassing manual tuning and state estimation.

Methodology: The Search Param Model (SPM)

The core innovation is the Search Param Model (SPM), which treats system identification as an iterative search problem rather than a regression task. Instead of predicting exact physical values, the SPM acts as a binary classifier $q_\phi$. Given a sequence of observations, actions, and candidate parameters, it predicts whether the true parameters are higher or lower than the current simulation settings.

The joint learning architecture for policy and search parameter model.

The system alternates between two phases:

  1. Policy Training: The agent learns the task in simulation using a specific parameter distribution.
  2. Sim Param Training: The SPM is trained on simulated trajectories to distinguish between parameter sets.

Periodically, the current policy is deployed in the real world to collect short video samples. The SPM analyzes this real-world data to determine the direction in which simulator parameters (e.g., rope length, friction, lighting) should shift. The simulator is then updated, and the cycle repeats. The policy is trained using CURL (Contrastive Unsupervised Representations for Reinforcement Learning) and SAC (Soft Actor-Critic) to learn directly from pixels.

Experimental Evaluation

The method was validated through both sim-to-sim and sim-to-real experiments. Sim-to-sim tests included tasks from the DeepMind Control Suite (Cheetah Run, Walker Walk, Finger Spin, Ball in Cup) and custom robotic tasks. Sim-to-real transfer was tested on a UFactory xArm 7 robot for two challenging tasks:

  • Rope Peg-in-Hole: Inserting a dangling rope into a small opening.
  • Cabinet Slide: Sliding open a cabinet door by its handle.

Results and Discussion

The proposed method significantly outperformed standard Domain Randomization. In sim-to-real trials, the auto-tuned policy achieved a 90% success rate on the Cabinet Slide and 40% on the Rope Peg-in-Hole, while the DR baseline failed completely (0% success) on both.

Success rates for sim-to-real tasks and parameter convergence plots showing how simulated parameters approach real-world values.

Key insights include:

  • Classification Robustness: Predicting "higher vs. lower" is more stable than absolute regression, especially when real-world parameters are outside the initial training distribution.
  • Task-Agnostic Tuning: The SPM focuses on matching physics trajectories rather than task rewards, making it broadly applicable.
  • Data Efficiency: The auto-tuned policy succeeded using less than 20% of the simulation steps required by DR baselines.

Conclusion

While the model effectively shifts parameters, it still requires a reasonable initial guess for the simulation distribution. Future work will explore handling highly coupled parameters and incorporating additional sensory modalities like depth or tactile feedback to resolve visual ambiguities in complex tasks.

Summary updated

BibTeX
@inproceedings{du2021auto,
  author = {Yuqing Du and Olivia Watkins and Trevor Darrell and Pieter Abbeel and Deepak Pathak},
  title = {{Auto-Tuned Sim-to-Real Transfer}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2021},
  url = {https://openreview.net/forum?id=hTqGt7s_mk},
}
Figure