Normalization Enhances Generalization in Visual Reinforcement Learning

Lu Li, Jiafei Lyu, Guozheng Ma, Zilin Wang, Zhenjie Yang, Xiu Li, Zhiheng Li

TL;DR

By integrating two simple normalization techniques—CrossNorm and SelfNorm—into standard visual Reinforcement Learning (RL) pipelines, researchers have significantly closed the generalization gap. This "plug-and-play" module allows agents to adapt to unseen environments (like changing weather in driving sims or moving backgrounds in robotics) without requiring any out-of-domain data or complex auxiliary losses.

What Problem Does This Paper Address?

Visual RL agents are notoriously "brittle." While they can learn to perform complex tasks like driving or robotic manipulation from pixel inputs, they often overfit to the specific visual characteristics of their training environment. If the background color changes, the lighting shifts, or a video starts playing on a wall behind the robot, the agent's performance typically collapses.

Existing solutions often rely on heavy data augmentation (which can hurt sample efficiency) or pre-trained encoders from massive datasets like ImageNet. The authors of this paper ask a simpler question: Can we improve generalization using only the data the agent sees during training, simply by changing how we normalize internal features?

Methods

The authors propose a module called CNSN, which combines two specific normalization techniques:

  1. CrossNorm (CN): This acts as a form of feature-level data augmentation. It swaps the mean and standard deviation of channels between different instances in a mini-batch. To account for the fact that RL training data is often less diverse than computer vision datasets, the authors introduce a random cropping step when calculating these statistics to further diversify the features.
  2. SelfNorm (SN): This recalibrates the mean and standard deviation of a single instance using attention-based functions. While CrossNorm expands the diversity of what the agent sees during training, SelfNorm helps the agent focus on the most discriminative features shared between training and testing.

The Workflow: The CNSN module is placed immediately after convolutional layers. During training, CrossNorm is randomly activated to "shake up" the features, while SelfNorm remains active. During testing, CrossNorm is turned off, but SelfNorm continues to process the features, helping the agent bridge the distribution shift.

Datasets

The researchers evaluated their method on two primary benchmarks:

  • CARLA: A high-fidelity autonomous driving simulator. Agents were trained under one weather condition (e.g., "WetCloudySunset") and tested on six unseen conditions involving different lighting and precipitation.
  • DeepMind Control Generalization Benchmark (DMC-GB): A suite of robotic control tasks (Walker, Cartpole, etc.) with three levels of visual interference:
  • Color Hard: Randomly jittered colors.
  • Video Easy: Backgrounds replaced with moving videos.
  • Video Hard: Moving video backgrounds plus the removal of the ground plane.

Key Insights and Ideas

  • Normalization is Underutilized in RL: While Batch Normalization is a staple in Computer Vision, it often fails in RL because RL data is non-stationary (the distribution changes as the agent learns). This paper shows that style-based normalization is a better fit for RL generalization.
  • The "Expansion-Bridge" Synergy: CrossNorm and SelfNorm work better together than alone. CrossNorm expands the training distribution so the agent doesn't overfit to one "style," while SelfNorm bridges the gap by standardizing features during both training and testing.
  • Feature-Level vs. Image-Level Augmentation: Unlike standard data augmentation (like flipping or rotating images), CrossNorm operates directly on the feature maps. This allows for more diverse and subtle alterations that are harder to achieve with raw pixel manipulation.

Key Results

The results were particularly striking in the CARLA driving environment:

  • Closing the Gap: A vanilla DrQ-v2 agent (a state-of-the-art baseline) saw its performance drop to just 14% of its training score when moved to unseen weather. Adding the CNSN module boosted its test performance to 97% of its training score.
  • Outperforming Specialized Baselines: CNSN outperformed other popular generalization methods like SVEA, RAD, and SODA across almost all DMC-GB tasks, especially in the "Video Hard" category.
  • Efficiency: While adding normalization slightly decreased sample efficiency during the initial training phase, the trade-off was deemed "tolerable" given the massive gains in robustness.

Limitations and Future Work

The authors identify a few areas for improvement:

  • Hyperparameter Sensitivity: One must predetermine how many layers of CrossNorm to activate. Activating too many can lead to training divergence, while too few might not provide enough generalization.
  • Comparison to Pre-training: While CNSN is "self-contained" (it doesn't need outside data), it may not yet surpass the performance of agents that use massive pre-trained image encoders (like those trained on ImageNet).
  • Future Direction: The authors suggest that combining CNSN with these large-scale pre-trained models could be a powerful next step for creating truly "unshakeable" RL agents.

Summary updated

BibTeX
@inproceedings{li2024normalization,
  author = {Lu Li and Jiafei Lyu and Guozheng Ma and Zilin Wang and Zhenjie Yang and Xiu Li and Zhiheng Li},
  title = {{Normalization Enhances Generalization in Visual Reinforcement Learning}},
  booktitle = {AAMAS},
  year = {2024},
  url = {https://openreview.net/forum?id=OORhNLQIBu},
}

Loading related content...

Figure