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

Localized Shortcut Removal

Nicolas M. Müller, Jochen Jacobs, Jennifer Williams, Konstantin BöttingerWorkshops @ CVPR 2023 · DOI

Abstract

Machine learning models frequently exploit "shortcuts"—spatially localized, highly predictive, but semantically irrelevant features—leading to poor generalization in real-world scenarios. We present a "neural lens" architecture that acts as an adversarial pre-processor to identify and scrub these shortcuts from training data. By constraining the lens with a reproduction budget, we force the downstream classifier to ignore superficial artifacts and focus on robust semantic features. Our method demonstrates significant accuracy recovery on corrupted datasets and improves model interpretability in medical imaging tasks.

Introduction

Deep learning models are notorious for finding the "path of least resistance." When a dataset contains consistent artifacts—such as watermarks on stock photos or hospital-specific tags on medical X-rays—models often learn to detect these shortcuts rather than the actual objects of interest. While this leads to high performance on internal test sets, it causes catastrophic failure when deployed in environments where these artifacts are absent. This paper addresses localized shortcuts: small, spatially concentrated features that are highly predictive but semantically irrelevant.

The Lens Network Architecture

The authors propose a novel Lens Network that serves as a pre-processing stage for any standard classifier. The architecture consists of two primary components:

  1. Attention Network ($A$): A low-capacity U-Net designed to localize the shortcut within the input image.
  2. Replacement Network ($R$): A higher-capacity U-Net that generates "in-painted" content to replace the identified shortcut area.

The final output image $I'$ is a blend of the original image $I$ and the replacement $R$, governed by the attention map $A$: $$I' = A \cdot R + (1 - A) \cdot I$$

The Lens Network architecture utilizes adversarial training to identify and remove predictive shortcuts before classification.

Adversarial Training and the Reproduction Budget

The system is trained using an adversarial objective. The lens aims to minimize the classifier's accuracy by removing the most predictive features, while the classifier simultaneously tries to maximize its accuracy. To prevent the lens from erasing the entire image, a reproduction loss ($L_{repr}$) is introduced with a "hinge" hyperparameter ($\rho$). This budget limits the lens to modifying only a small fraction of the image (e.g., 2.5%), forcing it to surgically target only the most "unfair" predictive clues.

Experimental Evaluation

The methodology was tested across several datasets:

  • CIFAR10: Augmented with artificial "Color Dot" and "Location Dot" shortcuts.
  • ImageNet: A subset (Goose vs. Pelican) modified with textual watermarks and logos.
  • COVID-QU-Ex: A real-world medical dataset containing chest X-rays with various hospital-specific markers and textual annotations.

Results and Discussion

The Lens Network effectively "un-teaches" the model's reliance on shortcuts. On the CIFAR10 "Color Dot" task, a standard model's accuracy on clean data plummeted to 28.5% due to shortcut reliance; the Lens Network restored this to 70.5%.

In real-world medical imaging, the impact is visible through interpretability tools. GradCAM visualizations of standard models often show intense focus on corner text and markers. With the Lens Network, the model's attention shifts back to the lungs, indicating it is learning relevant pathology.

GradCAM visualizations show that the Lens Network shifts the classifier's focus from corner artifacts to the lungs.

A key finding is the importance of the budget parameter $\rho$. If $\rho$ is set too high, the lens may erase semantic features; if too low, it fails to cover the shortcut. Optimal performance is typically achieved when $\rho$ matches the expected spatial extent of the shortcuts.

Conclusion

The Lens Network provides a robust safeguard against localized shortcuts without requiring manual annotation of artifacts. While highly effective for spatially concentrated features, future work is needed to address global or diffuse shortcuts, such as lighting or background bias, which exceed the current localized budget constraints.

Summary updated

BibTeX
@inproceedings{muller2023localized,
  author = {Nicolas M. Müller and Jochen Jacobs and Jennifer Williams and Konstantin Böttinger},
  title = {{Localized Shortcut Removal}},
  booktitle = {Workshops @ CVPR},
  year = {2023},
  doi = {10.1109/cvprw59228.2023.00382},
}
Figure