FairSwiRL: fair semi-supervised classification with representation learning

Shuyi Yang, Mattia Cerrato, Dino Ienco, Ruggero G. Pensa, Roberto EspositoMachine Learning 2023

Abstract

Machine learning models often face the dual challenge of limited labeled data and the need to mitigate algorithmic bias. We present FairSwiRL (Fair Semi-supervised classification with Representation Learning), a framework that leverages large amounts of unlabeled data to learn fair representations. By combining a semi-supervised autoencoder with an adversarial debiasing component, FairSwiRL effectively "scrubs" sensitive information from data representations. Our results demonstrate that FairSwiRL maintains high predictive accuracy while satisfying strict fairness constraints, even in scenarios with extreme label bias and minimal supervision.

Introduction

In high-stakes domains such as medical diagnostics and credit scoring, obtaining labeled data is often costly and time-consuming. Semi-supervised learning (SSL) addresses this by utilizing a small labeled dataset alongside a larger unlabeled pool. However, if the available labels reflect historical biases, standard SSL models risk amplifying these inequities.

The primary challenge lies in the fact that debiasing typically requires significant data to model the relationships between features and sensitive attributes. When labels are scarce, models struggle to distinguish between task-relevant patterns and discriminatory signals. FairSwiRL addresses this by asking: can unlabeled data—which is free from explicit label bias—be used to "unlearn" discrimination while maintaining classification performance?

Methodology

FairSwiRL is a deep learning architecture designed to optimize three concurrent objectives: reconstruction, classification, and debiasing.

Architecture Components

The framework consists of three primary modules:

  1. Encoder-Decoder (Autoencoder): This unsupervised core learns a compact latent representation ($z$) of the input data ($x$). By reconstructing the input, the model ensures that $z$ captures essential structural information.
  2. Classifier ($C_{\theta_c}$): An auxiliary network that predicts the target label ($y$) from the latent representation $z$, trained on the limited labeled subset.
  3. Adversarial Debiaser ($F_{\theta_f}$): This component attempts to predict the sensitive attribute ($s$) from $z$.
Figure 1: The FairSwiRL architecture. The encoder is trained to minimize reconstruction and classification loss while maximizing the loss of the sensitive attribute classifier via gradient reversal.

Adversarial Training

The "secret sauce" of FairSwiRL is the use of gradient reversal between the encoder and the debiaser. The encoder is incentivized to produce representations that make it impossible for the debiaser to identify protected group membership. This process forces the latent space to discard discriminatory information while retaining features necessary for the primary classification task.

Experimental Evaluation

The authors evaluated FairSwiRL across five diverse datasets, including Census Income (ADULT), Credit Default (CARD), and Recidivism (COMPAS). To test the limits of the framework, they also utilized a synthetic dataset where bias levels could be perfectly controlled.

Figure 2: Example of synthetic data labels and predictions, illustrating the challenge of learning from biased or unknown labels in a semi-supervised setting.

Key Insights

  • Unlabeled Data as a Fairness Catalyst: Unlabeled data is inherently "fairer" because it lacks biased target labels. FairSwiRL uses this data to better map the distribution of sensitive attributes, enhancing the effectiveness of adversarial debiasing.
  • Decoupled Representations: By learning a fair feature space ($z$), the resulting representations can be used with various downstream classifiers (e.g., Random Forest, SVM) while maintaining fairness properties.
  • Robustness in Extremes: The model remains stable even with as few as 10 labels or in cases where labels are 100% biased against a specific group.

Results

FairSwiRL was compared against state-of-the-art methods including FESF, FairSSL, and the Variational Fair Autoencoder (VFAE).

  • Fairness-Accuracy Tradeoff: Using the Statistical Absolute Difference (SAD) for fairness and Matthews Correlation Coefficient (MCC) for accuracy, FairSwiRL consistently achieved an optimal tradeoff.
  • Extreme Bias Resilience: In tests with perfectly biased labels, FairSwiRL was often the only method capable of producing a fair model, whereas competitors either failed to converge or produced highly discriminatory outputs.

Limitations and Future Work

Current limitations include a focus on single sensitive attributes rather than intersectional fairness. Additionally, while the model optimizes for Statistical Parity, other definitions like Equalized Odds remain challenging to estimate in semi-supervised settings due to label scarcity. Future work will also address the sensitivity of adversarial training to hyperparameter tuning.

Summary updated

BibTeX
@article{yang2023fairswirl,
  author = {Shuyi Yang and Mattia Cerrato and Dino Ienco and Ruggero G. Pensa and Roberto Esposito},
  title = {{FairSwiRL: fair semi-supervised classification with representation learning}},
  journal = {Machine Learning},
  year = {2023},
  doi = {10.1007/s10994-023-06342-9},
}
Figure