Style-Agnostic Reinforcement Learning

Juyong Lee, Seokjun Ahn, Jaesik Park

Abstract

We present a novel method of learning style-agnostic representation using both style transfer and adversarial learning in the reinforcement learning framework. The style, here, refers to task-irrelevant details such as the color of the background in the images, where generalizing the learned policy across environments with different styles is still a challenge. Focusing on learning style-agnostic representations, our method trains the actor with diverse image styles generated from an inherent adversarial style perturbation generator, which plays a min-max game between the actor and the generator, without demanding expert knowledge for data augmentation or additional class labels for adversarial training. We verify that our method achieves competitive or better performances than the state-of-the-art approaches on Procgen and Distracting Control Suite benchmarks, and further investigate the features extracted from our model, showing that the model better captures the invariants and is less distracted by the shifted style.

Introduction: The Challenge of Generalization

Deep Reinforcement Learning (RL) has achieved remarkable success in complex domains ranging from strategic games to robotic control. However, these agents often exhibit significant "brittleness" when faced with environmental shifts. An agent trained to navigate a level with a specific background color or texture may fail entirely when those task-irrelevant visual details change, even if the underlying mechanics and objectives remain identical. This failure stems from the agent's tendency to overfit to the visual "style" of the training environment rather than learning the essential "content"—the semantic features like player position, obstacles, and goals.

While traditional data augmentation techniques (e.g., color jittering or random cropping) provide some relief, they often require manual tuning and may not encompass the full spectrum of environmental variations. To address this, we propose Style-Agnostic Reinforcement Learning (SAR), a framework designed to automatically discover and ignore distracting visual styles without requiring human-defined labels or expert knowledge.

Methodology: Style-Agnostic Representation (SAR)

The core of SAR is a min-max game played between two primary components: a Style Perturbation Generator and the Actor (the RL agent). This adversarial framework forces the agent to develop representations that are invariant to visual style.

Adversarial Style Perturbation

The Style Perturbation Generator utilizes a technique inspired by Adaptive Instance Normalization (AdaIN) to apply style shifts within the latent feature space. Unlike random augmentation, the generator is trained adversarially; it specifically seeks out style perturbations that maximize the discrepancy in the agent's predicted actions. By identifying the visual "weak spots" that cause the agent to deviate from its optimal policy, the generator acts as a targeted stress-tester.

Learning Invariance

Simultaneously, the Actor is trained to minimize the difference between its actions on the original image and the style-perturbed image. By constantly adapting to the challenging styles produced by the generator, the agent learns to filter out task-irrelevant noise. To further enhance this robustness, SAR incorporates Style Mixing, which interpolates styles between different images within a training batch, diversifying the visual experience beyond simple pixel-level manipulations.

Experimental Evaluation

We evaluated the SAR framework on two rigorous benchmarks designed to test zero-shot generalization:

  1. OpenAI Procgen: A suite of 16 procedurally generated games where agents are tested on levels with visual layouts and backgrounds never seen during training.
  2. Distracting Control Suite: A modification of the DeepMind Control Suite that introduces intense distractions, including video backgrounds, shifting camera angles, and heavy color noise.

Results and Analysis

SAR demonstrated superior performance across both benchmarks, achieving the best average rank (2.9) across eight diverse tasks in Procgen, outperforming existing state-of-the-art methods such as DrAC and MixStyle. In the Distracting Control Suite, SAR showed particular resilience in "hard" settings. For instance, in the walker:walk task under extreme distraction, SAR maintained high performance levels while competing agents experienced significant performance degradation.

Qualitative Insights

To understand why SAR generalizes effectively, we utilized GradCAM to visualize the agent's focus. While standard agents often focus on background patterns, SAR agents consistently attend to the player character and interactive objects. Furthermore, image reconstruction tests revealed that SAR's internal representations are remarkably "clean." When reconstructing an image from the agent's features, the background is often reduced to a neutral gray, while essential task elements remain sharp and distinct. This confirms that the model successfully captures environmental invariants.

Conclusion and Future Work

Style-Agnostic Reinforcement Learning provides a robust framework for teaching agents to ignore the "paint" and focus on the "game." While the adversarial objective significantly improves generalization, we observed that in very simple, noise-free environments, the additional complexity can lead to slight over-regularization.

Future research will explore the integration of curriculum learning, gradually introducing adversarial perturbations as the agent masters the basic task mechanics. This could stabilize the min-max training process and further improve performance in complex, real-world scenarios where lighting, weather, and textures vary constantly.

Summary updated

BibTeX
@inproceedings{lee2022style,
  author = {Juyong Lee and Seokjun Ahn and Jaesik Park},
  title = {{Style-Agnostic Reinforcement Learning}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19842-7\_35},
}
Figure