Dr-Fairness: Dynamic Data Ratio Adjustment for Fair Training on Real and Generated Data

Yuji Roh, Weili Nie, De-An Huang, Steven Euijong Whang, Arash Vahdat, Anima AnandkumarICLR 2023 · OpenReview

Introduction

Dr-Fairness is a novel framework that uses bilevel optimization to dynamically find the perfect mix of real and generated data for fair AI training. By accounting for differences in learning difficulty and data quality across demographic groups, it achieves state-of-the-art fairness without the typical "accuracy tax" seen in previous methods.

The Problem: Beyond 1:1 Balancing

Machine learning models—especially in visual recognition—often inherit the biases of their training data. If a dataset contains 90% light-skinned faces and 10% dark-skinned faces, the resulting model will likely perform poorly on the minority group.

To fix this, researchers often use generative models (like GANs or Diffusion models) to "fill in the gaps" by creating synthetic images of underrepresented groups. However, current approaches usually rely on a simple heuristic: balance the groups to a 1:1 ratio.

The authors argue that "equal" is not the same as "optimal." A 1:1 ratio ignores two critical factors:

  1. Learning Difficulty: Some groups or classes are inherently harder for a model to learn than others.
  2. Data Quality: Synthetic data isn't perfect. If the generated images for one group are blurry or "noisy," forcing the model to use them in a 1:1 ratio can actually hurt accuracy and fairness.

Methodology: The Dr-Fairness Framework

The core of the paper is Dr-Fairness (Dynamic Data Ratio Adjustment for Fairness). It treats fair training as a bilevel optimization problem, dynamically adjusting the influence of different data subsets during training.

Dr-Fairness Framework Overview

The framework operates in two continuous loops:

  • The Inner Loop: The model trains its weights on a specific weighted mix of real and generated data.
  • The Outer Loop: The system evaluates the model’s current fairness (e.g., Equalized Odds) and classification loss. It then updates the sampling ratios for demographic groups and for real vs. generated data to improve performance in the next iteration.

The Secret Sauce: Efficiency Normally, solving bilevel optimization for deep neural networks is computationally prohibitive because it requires calculating a massive "inverse Hessian" matrix. The authors bypass this by using the Implicit Function Theorem (IFT) combined with a simple identity-matrix approximation. This allows the system to update data ratios on the fly during standard training with minimal overhead.

Datasets and Experimental Setup

The authors tested Dr-Fairness on two major benchmarks:

  • CelebA: A dataset of over 200,000 celebrity faces. They focused on attributes like gender and age as sensitive groups, and hair color or smiling as target labels.
  • ImageNet People Subtree: A much more challenging, large-scale dataset containing 112 occupation classes (e.g., "anchor," "astronaut") and sensitive attributes like skin color and age.
  • Synthetic Data: They used StyleGAN (via LACE) for CelebA and Diffusion Models for ImageNet to generate the supplemental fair data.

Key Insights and Results

Traditional fairness methods often suffer from "accuracy degradation"—you get a fairer model, but it's less accurate overall. Dr-Fairness shows that by intelligently mixing real and synthetic data, you can actually improve both metrics simultaneously.

Accuracy and Fairness Performance Comparison
  • State-of-the-Art Fairness: On CelebA, Dr-Fairness reduced the Equalized Odds (EO) disparity from 0.173 (non-fair) to 0.020, outperforming all baselines.
  • Accuracy Boost: On the complex ImageNet People Subtree, Dr-Fairness achieved a 5–9% absolute improvement in accuracy over the best previous fair baseline (FairBatch) while maintaining similar or better fairness scores.
  • The "Trust" Factor: One of the most interesting findings is that Dr-Fairness automatically learns how much to "trust" generated data. In experiments where the authors intentionally added noise to synthetic images, the algorithm adaptively reduced the ratio of generated data used for training.
  • Beyond 1:1: The optimal ratio for fairness is rarely a perfect 50/50 split. Depending on the group, the model might perform best with a 70/30 split of real vs. generated data.

Limitations and Future Work

While Dr-Fairness is efficient, it still adds some computational cost compared to "vanilla" training. The authors note that this can be mitigated by updating the data ratios every few iterations rather than every single step.

Additionally, the method relies on having a pre-trained generative model capable of producing group-specific data. If a demographic group is so underrepresented that a generative model cannot learn to synthesize it, Dr-Fairness cannot compensate. Future work could involve integrating the training of the generative model directly into the fairness optimization loop.

Summary updated

Abstract

Fair visual recognition has become critical for preventing demographic disparity. A major cause of model unfairness is the imbalanced representation of different groups in training data. Recently, several works aim to alleviate this issue using generated data. However, these approaches often use generated data to obtain similar amounts of data across groups, which is not optimal for achieving high fairness due to different learning difficulties and generated data qualities across groups. To address this issue, we propose a novel adaptive sampling approach that leverages both real and generated data for fairness. We design a bilevel optimization that finds the optimal data sampling ratios among groups and between real and generated data while training a model. The ratios are dynamically adjusted considering both the model's accuracy as well as its fairness. To efficiently solve our non-convex bilevel optimization, we propose a simple approximation to the solution given by the implicit function theorem. Extensive experiments show that our framework achieves state-of-the-art fairness and accuracy on the CelebA and ImageNet People Subtree datasets. We also observe that our method adaptively relies less on the generated data when it has poor quality.
BibTeX
@inproceedings{roh2023dr,
  author = {Yuji Roh and Weili Nie and De-An Huang and Steven Euijong Whang and Arash Vahdat and Anima Anandkumar},
  title = {{Dr-Fairness: Dynamic Data Ratio Adjustment for Fair Training on Real and Generated Data}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=1FVv8PS8LYW},
}
Figure