Image Counterfactual Sensitivity Analysis for Detecting Unintended Bias

Remi Denton, Ben Hutchinson, Margaret Mitchell, Timnit Gebru, Andrew ZaldivararXiv 2019

TL;DR

This paper introduces a framework for "causal auditing" of facial analysis models by using Generative Adversarial Networks (GANs) to create counterfactual images. By subtly manipulating specific facial attributes (like adding makeup or changing hair length) while keeping other features constant, the authors can measure exactly how sensitive a classifier is to irrelevant traits, revealing hidden and unintended biases.

What Problem Does This Paper Address?

Facial analysis models are increasingly deployed in high-stakes scenarios, from border control to hiring. While researchers often evaluate these models by comparing error rates across demographic groups (e.g., checking if a model is less accurate for women than men), these "disaggregated evaluations" don't tell the whole story. They show that a bias exists, but not necessarily why.

The authors argue that we need to understand the causal relationship between specific image features and a model's output. For instance, if a "smiling" classifier is more likely to label a face as smiling simply because the person is wearing lipstick, that indicates a problematic, unintended bias. The challenge is that in real-world datasets, attributes are highly correlated (e.g., makeup is correlated with gender expression), making it difficult to isolate the effect of a single feature.

Methods

The authors propose Image Counterfactual Sensitivity Analysis, which involves three main steps:

  1. Generative Modeling: They train a Progressive GAN on a large dataset of faces to create a continuous "latent space" where every point represents a realistic face. They also train an encoder to map real images into this latent space.
  2. Attribute Vector Discovery: To manipulate a specific trait (like "Young" or "No Beard"), they find a direction in the latent space—an attribute vector ($d_a$)—that corresponds to that trait. This is done by training a linear classifier to separate the latent codes of images with the attribute from those without it. Finding attribute vectors in latent space
  3. Sensitivity Metrics: They define two new metrics to quantify bias:
  4. Score Sensitivity: How much the model's continuous confidence score changes when an attribute is added or removed ($z + \lambda d_a$).
  5. Classification Sensitivity: The probability that the model's final binary label (e.g., "Smiling" vs. "Not Smiling") flips due to the manipulation.
Figure 2: Attribute vectors are computed by training a linear classifier to discriminate between latent codes correspond- ing to images with and without a given attribute a. The attribute vector da is taken to be the vector orthogonal to the decision boundary, normalized to have unit ℓ2 norm.
Figure 1: Counterfactual attribute sensitivity measures the effect of manipulating a specific property of an image on the output of a trained classifier. In this example, we consider the effect of adding facial hair on the output of a smiling classifier. If the classifier’s output systematically changes as a result of adding or removing facial hair then a poten- tially undesirable bias has been detected since, all else being equal, facial hair should be irrelevant to the classification task.

Datasets

The study primarily uses the CelebA dataset, a large-scale repository of over 200,000 celebrity images annotated with 40 binary attributes. While standard, the authors acknowledge CelebA's limitations, including its subjective labels (like "Attractive") and its binary operationalization of complex traits like gender.

Key Insights and Ideas

  • Causal Auditing: Unlike traditional metrics, this approach allows researchers to ask "what if" questions: "Would the prediction change if this person's hair were shorter?" This moves beyond correlation toward understanding the model's internal logic.
  • The Entanglement Problem: A major "aha" moment is the realization that attributes are rarely independent. As shown in their correlation matrix, traits like "Heavy Makeup" and "Wearing Lipstick" are nearly inseparable. Correlation matrix of CelebA attributes
  • Ethical Boundaries: The authors make a deliberate choice not to manipulate the "Male" attribute. They argue that gender is a social construct, not a simple facial feature, and manipulating it risks reinforcing harmful stereotypes and cisnormative biases. Instead, they recommend focusing on observable characteristics like hair length or facial hair.
Figure 3: Empirical correlation matrix of CelebA attributes.

Key Results

The authors tested a "smiling" classifier and found significant unintended sensitivities:

  • Irrelevant Features Matter: The classifier's output was significantly affected by traits that should be irrelevant to a smile, such as "Heavy Makeup," "Young," and "No Beard."
  • Label Flips: In many cases, adding makeup or removing facial hair caused the classifier to flip its prediction from "Not Smiling" to "Smiling," even when the mouth expression remained perceptually identical. Examples of classification flips
  • Linear Sensitivity: Interestingly, they found that linear changes in the latent space ($z + \lambda d_a$) resulted in roughly linear changes in the classifier's output scores.
Examples of classification flips

Limitations and Future Work

  • Social Validity: The authors note that GAN-generated images must be "socially valid"—meaning they must be realistic enough that humans perceive the intended attribute change correctly.
  • Disentanglement: Current GANs still struggle to perfectly isolate features. For example, increasing "Heavy Makeup" might inadvertently change hair color because those traits are correlated in the training data.
  • Human-in-the-Loop: Future work aims to include human raters to validate that the counterfactual images actually represent the intended changes without altering the core attribute (the smile) being tested.
  • Dataset Diversity: The authors suggest training generative models on more diverse datasets to ensure the audit itself isn't biased by the narrow range of faces found in celebrity datasets.

Summary updated

BibTeX
@misc{denton2019image,
  author = {Remi Denton and Ben Hutchinson and Margaret Mitchell and Timnit Gebru and Andrew Zaldivar},
  title = {{Image Counterfactual Sensitivity Analysis for Detecting Unintended Bias}},
  year = {2019},
  eprint = {1906.06439},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.06439},
}
Figure