Self-Supervised Sim-to-Real Adaptation for Visual Robotic Manipulation

Rae Jeong, Yusuf Aytar, David Khosid, Yuxiang Zhou, Jackie Kay, Thomas Lampe, Konstantinos Bousmalis, Francesco Nori

TL;DR

DeepMind researchers have developed a two-stage framework to bridge the "reality gap" in robotic manipulation. By combining privileged simulation training with a novel Contrastive Forward Dynamics (CFD) loss, they successfully transferred a cube-stacking skill to a real Sawyer robot using only five hours of unlabeled real-world data, significantly outperforming standard domain randomization.

What Problem Does This Paper Address?

Training reinforcement learning (RL) agents directly on real robots is notoriously difficult. It requires massive amounts of data, and automatically generating reward signals (e.g., "did the robot successfully stack the cube?") often requires complex external sensors or manual labeling.

Simulations offer a solution by providing infinite, perfectly labeled data. However, agents trained in simulation often fail in the real world due to the sim-to-real gap: differences in visual appearance (lighting, textures) and physical dynamics. While "domain randomization" (varying colors and physics in sim) helps, it often isn't enough for complex, long-horizon tasks like cube stacking. This paper tackles how to use unlabeled real-world robot experience to adapt a simulation-trained agent to the physical world.

Methods

The authors propose a two-stage training pipeline:

Stage 1: Learning in Simulation The agent is trained in a MuJoCo simulation. To speed up learning, the authors use an asymmetric actor-critic setup. A "teacher" agent has access to the full simulator state (exact coordinates of cubes and joints), while a "student" vision-based agent only sees raw pixels. The student learns to solve the task by imitating the teacher via Behavioral Cloning (BC) and standard RL (MPO).

Stage 2: Self-Supervised Sim-to-Real Adaptation The vision-based agent is moved to the real robot to collect unlabeled data. The system then performs "modality tuning": it freezes the high-level policy logic and only updates the initial visual processing layers.

The core innovation here is the Contrastive Forward Dynamics (CFD) loss. Unlike previous methods that only look at temporal proximity in video, CFD utilizes the robot's actions. It learns a latent representation where a forward dynamics model predicts the next state $z_{t+1}$ given the current state $z_t$ and action $a_t$. To avoid trivial solutions (like the model simply outputting zeros), they use a contrastive loss that forces the predicted state to be close to the actual future state and far from other random states in the mini-batch.

Overview of the two-stage training process.

Datasets

  • Simulation: A MuJoCo-based environment modeling a 7-DoF Sawyer robotic arm, a basket, and two cubes.
  • Real World: A physical Sawyer robot setup. The adaptation phase used 5 hours of unlabeled real robot data collected by running the initial simulation-trained policy.
  • Evaluation: Performance was measured over 50 real-world episodes of the cube-stacking task.

Key Insights and Ideas

  • Actions Matter: Standard self-supervision (like TCN) only looks at video frames. By including the robot's actions in the CFD loss, the agent learns a representation that is grounded in the physical laws of the environment, which are consistent between sim and real.
  • Modality Tuning is Crucial: The authors found that updating the entire network during adaptation led to "catastrophic forgetting." By freezing the policy layers and only adapting the early visual encoder, the agent retains its stacking logic while learning to "see" in the new domain.
  • Joint Optimization: During adaptation, it is vital to continue optimizing the original RL and BC losses on simulated data alongside the self-supervised loss on real data. This ensures the visual features remain useful for the actual task.
Multi-step future predictions in the latent space.

Key Results

The researchers compared their CFD-based adaptation against several baselines on the real-world cube stacking task:

Method Task Success Rate
Domain Randomization (Zero-shot) 46%
DANN (Domain-Adversarial Neural Net) 50%
SSDA with TCN (Two-Stage) 54%
SSDA with CFD (Ours, Two-Stage) 62%

The results show that CFD provides a significant boost over standard domain adaptation techniques. Furthermore, the two-stage approach was shown to be much more stable than end-to-end adaptation.

Simulation performance showing the stability provided by Behavioral Cloning (BC).

Limitations and Future Work

  • Initial Performance Requirement: The method relies on the simulation-trained agent being "good enough" to collect meaningful unlabeled data in the real world. If the sim-to-real gap is too large for the agent to even touch the cubes initially, the adaptation might fail.
  • Task Complexity: While cube stacking is difficult, the environment is still relatively controlled. Future work could explore more cluttered environments or tasks with deformable objects.
  • Hyperparameter Sensitivity: The paper notes that finding the right self-supervised objective is of "major importance," suggesting that different tasks might require different auxiliary losses.

Summary updated

BibTeX
@inproceedings{jeong2020self,
  author = {Rae Jeong and Yusuf Aytar and David Khosid and Yuxiang Zhou and Jackie Kay and Thomas Lampe and Konstantinos Bousmalis and Francesco Nori},
  title = {{Self-Supervised Sim-to-Real Adaptation for Visual Robotic Manipulation}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2020},
  doi = {10.1109/icra40945.2020.9197326},
}
Figure