Simple data balancing achieves competitive worst-group-accuracy

Badr Youbi Idrissi, Martín Arjovsky, Mohammad Pezeshki, David Lopez-Paz

Abstract

We study the problem of learning classifiers that perform well across (known or unknown) groups of data. After observing that common worst-group-accuracy datasets suffer from substantial imbalances, we set out to compare state-of-the-art methods to simple balancing of classes and groups by either subsampling or reweighting data. Our results show that these data balancing baselines achieve state-of-the-art-accuracy, while being faster to train and requiring no additional hyper-parameters. Finally, we highlight that access to group information is most critical for model selection purposes, and not so much during training. All in all, our findings beg closer examination of both benchmarks and methods for future research in worst-group-accuracy optimization.

Introduction

Standard machine learning models are often "lazy," exploiting spurious correlations to achieve high average accuracy. For example, if a dataset predominantly features "water birds" against aquatic backgrounds, a model may learn to identify the background rather than the bird itself. This leads to a failure in worst-group accuracy (WGA)—the performance on rare subgroups, such as a "land bird" appearing on water.

While previous research suggested that complex "robust optimization" algorithms are necessary to mitigate these biases, this paper investigates whether the issue is primarily one of data imbalance. We evaluate whether simple data balancing can match the performance of sophisticated state-of-the-art (SOTA) techniques.

Methodology

We compared complex SOTA methods, such as Group Distributionally Robust Optimization (gDRO) and Just Train Twice (JTT), against four simple baselines:

  1. SUBY & SUBG (Subsampling): Discarding data from majority classes or groups to achieve a perfect balance.
  2. RWY & RWG (Reweighting): Retaining all data but adjusting the loss function to prioritize underrepresented groups.

These methods were tested on four standard benchmarks for spurious correlations: CelebA (blond hair vs. gender), Waterbirds (birds vs. backgrounds), MultiNLI (language inference vs. negation words), and CivilComments (toxicity vs. identity mentions).

Key Results and Stability

Our experiments reveal that simple group subsampling (SUBG) or reweighting (RWG) matches or exceeds the performance of complex methods like JTT in nearly all cases.

Beyond accuracy, a major advantage of simple balancing is stability. As illustrated in the comparison below, standard Empirical Risk Minimization (ERM) fails to capture core features, resulting in zero WGA. While Reweighting (RWG) can achieve high WGA, it is notoriously unstable; its performance often crashes if training continues for too many iterations. In contrast, Subsampling (SUBG) remains remarkably stable throughout the training process.

Comparison of ERM, SUBG, and RWG decision boundaries and WGA stability over iterations.

Furthermore, SUBG is a "speed demon." On the Waterbirds dataset, SUBG reached peak performance in just 5 minutes per epoch, compared to 39 minutes for gDRO and 74 minutes for JTT—a nearly 7x to 14x improvement in training efficiency.

The Validation Secret

One of the most significant findings is that group labels are not strictly necessary during the training phase to achieve high WGA. However, they are essential for validation. Most SOTA methods rely on group-labeled validation sets to perform model selection (picking the best epoch). We demonstrate that if a group-labeled validation set is available, simple balancing techniques perform just as well as complex alternatives, suggesting that the complexity of the training objective may be secondary to the quality of the model selection process.

Conclusion and Future Work

This study suggests that for maximizing worst-group accuracy, balanced data is better than more data. Adding more biased data can inadvertently strengthen spurious correlations, making models less robust. While subsampling is highly effective, it does involve discarding data, which may be a limitation for smaller datasets.

Future research should shift focus from developing increasingly complex training objectives toward solving the challenge of model selection under weak supervision—specifically, how to build robust models when group labels are unavailable even for the validation set.

Summary updated

BibTeX
@inproceedings{idrissi2022simple,
  author = {Badr Youbi Idrissi and Martín Arjovsky and Mohammad Pezeshki and David Lopez-Paz},
  title = {{Simple data balancing achieves competitive worst-group-accuracy}},
  booktitle = {CLeaR},
  year = {2022},
  url = {https://openreview.net/forum?id=ef323z7xlI},
}
Figure