Look where you look! Saliency-guided Q-networks for generalization in visual Reinforcement Learning

David Bertoin, Adil Zouitine, Mehdi Zouitine, Emmanuel Rachelson

Overview

Deep Reinforcement Learning (RL) agents are notoriously easily distracted. While they can master complex visual control tasks in controlled simulations, they often fail miserably when introduced to minor visual disturbances or background changes. This phenomenon, known as observational overfitting, occurs when an agent memorizes the relationship between specific background pixels and rewards rather than learning the underlying physics of a task (e.g., the actual position of a robot's leg).

Existing solutions often rely on heavy data augmentation, such as random cropping or color jittering. However, even with these tricks, agents struggle to distinguish between "causal" features (the robot itself) and "confounding" factors (a moving shadow or a video playing in the background).

To address this, researchers have introduced Saliency-Guided Q-Networks (SGQN). This novel approach significantly improves the generalization of visual RL agents by forcing them to focus on task-relevant pixels while ignoring distracting backgrounds, setting a new state-of-the-art on the Deepmind Control Generalization benchmark.

Methodology: Saliency-Guided Q-Networks

SGQN is a generic framework designed to be integrated into any value-based RL algorithm (demonstrated primarily using Soft Actor-Critic, or SAC). The architecture encourages the agent to be "self-aware" of where it is looking, ensuring decisions are based only on the most critical parts of the image.

SGQN Architecture Overview

SGQN relies on two main pillars to achieve this focus:

  1. Consistency Regularization ($L_C$): The agent computes an "attribution map" (or saliency map) using Guided Backpropagation to identify which pixels most heavily influence its Q-value predictions. It then creates a masked version of the input image, retaining only these "salient" pixels. A consistency loss is applied to force the Q-network to produce nearly identical values for both the original and the masked image. This effectively trains the network to ignore the background and base decisions solely on key features.

  2. Self-Supervised Learning ($L_{SL}$): To robustify the visual encoder, an auxiliary task is introduced. The agent is fed an augmented version of a frame (e.g., with a random image overlaid on the background) and tasked with predicting the saliency map of the original, un-augmented frame. This forces the encoder to preserve features useful for identifying important pixels, even under heavy visual noise.

Together, these mechanisms create a virtuous cycle: the consistency loss sharpens the saliency maps, which then provide higher-quality "labels" for the self-supervised task, ultimately helping the encoder learn better, more resilient features.

Experimental Setup

The researchers evaluated SGQN on the Deepmind Control Generalization benchmark (DMControl-GB), utilizing five continuous control tasks (Walker walk/stand, Ball in cup, Cartpole, and Finger spin).

Agents were trained in a standard environment with a fixed, simple background and then tested under two levels of distribution shift:

  • Video Easy: The background is replaced with natural videos from the Places365 dataset.
  • Video Hard: Both the background and the floor/shadows are replaced with natural videos, creating a highly confusing visual scene.

Key Results and Insights

SGQN outperformed existing state-of-the-art methods (including SVEA, SODA, and DrQ) across the board, particularly excelling in the most difficult scenarios.

  • Massive Generalization Gains: In the challenging "Video Hard" benchmark, SGQN achieved an average score of 748, compared to the previous best (SVEA) at 468—a nearly 60% improvement.
  • Sample Efficiency: Even in the training domain without distractions, SGQN learned faster and reached higher asymptotic performance than vanilla SAC in 4 out of 5 environments.
  • Reduced Variance: Agents trained with SGQN demonstrated much more stable performance across different random seeds compared to baseline methods.
Training performance on Finger Spin

Beyond raw performance, SGQN offers unique advantages in representation and interpretability. Unlike methods that use data augmentation to learn general representations, SGQN uses the model's own "attention" as a supervisory signal, ensuring the representation is specifically tuned to the policy's needs. Furthermore, because the model is trained to predict its own saliency maps, it provides human-interpretable "attribution maps" at runtime with zero additional computational overhead, allowing observers to see exactly what the agent is "looking at."

Limitations and Future Work

While highly effective, the authors note that saliency maps represent an "anthropomorphic" view of vision. There may be more abstract forms of attribution that could prove even more effective for non-visual or high-dimensional RL tasks. Additionally, while empirical results are exceptionally strong, a formal mathematical proof linking these specific saliency losses to a bound on the generalization gap remains an open challenge.

Future work will likely explore extending this methodology to discrete action spaces (such as Atari/DQN) and integrating it with different architectures like Transformers.

Summary updated

BibTeX
@inproceedings{bertoin2022look,
  author = {David Bertoin and Adil Zouitine and Mehdi Zouitine and Emmanuel Rachelson},
  title = {{Look where you look! Saliency-guided Q-networks for generalization in visual Reinforcement Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=F7LVNDUiPEY},
}
Figure