Time Matters in Using Data Augmentation for Vision-based Deep Reinforcement Learning

Byungchan Ko, Jungseul Ok

Introduction

Data augmentation (DA) is a cornerstone of generalization in computer vision, but its application in Deep Reinforcement Learning (RL) is fraught with challenges. Unlike static datasets, RL involves non-stationary data distributions where the agent's policy and observations evolve. This paper identifies that standard augmentation techniques often interfere with reward maximization, leading to a trade-off between training performance and test-time generalization.

The Interference Problem

The authors identify two primary hurdles when applying DA to RL:

  1. Interference: The objective of learning a consistent representation (via augmentation) often conflicts with the primary goal of maximizing cumulative reward. This can slow down learning or lead to sub-optimal performance in the training environment.
  2. Forgetting: Because the environment is non-stationary, an agent might "forget" useful priors learned early on if those augmentations are not continuously applied.

Proposed Framework: UCB-ExDA

To address these issues, the paper introduces Distillation with Augmented observations (DA). This method ensures the agent's response to original (non-augmented) inputs remains stable while forcing consistency on augmented versions. The authors define two primary schedules for this distillation:

  • Intra Distillation (InDA): Interleaving RL training and DA distillation throughout the entire training process.
  • Extra Distillation (ExDA): Postponing the distillation of augmentation priors until after the RL training phase is complete. This requires no new environment samples.
The InDA vs. ExDA scheduling approaches

The UCB-ExDA framework uses a Multi-Armed Bandit algorithm (Upper Confidence Bound) to decide during training whether to use a specific augmentation or to use no augmentation at all to avoid interference. Once training is done, it runs a final ExDA phase to extract remaining generalization benefits.

Knowledge Preservation and Loss Design

A key technical contribution is the loss design, which explicitly preserves the agent's current knowledge. By minimizing the difference between the current agent's response to original data and its response to augmented data, the authors reduce the "distortion" that typically occurs when RL and self-supervised losses are combined concurrently.

Visualization of the distillation losses

Key Results and Insights

Evaluated on the OpenAI Procgen benchmark, UCB-ExDA consistently outperformed baselines like DrAC and RAD. In the game Chaser, UCB-ExDA achieved a test-background score of 3.18, compared to just 0.1 for DrAC.

  • Timing is Everything: For certain tasks, applying augmentation during training actually hurts. Postponing it to the end (ExDA) allows the agent to master the task first and then "polish" its representation for generalization later.
  • Efficiency: ExDA is remarkably efficient, injecting generalization priors in just 0.5M timesteps of distillation at the end of training, whereas other methods struggle even with 25M timesteps of concurrent augmentation.
  • Alleviating Gradient Conflict: While gradient projection methods like PAGrad can help prevent augmentation gradients from conflicting with RL gradients, the authors found that simple temporal separation (ExDA) was often more effective.

Conclusion

The timing of data augmentation is critical in RL. By prioritizing reward maximization during the non-stationary training phase and distilling generalization priors afterward, UCB-ExDA offers a robust solution for vision-based RL tasks, particularly in environments where training and testing distributions differ significantly.

Summary updated

BibTeX
@inproceedings{ko2022time,
  author = {Byungchan Ko and Jungseul Ok},
  title = {{Time Matters in Using Data Augmentation for Vision-based Deep Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=7KKL3Z5sod},
}
Figure