On Guiding Visual Attention with Language Specification

Suzanne Petryk, Lisa Dunlap, Keyan Nasseri, Joseph Gonzalez, Trevor Darrell, Anna Rohrbach · DOI

Abstract

Deep learning models often rely on spurious correlations, such as background cues, rather than task-relevant features. We present GALS (Guiding visual Attention with Language Specification), a framework that leverages pretrained vision-language models to provide spatial supervision via natural language prompts. By penalizing models when their internal attention deviates from language-grounded regions, GALS significantly improves robustness to bias and fairness without requiring manual pixel-level annotations.

Introduction: The Problem of Spurious Correlations

Deep learning models are notoriously "lazy," often latching onto the easiest available signal to minimize loss, even if that signal is irrelevant to the underlying task. This is known as spurious correlation. A classic example is the "Waterbirds" problem: if a dataset primarily features waterbirds against aquatic backgrounds, a model may learn to recognize "water" instead of the bird itself. Consequently, the model fails when encountering a waterbird in a forest.

While manual segmentation masks could mitigate this, they are prohibitively expensive and slow to produce. GALS addresses this by asking: Can we use simple, high-level language—like the phrase "a photo of a bird"—to tell a model where it should be looking?

The GALS Framework

GALS acts as a "spatial supervisor" during the training process through a three-step pipeline:

  1. Language Specification: The user provides a simple natural language description of the task-relevant object (e.g., "bird" or "meat").
  2. Information Grounding: The system uses an off-the-shelf, pretrained vision-language model (CLIP) and a saliency method (Grad-CAM) to generate an attention map. This map highlights the regions of the image that correspond to the language prompt.
  3. Attention Supervision: A standard CNN classifier is trained on the dataset. In addition to standard classification loss, an auxiliary attention loss is added. Using a technique called "Right for the Right Reasons" (RRR), the model is penalized if its internal gradients (where it is "looking") fall outside the regions highlighted by CLIP.
The GALS framework architecture: Category text and prompts are encoded to create a V+L attention map, which then supervises the CNN's internal attention via an auxiliary loss.

This approach offers a "best of both worlds" strategy: CLIP provides the "where" (general location), while the CNN focuses on the "what" (fine-grained classification).

Key Insights and Results

GALS effectively "re-programs" models to ignore distracting backgrounds and focus on task-relevant features. This is particularly evident in biased datasets where traditional models fail.

Qualitative comparison of attention maps: Vanilla CNNs often focus on backgrounds (like water), while GALS ensures the model attends to the bird regardless of the environment.

Performance Highlights:

  • Robustness to Bias: On the "Waterbirds-100%" dataset (perfect correlation between bird and background during training), GALS improved worst-group accuracy by 15% over the strongest unsupervised baseline.
  • Fairness Gains: On the MSCOCO-ApparentGender task, GALS achieved a 41–45% relative improvement in fairness metrics, successfully decoupling gender prediction from stereotypical background objects like kitchens.
  • Zero-Overhead Inference: Because language guidance occurs only during training, the final model is a standard CNN. It requires no text prompts or CLIP involvement during deployment, maintaining computational efficiency.

Limitations and Future Work

The effectiveness of GALS is inherently tied to the grounding quality of the underlying vision-language model. If CLIP cannot accurately localize an object in a complex or messy scene, the supervision will be poor. Furthermore, GALS is best suited for spatial biases (like backgrounds) rather than "entangled" biases where the spurious signal and the target object occupy the same pixels (e.g., age and race). Future work may involve improving grounding for complex compositional prompts.

Summary updated

BibTeX
@inproceedings{petryk2022guiding,
  author = {Suzanne Petryk and Lisa Dunlap and Keyan Nasseri and Joseph Gonzalez and Trevor Darrell and Anna Rohrbach},
  title = {{On Guiding Visual Attention with Language Specification}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.01756},
}
Figure