NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Avoiding spurious correlations via logit correction

Sheng Liu, Xu Zhang, Nitesh Sekhar, Yue Wu, Prateek Singhal, Carlos Fernandez-Granda

TL;DR

Standard machine learning models often take the "path of least resistance," relying on easy-to-learn spurious correlations (like image backgrounds) rather than core features. This paper introduces Logit Correction (LC), a simple loss function modification that mathematically balances the importance of majority and minority data groups to ensure models remain robust even when they lack explicit labels for those spurious attributes.

What Problem Does This Paper Address?

Deep learning models trained with Empirical Risk Minimization (ERM) are notoriously "lazy." If a specific background or texture is highly correlated with a label in the training set (e.g., 99% of "waterbird" photos have a water background), the model will likely learn to identify the water rather than the bird.

This creates a spurious correlation. While the model achieves high average accuracy, it fails miserably on "minority groups"—the rare cases where the correlation doesn't hold (e.g., a waterbird on land). Existing solutions often require "oracle" knowledge—manual labels identifying which samples belong to which group—which is expensive and often impossible to obtain in the real world. The authors aim to fix this "group-balanced accuracy" without needing those extra labels.

Methods

The authors propose a two-pronged approach to tackle this issue:

Two-branch architecture for Logit Correction
  1. Logit Correction (LC) Loss: The core innovation is a modification of the standard softmax cross-entropy loss. They use a two-branch network architecture. The first branch is a "biased" ERM model trained to intentionally overfit to spurious correlations. The second "robust" branch uses the outputs of the biased model to estimate group priors. It then "corrects" its own logits by subtracting the logarithm of these priors.
  2. Why it works: Mathematically, this ensures the loss is "Fisher consistent" with Group-Balanced Accuracy (GBA). It effectively forces the model to maintain a larger classification margin for minority groups, mitigating both statistical skew (slow convergence on hard samples) and geometric skew (unequal margins).
  3. Group MixUp: To further help the model generalize, the authors introduce a variation of the MixUp augmentation technique. When the model identifies a minority sample, it creates a synthetic training example by linearly combining it with a majority sample of the same class. This increases the diversity of the minority group, helping the model learn the "core" features that define the class regardless of the background.

Datasets

The researchers evaluated their method on five diverse benchmarks:

  • C-MNIST (Colored MNIST): A synthetic dataset where digit colors are spuriously correlated with the digit labels.
  • Corrupted CIFAR-10: Images corrupted with specific textures that act as spurious cues.
  • Waterbirds: A popular benchmark where birds (waterbirds vs. landbirds) are placed on matching or mismatching backgrounds (water vs. land).
  • CelebA: A real-world face dataset where "blond hair" is spuriously correlated with gender.
  • Biased FFHQ (bFFHQ): A face dataset where age and gender are spuriously linked.

Key Insights and Ideas

  • ERM as a Spurious Feature Detector: Instead of trying to prevent the ERM model from being biased, the authors lean into it. By training a branch to be intentionally biased, they can use its failures and successes as a signal to identify which samples belong to the "minority" groups.
  • Fisher Consistency: The paper provides a theoretical grounding, proving that minimizing the LC loss is equivalent to maximizing group-balanced accuracy. This moves the field away from heuristic "upweighting" of samples toward a more principled optimization objective.
  • Margin Balancing: The LC loss naturally creates larger margins for minority samples. In simple terms, it makes the "penalty" for getting a rare case wrong much higher than getting a common case wrong, preventing the majority group from dominating the model's internal logic.

Key Results

The proposed LC method significantly outperformed existing state-of-the-art (SOTA) methods that do not use group labels:

  • Massive Gains on Rare Data: On C-MNIST and Corrupted CIFAR-10, when the minority group represented only 0.5% of the data, LC improved accuracy by 6.03% and 4.61% respectively over previous SOTA methods.
  • Competitive with Oracles: Remarkably, LC (which doesn't use group labels) performed nearly as well as—and sometimes better than—"oracle" methods like Group-DRO that have full access to spurious attribute labels during training.
  • Real-World Performance: On the Waterbirds dataset, LC achieved a worst-group accuracy of 90.5%, a significant jump from the standard ERM's 62.9%.

Limitations and Future Work

While LC is highly effective, the authors note that its performance depends on the "biased" branch successfully capturing the spurious correlation. If the spurious feature is extremely complex or subtle, the initial detection might fail.

Types of spurious correlations between labels and attributes

Additionally, the current implementation assumes a certain relationship between labels and attributes (like one-to-one or many-to-one). While the authors showed LC is robust to different types of correlations, future work could involve more automated ways to detect the structure of the spurious correlation without any prior assumptions.

Summary updated

BibTeX
@inproceedings{liu2023avoiding,
  author = {Sheng Liu and Xu Zhang and Nitesh Sekhar and Yue Wu and Prateek Singhal and Carlos Fernandez-Granda},
  title = {{Avoiding spurious correlations via logit correction}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=5BaqCFVh5qL},
}
Figure