Active Domain Randomization

Bhairav Mehta, Manfred Diaz, Florian Golemo, Christopher J. Pal, Liam Paull

Abstract

Domain randomization is a popular technique for improving domain transfer, often used in a zero-shot setting when the target domain is unknown or cannot easily be used for training. In this work, we empirically examine the effects of domain randomization on agent generalization. Our experiments show that domain randomization may lead to suboptimal, high-variance policies, which we attribute to the uniform sampling of environment parameters. We propose Active Domain Randomization, a novel algorithm that learns a parameter sampling strategy. Our method looks for the most informative environment variations within the given randomization ranges by leveraging the discrepancies of policy rollouts in randomized and reference environment instances. We find that training more frequently on these instances leads to better overall agent generalization. Our experiments across various physics-based simulated and real-robot tasks show that this enhancement leads to more robust, consistent policies.

Introduction

Reinforcement Learning (RL) agents are notorious for overfitting to the specific physics of their simulators. When a policy trained in a perfect simulator is moved to a real-world robot—the sim2real gap—it often fails due to unmodeled friction, motor lag, or mass distributions. The standard solution is Domain Randomization (DR), which involves shuffling environment parameters during training. However, standard Uniform Domain Randomization (UDR) samples every parameter equally, which is often inefficient and fails to prioritize the most difficult or informative scenarios.

The ADR Framework

Active Domain Randomization (ADR) moves beyond uniform sampling by learning to prioritize the most informative environment variations. The framework treats the selection of environment parameters as a separate RL problem.

The Active Domain Randomization (ADR) framework architecture.

As shown in the architecture above, ADR uses an ensemble of particles controlled by Stein Variational Policy Gradient (SVPG) to propose environment configurations. A Discriminator network provides the reward signal by attempting to distinguish between trajectories from a "reference" environment and those from randomized instances. If the discriminator can easily tell the difference, it indicates that the agent is behaving differently in the randomized environment—likely because it is struggling. ADR uses this discrepancy as a reward, pushing the SVPG particles to find regions of the parameter space that currently challenge the agent.

Experimental Evaluation

The authors evaluated ADR across several physics-based environments, including LunarLander-v2, Pusher-3Dof-v0, and ErgoReacher-v0. They also conducted zero-shot transfer tests on a physical Poppy Ergo Jr. robot for both reaching and pushing tasks. These experiments aimed to test how well ADR handles high-dimensional parameter spaces and real-world physical discrepancies.

Key Results and Insights

ADR consistently produced more robust and consistent policies than UDR. In the Pusher task, ADR automatically identified that only about 25% of the parameter space (low friction/damping) was truly challenging and spent the majority of training time there, whereas UDR wasted 75% of its effort on easy instances.

Generalization results on the LunarLander environment comparing ADR to UDR and other baselines.

In the LunarLander environment, ADR achieved near-expert performance across the entire range of engine strengths, while UDR and the baseline failed on low-strength (hard) settings. Furthermore, ADR showed significantly reduced variance across training runs, which is a critical factor for reliable real-world deployment. On the real Poppy Ergo Jr. robot, ADR policies maintained a low distance-to-target with much less performance spread compared to UDR.

Conclusion

Active Domain Randomization provides an effective way to automate the creation of a training curriculum. By focusing on the most informative environment variations, it produces agents that generalize better to unseen domains and transfer more reliably to real hardware. While it introduces additional computational components, the resulting gains in robustness and reduced variance make it a powerful tool for bridging the sim2real gap.

Summary updated

BibTeX
@inproceedings{mehta2019active,
  author = {Bhairav Mehta and Manfred Diaz and Florian Golemo and Christopher J. Pal and Liam Paull},
  title = {{Active Domain Randomization}},
  booktitle = {Conference on Robot Learning},
  year = {2019},
  url = {https://openreview.net/forum?id=Wj31MELXP-},
}
Figure