Source-linked AI summary

FairBatch: Batch Selection for Model Fairness

Yuji Roh, Kangwook Lee, Steven Euijong Whang, Changho Suh

arXiv:2012.01696v2cs.LGcs.AIstat.ML

TL;DR

Fair machine-learning methods often require broad changes to preprocessing or training, limiting adoption in complex systems. FairBatch addresses this with bilevel optimization that adds adaptive fairness-aware minibatch selection around standard training, and experiments report comparable or better performance across accuracy, fairness, and runtime.

  • Problem

    Existing fairness methods often require changes to data preprocessing or model training, making them difficult to adopt in potentially complex machine-learning systems.

  • Method

    FairBatch uses bilevel optimization with standard training as the inner optimizer and an outer optimizer that adaptively selects minibatch sizes by sensitive group.

  • Results

    Across synthetic and benchmark real datasets, FairBatch achieves comparable or greater performance than state-of-the-art methods across accuracy, fairness, and runtime.

  • Takeaways & Limitations

    FairBatch supports equal opportunity, equalized odds, and demographic parity with minimal integration changes and can fine-tune pre-trained models for improved fairness.

  • Takeaways & Limitations

    For multiple sensitive groups, the efficient adjacent-disparity approximation may allow a nonadjacent disparity as large as (nz − 1) × ϵ.

Abstract

from arXiv · show

Training a fair machine learning model is essential to prevent demographic disparity. Existing techniques for improving model fairness require broad changes in either data preprocessing or model training, rendering themselves difficult-to-adopt for potentially already complex machine learning systems. We address this problem via the lens of bilevel optimization. While keeping the standard training algorithm as an inner optimizer, we incorporate an outer optimizer so as to equip the inner problem with an additional functionality: Adaptively selecting minibatch sizes for the purpose of improving model fairness. Our batch selection algorithm, which we call FairBatch, implements this optimization and supports prominent fairness measures: equal opportunity, equalized odds, and demographic parity. FairBatch comes with a significant implementation benefit -- it does not require any modification to data preprocessing or model training. For instance, a single-line change of PyTorch code for replacing batch selection part of model training suffices to employ FairBatch. Our experiments conducted both on synthetic and benchmark real data demonstrate that FairBatch can provide such functionalities while achieving comparable (or even greater) performances against the state of the arts. Furthermore, FairBatch can readily improve fairness of any pre-trained model simply via fine-tuning. It is also compatible with existing batch selection techniques intended for different purposes, such as faster convergence, thus gracefully achieving multiple purposes.

1 INTRODUCTION

FairBatch addresses the adoption burden of fair machine learning by adding fairness-aware batch selection around standard training. It adjusts sensitive-group batch ratios to support equalized odds, equal opportunity, and demographic parity while requiring only a minimal training-pipeline change.

  • Fairness techniques commonly modify data preprocessing or model training, making them difficult to adopt in complex machine-learning systems.
  • FairBatch uses bilevel optimization, retaining standard training as the inner optimizer and adding an outer optimizer for fairness-aware batch selection.
  • FairBatch adjusts sensitive-group batch sizes according to fairness measured on an intermediate model from the current epoch.
  • Equalized odds is achieved by minimizing accuracy disparity between sensitive groups conditioned on the true label, with FairBatch also supporting equal opportunity and demographic parity.
  • FairBatch requires only a slight batch-selection modification and no other changes to data preprocessing or model training.
  • Experiments on synthetic and benchmark datasets report accuracy, fairness, and runtime that are at least comparable to state-of-the-art methods.

2 BILEVEL OPTIMIZATION FOR FAIRNESS

The paper interprets adaptive batch selection as bilevel optimization: minibatch SGD remains the inner optimizer while an outer optimizer changes sampling to reduce fairness disparities. Fairness criteria are encoded through group-specific risks and sampling variables, with extensions beyond binary attributes using an efficient approximation.

  • Bilevel optimization: Standard training such as SGD serves as the inner optimizer, while batch selection acts as an outer optimizer that updates sampling based on inner-optimization outcomes.
  • Bilevel optimization: Changing minibatch sampling away from uniform sampling produces an unbiased estimate of a reweighted empirical risk rather than the overall empirical risk.
  • Fairness criteria: For equal opportunity, FairBatch adjusts sampling between the y = 1 sensitive groups and minimizes |L1,0(wλ) − L1,1(wλ)|.
  • Fairness criteria: For equalized odds, FairBatch adjusts sampling across both true-label strata and minimizes the maximum of the two group disparities.
  • Fairness criteria: For demographic parity, FairBatch adjusts sampling across groups and labels to enforce sufficient equalities among group-conditioned risks.
  • Beyond binary attributes: With more than two sensitive-attribute values, the implementation uses adjacent disparities; if each is at most ϵ, a nonadjacent disparity can reach (nz − 1) × ϵ.

3 UPDATE RULE OF FAIRBATCH

FairBatch updates batch-selection parameters through bilevel optimization, with separate rules for one or multiple fairness disparities. Under stated conditions, the one-disparity objective is quasiconvex and the signed-gradient update converges, while broader convexity guarantees do not generally hold.

  • Update rules: FairBatch uses efficient update rules tailored to the number of fairness disparities: gradient descent for d = 1 and an extension for d > 1.Equal opportunity is treated as one-dimensional, while equalized odds and demographic parity are multidimensional.
  • One-disparity case: For d = 1, the outer objective F(λ) = |f1(wλ) − g1(wλ)| is quasiconvex under specified regularity conditions.The conditions include twice differentiability and positive definiteness of a weighted Hessian expression, among alternatives stated in Lemma 1.
  • One-disparity case: The signed-gradient update increases λ by α when f1(wλ) ≤ g1(wλ) and decreases it otherwise, increasing sampling of the disadvantageous group.This direction follows the sign of the disparity between the two group objectives.
  • Convergence: The one-dimensional iterates satisfy |λ(t) − λ*| ≤ max{|λ(0) − λ*| − tα, α}.Proposition 1 provides this convergence bound for λ* = arg minλ F(λ).
  • Scope and limitations: The outer objective need not be convex even when the inner objectives are convex or strongly convex.In the non-convex setting, the paper reports empirical performance but provides no theoretical guarantee.
  • Multiple-disparity case: For multiple disparities, FairBatch derives a subgradient involving Hλ but approximates it using only the component associated with the largest disparity.This approximation avoids the expensive Hessian computation required for the full subgradient.

4 EXPERIMENTS

The experiments evaluate FairBatch against non-fair, pre-processing, and in-processing baselines across synthetic and benchmark datasets using accuracy, fairness, runtime, and pretrained-model fine-tuning settings. Results indicate that FairBatch offers competitive fairness and accuracy, improves fairness during fine-tuning, and can accelerate convergence when combined with importance sampling.

  • Evaluation criteria: Fairness is quantified using equal opportunity, equalized odds, and demographic parity disparities across sensitive groups.The experiments also report accuracy and complexity, with runtime examined separately.
  • Experimental setup: Experiments compare FairBatch with non-fair, pre-processing, and in-processing baselines on synthetic, COMPAS, and AdultCensus datasets.The evaluation uses separate test sets and repeats experiments with 10 random seeds.
  • Accuracy, fairness, and runtime: FairBatch achieves comparable or greater fairness while sacrificing less accuracy than the evaluated pre-processing and in-processing methods.Table 1 evaluates accuracy, EO disparity, and complexity across the synthetic, COMPAS, and AdultCensus test sets.
  • Fine-tuning pretrained models: FairBatch improves equalized-odds fairness for pretrained ResNet18 and GoogLeNet models on UTKFace without sacrificing accuracy.The evaluation uses race as the sensitive attribute and considers gender or age as the label attribute.
  • Compatibility with other batch selection techniques: Combining FairBatch with loss-based importance weighting reduces convergence time by about 50 epochs while maintaining similar fairness performance.The compatibility experiment evaluates equalized odds and demographic parity on the synthetic dataset.

5 RELATED WORK

FairBatch is positioned among group-fairness and batch-selection methods as a lightweight alternative grounded in bilevel optimization. Its scope covers several group-fairness measures but not individual, causal, or distributionally robust fairness.

  • Model Fairness: Fairness methods include pre-processing, in-processing, and batch-selection approaches, with FairBatch focusing on group fairness.The paper focuses on equal opportunity, equalized odds, and demographic parity.
  • Model Fairness: AdaFair reweights examples across boosting rounds, whereas FairBatch adjusts batch composition each epoch and reports an order-of-magnitude speed improvement.
  • Model Fairness: FairBatch does not directly address individual fairness, causality-based fairness, or distributionally robust optimization-based fairness.Extending FairBatch to these measures is identified as future work.
  • Model Fairness: FairBatch addresses majority-error effects through sensitive-group batch balancing and can address some encoded bias, but it does not directly solve insufficient data collection.

6 CONCLUSION

The paper concludes that FairBatch uses bilevel optimization to adaptively select batches for fairness while retaining SGD as the inner optimizer. It supports three group-fairness measures and is designed for simple integration with competitive accuracy, fairness, and runtime.

  • Conclusion: FairBatch combines an SGD inner optimizer with an outer optimizer that adaptively selects batches to improve fairness.
  • Conclusion: The framework supports equal opportunity, equalized odds, and demographic parity through its underlying bilevel-optimization theory.
  • Conclusion: FairBatch is reported to achieve performance on par with or better than state-of-the-art methods across accuracy, fairness, and runtime.
  • Conclusion: The method can be adopted by replacing batch selection with a single line of code and combined with batch-selection techniques for faster convergence.
  • Conclusion: A sufficient demographic-parity condition equates the relevant loss terms across sensitive groups when the associated class proportions are equal.

A.2 PROOF FOR LEMMA 1

The proof establishes quasi-convexity of the outer objective by showing that the loss difference is nonincreasing in the weighting parameter. It handles both a zero-regularizer case and a twice-differentiable case under a positive-definite Hessian condition.

  • Proof strategy: The proof reduces quasi-convexity of F(λ) to showing that f1(wλ) − g1(wλ) is nonincreasing.The absolute value of a nonincreasing function is nonincreasing and then nondecreasing.
  • Case 1: In Case 1, increasing λ places greater weight on f1, producing lower f1(w*) and higher g1(w*) under the inner optimization.
  • Proof strategy: The contradiction arguments complete the first monotonicity claim, after which the second claim follows from F(λ)=|f1(wλ)−g1(wλ)|.
  • Case 2: In Case 2, twice differentiability and a positive-definite weighted Hessian condition support the monotonicity argument through implicit differentiation.
  • Derivative sign: Away from F(λ)=0, the outer derivative has the sign of g1(wλ) − f1(wλ), linking the update direction to the loss imbalance.

A.3 INNER OBJECTIVE’S CONVEXITY DOES NOT IMPLY OUTER OBJECTIVE’S CONVEXITY

The appendix shows that convex inner objectives do not guarantee a convex outer objective, while the outer objective can remain quasi-convex. It then motivates and describes FairBatch’s adaptive parameter updates from intermediate-model losses.

  • Outer-objective geometry: Strongly convex inner functions can produce an outer objective F(λ) that is not convex but is quasi-convex.
  • Outer-objective geometry: The example uses the strongly convex function f1(w) = e^w + e^−w to demonstrate the distinction between inner and outer convexity.
  • Gradient derivation: The gradient derivation assumes a positive-definite aggregate Hessian over the weighted inner objectives and regularizer.
  • Gradient approximation: The gradient approximation concentrates γ on the coordinate whose fairness-loss gradient difference is largest when the coordinate norms are approximately equal.
  • Adaptive updates: FairBatch updates λ by comparing class-conditioned losses from an intermediate model, with separate procedures for equal opportunity and equalized odds.

B.1 OTHER EXPERIMENTAL SETTINGS

The experiments use Adam for training, cross-validation for hyperparameter selection, and separate test sets with dataset-specific train-to-test ratios.

  • Adam is used as the optimizer for all trainings.
  • Cross-validation on the training sets selects the best hyperparameters for each algorithm.
  • The models are evaluated on separate test sets, using train-to-test ratios of 2:1 for synthetic data and 4:1 for real data.

B.2 EQUALIZED ODDS RESULTS

The equalized-odds evaluation compares fairness techniques across synthetic, COMPAS, and AdultCensus test sets, while extending FairBatch to equalized odds through adaptive group reweighting. FairBatch converges quickly to low fairness disparities and shows robust accuracy, fairness, and runtime performance.

  • FairBatch achieves robust performance across accuracy, fairness, and runtime on synthetic, COMPAS, and AdultCensus equalized-odds tests.
  • The ED comparison is reported on synthetic, COMPAS, and AdultCensus test sets, with other settings matching Table 1.
  • Equalized-odds disparity measures prediction disparities between sensitive groups conditioned on the true label.
  • FairBatch is among the fastest methods to converge to low equalized-odds or demographic-parity disparities.

B.5 TRADE-OFF CURVES OF FAIRBATCH

FairBatch’s synthetic-data curves examine convergence, accuracy–fairness trade-offs, runtime, weight changes, multiclass extensions, and compatibility with loss-based weighting. The results show a clear accuracy–disparity trade-off and faster convergence when combined with loss-based weighting.

  • FairBatch exposes a clear trade-off between accuracy and disparity for both equal opportunity and demographic parity.The trade-off is controlled by updating λ only when disparity exceeds a threshold T.
  • Each runtime is proportional to the number of epochs, while a FairBatch batch takes 1.5x longer than a logistic-regression batch.
  • For multiclass equalized odds, FairBatch adjusts the λ parameters associated with the class having the highest disparity in each epoch.
  • FairBatch uses about 50 fewer epochs to reach low disparities when combined with loss-based weighting.
Loading 2012.01696v2…