S PREAD S PURIOUS A TTRIBUTE : I MPROVING W ORST - GROUP A CCURACY WITH S PURIOUS A TTRIBUTE E STIMATION
A BSTRACT
The paradigm of worst-group loss minimization has shown its promise in avoiding to learn spurious correlations, but requires costly additional supervision on spurious attributes.
To resolve this, recent works focus on developing weaker forms of supervision—e.g., hyperparameters discovered with a small number of group-labeled samples with spurious attribute annotation—but none of the methods retain comparable performance to methods using full supervision on the spurious attribute.
In this paper, instead of searching for weaker supervisions, we ask: Given access to a ﬁxed number of group-labeled samples, what is the best achievable worst-group loss if we “fully exploit” them?
To this end, we propose a pseudo-attribute-based algorithm, coined Spread Spurious Attribute (SSA), for improving the worst-group accuracy.
In particular, we leverage samples both with and without spurious attribute annotations to train a model predicting the spurious attribute, then use the pseudo-attribute predicted by the trained model as a supervision on the spurious attribute to train a new robust model having minimal worst-group loss.
Our experiments on various benchmark datasets show that our algorithm consistently outperforms the baseline methods using the same number of group-labeled samples.
We also demonstrate that the proposed SSA can achieve comparable performances to methods using full (100%) spurious attribute supervision, by using a much smaller number of group-labeled samples—from 0.6% and up to 1.5%, depending on the dataset.
I NTRODUCTION
Machine learning models trained on datasets containing spurious correlation (also known as “shortcuts”) often end up learning such shortcuts instead of intended solutions (Geirhos et al., 2020).
For example, consider an image classiﬁcation dataset of ‘cows’ and ‘camels,’ in which most images of cows appear on grasslands and camels on deserts.
When trained on such a dataset, models often learn to make predictions based on the landscape instead of the object (Beery et al., 2018).
This phenomenon can lead to very low test accuracies on groups underrepresented in the training set.
Various approaches have been proposed to resolve this gap, and the idea of minimizing the worstgroup loss —e.g., Sagawa et al.
(2020)—has arisen as one of the most promising solutions.
This approach forces high performances on both the majority group (e.g., cows standing on grasslands) and the minority group which contradicts the spurious correlation (e.g., cows standing on deserts).
Despite its effectiveness, the worst-group loss minimization approach has a drawback: The learner requires supervision on which group each training sample belongs.
For example, the learner needs to know that sample belongs to both the ‘cow’ and the ‘desert’ categories to utilize such group information to perform worst-group loss minimization.
Even if we put aside the issue of identifying the spuriously correlated attributes (‘desert’ and ‘grass’) in the ﬁrst place, one still needs to collect additional annotation on such spurious attributes.
Acquiring such ﬁne-grained annotation is presumably more expensive to collect, as the annotator needs a clear understanding of both the target attribute (‘cow’ and ‘camel’) and the spurious attribute (‘desert’ and ‘grass’).
Acknowledging this difﬁculty, recent works propose worst-group loss minimization algorithms that require a smaller number of group-labeled training samples (i.e., training samples with spurious attribute annotations)
(Nam et al., 2020; Liu et al., 2021).
At a high level, these works share a similar strategy (Fig. 1, Left): The methods ﬁrst use a specialized mechanism to identify minority group samples among group-unlabeled training samples, and train a model in a way that puts more emphasis on identiﬁed-as-minority samples, e.g., by upweighting.
A small set of group-labeled samples are used to tune hyperparameters of this procedure; as Liu et al.
(2021) shows, the performance of trained models are very sensitive to these hyperparameters, indicating the high dependency of such algorithms on the availability of the group-labeled samples.
Although these methods achieve higher worst-group accuracy than completely annotation-free approaches, e.g., Sohoni et al.
(2020), they fail to perform comparably to the algorithms which use full annotations on spurious attributes, e.g.,
Sagawa et al.
This performance gap gives rise to the following question: Can we closely achieve the full-annotation performance using a partially annotated dataset, if we use group-labeled samples more actively than hyperparameter-tuning?
Contribution.
This paper proposes a worst-group loss minimization algorithm, coined Spread Spurious Attribute (SSA).
At a high level, SSA consists of two phases— pseudo-labeling and robust training —that are designed to make a full use out of the group-labeled samples (Fig. 1, Right):
• Pseudo-labeling: SSA trains a spurious attribute predictor, using both group-labeled and groupunlabeled samples (i
e., samples lacking spurious attribute annotations)
We ﬁnd
that group imbalances underlying the dataset can render pseudo-labels to be biased towards the majority group, which can be detrimental to the performance (as in Kim et al.
and propose using groupwise adaptive thresholds to mitigate this problem.
The predictions are used as pseudo-labels (Lee, 2013) on the group-unlabeled samples.
• Robust training: Based on the pseudo-labeled training set, SSA trains a model which predicts the target attribute, using the worst-group loss minimization algorithms developed for fully supervised cases.
We use Group DRO (Sagawa et al., 2020) as a default choice, and re-use group-labeled samples for the hyperparameter tuning.
Our experimental results suggest that SSA is a general yet effective framework for worst-group loss minimization.
On various benchmark datasets, SSA consistently achieves performances comparable to fully supervised Group DRO and outperforms other baseline methods even when using only 5% of the group-labeled samples compared to the baselines.
To be more speciﬁc, SSA requires less than 1.5% (as little as 0.6%) of group-labeled samples—993 out of 182637 on CelebA, and 4123 out of 288637 on MultiNLI—to achieve a worst-group accuracy similar to that of 100% usage.
Moreover, we ﬁnd that such beneﬁts of SSA persist when combined with other robust training methods, such as
Correct-N-Contrast (CNC 1 ; Zhang et al.
the supervised contrastive learning with contrastive batch sampling using group information.
Finally, we also empirically observe that the group-wise adaptive thresholding technique—which we proposed for better pseudo-labeling—enjoy a broader usage for addressing the general problem of semi-supervised learning under class imbalance; existing pseudo-labeling techniques (Kim et al., 2020; Wei et al., 2021) require certain assumptions in datasets to work well for the task, while ours does not.
R ELATED W ORKS
Improving worst-group accuracy with group annotations.
It has been known in various literature that machine learning models often perform signiﬁcantly worse on the samples from groups with a relatively small number of training samples than on samples from the majority group.
The class imbalance problem (Japkowicz, 2000; Johnson & Khoshgoftaar, 2019) is one of the representative cases of this phenomenon.
Here, class labels naturally deﬁne group identities and thus do not require any additional group annotations.
In this context, popular strategies to improve worst-group performances are using re-weighted loss for each group (Huang et al., 2016; Khan et al., 2017) and re-sampling the given dataset to balance the group distribution of the training dataset (Chawla et al., 2002; He & Garcia, 2009).
This paper, in contrast, considers a setup where the group is deﬁned as a combination of the label (target attribute) and the spuriously correlated attribute; unlike the class imbalance literature, the availability of the full group identity information is not guaranteed, as spurious attributes may not have proper annotations.
Under the setting where spurious attribute annotations are available on all samples, Sagawa et al.
(2020) gives an online optimization algorithm that shows promising results on minimizing the worst-group loss.
Improving worst-group accuracy without group annotations.
To reduce additional annotation costs, recent works aim to train a robust model without requiring group annotations for all training samples.
These works utilize models trained with standard procedure to identify samples that disagree with spurious correlations.
Nam et al.
(2020) train a model to be intentionally biased using the generalized cross entropy loss, and use it to identify-and-upweight high-loss samples for training another model.
Liu et al.
(2021) train a standard ERM model for a few epochs and upweight samples misclassiﬁed by this model to train the second model.
Although these approaches do not use any group information for training, they still use a small number of group-labeled samples for hyperparameter tuning, which is critical to their worst-group performance.
In this paper, we design a method to utilize group-labeled samples more efﬁciently.
We note that, in the class imbalance literature, another line of works proposes to use group-labeled samples more actively; they use labeled samples for determining sample weights for the training set through meta-learning (Ren et al., 2018) or training a model to predict sample weights (Shu et al., 2019).
P ROBLEM SETUP
Consider the learning a classiﬁer in the presence of spurious correlations in the training set.
Following the prior work of Sagawa et al.
(2020), we cast this problem as minimizing the worst-group loss, where the group identity is determined by the target attribute (that we want to predict) and the spurious attribute (that we want to ignore).
We assume that we do not have spurious attribute annotations of the samples in the training set ( group-unlabeled set ), but have an access to additional set of samples with both spurioust attribute and target attribute annotations ( group-labeled set ).
More formally, we let each sample be a triplet consisting of an input x ∈ X , a target attribute y ∈ Y , and a spurious attribute a ∈ A .
Our goal is to train a parameterized model f θ : X → Y that minimizes the worst-group expected loss on test samples; for the purpose of avoiding learning spurious correlations, we deﬁne the group as an attribute pair g :=
( y, a ) ∈
Y ×
A =: G .
In other words, we aim to minimize
[Equation]
for some loss function (cid:96) :
Y × Y → R , where P g denotes the group-conditioned data-generating distribution.
Note that, as we focus on the group deﬁned by the attribute pairs, P g is deterministic on y and a , and stochastic only on x .
We assume that the learner has access to two types of samples for training: The group-unlabeled set consists of n samples without spurious attribute annotations, i.e., D U :=
{ ( x 1 , y 1 ) , . .
, ( x n , y n ) } , and the group-labeled set consists of m samples with spurious attribute annotations, i.e., D L := { (˜ x 1 , ˜ y 1 , ˜ a 1 ) , . . .
, (˜ x m , ˜ y m , ˜ a m ) } .
We assume that the group-labeled samples are much more costly to collect, and thus we have n (cid:29) m .
S PREAD S PURIOUS A TTRIBUTE
We now describe the algorithm we propose, Spread Spurious Attribute (SSA).
At a high level, SSA consists of two phases: pseudo-labeling and robust training .
In the pseudo-labeling phase, SSA trains a model to predict the spurious attribute.
In particular, we use both group-labeled and groupunlabeled samples to generate pseudo-labels on the group-unlabeled training samples (Section 4.1), with an adaptive thresholding technique for balancing the number of samples in each group (Section 4.2).
Then, in the robust training phase, SSA uses generated pseudo-labels to train a model that predicts the target attribute with a small worst-group loss (Section 4.3).
We use Group DRO (Sagawa et al., 2020) as our default robust training method, but SSA also performs well when combined with other existing algorithms that use full spurious label supervisions (see Section 5.3).
4. P SEUDO - LABELING USING GROUP - LABELED AND GROUP - UNLABELED SAMPLES
Using both group-labeled set D L and group-unlabeled set D U , we train a model to predict spurious attributes on the group-unlabeled samples.
The predictions will be used to generate artiﬁcial spurious attribute labels on the group-unlabeled training samples, called pseudo-labels (Lee, 2013).
We emphasize that we also use D U for training the model, instead of training solely based on D L .
In fact, as we shall see in Section 5.2, the additional use of training set brings a signiﬁcant performance boost.
More speciﬁcally, we ﬁrst partition both the group-labeled and group-unlabeled set into two:
[Equation]
We use D ◦ L , D ◦ U to train the spurious attribute predictor that make prediction on D • U , and validate the model with D • L .
To train this predictor, we use a loss function consisting of two terms: the supervised loss for the samples in D ◦ L , and the unsupervised loss for samples in D ◦ U .
The supervised loss is simply the standard cross entropy loss.
For the unsupervised loss, we use the cross entropy loss between the prediction and the pseudo-labels , i.e., labels generated by taking the arg max of predictions.
Following prior works (e.g., Sohn et al.
, we apply the loss only if the conﬁdence of the prediction exceeds some threshold τ ≥ 0 .
More formally, let us denote the class probability estimate of the predictor on the attribute
a given the input x as ˆ p ( a | x ) , and the pseudo-label from this prediction as ˆ a ( x ) = arg
[Equation] a ∈A ˆ p ( a | x ) .
Then, the supervised and unsupervised losses are
[Equation]
where CE (ˆ p ( ·| x ) , a ) denotes the cross-entropy loss between the prediction
ˆ p ( ·| x ) and label a .
The total loss is then given as the sum of the supervised and unsupervised loss
[Equation]
As we will describe in Section 4.2, we additionally use group-wise adaptive thresholds for pseudolabeling (i.e., set different τ for each group).
The thresholds are determined in a way that balances the pseudo-group (i.e., the pair ˆ g
=
( y, ˆ a ( x )) )
population of the samples with conﬁdence exceeding the group-wise threshold.
This strategy helps the model to avoid making a pseudo-label prediction biased toward the majority group.
Also, we note that we make predictions only on samples in D • U and not on samples in D ◦ U ; empirically, we observe that this “splitting” of group-unlabeled samples is beneﬁcial for performance comparing to using the whole D U for training (at the cost of running pseudo-labeling multiple times).
For more discussions and ablation studies, see Appendix A.2.
4. B ALANCING GENERATED PSEUDO - LABELS VIA ADAPTIVE THRESHOLDS
As we train the spurious attribute predictor with the loss (Eq.
(4)), the prediction conﬁdence of the model on each sample gradually increases.
Ideally, we want the number of highly-conﬁdent samples (i.e., with conﬁdence greater than τ ) to increase uniformly over all pseudo-groups so that each pseudo-group contributes evenly to weight updates.
However, if the underlying group population is severely imbalanced—as is common with spurious attributes—samples from the majority group often attains high prediction conﬁdence signiﬁcantly faster than samples from minority groups, by receiving more frequent gradient updates.
This training imbalance leads to a severer imbalance in the pseudo-labels, resulting in detrimental effects on the downstream training.
To mitigate this majority group bias, we set different thresholds for each pseudo-group, so that the same number of samples from each group is used for training with Eq.
To do this, we ﬁrst set a ﬁxed threshold τ g min for the group with the smallest population in the training split of the group-labeled set, i.e., the group deﬁned as
[Equation]
Next, we count the number of samples in D ◦ U which (a) belongs to g min after pseudo-labeling, and (b) the prediction conﬁdence exceeds τ g min .
Then, we set thresholds for other groups to have same number of samples from each group.
Concretely, let D ◦ U
( g, τ g ) be the set of samples in the training split of the group-unlabeled set with pseudo-group g and conﬁdence greater than equal to τ g , i.e.,
D ◦ U
[Equation]
Then, for each group g (cid:54) =
g min , we set τ g to be the smallest real number such that
[Equation]
With this group-wise adaptive threshold, we use the unsupervised loss revised as
[Equation]
We show the effectiveness of this group-wise adaptive threshold in Section 5.2, and further applicability to class-imbalance problem in Section 5.4.
4. W ORST - GROUP LOSS MINIMIZATION WITH ESTIMATED PSEUDO - GROUPS
After training the model using the revised loss (Section 4.2), we generate ﬁnal pseudo-labels for all samples in the training set.
In other words, we generate
[Equation]
We put pseudo-labels on all samples without applying any threshold, which allows us to utilize the whole training set.
In the robust training phase, we use the pseudo-labeled dataset (cid:101) D U and the group-labeled dataset D L to perform worst-group loss minimization.
We use Group DRO (Sagawa et al., 2020) as our default algorithm, using (cid:101) D U for training and D L for validation.
We note that
SSA can also use other robust training subroutines instead of group DRO; in Section 5.3, we show that our framework performs well when combined with CNC (Zhang et al., 2021).
E XPERIMENTS
Here, we brieﬂy describe the experiment setup that will be used throughout all experiments in this section, except for Section 5.4 where we consider a slightly different scenario.
Datasets.
We evaluate SSA on two image classiﬁcation datasets (Waterbirds, CelebA) and two natural language processing datasets (MultiNLI, CivilComments-WILDS) containing spurious correlations.
For all datasets, we use the validation split of the dataset as the group-labeled set.
Below, we brieﬂy describe each dataset and the corresponding spurious correlations.
• Waterbirds (Sagawa et al., 2020): Waterbirds is an artiﬁcial dataset generated by combining bird photographs in the Caltech-UCSD Birds dataset
(Wah et al., 2011) with landscapes from Places (Zhou et al., 2017).
The goal is to classify the target attributes Y
=
{ waterbird, landbird } given the spurious correlations with the background landscape
A = { water background, land background } .
• CelebA
(Liu et al., 2015): CelebA dataset consists of the face pictures of celebrities, with various annotations on facial/demographic features.
We use the hair color as the target attribute Y =
{ blond, non-blond } , given the spurious correlations with the gender
A = { male, female } .
• MultiNLI
(Williams et al., 2018): MultiNLI is a multi-genre natural language corpus where each data instance consists of two sentences and a label indicating whether the second sentence is entailed by, contradicts, or neutral to the ﬁrst.
We use this label as the target attribute (i.e., Y = { entailed, neutral, contradictory } ), and use the existence of the negating words as the spurious attribute (i.e., A = { negation, no negation } ).
[Table] [Table]
• CivilComments-WILDS (Borkan et al., 2019; Koh et al., 2021): CivilComments-WILDS consists of comments generated by online users, each of which are labeled with the toxicity indicator Y = { toxic , non-toxic } .
We use demographic attributes of the mentioned identity
A = { male, female, White, Black, LGBTQ, Muslim, Christian, other religion } as a spurious attribute for evaluation purpose.
We note that a comment can contain multiple such identities, so that groups deﬁned by
Y ×
A can be
overlapped.
Therefore, we use A (cid:48)
= { any identity, no identity } as a spurious attribute for training, following Liu et al. (2021).
Models.
For the all experiments on image classiﬁcation datasets, we use ResNet-50 (He et al., 2016) starting from ImageNet-pretrained weights.
For experiments on language datasets, we use pretrained
BERT (Devlin et al., 2019).
We use the same architecture for predicting the spurious attribute (in the pseudo-labeling phase) and the target attribute (in the robust training phase).
5. M AIN R ESULTS
We compare the average and worst-case performance of the proposed SSA against the standard empirical risk minimization (ERM) and recent methods that tackles spurious correlation without group annotation for the training, including CVaR DRO (Levy et al., 2020), LfF (Nam et al., 2020),
EIIL (Creager et al., 2021), JTT (Liu et al., 2021), and Group DRO (Sagawa et al., 2020) requiring group annotation to minimize the worst-group loss.
In Table 1, 2, we report average accuracies and the worst-group accuracies on all datasets we consider.
Our method consistently outperforms all the other approaches that use spurious attribute annotated dataset for validation while using the same amount of spurious attribute annotation.
Notably, our method shows comparable performance to Group DRO which uses full amount of spurious attribute annotation for the training set, even outperforms on CelebA dataset.
We also run our algo-
[Table] [Table]
rithm using only 5% of the default validation set to show efﬁciency of our algorithm to improve the worst-group accuracy.
We further provide analysis on varying group-labeled set size below
[Table]
Effect of group-labeled set size.
Although we focus on improving the worst-group performance with given amount of spurious annotation, reducing the amount of supervision is an important topic to discuss especially with high annotation cost.
In the main results in Table 1, 2, we use the default validation sets provided by each dataset as D L .
To further test whether SSA can achieve high worstgroup accuracy with reduced amount of supervision, we run our algorithm with small fraction of the default validation sets as group-labeled sets.
Following Liu et al.
(2021), we run our method using 100%, 20%, 10%, 5% of the default validation set.
In Table 3, we report the worst-group accuracy of
JTT and our algorithm on Waterbirds and CelebA, with various group-labeled set size.
Surprisingly, we ﬁnd that our method maintains high worst-group accuracy even with the 10% of the original validation set.
Most notably, the number of attribute annotated samples used for training spurious attribute predictor is 58 in total, 6 for the worst-group in Waterbirds when we only use 10% of the default validation set.
5. D ETAILED ANALYSIS ON THE PSEUDO - LABELING PHASE OF SSA
We now take a closer look at the pseudo-labeling phase of the proposed SSA.
In particular, we focus on validating the effectiveness of the group-wise adaptive threshold we introduced in Section 4.2.
The purpose of the adaptive threshold was to prevent the pseudo-labels from being biased towards the majority group during the pseudo-labeling phase; the prediction conﬁdence of the majority group samples may exceed the threshold faster than samples of minority group, increasing the contribution of majority-group samples on the loss even further.
In the ﬁrst set of experiments (Table 4), we perform ablation studies on the pseudo-labeling and the adaptive threshold to see their effects on the spurious attribute prediction performance of the SSA.
In the second set of experiments (Table 5), we validate if the pseudo-labels are biased towards the majority group and check that our adaptive threshold strategy successfully addresses the phenomenon.
Accuracy of the spurious attribute predictor.
In Table 4, we report the group-wise spurious attribute prediction accuracies of SSA on CelebA dataset (using 5% or 10% of the validation split as the group-labeled set) in pseudo-labeling phase for following ablations: (1) Vanilla : Does not use any pseudo-labels and train the model using only the validation set samples.
(2) Pseudo-labeling :
Uses pseudo-labeling with a ﬁxed threshold, and (3) +Group-wise threshold : Identical to SSA, using group-wise adaptive thresholds for pseudo-labeling.
We ﬁnd that using the group-wise threshold increases the spurious attribute prediction accuracy for the worst-group— ( y, a ) =
( Blond , Male ) , providing 7% boost in both cases.
Interestingly, we observe that pseudo-labeling with ﬁxed thresholds can even slightly degrade the performance, when the validation set is too small (5%).
[Table] [Table]
Population comparison.
In Table 5, we compare the populations of pseudo-labeled samples that contribute to the training, for pseudo-labeling using a ﬁxed threshold (‘Pseudo-labeling’) and the adaptive threshold (‘+Group-wise threshold’); for each method, we trained the spurious attribute predictor until the worst-group spurious attribute prediction accuracy reaches the highest point.
We used CelebA dataset with only 5% of the validation split.
From the experimental results, we ﬁnd that na ¨ ıve pseudo-labeling with a ﬁxed threshold indeed leads the pseudo-labels to be biased towards the majority group using only 0.68% of the minority group (male blond) for training while the true fraction of the group is over 0 .
On the other hand, using the adaptive threshold successfully addresses this problem, lifting the fraction of blond male samples to 0 .
88% , which is close to the population level.
More impressively, we observe that pseudo-labeling phase adaptive threshold uses relatively uniform number of samples from each group to training the spurious attribute predictor.
5. SSA COMBINED WITH S UPERVISED C ONTRASTIVE L EARNING
We now examine whether the proposed SSA still remains to be beneﬁcial when combined with other robust training procedures.
As an example, we choose a recent robust training procedure (Zhang et al., 2021) proposed as an alternative to Group DRO.
More speciﬁcally, CNC (Zhang et al., 2021) considers a following procedure base on the supervised contrastive loss (Khosla et al., 2020):
As in
JTT (Liu et al., 2021), we ﬁrst train a standard ERM model.
Then, we use the contrastive loss to maximize the representational similarity between samples have the same target label but different
ERM prediction, while minimizing the representational similarity of samples with different target attribute but same ERM prediction.
This procedure can be smoothly combined the SSA framework, by replacing the ERM predictions with the pseudo-labels generated in the ﬁrst phase of SSA.
In Table 6, we compare the performance of SSA using Group DRO or CNC with the performance of the robust training methods using the full spurious attribute annotations on the training set.
Both models learned with SSA achieved comparable performance to the fully supervised counterparts.
This result suggests that the beneﬁt of SSA may not be constrained on a speciﬁc robust training method, and may be combined with more general classes of robust training algorithms.
Also, we ﬁnd that none of the robust training method consistently outperform the other; CNC with group label slightly outperforms Group DRO on Waterbirds, and Group DRO does better on CelebA.
[Table]
5. A PPLICATION TO GENERAL SEMI - SUPERVISED LEARNING UNDER CLASS IMBALANCE
In Section 4.2, we proposed to use adaptive thresholding to mitigate conﬁrmation bias when pseudolabeling group-imbalanced datasets.
Interestingly, it turns out that the beneﬁt of this idea also extends (without any modiﬁcation) to a more general scenario of semi-supervised learning (SSL) on datasets with class imbalances.
In fact, two settings are quite similar, except that SSA aims to put pseudo-labels on spurious attributes while SSL methods estimate target attributes.
To demonstrate this point, we evaluate adaptive thresholds under the SSL setup, and compare it with the performances of baseline pseudo-labeling-based SSL algorithms.
FixMatch (Sohn et al., 2020) is a recent
SSL method proposed without considerations on the class imbalance issue.
DARP
(Kim et al., 2020) and CReST (Wei et al., 2021) build on FixMatch to handle class imbalance, but are primarily designed under the assumptions that there exists sufﬁciently many labeled data at hand (to estimate the class imbalance ratio), and that class distributions of labeled and unlabeled datasets are identical, respectively.
In contrast, our method of adaptive thresholds does not rely on such assumptions to solve the same task.
We consider a slightly more challenging experimental setup than in Kim et al.
(2020): We construct an artiﬁcial labeled dataset from the CIFAR-10 (Krizhevsky et al., 2009) by controlling the number of samples in the majority class m maj (i.e., the largest class) and the ratio between the largest and smallest class sizes γ lab ≥ 1 .
In a similar manner, we construct an unlabeled dataset using some parameters n maj and γ unlab .
We select these parameters so that the number of labeled samples is small, and the imbalance ratios of labeled and unlabeled sets have bigger discrepancies (We provide further details in Appendix A.6).
In Table 7, we observe that empirical gains from both DARP and
CReST are limited comparing to supervised learning with full ground-truth labels (oracle), due to the violation of their inherent assumptions in the experimental setups of our choice, i.e., limited labeled data and different class distribution between labeled and unlabeled datasets.
However, our method successfully reduces such gap by effectively constructing the pseudo-labels for minority classes.
Overall, these results implies that the proposed method has a potential to provide a more robust semi-supervised learning solution (despite its simplicity) in more realistic scenarios, which we think is an interesting direction to explore further in the future.
C ONCLUSION
In this work, we present Spread Spurious Attribute (SSA), an algorithm for improving worst-group accuracy in the presence of spurious correlation.
SSA framework uses a small amount of spurious attribute annotated samples to estimate group identities of the training
set samples.
With the generated attribute annotated training set, we successfully train a robust model using existing worst-case loss minimization algorithms.
SSA is highly effective given a limited amount of the spurious attribute annotated samples, but still does not completely remove the need for supervision on spurious attributes which is an important future direction.
E THICS STATEMENT
This paper addresses the problem of mitigating the harmful effects of spurious correlations in the dataset, which is deeply intertwined with the topics of machine bias and fairness.
By targeting demographic groups (e.g., gender, race) carefully, our method has a potential to be used for preventing the machine to make predictions on the basis of biases on such demographic identities.
One possible pitfall, however, is that this group-based evaluation can provide a false sense of morality; as making a fair decision in terms of group cannot be equated with the individual fairness (even putting aside the issues of gerrymandering ), our performance reports based on the worst-group performance should not be na¨ıvely taken as a measure of justice.
About the responsible research practice: We have used benchmark datasets, and thus believe that our research practice has not posed any foreseeable hazard in this regard.
R EPRODUCIBILITY STATEMENT
We provide descriptions of the experimental setup and implementation details in Appendices A.2,
A.3 and A.5.
Also, we provide our source code as a part of the open-to-public supplementary materials. A CKNOWLEDGMENTS
This work was supported by Institute of Information & Communications Technology Planning &
Evaluation (IITP) grant funded by the Korea government(MSIT)
(No.2019-0-00075, Artiﬁcial Intelligence Graduate School Program (KAIST) and No.2019-0-01396, Development of framework for analyzing, detecting, mitigating of bias in AI model and training data)
A E XPERIMENTAL DETAILS A. S PREAD S PURIOUS A TTRIBUTE P SEUDOCODE
Algorithm 1 provides pseudocode for Spread Spread Attribute combined with Group DRO.
A. D ISCUSSIONS ON SPLITTING THE GROUP - LABELED AND GROUP - UNLABELED SETS
Recall that in the pseudo-labeling phase of SSA (Section 4.1, we partition both the group-labeled set and the group-unlabeled set into two subsets:
[Equation]
SSA then trains a spurious attribute predictor based on D ◦ L , D ◦ U , with hyperparameters tuned using
D • L .
The trained model is then used to make predictions on the samples in D • U .
Here, it is easy to see that, if we want to make a best prediction on a particular data point x (cid:63) ∈
D U , then the optimal split would be the one that uses the largest number of group-unlabeled samples for training the model, i.e.,
[Equation]
However, such partitioning requires training |D
U | different models to label all samples in the group-unlabeled set, which is computationally infeasible.
Thus, we propose partitioning the groupunlabeled dataset into K equally-sized subsets D (1) U , . . .
, D ( K ) U , and run the algorithm K times, using
[Equation]
(12) for the i -th training iteration.
For all experiments appearing in this paper, we used K = 3 for a simple evaluation; the empirical performance of SSA may improve if we use a larger value of K .
For the group-labeled set, we do not require such trick.
We simply partitioned the group-labeled into two equally size subsets, and used one for training and another for validation.
We kept the split ﬁxed throughout the whole pseudo-labeling phase.
[Table] [Table]
The splitting procedure aims to mitigate the potential negative effect of “selfconﬁrmation” that may take place in the pseudo-labeling procedure.
During the training of pseudolabeler, SSA utilizes the pseudo-attributes of the training samples whenever the prediction conﬁdence exceeds a certain threshold.
In other words, when a sample gains a high-enough conﬁdence, pseudo-labeling may continually strengthen its own predictions, and can be very problematic in group-DRO-like scenarios where we expect a severe group imbalance.
Data splitting helps mitigate this effect by separating the samples that we train on and the samples we make ﬁnal predictions on (as a side note, we also propose group-adaptive thresholds to mitigate the same effect).
Empirically, we indeed observe that data splitting helps improve the downstream worst-group performance.
Tables 8 and 9 give a comparison of SSA with/without splitting on CelebA and Waterbirds dataset, respectively.
A. T RAINING DETAILS
Models.
As we brieﬂy discussed in the main text, we use pretrained ResNet-50 and BERT for image and natural language dataset experiments, respectively.
For ResNet-50, we use the torchvision implementation.
For BERT, we use the huggingface implementation.
Hyperparameter Tuning - Overall.
We separately tune the hyperparameters for the pseudolabeling phase and the robust training phase.
For the pseudo-labeling phase, the tuning criterion is the worst-group spurious label classiﬁcation accuracy on D • L .
For the robust training phase, the tuning criterion is the worst-group prediction accuracy of the trained target attribute classiﬁer on the whole validation set D L .
We ﬁx the threshold τ g min for the group with smallest population as 0.
following (Sohn et al., 2020) in pseudo-labeling phase.
Hyperparameter Tuning - Image.
For Waterbirds and CelebA, we tuned the learning rate over { 1e3, 1e-4, 1e-5 } and (cid:96) 2 regularization over { 1e-1, 1e-4 } .
We used SGD optimizer with momentum 0.
and batch size 64.
In pseudo-labeling phase, we train the spurious attribute predictor 1k iterations for Waterbirds and 45k iterations for CelebA.
Hyperparameter Tuning - Natural Language.
For MultiNLI and CivilComments-WILDS, we did not tune any hyperparameter and follow the details of Liu et al.
For MultiNLI, we trained
SSA and its baselines for 5 epochs with default tokenization and dropout, using the batch size 32 and the initial learning rate of 2e-5.
We did not use any (cid:96) 2 regularization.
For CivilComments-WILDS, we capped the number of tokens per example at 300 and used batch size 8, (cid:96) 2 regularization of 1e-2 and initial learning rate of 1e-5.
We used AdamW optimizer with gradient clipping for both
MultiNLI and CivilComments-WILDS.
In pseudo-labeling phase, we train the spurious attribute predictor 30k iterations for both MultiNLI and CivilComments.
[Table]
Hyperparameter Tuning - Robust Training.
For the robust model, we use hyperparameters to maximize worst-group accuracy on D val .
Following Liu et al.
(2021), we use learning rate of 1e4 and (cid:96) 2 regurlarization 1e-1 for Waterbirds, learning rate of 1e-5 and (cid:96) 2 regularization 1e-1 for
CelebA. We use SGD optimizer with momentum 0.9 and batch size 64 for both Waterbirds and
CelebA. For MultiNLI and CivilComments, we use the same conﬁguration as pseudo-labeling phase, except using batch size 16 for CivilComments.
In robust training phase, we train the robust model 300 epochs for Waterbirds and CelebA, 10 epochs for MultiNLI, and 5 epochs for CivilComments.
We choose the best model based on the model selection criteria described above.
Baseline Implementation.
For EIIL, we directly take results on Waterbirds and CivilComments from Creager et al.
(2021), while the results on CelebA and MultiNLI are new.
For environment inference on CelebA, we follow the same procedure as for Waterbirds.
We use one epoch trained
ERM as a reference classiﬁer.
We optimize the EI objective with a learning rate of 0.01 for 20k steps using the Adam optimizer.
For environment inference on MultiNLI, we follow the same procedure as for CivilComments-WILDS.
We train an ERM model for 5 epochs and choose the reference classiﬁer using the best epoch based on the validation worst-group accuracy.
We use the error split heuristic instead of optimizing EI objective as Creager et al.
(2021) did.
We then train the robust model with the same procedure as we did.
A. R UNTIME ANALYSIS
In Table 10, we provide the time required for the pseudo-labeling phase and the robust training phase on a single Nvidia Titan XP for each dataset.
Compared with the vanilla Group DRO, SSA requires an additional pseudo-labeling phase.
When we select K = 3 , the overhead is as small as x0.5 on the CelebA dataset, and does not exceed x4 in the worst case (Waterbird).
We make two additional remarks.
First, other baseline methods for addressing the lack of full group annotation (e.g., JTT,
LfF) also require additional computation and runtime.
For instance, JTT requires a preliminary training run to estimate the spurious label.
Second, the number of iterations we used for pseudolabeling has not been optimized for achieving the best runtime-performance tradeoff, and thus can be further improved with a more careful search.
A. D ETAILS ON SUPERVISED CONTRASTIVE LEARNING
Given an anchor ( x i , y i ) , original supervised contrastive loss uses same class samples ( y = y i ) as positive samples and different class samples ( y (cid:54) =
y i ) as negative samples to maximize similarity of representation between samples belong to same class.
Correct-N-Contrast (CNC; Zhang et al.
ﬁrst trains ERM model as JTT and use ERM prediction as a surrogate to ground truth spurious attribute.
With obtained ERM prediction, CNC uses supervised contrastive loss to maximize similarity of representation between samples having same target and different ERM prediction, while minimizing similarity of representation between samples having different target and same ERM prediction.
Similar to the second stage of CNC, given an anchor ( x i , y i , a i ) , we use samples having same target and different spurious attribute as positive samples ( y + =
y i , a + (cid:54) = a i ) and samples having different target and same spurious attribute as negative samples ( y − (cid:54) =
y i , a − = a i ) .
To be speciﬁc, we sample M samples from each group.
Given an anchor ( x i , y i , a i ) , we use samples from group ( y i , a + ) for a + (cid:54) = a i as a set of positive samples B + and samples from group ( y − , a i ) for y − (cid:54) =
y i as a set of negative samples B − .
In addition to standard cross entropy loss, we minimizes following supervised contrastive loss for each anchor x i :
[Equation]
[Equation]
where z = g ( x ) is a representation of x and g : X → R d is an encoder maps x to a representation, f
= h ◦ g , τ > 0 is a scalar temperature hyperparameter.
We use M = 16 for both Waterbirds and CelebA. Except batch size, we follow Zhang et al.
(2021) for other hyperparameters.
For Waterbirds, we use temperature 0.1, contrastive weight 0.75, SGD optimizer with momentum 0.9, learning rate 1e-4, weight decay 1e-3 and use gradient accumulation to update model parameter every 32 batches.
For CelebA, we use temperature 0.05, contrastive weight 0.75, SGD optimizer with momentum 0.9, learning rate 1e-5, weight decay 1e-1 and use gradient accumulation to update model parameter every 32 batches.
A. D ETAILS ON CLASS - IMBALANCED SEMI - SUPERVISED LEARNING
We consider a classiﬁcation problem with K classes.
In other words, our goal is to train a predictor
X → Y with Y = { 1 , . . .
, K } .
We assume that we have access to two types of datasets: labeled, and unlabeled.
We let
[Equation]
The number of samples in some class k ∈ Y will be denoted by m k and n k , respectively, i.e., (cid:80)
Kk =
m k = n and (cid:80) Kk =
1 m k
= m .
Without loss of generality, we assume that the number of labeled data in each class is ordered in a descending order, i.e.,
[Equation]
We deﬁne the imbalance ratio of this labeled dataset as the ratio between the sample sizes of the largest class and the smallest class, i.e., γ lab = m 1 /m K ≥ 1 .
This quantity is used as a key parameter that controls the degree of class imbalance in the labeled dataset; higher the γ lab , more severe the imbalance.
To determine the number of samples in other classes, we use an exponential decay function, i.e., m k
= m 1 · γ ( −
[Equation]
We assume that the same ordering holds for the unlabeled samples, i.e., n 1 ≥ · · · ≥ n K , and let deﬁne the imbalance ratio as γ unlab = n 1 /n K .
For simplicity, we let γ unlab = 1 , i.e., all classes have the same number of unlabeled samples.
To evaluate the classiﬁcation performance of models trained under the imbalanced dataset, we report two popular metrics: balanced accuracy (bACC) and geometric mean scores (GM), which are deﬁned by the arithmetic and geometric mean over class-wise sensitivity, respectively.
Mean and standard deviation are reported across three random trials, respectively.