MaskTune: Mitigating Spurious Correlations by Forcing to Explore

Saeid Asgari, Aliasghar Khani, Fereshte Khani, Ali Gholami, Linh Tran, Ali Mahdavi-Amiri, Ghassan Hamarneh

TL;DR

MaskTune is a simple yet powerful fine-tuning strategy designed to stop deep learning models from taking "shortcuts." By identifying and masking the features a model initially relies on, MaskTune forces the network to explore and learn a broader, more robust set of discriminative features—all without requiring expensive human annotations of spurious attributes.

What Problem Does This Paper Address?

Deep neural networks are notorious for being "lazy" learners. When presented with a task, they often latch onto spurious correlations—coincidental associations in the training data that don't hold up in the real world.

A classic example is a model trained to distinguish between cows and camels. If most training images show cows on green grass and camels in sandy deserts, the model might simply learn to recognize "green" as "cow" and "yellow" as "camel." When it later sees a cow on a beach, it fails. This is known as shortcut learning.

MaskTune Process

Existing solutions often require "group labels" (e.g., explicitly telling the model which images are "cows on sand") to penalize these shortcuts. However, labeling every possible spurious correlation in a massive dataset is practically impossible. MaskTune aims to solve this problem in an entirely unsupervised manner.

Methods: Burn-in and Explore

MaskTune operates as a two-stage process designed to force feature exploration:

  1. Initial Training: A model is trained normally using Empirical Risk Minimization (ERM) until it fully fits the training data. At this point, it has likely latched onto the easiest "shortcuts."
  2. Feature Discovery: The researchers use xGradCAM, an explainability tool, to generate a localization map for every training image. This map highlights exactly which pixels the model used to make its prediction (the "first set" of features).
  3. Masking: A thresholding function is applied to these maps to create a mask. The most "important" pixels (the shortcuts) are blacked out.
  4. Single-Epoch Fine-tuning: The model is fine-tuned for exactly one epoch on this masked data. Because the original shortcuts are gone, the model is forced to "explore" the remaining pixels to find new ways to minimize loss.

Crucially, the authors found that fine-tuning for more than one epoch or using a high learning rate causes the model to "forget" the original features. The goal is to add to the model's knowledge, not replace it.

Key Insights and Ideas

  • Forced Exploration: By masking the "easiest" features, the model is pushed into a higher-complexity regime. It can no longer rely on a single texture or color and must look for more complex, semantic features (like the shape of a cow's head instead of just the green grass).
  • The Power of One Epoch: A very brief fine-tuning stage is sufficient to broaden a model's feature set without destroying the useful parts of the original representations.
  • Unsupervised Robustness: Unlike many competing methods, MaskTune doesn't need to know what the bias is beforehand. It simply assumes that if a model is over-relying on a small area of an image, it's probably a shortcut worth masking.
  • Selective Classification: MaskTune can be used to make models safer. By comparing the predictions of the "initial" model and the "MaskTune" model, the system can choose to abstain (reject the sample) if the two models disagree, indicating uncertainty.

Key Results

The authors evaluated MaskTune across several benchmarks designed to trip up biased models, including Biased MNIST, CelebA, Waterbirds, and the Background Challenge (ImageNet-9L).

Attention Maps on CelebA and Waterbirds
  • CelebA: MaskTune achieved a 78.0% worst-group accuracy, significantly outperforming standard ERM (47.2%) and beating other unsupervised methods like DivDis (55.0%). As seen in the attention maps, MaskTune shifts the model's focus from spurious features (like hair color) to actual facial features.
  • Waterbirds: It improved the worst-group accuracy from 80.8% (ERM) to 86.4%, successfully shifting attention away from the background (water/land) to the bird itself.
  • Background Challenge: On the "Only-FG" (foreground only) test set, MaskTune outperformed the baseline by 2.5%, proving it relies less on background "nuisance" signals.
  • Selective Classification: In tasks where the model is allowed to "reject" difficult images, MaskTune consistently achieved lower error rates at various coverage levels compared to specialized architectures like SelectiveNet.

Limitations and Future Work

  • Masking Threshold Sensitivity: The effectiveness of the method depends on the threshold used for masking. If the mask is too small, the model stays lazy; if it's too large, it destroys the signal entirely.
  • Image-Centric: Currently, the method relies on visual explainability tools (GradCAM). Adapting this to non-image data (like text or tabular data) remains an area for future exploration.
  • Subtle Transformations: MaskTune might struggle with "imperceptible" biases, such as subtle color shifts or sensor noise common in medical imaging, which GradCAM might not easily localize.

Summary updated

BibTeX
@inproceedings{asgari2022masktune,
  author = {Saeid Asgari and Aliasghar Khani and Fereshte Khani and Ali Gholami and Linh Tran and Ali Mahdavi-Amiri and Ghassan Hamarneh},
  title = {{MaskTune: Mitigating Spurious Correlations by Forcing to Explore}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=hMGSz9PNQes},
}
Figure