Learning Cross-Domain Correspondence for Control with Dynamics Cycle-Consistency

Qiang Zhang, Tete Xiao, Alexei A. Efros, Lerrel Pinto, Xiaolong Wang

TL;DR

This paper introduces a framework that learns to align robot observations and actions across different domains—such as simulation to reality, or between robots with different body shapes—using only unpaired, randomly collected data. By enforcing a "dynamics cycle-consistency" constraint, the method maps behaviors through time, enabling reinforcement learning policies trained in one environment to be directly transferred to another without any additional fine-tuning.

What Problem Does This Paper Address?

In robotics, getting a policy to work across different domains is a pervasive challenge. Whether you are trying to transfer a policy from a simulator to a real robot (sim-to-real), trying to get a robot to mimic a human (imitation learning), or transferring skills between different robot setups, you need to find a "correspondence" between the two domains. This is incredibly difficult because domains can differ in observation type (e.g., raw camera pixels vs. internal joint angles), physics parameters (mass, friction), and morphology (the physical structure or number of limbs of the robot).

Existing approaches typically rely on paired, perfectly aligned trajectories, which are expensive or impossible to collect in the real world. Other methods use visual translation techniques like CycleGAN, but these operate purely in the visual space. They ignore the underlying physics and dynamics of the system, causing them to fail when environments have different physical properties or robot structures.

Methods

The authors propose Dynamics Cycle-Consistency. Instead of just matching static images or states, their framework chains observations and actions across time and domains.

Given unpaired trajectory data from Domain X and Domain Y, the framework learns an observation translator ($G: X \to Y$) and an action translator ($H: X \times A \to U$, along with its inverse $P$). To tie these translations to physical reality, they introduce a pre-trained forward dynamics model ($F$) of Domain Y.

The core intuition is simple: if you take an observation ($x_t$) and action ($a_t$) from Domain X, translate them to Domain Y, and pass them through Domain Y's forward dynamics model, the predicted next state should perfectly match the translation of the actual next state from Domain X ($G(x_{t+1})$).

Model framework for different alignment settings

To prevent the neural networks from finding "shortcuts" or experiencing model collapse, the authors develop an Alternatingly Joint Training Algorithm. They first pre-train and freeze the forward dynamics model $F$ on Domain Y. Then, they alternate between training the action mapping functions ($H, P$) and the observation mapping function ($G$) using a combination of adversarial and dynamics cycle losses.

Datasets

The method was evaluated across several challenging setups:

  • MuJoCo Physics Engine: Standard benchmarks from OpenAI Gym and DeepMind Control Suite, including HalfCheetah, FetchReach, Walker2d, Hopper, and FingerSpin.
  • Modified MuJoCo Environments: Custom variations designed to test specific discrepancies:
  • Cross-physics: Environments with altered armature and torso mass.
  • Cross-morphology: A 3-legged Cheetah (modified from the standard 2-legged version) and a 4-limbed Swimmer (modified from 3 limbs).
  • Real-World Robot Data: Uncalibrated monocular RGB video trajectories of a real xArm robot performing random actions, paired with randomly collected simulation trajectories.

Key Insights and Ideas

  • Dynamics as an Anchor: Purely visual translation is under-constrained. By forcing the cross-domain translation to obey the laws of a forward dynamics model, the system is constrained to learn physically meaningful, behaviorally aligned correspondences.
  • Random Data is Sufficient: Remarkably, the system does not need expert demonstrations or aligned data. Randomly wiggling a real robot arm and randomly running a simulation is enough to establish a precise mapping between camera pixels and simulation joint states.
  • Task-Agnostic Alignment: Because the correspondence is learned from random trajectories without using a reward function, the resulting alignment is completely task-agnostic. It can be used to transfer multiple different downstream RL policies without retraining the mapping.

Key Results

  • Cross-Physics Transfer: On tasks with altered mass or armature, the proposed method successfully transferred policies without fine-tuning, outperforming both direct transfer and domain randomization (DR) baselines (e.g., achieving a reward of 3997 on HalfCheetah vs. 3763 for DR).
  • Cross-Modality (Pixels to States): The model successfully performed state estimation from raw images. On HalfCheetah, it achieved an L1 state estimation error of 0.57, compared to 2.07 for a standard CycleGAN baseline.
  • Cross-Morphology: The framework successfully transferred policies between different robot structures (e.g., 2-leg to 3-leg Cheetah), where baseline methods completely failed.
  • Real Robot Execution: When tested on a real xArm robot using uncalibrated monocular video, the method achieved an exceptionally low L1 error (0.025) for end-effector position estimation, vastly superior to the CycleGAN baseline (0.18).
Visualization of learnt correspondence from RGB images to robot joint states with xArm robot

Limitations and Future Work

  • Dependence on the Forward Model: The framework relies heavily on a highly accurate forward dynamics model for Domain Y. If Domain Y is highly complex, chaotic, or stochastic, training an accurate forward model might become a major bottleneck.
  • Unidirectional Forward Model: The current formulation only requires a forward model in one domain (Domain Y). While this is practical for sim-to-real (as you don't need a real-world forward model), exploring bidirectional dynamics constraints could potentially improve robustness.
  • Action Space Initialization: For cross-morphology tasks where action dimensions differ, the method requires a heuristic initialization (e.g., copying nearby joint actions) to successfully kickstart the alternating training process.

Summary updated

BibTeX
@inproceedings{zhang2021learning,
  author = {Qiang Zhang and Tete Xiao and Alexei A. Efros and Lerrel Pinto and Xiaolong Wang},
  title = {{Learning Cross-Domain Correspondence for Control with Dynamics Cycle-Consistency}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=QIRlze3I6hX},
}
Figure