Robust Robotic Control from Pixels using Contrastive Recurrent State-Space Models

Nitish Srivastava, Walter Talbott, Martin Bertran Lopez, Shuangfei Zhai, Joshua M. Susskind

Abstract

Modeling the world can benefit robot learning by providing a rich training signal for shaping an agent's latent state space. However, learning world models in unconstrained environments over high-dimensional observation spaces such as images is challenging. One source of difficulty is the presence of irrelevant but hard-to-model background distractions, and unimportant visual details of task-relevant entities. We address this issue by learning a recurrent latent dynamics model which contrastively predicts the next observation. This simple model leads to surprisingly robust robotic control even with simultaneous camera, background, and color distractions. We outperform alternatives such as bisimulation methods which impose state-similarity measures derived from divergence in future reward or future optimal actions. We obtain state-of-the-art results on the Distracting Control Suite, a challenging benchmark for pixel-based robotic control.

Introduction: The Challenge of Visual Distractions

Model-based Reinforcement Learning (MBRL) is a powerful paradigm for robotic learning, allowing agents to learn a "world model"—an internal simulation of environmental dynamics. Most state-of-the-art world models, such as Dreamer, rely on pixel-level reconstruction. They attempt to predict and recreate every pixel of future observations.

However, in unconstrained real-world environments, pixel-perfect reconstruction is often computationally wasteful and counterproductive. Irrelevant distractions—such as moving backgrounds, changing lighting conditions, or camera jitter—can dominate the reconstruction loss, causing the model to focus on modeling noise rather than task-relevant features (e.g., a door handle). This research introduces CoRe (Contrastive Recurrent State-Space Models) to address these challenges by shifting from reconstruction to contrastive learning.

CoRe: Contrastive Recurrent State-Space Models

CoRe replaces the traditional reconstruction objective with a contrastive world model. Instead of recreating the next image, the model predicts a high-level embedding of that image.

The CoRe architecture combines a Recurrent State-Space Model (RSSM) with a contrastive prediction objective.

The architecture consists of three main components:

  1. Contrastive Prediction: A contrastive loss ensures that the predicted embedding is similar to the actual future observation while remaining distinct from unrelated observations in the training batch.
  2. Recurrent State-Space Model (RSSM): The authors identify recurrence as a critical factor for success. By using a Recurrent Neural Network (specifically a GRU), the model maintains temporal smoothness and generates "hard negatives"—examples that are visually similar but temporally distinct—forcing the model to learn precise dynamics.
  3. Auxiliary Grounding: To ensure the latent space supports control, the model includes auxiliary tasks: predicting immediate rewards and "inverse dynamics" (inferring the action taken between two states).

Experimental Benchmarks

The effectiveness of CoRe was evaluated on two challenging benchmarks:

  • Distracting Control Suite (DCS): An extension of the DeepMind Control Suite where backgrounds are replaced with dynamic videos from the DAVIS dataset, and camera poses and colors shift continuously.
  • Robosuite: A MuJoCo-based simulator for robot manipulation. Custom lighting and camera distractions were added to simulate the variability of real-world settings.

Results and Key Insights

CoRe demonstrates significant improvements in robustness and efficiency over existing methods.

Performance comparison of CoRe against several baselines on the Distracting Control Suite.

Key findings include:

  • Superior Robustness: In the "Dynamic-Medium" distraction setting of DCS, CoRe significantly outperformed baselines such as SAC-RAD, CURL, and PSE (a bisimulation-based method).
  • Sample Efficiency: CoRe achieved state-of-the-art results, often reaching peak performance within 500k environment steps, whereas reconstruction-based models like Recon often failed to progress.
  • Emergent Attention: Visualizations reveal that the model naturally learns to focus on task-relevant entities, such as the robot's base or a door handle, while ignoring chaotic background videos.
  • The Role of Recurrence: Ablation studies showed that previous contrastive RL methods (like CURL) struggled due to a lack of temporal components. CoRe's recurrent world model provides the necessary structure for stable contrastive learning.

Discussion and Limitations

A notable side effect of the contrastive objective is its tendency to ignore information that remains constant throughout an episode. While this helps filter out static backgrounds, it can inadvertently lead the model to ignore static goals, such as fixed target coordinates in the Reacher task.

Future work will focus on testing CoRe on physical robots and exploring multi-task settings. The authors suggest that by decoupling the world model from specific task controllers, it may be possible to develop a general-purpose "understanding" of the world that can be leveraged across diverse robotic skills.

Summary updated

BibTeX
@inproceedings{srivastava2021robust,
  author = {Nitish Srivastava and Walter Talbott and Martin Bertran Lopez and Shuangfei Zhai and Joshua M. Susskind},
  title = {{Robust Robotic Control from Pixels using Contrastive Recurrent State-Space Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=CU0fuiiprL},
}
Figure