Enforcing Conditional Independence for Fair Representation Learning and Causal Image Generation

Jensen Hwa, Qingyu Zhao, Aditya Lahiri, Adnan Masood, Babak Salimi, Ehsan Adeli

TL;DR

This paper introduces a novel training paradigm that enforces conditional independence (CI) constraints directly within high-dimensional latent representation spaces. By leveraging a unique dynamic sampling strategy to minimize Jensen-Shannon divergence, the authors successfully eliminate bias from generative model representations, enabling both fair downstream classification and controllable, causal image generation.

What Problem Does This Paper Address?

Algorithmic fairness typically relies on enforcing conditional independence—for example, ensuring that a model's prediction ($\hat{y}$) is independent of a protected attribute ($s$, like race or gender) given the true label ($y$). However, traditional approaches suffer from a major dichotomy: they either blindly strip out all features related to the protected attribute (which destroys image generation quality), or they only enforce fairness on the final output layer, leaving the internal latent representations heavily biased.

Enforcing conditional independence directly within high-dimensional latent spaces ($v$) would solve this, but it presents a serious "chicken-and-egg" computational challenge. To minimize the divergence between the true latent distribution and a fair ideal, you need to sample from the conditional distribution $p(v|y)$. Because the latent space is constantly changing as the encoder trains, constructing an accurate conditional sampler a priori is virtually impossible.

Methods

The authors tackle this sampling bottleneck by introducing a Dynamic Sampler architecture.

Figure 1. We propose a new way to ensure fairness in downstream tasks by enforcing conditional independence constraints on the la- tent representation. This is achieved by minimizing the Jensen- Shannon divergence (JS) between distributions obtained using a novel dynamic sampling technique. In the setting shown here, we apply our technique to the diffusion autoencoder’s semantic repre- sentation to disentangle the sensitive attribute of skin type (a proxy variable for race) and perform causal image generation.

Instead of trying to pre-compute a perfect conditional sampler, they approximate the empirical distribution $p(v|y)$ on the fly. During training, the dynamic sampler draws samples with replacement from the latent vectors within the same training batch that share the same target label $y$. This bootstrapping technique allows a dual-discriminator GAN framework to robustly minimize the Jensen-Shannon (JS) divergence between the biased and unbiased joint distributions.

The authors integrate this enforcer into a Diffusion Autoencoder (DiffAE). To prevent the fairness constraint from degrading image quality, they split the model's semantic subcode into two distinct parts:

  1. An invariant portion, where conditional independence is strictly enforced.
  2. A variant portion, which explicitly uses a prediction head to capture the sensitive attribute.

Datasets

The approach was evaluated on two distinct setups:

  • Synthetic Dataset: $32\times32$ pixel images containing four Gaussian kernels. Two diagonal kernels represent the target feature ($\sigma_A$), while two off-diagonal kernels represent the confounding protected attribute ($\sigma_B$).
  • Gender Shades Dataset: A real-world dataset consisting of 1,270 facial images annotated with sex (target label) and skin type via the Fitzpatrick classification system (protected attribute). The underlying Diffusion Autoencoder was pretrained on the Flickr-Faces-HQ (FFHQ) dataset (70,000 face images).

Key Insights and Ideas

  • Latent Space vs. Label Space: Enforcing fairness in the latent space ($v$-space) yields vastly superior debiasing compared to doing so only in the final label space ($y$-space). Label-space constraints often result in unstable training and fail to stop the encoder from learning biased representations.
  • The Power of Imperfect Samplers: A key mathematical advantage of this JS-divergence formulation is that the conditional sampler $q(v'|y)$ doesn't need to be perfect; it only needs to share overlapping support with the true distribution to effectively guide the encoder toward fairness.
  • Preserving Realism via Subcode Splitting: Forcing an entire semantic latent space to be invariant to an attribute like skin type ruins image generation because the model compensates by shoving anatomical data into its stochastic noise subcode. Splitting the semantic subcode allows the model to cleanly disentangle and control causal factors without sacrificing image sharpness.

Key Results

In the synthetic experiments, the $v$-space conditional independence model achieved a balanced accuracy of 0.84, remarkably close to the theoretical fair maximum of 0.83, while dropping the squared distance correlation ($dcor^2$) down to a negligible 0.055 (compared to 0.432 for a vanilla CNN).

Figure 5. Fairness and accuracy metrics versus conditional inde- pendence strength λ. Orange lines correspond to the y-space CI- CNN, and blue lines to the v-space CI-CNN.

When applied to the real-world Gender Shades dataset for sex classification, the $v$-space CI-DiffAE outperformed all baseline methods:

  • Balanced Accuracy: Achieved 96.6%, higher than Kim et al. (88.8%) and the Vanilla Diffusion Autoencoder (93.0%).
  • Fairness Metrics: Reduced the Equalized Odds (EO) gap to 5.0% and achieved a low $dcor^2$ of 0.076, demonstrating excellent debiasing without sacrificing downstream task performance.

Qualitatively, this allowed the authors to smoothly alter race-variant features (skin tone) in generated images while keeping other core facial structures perfectly intact.

Limitations and Future Work

While highly effective, the current implementation was primarily demonstrated on tasks isolating a single sensitive attribute at a time. The authors note that while the architecture can theoretically be extended to handle multiple protected attributes simultaneously, they haven't yet mapped out its performance limits under highly complex, multi-variable causal graphs. They suggest that future work could leverage these conditionally invariant embeddings to scale traditional causal frameworks, such as mediational analysis, into high-dimensional deep learning spaces.

Summary updated

Abstract

Conditional independence (CI) constraints are critical for defining and evaluating fairness in machine learning, as well as for learning unconfounded or causal representations. Traditional methods for ensuring fairness either blindly learn invariant features with respect to a protected variable (e.g., race when classifying sex from face images) or enforce CI relative to the protected attribute only on the model output (e.g., the sex label). Neither of these methods are effective in enforcing CI in high-dimensional feature spaces. In this paper, we focus on a nascent approach characterizing the CI constraint in terms of two Jensen-Shannon divergence terms, and we extend it to high-dimensional feature spaces using a novel dynamic sampling strategy. In doing so, we introduce a new training paradigm that can be applied to any encoder architecture. We are able to enforce conditional independence of the diffusion autoencoder latent representation with respect to any protected attribute under the equalized odds constraint and show that this approach enables causal image generation with controllable latent spaces. Our experimental results demonstrate that our approach can achieve high accuracy on downstream tasks while upholding equality of odds.
BibTeX
@misc{hwa2024enforcing,
  author = {Jensen Hwa and Qingyu Zhao and Aditya Lahiri and Adnan Masood and Babak Salimi and Ehsan Adeli},
  title = {{Enforcing Conditional Independence for Fair Representation Learning and Causal Image Generation}},
  year = {2024},
  eprint = {2404.13798},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.13798},
}
Figure