SlowGuess/NeurIPS_2023_OCR huggingface dataset:
by utilizing the Bayes rule. This way we have a candidate strategy to maximize multi-label class-balanced accuracy in Equation (9): First, we will estimate  $p_{\mathrm{data}}(y,z|x)$  and  $p_{\mathrm{data}}(y,z)$  from data, and then we will divide the estimates. Notice that, in order to make a prediction about  $(y,z)$  given  $x$ , we do not need to model  $p_{\mathrm{data}}(x)$  as this quantity is constant in  $(y,z)$ , and thus does not influence the argmax.
Training process. We can directly estimate  $p_{\mathrm{data}}(y,z)$  from available training data by computing the empirical frequencies of pairs  $(y,z)\in [L]\times [K]$ , or by a Bayesian estimate with a Dirichlet prior. On the other hand, we can train a parameterized discriminative model  $p_{\theta}$  with maximum conditional likelihood estimation to estimate  $p_{\mathrm{data}}(y,z|x)$
$$
\max  _ {\theta} \frac {1}{| \mathcal {D} |} \sum_ {x, y, z \in \mathcal {D}} \log p _ {\theta} (y, z \mid x) \tag {12}
$$
which is equivalent to the minimization of a KL divergence estimate between the  $p_{\mathrm{data}}$  and  $p_{\theta}$  model conditionals.
The method described so far would have sufficed if the goal was to perform multi-label classification, however we need to devise a way to overcome the bias-supervision, since we only care about classifying  $Y$  without having access to  $Z$  annotations. For this reason, we need to proceed to modelling assumptions about  $p_{\theta}$ , which will allow us to develop the bias unsupervised method described in Section 3. First, we recall that  $p_{\mathrm{data}}$  factorizes as
$$
p _ {\text {d a t a}} (y, z \mid x) = p _ {\text {d a t a}} (y \mid x, z) p _ {\text {d a t a}} (z \mid x). \tag {13}
$$
Let  $h_{\theta}:\mathcal{X}\to \mathbb{R}^{K}$  be a parameterized model (such as a neural network) tasked to predict unnormalized logits of  $Y$  given an observation  $x$ . Then, we model  $p_{\mathrm{data}}(y|x,z)$  by
$$
p _ {\theta} (y \mid x, z) \propto \exp \left(h _ {\theta} (x) _ {y} + \log \hat {p} _ {\text {d a t a}} (y \mid z)\right). \tag {14}
$$
Unpacking our modelling assumption Equation (14), we have the following: First, we are going to compute  $\hat{p}_{\mathrm{data}}(y|z) = \frac{\hat{p}_{\mathrm{data}}(y,z)}{\hat{p}_{\mathrm{data}}(z)}$ , by using our estimated  $\hat{p}_{\mathrm{data}}(y,z)$  and by marginalizing out  $y$  for  $\hat{p}_{\mathrm{data}}(z) = \sum_{y\in [K]}\hat{p}_{\mathrm{data}}(y,z)$ . Given a tuple of observables  $(x,y,z)$  in a training batch, we use  $\log \hat{p}_{\mathrm{data}}(y|z)$  to adjust additively the outputs of our parametric discriminative model  $h_\theta$  to the observed input  $x$ . Notice that since  $Y$  is a categorical variable,  $\log \hat{p}_{\mathrm{data}}(y|z) \in (-\infty,0]$  for all  $y \in [K]$ . For this reason, we can intuitively interpret logit adjustment as a soft masking operation for outputs of  $h_\theta$  which are unlikely in the training data when we have observed  $z$ . In this way, we account for the dependency of  $Y$  to  $Z$  which spuriously exists in the training distribution. By fitting the cross-entropy objective under logit adjustment, the network  $h_\theta$  has to model the remaining relations for  $Y|X$  that are not spurious since those are already accounted for.
Prediction process. Our modelling assumption enables the prediction of  $y$  without computing the maximizer over combinations of  $(y, z) \in [K] \times [L]$ . This is an important step towards developing a bias-unsupervised training procedure. This is because assumption 14 allows us to compute the maximizer for  $y \mid x$  and  $z \mid x$  separately. We show that under our modelling assumption, if we are only interested in predicting only the target variable  $y$  given an observation  $x$ , we do not need to model  $z \mid x$  at all. To understand how this is possible, we take a close look at the total expression for optimal predictor. After fitting the model  $p_{\theta}$  using Equation (12), we calculate the estimated scoring function for the multi-label class-imbalanced problem as in Equation (11)
$$
\begin{array}{l} \hat {f} _ {Y, Z \mid X} (x) = \hat {p} _ {\text {t e s t}} (x \mid y, z) = \frac {\hat {p} _ {\text {d a t a}} (y , z \mid x)}{\hat {p} _ {\text {d a t a}} (y , z)} \hat {p} _ {\text {d a t a}} (x) \tag {15} \\ = \frac {p _ {\theta} (y \mid x , z)}{\hat {p} _ {\text {d a t a}} (y \mid z)} \frac {\hat {p} _ {\text {d a t a}} (z \mid x)}{\hat {p} _ {\text {d a t a}} (z)} \hat {p} _ {\text {d a t a}} (x) \\ = \frac {\exp \left(h _ {\theta} (x) _ {y} + \log \hat {p} _ {\text {d a t a}} (y | z)\right)}{Z _ {\theta} (z , x) \hat {p} _ {\text {d a t a}} (y | z)} \frac {\hat {p} _ {\text {d a t a}} (z | x)}{\hat {p} _ {\text {d a t a}} (z)} \hat {p} _ {\text {d a t a}} (x) \\ = \exp \left(h _ {\theta} (x) _ {y}\right) \frac {\hat {p} _ {\text {d a t a}} (z | x) \hat {p} _ {\text {d a t a}} (x)}{Z _ {\theta} (z , x) \hat {p} _ {\text {d a t a}} (z)}, \\ \end{array}
$$
where  $Z_{\theta}(z,x) \coloneqq \sum_{y \in [K]} \exp \left(h_{\theta}(x)_y + \log \hat{p}_{\mathrm{data}}(y|z)\right)$  is the partition function of  $p_{\theta}(y|x,z)$ . Notice that the expression simplifies into a multiplication of two terms; the first,  $\exp \left(h_{\theta}(x)_y\right)$ , solely depends on  $(x,y)$ , while the second fraction only depends on  $(x,z)$ . Then, predicting according to Equation (10) amounts to computing
$$
\max  _ {y, z} \hat {p} _ {\text {t e s t}} (x \mid y, z) = \max  _ {y} \exp \left(h _ {\theta} (x) _ {y}\right) \max  _ {z} \frac {\hat {p} _ {\text {d a t a}} (z \mid x) \hat {p} _ {\text {d a t a}} (x)}{Z _ {\theta} (z , x) \hat {p} _ {\text {d a t a}} (z)}. \tag {16}
$$
Essentially, information about  $Z$  is only need during training time and not during prediction of  $Y$  given  $X$ . In practice, during prediction we adapt the model by removing the logit adjustment term in order to acquire the unbiased network for the task. Consequently, the obtained scoring function for debiased  $Y$  predictions is just the trained neural network
$$
\hat {f} _ {Y \mid X} (x; \theta) := h _ {\theta} (x). \tag {17}
$$
Notice that our design decisions are well-justified, in the sense that, under our class of models (eq. 14), we have  $\mathrm{Acc}_{Y,Z|X}(\hat{f}_{Y,Z|X};p_{\mathrm{test}})\leq \mathrm{Acc}_{Y|X}(\hat{f}_{Y|X};p_{\mathrm{test}})$ . This means that by maximizing the multi-label class-balanced accuracy we indirectly maximize the top-1 accuracy of the candidate scoring function  $\hat{f}_{Y|X}$  under the test distribution  $p_{\mathrm{test}}$ , which is the group-balanced accuracy as we have demonstrated.
Proposition A.1 (SLA optimizes the group-balanced accuracy). Under the assumption that the hypothesis class of  $p_{\theta}(y|x,z)$  (eq. 4) contains  $p_{data}(y|x,z)$ , the minimizer network  $h_{\theta^*}$  of the cross-entropy loss maximizes a lower bound to the group-balanced accuracy  $\mathrm{Acc}_{Y|X}(h_{\theta^*};p_{test})$ .
Proof. We will start by the quantity
$$
\operatorname {A c c} _ {Y, Z \mid X} (f; p _ {\text {t e s t}} (\cdot | y, z)) := \mathbb {P} _ {x \mid y, z} ^ {(\text {t e s t})} ((y, z) = \underset {y ^ {\prime}, z ^ {\prime}} {\operatorname {a r g m a x}} f (x) _ {y ^ {\prime}, z ^ {\prime}}) \tag {18}
$$
the classification accuracy conditioned on the pair  $(y,z)$ . Recall that under our modelling assumption Equation (14), the estimated Bayes-optimal scoring function for the multi-label class-imbalanced classification problem is
$$
\hat {f} _ {Y, Z \mid X} (x) = \hat {p} _ {\text {t e s t}} (x \mid y, z) = \exp \left(h _ {\theta^ {*}} (x) _ {y}\right) C (z, x), \tag {19}
$$
where  $C(z,x) \coloneqq \frac{\hat{p}_{\mathrm{data}}(z|x)\hat{p}_{\mathrm{data}}(x)}{Z_{\theta}(z,x)\hat{p}_{\mathrm{data}}(z)}$  is a constant in  $y$ . We then substitute to get
$$
\operatorname {A c c} _ {Y, Z \mid X} \left(\hat {f} _ {Y, Z \mid X}; p _ {\text {t e s t}} (\cdot | y, z)\right) = \mathbb {P} _ {x \mid y, z} ^ {(\text {t e s t})} \left((y, z) = \underset {y ^ {\prime}, z ^ {\prime}} {\operatorname {a r g m a x}} \exp \left(h _ {\theta^ {*}} (x) _ {y ^ {\prime}}\right) C \left(z ^ {\prime}, x\right)\right). \tag {20}
$$
However  $\max_{z'}$  gets pushed to the innermost term since  $\exp(h_{\theta^*}(x)_{y'})$  is independent of  $z'$ , as well as  $\max_{z'} C(z', x)$  is independent of  $y'$ . This means that we can take the  $\arg \max$  of individual expression independently
$$
\operatorname {A c c} _ {Y, Z \mid X} \left(\hat {f} _ {Y, Z \mid X}; p _ {\text {t e s t}} (\cdot | y, z)\right) = \tag {21}
$$
$$
\mathbb {P} _ {x | y, z} ^ {\mathrm {(t e s t)}} \big (\{y = \operatorname * {a r g m a x} _ {y ^ {\prime}} \exp \big (h _ {\theta^ {*}} (x) _ {y ^ {\prime}} \big) \} \cap \{z = \operatorname * {a r g m a x} _ {z ^ {\prime}} C _ {2} (z ^ {\prime}, x) \} \big),
$$
and since  $\mathbb{P}(A\cap B)\leq \mathbb{P}(A)$  and exp is a strictly increasing function, we get
$$
\operatorname {A c c} _ {Y, Z \mid X} \left(\hat {f} _ {Y, Z \mid X}; p _ {\text {t e s t}} (\cdot | y, z)\right) \leq \mathbb {P} _ {x \mid y, z} ^ {(\text {t e s t})} \left(y = \underset {y ^ {\prime}} {\operatorname {a r g m a x}} h _ {\theta^ {*}} (x) _ {y ^ {\prime}}\right). \tag {22}
$$
We recognise the scoring function  $\hat{f}_{Y|X}(x) \coloneqq h_{\theta^*}(x)$  on the right hand side of the expression. Finally, by summing up all inequalities for all  $(y,z) \in [K] \times [L]$ , and dividing by  $KL$ , we get
$$
\frac {1}{K L} \sum_ {y, z} \operatorname {A c c} _ {Y, Z | X} \left(\hat {f} _ {Y, Z | X}; p _ {\text {t e s t}} (\cdot | y, z)\right) \leq \frac {1}{K L} \sum_ {y, z} \mathbb {P} _ {x | y, z} ^ {(\text {t e s t})} \left(y = \underset {y ^ {\prime}} {\operatorname {a r g m a x}} \hat {f} _ {Y | X} (x) _ {y ^ {\prime}}\right) \tag {23}
$$
$$
\operatorname {A c c} _ {Y, Z \mid X} \left(\hat {f} _ {Y, Z \mid X}; p _ {\text {t e s t}}\right) \leq \operatorname {A c c} _ {Y \mid X} \left(\hat {f} _ {Y \mid X}; p _ {\text {t e s t}}\right). \tag {24}
$$
This shows that the scoring function  $\hat{f}_{Y|X}(x) \coloneqq h_{\theta^*}(x)$  maximizes a lower bound to the group-balanced accuracy.
B Self-supervised Learning Algorithms
Target Attribute	Bias Attribute
pdata	ptest	pdata	ptest
CMNIST (1%)	98.86	27.01	99.88	96.04
CCIFAR10 (1%)	98.93	36.53	99.60	82.05
SMPI3D (C=3)	98.19	66.08	99.91	87.22
CELEBA*	94.01	75.44	95.74	90.60
Table 6: Downstream online linear classification against the target and bias attributes of each task considered (see Appendix D). We present top-1 (average) accuracy (\%) of the corresponding classifiers evaluated at last epoch of MoCoV2+ training, under samples from the i.i.d. validation set ( $p_{\text{data}}$ ) and the o.o.d. test set ( $p_{\text{test}}$ ). *For CELEBA, since the test split is not controlled to be group-balanced, we simulate the accuracy under  $p_{\text{test}}$  by utilizing the existing bias annotations to estimate a group-balanced test accuracy.
In our work, we are using a contrastive learning algorithm [58, 14, 35, 15] to pretrain a base model for the bias proxy, as well as to initialize the debiased model. In contrastive learning, an instance discrimination pretext task is defined from unlabeled data. In particular, pairs of data points (positives), which are derived by independently augmenting the same observation (views), should have representations that are closer in distance than representations of other samples in the dataset (negatives). To achieve that we optimize a form of the InfoNCE loss [58]
$$
\mathcal {L} \left(q, k ^ {+}, \left\{k _ {i} ^ {-} \right\} _ {i = 1} ^ {N}\right) = - \log \frac {\exp \left(q ^ {\top} k ^ {+} / \tau\right)}{\exp \left(q ^ {\top} k ^ {+} / \tau\right) + \sum_ {i = 1} ^ {N} \exp \left(q ^ {\top} k _ {i} ^ {-} / \tau\right)}, \tag {25}
$$
where  $(q, k^{+})$  is the positive pair and  $\{k_{i}^{-}\}_{i=1}^{N}$  are the negatives. Typically, representations are projected to the unit hypersphere for training stability. In the MoCoV2+ framework [15], gradients are backpropagated only through the query representation  $(q)$  to the encoding network, while the key representations  $(k^{+}$  and  $k^{-})$  are extracted by a network derived from the exponential moving average of its parameters. Finally, positive key representations of past batches are kept in a queue in memory to serve as negative key representations for the subsequent batches.
C uLA: Algorithm
In Algorithm 1, we provide a high-level description of the ULA methodology for training and validation of group-robust models without any bias annotations. In addition, a PyTorch [59] implementation is available at the following repository: https://github.com/tsirif/uLA.
D.1 Systematic MPI3D
sMPI3D is our contributed dataset which we use to study combinatorial systematicity in classifiers. By this term, we designate the ability of classifiers to generalize to samples generated from novel combinations of generative attributes, which under  $p_{\mathrm{data}}$  have 0 probability. However, all the constituent values of the individual generative attributes in the novel combinations have been observed under some combination in the training data. The real split of MPI3D [29] consists of photographs of a robotic arm that has a colored rigid object attached to its end effector. The images are captured in a way that controls their generative attributes, such as the shape of the rigid object or the position of the robotic arm.
We use this dataset to create development, and deployment splits to test for systematic generalization. In particular, we consider the shape of the rigid object to be the target variable  $Y_{\mathrm{shape}}$ , while its color to be the bias  $Z_{\mathrm{color}}$ . There are 6 possible shapes for the objects and 6 possible colors, totaling 36 combinations of attributes. Figure 2d illustrates pairs of attributes used to sample an example systematic training split. A training set is created by assigning  $C$  number of colors per shape so that: first,  $p_{\mathrm{data}}(z_{\mathrm{color}} \mid y_{\mathrm{shape}}) = \frac{1}{C}$  if  $(y_{\mathrm{shape}}, z_{\mathrm{color}})$  exists in the elected pairs of attributes for training; otherwise 0. Second, we make sure that marginally all colors and shapes are represented uniformly, which means that  $p_{\mathrm{data}}(y) = \frac{1}{6}$  and  $p_{\mathrm{data}}(z) = \frac{1}{6}$ . During testing, we desire to generalize to samples generated from  $p_{\mathrm{test}}$  which distributes pairs  $(y_{\mathrm{shape}}, z_{\mathrm{color}})$  uniformly, covering combinations that are entirely missing from the training set. In our benchmarks, we are testing methods for  $C \in \{2, 3, 4, 5\}$ , against the same 5 sets of systematic splits which we generate independently per  $C$ .
Systematic split generation. As we described above, sMPI3D is generated using the real "split" of the MPI3D dataset [29]. The dataset is distributed as a tensor of shape  $(6, 6, 2, 3, 3, 40, 40, 64, 64, 3)$ , with the last 3 axis corresponding to pixel values of a  $64 \times 64$  RGB image and the rest to coordinates for generative attribute values. The first two coordinates correspond to the color and shape attributes for the rigid object depicted in the image. The procedure for generating splits of sMPI3D is stochastic, meaning that it depends on a random seed set by the user. The reason for this is that we would like to benchmark methods against the possibility that some systematic splits are consistently easier to generalize than others. To generate a train-validation-test split of sMPI3D, we first generate the pattern of included-excluded combinations for the development dataset (training and validation datasets), like the one presented in Figure 2d. The pattern depends on the argument  $C$ , the number of color values observed per shape value. Then, we randomly permute data points across the first two
Algorithm 1: ULA: Logit adjustment without bias labels during training or model selection.
Data: Training split:  $\mathcal{D}\coloneqq \{x_m,y_m\}_{m = 1}^M$    
Data: Validation split:  $D_{\mathrm{valid}}\coloneqq \{x_n,y_n\}_{n = 1}^N$    
Data: Hyperparameters: SSL checkpoint  $T_{\mathrm{ssl}}$  , linear probe training steps  $T_{\mathrm{stop}}$  , logit adjustment strength  $\eta$  and calibration  $\tau$  , and optimization hyperparameters   
Result: Debiased model  $h_\theta^*$  and its validation_score   
1  $/^{*}$  Load pretrained SSL encoder \*/   
2  $f_{\mathrm{base}}\gets \mathrm{load}(T_{\mathrm{ssl}})$    
3  $/^{*}$  Train Linear Head \*/   
4 Define a classifier  $h_\mathrm{bias} = g_\phi \circ f_\mathrm{bias}$  from the composition of pretrained  $f_{\mathrm{base}}$  and linear classifier  $g_{\phi}$  with parameters  $\phi$    
5 Predict biased predictions using  $\hat{y} (x;h_{\mathrm{bias}}) = \mathrm{argmax}_y h_{\mathrm{bias}}(x)_y$    
6 for  $t = 1$  to  $T_{\mathrm{stop}}$  do   
7 Sample batch  $B$  from  $\mathcal{D}$    
8 Update  $\phi$  so that linear model on top of  $h_\mathrm{bias}(x)$  minimizes average cross-entropy on  $B$    
9 end   
10  $/^{*}$  Finetune with logit adjustment \*/   
11 Define calibrated model of biased predictions  $p_{\mathrm{bias}}(y_{\mathrm{bias}}|x)\propto \exp (h_{\mathrm{bias}}(x)y_{\mathrm{bias}} / \tau)$    
12 Compute confusion matrix  $\hat{p}_{\mathrm{data}}(y,y_{\mathrm{bias}}) / /$  See Equation (5)   
13 Define  $h_\theta$  to be the debiased model   
14 Initialize base model in  $h_\theta$  from pretrained  $f_{\mathrm{base}}$    
15 Predict debiased predictions using  $\hat{y} (x;h_\theta) = \mathrm{argmax}_yh_\theta (x)_y$    
16   
17 checkpoints  $\leftarrow []$    
18 for  $t = 1$  to maximum number of iterations do   
19 Sample batch  $B$  from  $\mathcal{D}$    
20 Update  $\theta$  so that model  $p_{\theta}(y|x)\propto \exp \left(h_{\theta}(x)_y + \eta \log \hat{p}_{\mathrm{data}}(y|\hat{y} (x;h_{\mathrm{bias}}))\right)$  minimizes average cross-entropy on  $B$    
21 validation_score  $\leftarrow$  compute_validationCriterion(Dvalid,  $h_\mathrm{bias},h_\theta)$  // see Equation (7)   
22 checkpoints  $\leftarrow$  checkpoints + [(validation_score,  $h_\theta))]$    
23 end   
24 Final debiased model,  $h_\theta * \gets \max_{\mathrm{validation\_score}}$  checkpoints
axis of the data tensor, which correspond to the color and shape attributes. Afterwards, we split the data tensor according to whether a certain position (color, shape) belongs to the development dataset or not. We subsample the deployment dataset uniformly across i.i.d. combinations for  $180k$  and  $18k$  mutually exclusive data points for the training and validation sets respectively, for all  $C \in \{2,3,4,5\}$ . Finally, the remaining data points are combined and  $54k$  images are sampled uniformly from all combinations to create the unbiased test set. We provide code for generating systematic splits on MPI3D in the supplementary material.
D.2 Non-systematic Benchmarks
Colored MNIST. (CMNIST) is an RGB version of MNIST dataset [47], in which the digit target variable  $Y_{\mathrm{digit}}$  is paired with a color bias variable  $Z_{\mathrm{color}}$  to draw an image of that digit using a specific color. In this work, we study the dataset which follows the data generation procedure from Nam et al. [57]. Each of the digits  $k \in \{0, \dots, 9\}$  is paired with a distinct color out of a choice of ten, with probability  $p_{\mathrm{data}}(Z_{\mathrm{color}} = k \mid Y_{\mathrm{digit}} = k) = 1 - \beta$  of the available training samples for that digit  $k$ . The rest of the probability mass is split uniformly across the remaining color options,  $p_{\mathrm{data}}(Z_{\mathrm{color}} = l \mid Y_{\mathrm{digit}} = k) = \frac{\beta}{9}$  for  $l \neq k$ . Essentially,  $\beta$  controls for the percentage of bias-conflicting samples in the training set. The goal is to train a classifier that performs well under the
Learning Rate	Batch Size	Weight Decay	Temperature
CMNIST	1.0	256	1e-3	0.1
CCIFAR10	0.9	256	1e-4	0.1
SMPI3D	0.9	256	1e-4	0.1
CELEBA	0.3	128	3e-5	0.1
SSL Augmentations
CMNIST	RRC + Gaussian Blur
CCIFAR10	RRC + Color Jitter + Gray Scale + Gaussian Blur + Horizontal Flip
SMPI3D	RRC + Color Jitter + Gray Scale + Gaussian Blur + Horizontal Flip
CELEBA	RRC + Color Jitter + Solarization + Horizontal Flip
Table 7: Hyperparameters used during SSL pretraining.
test set in which digits are paired with colors with random chance  $1/10^2$ . We obtain four different tasks by varying  $\beta \in \{0.5\%, 1\%, 2\%, 5\% \}$ .
Corrupted CIFAR10. (CCIFAR10) is a modification of the CIFAR10 dataset [45] by Hendrycks and Dietterich [37], in which images are affected by a type of texture noise which correlates with the original target category. Similarly to CMNIST, there are 10 different types of texture noise each of which is predominantly paired to a unique CIFAR10 label. The training set is created under  $p_{\mathrm{data}}(Z_{\mathrm{noise}} = k \mid Y_{\mathrm{cifar}} = k) = 1 - \beta$  with the rest of probability spread uniformly to the bias-conflicting options of texture noise. Our goal again is to perform well under the test set in which pairs of texture noise and labels are distributed uniformly. Four development datasets are used in the experiments with  $\beta \in \{0.5\%, 1\%, 2\%, 5\% \}$ .
Waterbirds. Our study employs the WATERBIRDS dataset, devised by Sagawa et al. [61]. This dataset is derived from the CUB dataset's bird images [68], superimposed on backgrounds from the Places dataset [77]. The dataset classifies seabirds and waterfowl as waterbirds, and all other species as landbirds. Ocean and natural lake backgrounds from Places are labeled as 'water background', while bamboo and broadleaf forest backgrounds are termed 'land background'. Four groups emerge: land background with waterbird and landbird, and water background with waterbird and landbird. The first two are minority groups due to fewer examples, while the latter two constitute majority groups. The dataset maintains the original training, validation, and test splits from Sagawa et al. [61]. In training,  $95\%$  of waterbirds and landbirds are respectively paired with water and land backgrounds, while we care for the worst-group test accuracy.
CelebA. We examine a fair classification task using the CELEBA dataset [51] of celebrity facial attributes. Same to Sagawa et al. [61], we consider the BlondHair attribute to be the target variable. Then, a spurious correlation can naturally be observed with the binarized gender attribute Male. Four groups emerge for which the minorities are males with blond hair, followed by females with non-blond hair. We use the standard splits defined in the literature, and we report the worst-group test accuracy.
Architecture, Optimization, Augmentation and Validation. For CMNIST, we train a 3-hidden layer MLP with 100 hidden neurons for each layer, while we use a ResNet18 [34] for CCIFAR10 and SMP13D, and a ResNet50 for WATERBIRDS and CELEBA. For all datasets except WATERBIRDS, we pretrain the base model with the MOCoV2+ [15] process, while for WATERBIRDS we use an already pretrained ResNet50 onImagenet [60]. Training of the linear probe for the bias network and finetuning for the logit adjusted debiased network happen with AdamW [52] optimizer using default momentum hyperparameters  $\beta = (0.9, 0.999)$ , except for WATERBIRDS where we use SGD with 0.9 momentum. The learning rate for all dataset, excluding WATERBIRDS, is scheduled with a cosine decaying rule. Batch size is set to 256 for CMNIST, CCIFAR10, SMP13D and CELEBA, and 64 for WATERBIRDS. We use minimal data augmentation for training the linear probe, as well as the debiased logit adjusted model, following the baselines we compare against for fair comparison. In more details, we use random resized crops (RRC) and random horizontal flipping for all datasets, except CMNIST where no augmentation is used. Finally, training happens for a maximum of 100