Revisiting Data Augmentation in Deep Reinforcement Learning

Jianshu Hu, Yunpeng Jiang, Paul Weng

Introduction

Image-based Deep Reinforcement Learning (DRL) has long been plagued by sample inefficiency and a lack of robustness. While data augmentation (DA) has become a standard tool to mitigate these issues, its application in DRL remains largely empirical and often lacks a theoretical foundation. Agents frequently struggle to generalize to novel environments—such as those with varying backgrounds or lighting—and the training process itself can be destabilized by the very augmentations intended to help.

This paper provides a comprehensive theoretical and empirical "health check" on DA in DRL. By moving beyond trial-and-error, the authors propose a principled framework that categorizes existing methods, introduces novel regularization techniques to stabilize training, and offers new insights into why certain augmentations succeed or fail.

A Unified Framework for Data Augmentation

The authors begin by categorizing existing DA methods into two distinct buckets:

  1. Implicit Regularization: This involves directly transforming observations during the training loop. Methods like RAD and DrQ fall into this category, where the agent simply sees augmented versions of the state.
  2. Explicit Regularization: This involves adding specific loss terms that penalize the agent if its output changes when the input is augmented. Methods like DrAC use this to force the agent to ignore irrelevant pixel-level changes.

A key theoretical contribution of this work is the proof that explicit regularization is essentially a specific case of implicit regularization where a higher probability is assigned to the "identity" (untransformed) image. This unified view bridges the gap between popular algorithms and allows for a more structured approach to algorithm design.

Methodology: Tangent Prop and KL Regularization

To improve upon existing methods, the authors propose a hybrid approach incorporating three key components designed to stabilize the actor-critic architecture:

Tangent Prop for DRL

Borrowed from 1990s computer vision and adapted for DRL, Tangent Prop penalizes the gradient of the critic with respect to the transformation parameters. By enforcing that the derivative of the Q-function with respect to the transformation is zero, the agent is explicitly taught that the Q-value should remain invariant even if the image is slightly tweaked. This helps the agent distinguish between task-relevant features and environmental "distractors."

KL Regularization

To ensure policy invariance, the authors introduce a Kullback–Leibler (KL) divergence term to the actor's loss. This forces the policy to produce consistent action distributions across different augmented versions of the same state, preventing the agent from taking wildly different actions based on irrelevant visual noise.

Update Frequency and Complexity

The paper challenges the conventional wisdom that "complex" augmentations (like random convolutions) should be avoided due to high variance. Instead, the authors argue that the primary issue is bias. They demonstrate that complex augmentations can be highly effective if the agent is allowed more training updates per environment step to overcome the initial bias introduced by the transformations.

Empirical Evaluation

The proposed method was evaluated using the DeepMind Control Suite (DMC), focusing on both standard sample efficiency and generalization under stress. To test the latter, the researchers utilized "Video-Hard" backgrounds, where agents must perform tasks (e.g., "ball in cup" or "walker walk") against a backdrop of complex, moving video sequences.

Key Results

  • State-of-the-Art Performance: The proposed framework outperformed strong baselines, including DrQ-v2 and SVEA, across the majority of DMC environments.
  • Robust Generalization: In the "Video-Hard" setting, the method showed significant gains. For example, in the "ball in cup catch" task, the proposed agent achieved a score of 569.5, substantially higher than SVEA’s 445.0.
  • Training Stability: The inclusion of KL and Tangent Prop terms led to a measurable reduction in the standard deviation of critic loss and target Q-values, resulting in smoother and more reliable training curves.
  • Predictive Metrics: The authors discovered that the cosine similarity of augmented features at the start of training (approx. 100k steps) serves as a reliable "early warning system" to determine if an augmentation is too complex for the agent to handle efficiently.

Discussion and Limitations

While the paper provides a more principled approach to DA, some challenges remain. The method still requires human intuition to select which augmentations are appropriate for a specific task. Furthermore, the use of Tangent Prop introduces additional computational overhead, as it requires calculating second-order derivatives (gradients of gradients).

Finally, the framework assumes that the chosen transformations should be invariant. If a transformation inadvertently removes information critical to the task, the regularization could negatively impact performance.

Conclusion

By unifying implicit and explicit regularization and introducing Tangent Prop to the DRL toolkit, this work moves the field toward a more rigorous understanding of data augmentation. The results demonstrate that with the right regularization and update frequency, even complex augmentations can be leveraged to create agents that are both sample-efficient and robust to environmental distractions. Future work will likely focus on "task-aware" augmentation, where agents automatically learn which image properties are irrelevant to the reward signal.

Summary updated

BibTeX
@inproceedings{hu2024revisiting,
  author = {Jianshu Hu and Yunpeng Jiang and Paul Weng},
  title = {{Revisiting Data Augmentation in Deep Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=EGQBpkIEuu},
}
Figure