Image Augmentation Is All You Need: Regularizing Deep Reinforcement Learning from Pixels

Denis Yarats, Ilya Kostrikov, Rob Fergus

TL;DR

DrQ (Data-regularized Q) is a simple yet remarkably effective technique that allows reinforcement learning (RL) agents to learn directly from pixels with state-of-the-art sample efficiency. By applying random image shifts and regularizing the Q-function to be invariant to these transformations, DrQ closes the long-standing performance gap between learning from raw images and learning from internal robot states.

The Challenge of Pixel-Based RL

Reinforcement learning has seen massive success in environments where the "state" is clearly defined—such as joint angles and velocities in a physics simulation. However, in the real world, robots often only have access to raw pixels from a camera.

Learning a policy directly from high-dimensional image data is notoriously difficult. Standard model-free RL algorithms, like Soft Actor-Critic (SAC) or Deep Q-Networks (DQN), usually fail or require millions of frames to learn simple tasks from pixels. To overcome this, researchers previously turned to complex "auxiliary tasks"—like training the agent to reconstruct the image or using self-supervised contrastive learning—to help the agent understand its visual input. These methods add significant computational overhead and don't always align with the actual goal of the agent.

Enter DrQ: Data-Regularized Q

The authors introduce DrQ, an approach that eschews complex auxiliary losses in favor of a classic computer vision tool: Data Augmentation.

DrQ is built on three simple pillars that can be plugged into any off-policy actor-critic algorithm:

  1. Input Transformations: Every time a transition is sampled from the replay buffer, the images are slightly shifted (padded by 4 pixels and then randomly cropped back to the original size).
  2. Target Q-Regularization: When calculating the target value for the Bellman update, the algorithm averages the Q-values over $K$ different augmentations of the next state.
  3. Q-Function Regularization: The current Q-value is also averaged over $M$ different augmentations of the current state during the update.

Essentially, DrQ forces the neural network to learn that a "shifted" version of an image should result in the same expected reward (Q-value) as the original image.

Learning curves on Walker Walk demonstrating DrQ's massive performance boost over standard SAC without augmentation.

Key Insights and Innovations

Simplicity Wins

The most surprising finding is that simple random shifts outperform much more complex methods like contrastive learning (CURL) or world models (Dreamer). Simply augmenting the input images helps, but the real performance boost comes from the Q-regularization (averaging over $K$ and $M$ augmentations). This drastically reduces the variance of the Q-function estimates, which is a major bottleneck in RL.

Fixing the "Capacity Paradox"

Usually, in image-based RL, using a larger, more powerful convolutional encoder leads to worse performance because the model overfits to the small amount of training data. DrQ fixes this paradox. By regularizing the data, DrQ allows high-capacity encoders to actually improve performance rather than collapse.

Comparison of unmodified SAC (top) and DrQ (bottom) across different encoder architectures. DrQ stabilizes learning across all encoder capacities.

Closing the State-Pixel Gap

On many tasks, DrQ reaches the same level of performance as agents trained on "perfect" internal states (e.g., exact joint positions), effectively solving the "learning from pixels" overhead that has plagued continuous control tasks.

Benchmarks and Results

The authors evaluated DrQ on two major benchmarks, proving its versatility across both continuous and discrete control:

  • DeepMind Control Suite (DMC): DrQ outperformed all previous model-free and model-based methods on standard continuous control tasks (like making a "Cheetah" run or a "Finger" spin).
  • Atari 100k: On this benchmark—specifically designed to test sample efficiency by limiting the agent to roughly 2 hours of real-time play—DrQ achieved a median human-normalized score of 0.27. This surpassed the previous best of 0.24 (CURL) and significantly beat the base "Efficient DQN" (0.09).

Because it doesn't require training a decoder or a world model, DrQ is also significantly faster in terms of wall-clock time than its competitors.

Limitations and Future Work

While DrQ is a massive step forward, it is not without limitations:

  • Transformation Choice: The authors found that while "shifts" work universally well, other augmentations like rotations or flips can actually hurt performance if the task depends on orientation (e.g., knowing which way is "up").
  • Algorithm Compatibility: While DrQ works for both continuous and discrete action spaces, the paper primarily focuses on off-policy algorithms. Extending this to on-policy algorithms (like PPO) might require different handling of the data stream.
  • The Human Gap: While 0.27 on Atari 100k is a new record, it is still far from human-level performance (1.0). This indicates that while augmentation is powerful, the quest for truly sample-efficient learning from pixels is not fully solved yet.

Summary updated

BibTeX
@inproceedings{yarats2021image,
  author = {Denis Yarats and Ilya Kostrikov and Rob Fergus},
  title = {{Image Augmentation Is All You Need: Regularizing Deep Reinforcement Learning from Pixels}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=GY6-6sTvGaf},
}
Figure