Machine learning models often suffer from "shortcut learning," where they rely on co-occurring but irrelevant features to make predictions—a phenomenon known as spurious correlation. For instance, a model might identify a "waterbird" based on a water background rather than the bird's actual features, causing it to fail when the bird appears on land.
While this is a well-documented issue in computer vision, addressing it in massive multi-modal models like CLIP is computationally prohibitive if approached via full retraining. Furthermore, spurious correlations are often domain-specific and difficult to anticipate during general pre-training. This paper introduces a computationally efficient, two-stage pipeline to detect and mitigate these shortcuts during the fine-tuning phase, ensuring models are "right for the right reasons."
Methodology: Detection and Mitigation
The authors propose a lightweight pipeline that leverages the multi-modal nature of foundation models to identify and correct biases.
Stage 1: Detection
To uncover unknown spurious correlations, the researchers utilize an open-vocabulary detector (OWL-ViT) to identify objects within a dataset. They then calculate an accuracy discrepancy score: if the model's accuracy for a target class (e.g., "baby pacifier") drops significantly when a specific attribute (e.g., "baby") is absent, that attribute is flagged as a potential spurious correlation.
Stage 2: Mitigation
Once identified, the spurious attribute is addressed using a specialized multi-modal contrastive loss function. Rather than simply associating an image with a label, this loss function introduces two key constraints:
- Decorrelate in Language: It explicitly pushes the language representation of the class name away from the representation of the spurious attribute.
- Set Apart in Vision: It forces image embeddings of the same class with different backgrounds (e.g., a bird on water vs. a bird on land) to cluster together, while pushing away embeddings of the spurious attribute itself.
Crucially, this mitigation strategy only fine-tunes the model's projection layers, leaving the massive vision and language encoders frozen. This makes the intervention highly efficient and accessible without requiring high-performance computing resources.
Key Insights
- Language as a Debugger: Because CLIP inherently understands language, text can be used to "tell" the model what to ignore. Expressing spurious relationships through language guides the model's visual attention without requiring pixel-level masks for training images.
- The AIoU Metric: Recognizing that raw accuracy does not indicate where a model is looking, the authors introduce the Adjusted Intersection-over-Union (AIoU) metric. AIoU quantifies how well a model's activation maps (e.g., GradCAM) align with the ground-truth object, penalizing the model for focusing on the background.
Experimental Results
The approach was evaluated on two primary benchmarks: Waterbirds (a classic dataset for spurious correlations) and ImageNet-1K.
- Waterbirds: On the "worst-group" (the most challenging examples, such as a waterbird on land), the proposed method achieved an accuracy 23% higher than standard Empirical Risk Minimization (ERM) using a ResNet-50 backbone, and 32% higher with a ViT backbone.
- ImageNet-1K (Baby Pacifier): The detection pipeline uncovered previously unknown spurious correlations, such as the "baby pacifier" class relying heavily on "baby faces." The mitigation strategy successfully shifted the model's focus to the pacifier itself, improving worst-case AIoU scores from 0.380 to 0.645.
- Stability: Unlike other robust optimization methods (e.g., Group DRO), this approach significantly improved worst-case performance while maintaining the exact same average accuracy as ERM.
Limitations and Future Work
The authors note a few challenging scenarios where the method struggles:
- Visual Commonality: When the spurious attribute and the target object share similar visual characteristics (e.g., a metal "can" and a metal "can opener"), decorrelation is much harder.
- High Concept Variation: If a class exhibits high visual variance and training data is limited, the model may struggle to isolate the true features.
- Scaling: Future research is needed to evaluate how this method scales when a single class contains multiple distinct spurious correlations that must be mitigated simultaneously.
Summary updated