Calibrating Multi-modal Representations: A Pursuit of Group Robustness without Annotations

Chenyu You, Yifei Min, Weicheng Dai, Jasjeet S. Sekhon, Lawrence Staib, James S. Duncan

TL;DR

Researchers at Yale University have developed Contrastive Feature Recalibration (CFR), a lightweight method to fix "spurious correlations" in vision-language models like CLIP without needing expensive manual group labels. By identifying and recalibrating misclassified samples using a novel contrastive learning strategy, CFR significantly boosts robustness for minority groups, often rivaling methods that have access to full group annotations.

What Problem Does This Paper Address?

Large-scale vision-language models (VLMs) like CLIP are powerful, but they have a "shortcut" problem. They often learn spurious correlations—patterns that appear in the training data but aren't actually relevant to the task. For example, if most "waterbird" images in a dataset have a water background, a model might learn to look for water rather than the bird itself. This leads to poor performance on minority groups, like a "waterbird on land."

Fixing this usually requires group annotations (e.g., labeling every image with both the bird type and the background type), which is incredibly expensive and often impossible for real-world datasets. Furthermore, fine-tuning these massive models is computationally heavy. This paper seeks a way to improve "group robustness" (performance on the hardest subgroups) that is both parameter-efficient and requires zero group labels.

Methods

The authors propose a two-step framework called Contrastive Feature Recalibration (CFR):

  1. Calibration Set Formation: Instead of retraining the whole model, they only train CLIP's final projection head using standard Empirical Risk Minimization (ERM). They then identify samples that this ERM-tuned model gets wrong. These misclassified samples are likely the "hard" cases where spurious correlations failed, forming a natural calibration set.
  2. Contrastive Feature Recalibration: They refine the representations of these "hard" samples using a contrastive loss.
  3. Dynamic Positive Centroid Sampling (DPS): They pull the feature of a "hard" sample toward the "optimal" center (centroid) of its true class. Since the true center is unknown, they estimate it using an Exponential Moving Average (EMA) of features from samples the model correctly identified.
  4. Negative Sampling: They push the feature away from opposing class centroids using either Random Negative Sampling (RNS) or Nearest-neighbour Negative Sampling (NNS).
  5. Holistic Data Integration: To prevent the model from overfitting only to the hard samples, they combine this calibration loss with a global cosine similarity loss applied to the entire training set.

Crucially, only the final projection layer is updated, making the process extremely fast and memory-efficient.

Datasets

The method was evaluated on five diverse benchmarks known for spurious correlations:

  • Waterbirds: Classifying birds where backgrounds (land vs. water) are misleading.
  • CelebA: Identifying hair color (blond vs. non-blond) where gender is a spurious attribute.
  • CheXpert: A medical imaging dataset (chest X-rays) where race and gender can act as spurious cues.
  • MetaShift: A dataset derived from Visual Genome focusing on cat vs. dog classification with indoor/outdoor background biases.
  • Colored-MNIST: A synthetic benchmark where digit color is spuriously correlated with the label.

Key Insights and Ideas

  • CLIP is biased out-of-the-box: The authors used GradCAM to show that as you go deeper into CLIP’s layers, the model’s attention actually shifts away from the object of interest and toward the background.
GradCAM analysis showing CLIP focusing on backgrounds in deeper layers.
  • Last-Layer Retraining is a "Free Lunch": Simply freezing the backbone and retraining only the final layer can significantly improve robustness, confirming that the "good" features are often already there, just poorly weighted.
  • ViT vs. ResNet: Vision Transformers (ViT) appear inherently more robust to spurious correlations than ResNet backbones when used within the CLIP framework.
  • Better Class Separation: Visualizations show that while standard ERM training keeps groups clumped by their spurious features (like background), CFR successfully pulls minority groups toward their correct class clusters.
Figure 1. t-SNE and UMAP visualizations for pre-trained CLIP, ERM-tuned CLIP, and CFR (ours) on Waterbirds. We observe that both the pre-trained and ERM-tuned CLIP exhibit noticeable spurious correlations, with feature separations inappropriately aligned with spurious attributes, specifically the background, rather than the target class. In contrast, our method, as visualized through t-SNE and UMAP, demonstrates a significantly improved class separations, underscoring the robustness of our method in reducing spurious correlations.

Key Results

CFR consistently outperformed other "annotation-free" (semi-supervised) methods across all benchmarks. The primary metric used was Worst-Group Accuracy (WGA)—the accuracy on the single most difficult subgroup.

  • Significant Gains: On the Waterbirds dataset using a ResNet-50 backbone, CFR achieved a WGA of 76.93%, a massive jump over standard ERM (45.64%) and significantly better than other semi-supervised baselines like JTT (61.68%).
  • Rivaling Supervised Methods: In many cases, CFR's performance (which uses no group labels) approached or even matched supervised methods like GroupDRO that require full group annotations.
  • Efficiency: Because it only tunes the projection head, CFR converges much faster than methods that require full-model fine-tuning.
Figure 3. Comparison of methods using the CLIP-ResNet50 architecture on four benchmark datasets. We use Worst Group Accuracy to evaluate the performance for various methods, including ERM, semi-supervised baselines (i.e., AFR [47], CnC [73], JTT [33]), and our proposed methods. We observe that CFR combined with the sample selection strategies (i.e., {DPS, RPS}×{RNS,NNS}) outperforms all semi-supervised baselines across all benchmarks.

Limitations and Future Work

  • Backbone Gap: While CFR works well, there is still a performance gap between ResNet and ViT backbones, suggesting that some architectures are fundamentally more prone to capturing spurious features.
  • Hyperparameter Sensitivity: The Nearest-neighbour Negative Sampling (NNS) strategy is sensitive to the choice of $k$ (number of neighbors) and batch size, which might require careful tuning in new domains.
  • Future Directions: The authors suggest exploring more sophisticated ways to estimate class centroids and investigating if these calibration techniques can be applied to even larger generative multi-modal models.

Summary updated

Abstract

Fine-tuning pre-trained vision-language models, like CLIP, has yielded success on diverse downstream tasks. However, several pain points persist for this paradigm: (i) directly tuning entire pre-trained models becomes both time-intensive and computationally costly. Additionally, these tuned models tend to become highly specialized, limiting their practicality for real-world deployment; (ii) recent studies indicate that pre-trained vision-language classifiers may overly depend on spurious features -- patterns that correlate with the target in training data, but are not related to the true labeling function; and (iii) existing studies on mitigating the reliance on spurious features, largely based on the assumption that we can identify such features, does not provide definitive assurance for real-world applications. As a piloting study, this work focuses on exploring mitigating the reliance on spurious features for CLIP without using any group annotation. To this end, we systematically study the existence of spurious correlation on CLIP and CLIP+ERM. We first, following recent work on Deep Feature Reweighting (DFR), verify that last-layer retraining can greatly improve group robustness on pretrained CLIP. In view of them, we advocate a lightweight representation calibration method for fine-tuning CLIP, by first generating a calibration set using the pretrained CLIP, and then calibrating representations of samples within this set through contrastive learning, all without the need for group labels. Extensive experiments and in-depth visualizations on several benchmarks validate the effectiveness of our proposals, largely reducing reliance and significantly boosting the model generalization.
BibTeX
@inproceedings{you2024calibrating,
  author = {Chenyu You and Yifei Min and Weicheng Dai and Jasjeet S. Sekhon and Lawrence Staib and James S. Duncan},
  title = {{Calibrating Multi-modal Representations: A Pursuit of Group Robustness without Annotations}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
}
Figure