How to Close Sim-Real Gap? Transfer with Segmentation!

Mengyuan Yan, Qingyun Sun, Iuri Frosio, Stephen Tyree, Jan KautzarXiv 2020

Abstract

One fundamental difficulty in robotic learning is the sim-real gap problem. In this work, we propose to use segmentation as the interface between perception and control, as a domain-invariant state representation. We identify two sources of sim-real gap: dynamics and visual. To close the dynamics sim-real gap, we propose to use closed-loop control. For complex tasks with segmentation mask input, we further propose learning a closed-loop model-free control policy with a deep neural network using imitation learning. To close the visual sim-real gap, we propose learning a perception model in a real environment using simulated targets plus real background images, without using any real-world supervision. We demonstrate this methodology in an eye-in-hand grasping task. Combining the control policy learned from simulation with the perception model, we achieve an impressive 88% success rate in grasping a tiny sphere with a real robot.

Introduction

Training robots in the real world is slow, expensive, and potentially dangerous. While simulators provide infinite, safe data, models trained purely in "sim" often fail in "real" because of the Sim-Real Gap. This gap manifests in two distinct ways:

  1. Visual Sim-Real Gap: Simulated images look different from real ones due to lighting, textures, and shadows.
  2. Dynamics Sim-Real Gap: Simulated physics (friction, joint latency, mass) rarely matches the messy reality of hardware.

Most end-to-end approaches try to map raw pixels directly to motor commands, which makes the model hypersensitive to these discrepancies. This paper asks: Can we decouple perception from control to make the transfer more robust?

Methodology: Decoupling Perception and Control

The authors propose a modular architecture that separates the "seeing" from the "doing," using a binary segmentation mask as the bridge.

The full system architecture, showing the visual module translating RGB images into binary masks, which are then processed by the controller module to output joint updates.

The Interface

Instead of raw pixels, the controller receives a 100x100 binary segmentation mask of the target object. This mask looks identical whether it comes from a simulator or a real camera, acting as a "domain-invariant" representation. By forcing the robot to communicate through this mask, the controller is effectively "blinded" to the visual differences between sim and real.

The Controller (The "Doing")

A Deep Neural Network (DNN) is trained entirely in simulation using DAGGER (Dataset Aggregation), an iterative imitation learning algorithm. It takes the mask and the current robot joint angles as input and outputs changes in joint positions. Because it is closed-loop (constantly re-evaluating based on new visual input), it can naturally correct for small errors in physics or robot calibration. If the real robot's arm is slightly heavier or slower than the simulated one, the controller simply sees the error in the next frame and adjusts.

The Vision Module (The "Seeing")

A separate DNN translates real RGB images into the binary masks the controller expects. To train this module without manual labeling, the authors developed a novel data generation strategy.

Hybrid Training Data

To bridge the visual gap, the authors blended rendered images of the target onto real-world background images captured by the robot. They used the Povray raytracer for realistic lighting and shadows, as standard simulator images (like Gazebo) were often too "flat" to generalize well to the real world.

The process of generating hybrid training data: composing real background images with simulated target renders to create a training set for the vision module.

This approach allowed the vision module to learn to identify the target against complex, real-world backgrounds without requiring any manually annotated real-world training data.

Key Results and Robustness

The methodology was evaluated on a physical Baxter robot tasked with grasping a tiny 1.37cm sphere.

  • High Success Rate: The system achieved an 88% success rate in the real world.
  • Dynamic Robustness: The robot successfully handled moving targets and cluttered environments, even though it was never explicitly trained for those scenarios in simulation.
  • Recovery Strategies: The closed-loop nature allowed the robot to develop emergent recovery behaviors. If it bumped the sphere and it rolled away, the robot would automatically re-adjust and try again.
  • Efficiency: Using DAGGER, the team reached 92% success in simulation with only 50,000 frames, significantly more efficient than many Reinforcement Learning (RL) benchmarks.

Conclusion

By using segmentation masks as a domain-invariant interface, this research demonstrates that the sim-real gap can be effectively bridged. The combination of a closed-loop controller trained in simulation and a vision module trained on hybrid data provides a robust, data-efficient path for transferring complex robotic skills from virtual environments to the real world.

Summary updated

BibTeX
@misc{yan2020how,
  author = {Mengyuan Yan and Qingyun Sun and Iuri Frosio and Stephen Tyree and Jan Kautz},
  title = {{How to Close Sim-Real Gap? Transfer with Segmentation!}},
  year = {2020},
  eprint = {2005.07695},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2005.07695},
}
Figure