Enhancing Class Fairness in Classification with A Two-Player Game Approach

Yunpeng Jiang, Paul Weng, Yutong Ban

Abstract: Data augmentation is widely applied and has shown its benefits in different machine learning tasks. However, as recently observed, it may have an unfair effect in multi-class classification. While data augmentation generally improves the overall performance (and therefore is beneficial for many classes), it can actually be detrimental for other classes, which can be problematic in some application domains. In this paper, to counteract this phenomenon, we propose CLAM, a CLAss-dependent Multiplicative-weights method. To derive it, we first formulate the training of a classifier as a non-linear optimization problem that aims at simultaneously maximizing the individual class performances and balancing them. By rewriting this optimization problem as an adversarial two-player game, we propose a novel multiplicative weight algorithm, for which we prove the convergence. Interestingly, our formulation also reveals that the class-dependent effects of data augmentation is not due to data augmentation only, but is in fact a general phenomenon. Our empirical results over six datasets demonstrate that the performance of learned classifiers is indeed more fairly distributed over classes, with only limited impact on the average accuracy.

Introduction

In computer vision, data augmentation (DA) is often considered the "free lunch" of machine learning. Techniques like random cropping, flipping, or color jittering effectively increase dataset diversity and prevent overfitting. However, recent research has uncovered a significant "fairness" problem: DA does not benefit all classes equally. In many cases, it can be detrimental to specific classes, leading to substantial performance gaps between "easy" and "hard" classes.

This disparity is particularly critical in safety-sensitive domains. For instance, an autonomous vehicle model with 99% average accuracy is still dangerous if it consistently fails to recognize a rare but vital road sign. This paper argues that such class-dependent effects are not merely a quirk of DA but a fundamental issue in standard training objectives that prioritize average performance over equitable treatment across all classes.

Methodology: The CLAM Framework

To address this, we propose CLAM (CLAss-dependent Multiplicative-weights), which reformulates classifier training as an adversarial two-player zero-sum game.

Conceptual overview of the two-player game between a Max player (classifier) and a Min player (weight assigner) to balance class performance.

In this framework, the training process involves two competing agents:

  1. The Max Player (The Classifier): Aims to maximize the weighted accuracy across all classes by updating the model parameters ($\theta$).
  2. The Min Player (The Weight Assigner): Aims to ensure fairness by adjusting the weights ($w$) assigned to each class. If a class performs poorly, the Min player increases its weight, compelling the Max player to prioritize that class in subsequent training rounds.

Algorithmic Implementation

To solve this game, CLAM utilizes the Multiplicative Weights Update (MWU) algorithm, specifically a variant of the Hedge algorithm. Standard "max-min" fairness approaches often focus solely on the single worst-performing class, which can lead to training instability and oscillations. CLAM avoids this by using a constrained simplex for weight assignment. This constraint prevents weights from becoming too extreme, ensuring the model continues to learn from all classes while still prioritizing those that are struggling.

The iterative update process of CLAM across training epochs, showing the interaction between the payoff matrix, weight updates, and parameter optimization.

As shown in the iterative process above, the payoff matrix $M$ tracks per-class accuracy. The Min player updates the weight vector $w^t$ based on these performances, which then informs the Max player's loss function for updating $\theta^{t+1}$. We provide a theoretical proof of convergence, demonstrating that the average loss of the Min player's strategy asymptotically approaches the optimal fixed strategy.

Experimental Results

We evaluated CLAM across six diverse image classification benchmarks, including CIFAR-10/100, Fashion-MNIST, Mini-ImageNet, the full ImageNet, and the class-imbalanced iNaturalist2018 dataset.

Key Findings

  • Fairness Gains: CLAM consistently reduced performance variance. On CIFAR-100, it reduced the standard deviation of class accuracies from 11.8% to 10.8% and narrowed the gap between the best and worst classes by over 3%.
  • Worst-Class Improvement: Significant gains were observed in the bottom decile of classes. For Fashion-MNIST, the worst-class accuracy improved from 81.0% to 82.5%.
  • Universal Disparity: Our results show that class-dependent performance gaps exist even without data augmentation; DA simply exacerbates an underlying tendency of neural networks to favor certain features.
  • Accuracy-Fairness Trade-off: While CLAM achieved these fairness gains with minimal impact on average accuracy, a slight decrease (typically <0.5%) was noted in some datasets. However, in cases like CIFAR-100 and Mini-ImageNet, CLAM actually improved overall average accuracy, suggesting that focusing on difficult classes can benefit the entire model.

Conclusion

CLAM provides a robust, game-theoretic framework for enhancing class fairness in multi-class classification. By dynamically balancing class weights through an adversarial process, it mitigates the unfair side effects of data augmentation and standard training. Future work will explore extending this approach to multi-task learning and other performance metrics beyond accuracy.

Summary updated

BibTeX
@article{jiang2025enhancing,
  author = {Yunpeng Jiang and Paul Weng and Yutong Ban},
  title = {{Enhancing Class Fairness in Classification with A Two-Player Game Approach}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=zNsfgCns7x},
}
Figure