Gradient Extrapolation for Debiased Representation Learning

Ihab Asaad, Maha Shadaydeh, Joachim Denzler

TL;DR

This paper introduces GERNE, a novel method for training machine learning models that are less susceptible to spurious correlations in data. By extrapolating gradients from batches with varying levels of these correlations, GERNE effectively guides models towards learning more robust and generalizable representations, outperforming existing methods on several benchmarks.

What Problem Does This Paper Address?

Deep learning models have achieved remarkable success, but they often learn to rely on "spurious correlations" – unintended associations between non-target attributes and target labels. For instance, a model trained to identify birds might learn to associate waterbirds with water backgrounds and landbirds with land backgrounds. While these correlations can be predictive in the training data, they lead to poor generalization when absent in new, unseen data. This is a critical issue in various fields like medical imaging and finance, where robust and reliable predictions are paramount. Existing methods often struggle to fully mitigate this problem, especially when attribute information is limited or unavailable.

Methods

The core innovation of GERNE is its approach to model optimization. Instead of relying on a single loss function, GERNE samples two types of batches: a "biased batch" (Bb) that reflects the spurious correlations present in the dataset, and a "less biased batch" (Blb) with a more balanced distribution of attributes. The key idea is that the difference between the gradients computed on these two batches captures a "debiasing direction." GERNE then defines a target gradient as a linear extrapolation of these two gradients, pushing the model towards the direction indicated by the less biased batch.

This extrapolation is controlled by a hyperparameter, $\beta$, which can be tuned. The paper also derives theoretical bounds for $\beta$ and shows how it can be used to optimize for either Group-Balanced Accuracy (GBA) or Worst-Group Accuracy (WGA). For scenarios where attribute information is unknown during training, GERNE proposes a method to generate "pseudo-attributes" based on the model's own predictions, allowing the same extrapolation principle to be applied.

Datasets

The paper evaluates GERNE on a variety of datasets:

  • Datasets-1 (Known Attributes):
    • Colored MNIST (C-MNIST)
    • Corrupted CIFAR-10 (C-CIFAR-10)
    • Biased FFHQ (bFFHQ)
  • Datasets-2 (Known and Unknown Attributes):
    • Waterbirds
    • CelebA
    • CivilComments

These datasets are designed to exhibit spurious correlations between target classes and various attributes (e.g., background color for birds, texture for objects, age/gender for faces).

Key Insights and Ideas

  • Gradient Extrapolation as a Debiasing Mechanism: The central insight is that by linearly combining gradients from batches with different correlation strengths, we can create a new gradient that actively steers the model away from spurious correlations.
  • Tunable Extrapolation for Different Goals: The hyperparameter $\beta$ offers flexibility, allowing the model to be optimized for different fairness metrics (GBA vs. WGA), which is a significant advantage over methods with fixed objectives.
  • General Framework: GERNE is presented as a general framework that can encompass existing methods like ERM and Resampling as special cases, highlighting its broad applicability.
  • Handling Unknown Attributes: The proposed method for generating pseudo-attributes is a clever way to extend the debiasing approach to settings where explicit attribute labels are not available during training.

Key Results

GERNE demonstrated competitive and often superior performance across all tested benchmarks, for both known and unknown attribute scenarios.

  • On C-MNIST and C-CIFAR-10, GERNE outperformed Group DRO by a significant margin (up to 16% on C-MNIST).
  • On bFFHQ, GERNE outperformed Resampling by over 13%.
  • For Datasets-2, GERNE achieved the highest accuracy on CelebA and CivilComments (known attributes) and ranked second on Waterbirds.
  • In the unknown attribute case, GERNE again achieved the best results on Waterbirds and CivilComments, and remained competitive on CelebA.
  • The paper also showed that GERNE can achieve high accuracy even with a very limited number of minority samples when attributes are unknown.

Limitations and Future Work

  • Attribute Selection for Unknown Case: The method for generating pseudo-attributes relies on a threshold parameter ($t$), and its selection can influence performance. The paper suggests that identifying minority samples with high precision and recall is crucial for optimal results.
  • Validation Set Role: The paper notes that the role of the validation set is critical for model selection, especially in the unknown attribute case. A group-balanced validation set is beneficial for GERNE.
  • Future Work: The authors suggest exploring dynamic adaptation of the extrapolation factor $\beta$ and refining attribute estimation for the unknown attributes case. They also mention that future work will explore extending GERNE to unbiased datasets.

Summary updated

BibTeX
@inproceedings{asaad2025gradient,
  author = {Ihab Asaad and Maha Shadaydeh and Joachim Denzler},
  title = {{Gradient Extrapolation for Debiased Representation Learning}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure