Correct-n-Contrast: A Contrastive Approach for Improving Robustness to Spurious Correlations
Michael Zhang†, Nimit S. Sohoni†, Hongyang R. Zhang‡, Chelsea Finn†、Christopher Ré† †Stanford University, ‡Northeastern University Corresponding author
Abstract
Spurious correlations pose a major challenge for robust machine learning. Models trained with empirical risk minimization (ERM) may learn to rely on correlations between class labels and spurious attributes, leading to poor performance on data groups without these correlations. This is particularly challenging to address when spurious attribute labels are unavailable. To improve worst-group performance on spuriously correlated data without training attribute labels, we propose Correct-n-Contrast (CnC), a contrastive approach to directly learn representations robust to spurious correlations. As ERM models can be good spurious attribute predictors, CnC works by (1) using a trained ERM model’s outputs to identify samples with the same class but dissimilar spurious features, and (2) training a robust model with contrastive learning to learn similar representations for same-class samples. To support CnC, we introduce new connections between worst-group error and a representation alignment loss that CnC aims to minimize. We empirically observe that worst-group error closely tracks with alignment loss, and prove that the alignment loss over a class helps upper-bound the class’s worst-grou
中文速览
模型在训练时容易被数据中"虚假相关性"(spurious correlation)带偏——比如靠背景颜色而非真正的物体特征来做分类,导致在少数群体上表现很差。作者提出了一种叫 Correct-n-Contrast(CnC)的两阶段方法:先用一个普通的经验风险最小化(ERM)模型来推断哪些样本可能依赖了虚假特征,再利用对比学习(contrastive learning)把"同类但虚假属性不同"的样本表示拉近、把"不同类但虚假属性相同"的样本推开,从而让模型学到真正依赖类别而非虚假属性的特征表示。理论上作者证明了"对齐损失"(alignment loss)的降低可以有效收紧最差群体误差与平均误差之间的差距,实验上 CnC 在多个基准上比此前不需要属性标注的方法平均提升了 3.6 个百分点的最差群体准确率,甚至接近需要人工标注群体标签的方法。这项工作为在无标注场景下系统性地解决虚假相关性问题提供了既有理论支撑又实用的新思路。
原文 arXiv:2203.01517;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2203.01517v2