Abstract
Deep Reinforcement Learning (RL) agents often struggle with domain generalization, failing when visual styles change despite identical task mechanics. We present Style-Agnostic Reinforcement Learning (SAR), a framework that enhances robustness by training agents against an adversarial style generator. By synthesizing novel visual perturbations, SAR forces the agent to learn representations invariant to task-irrelevant features like texture and color, leading to superior performance on challenging benchmarks like OpenAI Procgen and the Distracting Control Suite.
Introduction
Deep RL agents are notoriously "brittle." An agent trained to play a video game with a blue background might fail if the background turns red, even if the gameplay mechanics remain identical. This failure of domain generalization occurs because convolutional neural networks (CNNs) often latch onto "style" (task-irrelevant visual features) instead of "content" (task-relevant features like player positions). While standard data augmentation helps, it is often limited by human-defined heuristics. SAR seeks to automatically learn style-agnostic representations—features that remain invariant regardless of the environment's visual "coat of paint."
Methodology
The SAR framework, as illustrated in Figure 1, combines style transfer techniques with adversarial training to decouple content from style. The method relies on three core components:
- Style as Statistics: Following computer vision conventions, "style" is defined as the mean and standard deviation of feature maps within a CNN. Manipulating these statistics allows the model to change the visual style without altering semantic content.
- The Style Perturbation Layer: Unlike previous methods that only interpolate between existing styles, SAR utilizes an Adversarial Style Perturbation Generator. This generator produces unique shift parameters ($\gamma$ and $\beta$) to create entirely new, synthetic styles.
- The Min-Max Game: The architecture sets up a competitive objective. The Generator attempts to create style perturbations that maximize the difference in the agent's predicted actions (divergence $\mathcal{L}_{div}$), essentially trying to "distract" the agent. Conversely, the Actor (Agent) tries to minimize this difference, forcing itself to produce consistent action distributions regardless of the visual style.
Consistency regularization is also applied to the Critic network to ensure stable value estimates across both original and perturbed feature sets.
Experimental Evaluation
The authors evaluated SAR on two major benchmarks for RL generalization:
- OpenAI Procgen: A suite of 16 procedurally generated games where visual layouts and backgrounds change every level. SAR was tested on a subset of 8 tasks, including Starpilot and Bigfish.
- Distracting Control Suite: A modified version of the DeepMind Control Suite that introduces heavy distractions, such as video backgrounds and camera shakes.
Key Results
- State-of-the-Art Performance: On the Procgen benchmark, SAR achieved the best average rank (2.9) across eight tasks, outperforming strong baselines like RAD and DrAC.
- Robustness to Heavy Noise: In the Distracting Control Suite, SAR dominated in "moderate" and "hard" noise settings. For instance, in the walker:walk task with hard noise, SAR achieved a score of 112, significantly higher than the vanilla SAC baseline of 85.
- Visual Focus: GradCAM visualizations confirm that SAR agents maintain focus on task-relevant objects (like the player character) while standard agents are frequently distracted by complex backgrounds.
Discussion and Limitations
SAR demonstrates that treating the "style gap" as an adversarial problem allows agents to extrapolate beyond the training distribution. However, some limitations remain. In perfectly noise-free environments, SAR can occasionally perform slightly worse than vanilla baselines due to the added complexity of the adversarial objective. Additionally, if training environments lack sufficient initial variety, the generator may struggle to find meaningful perturbation directions. Future work may explore curriculum learning to gradually increase perturbation strength, potentially improving training stability and final performance.
Summary updated