Measuring axiomatic soundness of counterfactual image models

Miguel Monteiro, Fabio De Sousa Ribeiro, Nick Pawlowski, Daniel C. Castro, Ben Glocker

Executive Summary

Evaluating counterfactual image models is notoriously difficult because we rarely have "ground truth" images of what an individual would look like under an alternate scenario (e.g., wearing glasses when they originally were not). This paper introduces a framework to measure the soundness of these models using Pearl’s causal axioms—Composition, Reversibility, and Effectiveness. This approach provides a robust method to quantify model quality using only observational data and "pseudo-oracle" classifiers.

The Challenge of Counterfactual Identifiability

Deep generative models, such as Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs), are powerful tools for creating counterfactuals—synthetic images that depict "what if" scenarios. However, these models suffer from a fundamental identifiability problem: multiple different causal models can explain the same observed data equally well, but they might produce wildly different counterfactuals.

In real-world applications, we almost never have access to the "true" counterfactual or the underlying Structural Causal Model (SCM) that generated the data. Without a ground-truth "after" image to compare against, researchers have historically struggled to measure whether a model's counterfactuals are logically consistent or merely visually plausible hallucinations.

Axiomatic Evaluation Framework

To address this, the authors propose treating counterfactual inference engines as "black boxes" and testing if their outputs obey three fundamental axioms of causality defined by Judea Pearl:

  1. Composition: If you intervene on a variable to set it to the value it already has, the image should not change.
  2. Reversibility: If you change an attribute (e.g., add glasses) and then immediately change it back to the original value, you should return to the original image.
  3. Effectiveness: If you intervene to change an attribute, the resulting image should actually reflect that change (e.g., the person in the image should actually be wearing glasses).
Visualizing causal axioms on Color MNIST

To quantify these axioms, the authors derive specific distance metrics:

  • Composition and Reversibility are measured using the $L_1$ distance between the original and the "cycled" or "null-intervened" images.
  • Effectiveness is measured using pseudo-oracles—independent classifiers or regressors trained to detect the attribute in question. If the classifier fails to detect the intended change, the model fails the effectiveness test.

Additionally, the framework introduces simulated interventions during training. By resampling data to break spurious correlations (confounding), the models are prevented from learning "shortcuts," such as incorrectly assuming all people with blonde hair must have blue eyes.

Experimental Setup

The framework was validated across three distinct datasets:

  • Color MNIST: A modified version of MNIST where digit identity and color are confounded (e.g., most '0's are red). This tests how models handle biased data.
  • 3D Shapes: A synthetic dataset with six independent factors (floor color, object shape, etc.), allowing for precise control over interventions.
  • CelebA-HQ: High-resolution natural face images, used to test the framework on complex, real-world distributions using attributes like "smiling" and "eyeglasses."

Key Insights and Findings

  • The Fidelity-Effectiveness Trade-off: In hierarchical models like the VDVAE, the authors found a sharp trade-off. If the model "abducts" (encodes) too much information from the original image to ensure high visual fidelity (Composition), it becomes "stubborn" and ignores the counterfactual command (Effectiveness).
  • Soundness vs. Identifiability: While it may be impossible to prove a model is the true causal model (identifiability), this framework allows us to prove it is sound—meaning it is logically consistent with fundamental causal laws.
  • Simulated Interventions are Essential: When training data is biased, standard generative models fail to disentangle causes. Explicitly simulating interventions by resampling the training distribution is a simple but highly effective way to "de-bias" the model's causal understanding.

Model Comparisons

  • VAEs vs. GANs: VAEs naturally respect the Composition axiom better than GANs because their training objective inherently includes a reconstruction loss. GANs, on the other hand, require an explicit "composition constraint" (a regularizer) to prevent them from distorting the image during null interventions.
  • Quantifying "Drift": By applying the null intervention repeatedly ($m$ times), the authors demonstrated that poor models cause the image to "drift" or degrade over time, while sound models remain stable.
  • CelebA-HQ Performance: On complex face images, the authors showed that by carefully choosing the number of latent variables to fix during abduction, they could achieve an F1-score of ~0.93 for effectiveness while maintaining reasonable image stability.

Limitations and Future Directions

  • Pseudo-Oracle Dependency: The "Effectiveness" metric relies heavily on the classifier used to measure it. If the pseudo-oracle is biased or inaccurate, the soundness metric becomes unreliable.
  • The Invertibility Assumption: The Reversibility metric assumes the underlying causal mechanism is invertible. While this holds for many deep generative architectures (like Normalizing Flows), it may not hold for all real-world physical processes.
  • Metric Choice: The authors utilized $L_1$ distance for image comparison to maintain mathematical "metric" properties. However, they acknowledge that perceptual metrics (like LPIPS) might better capture the human intuition of "sameness," even if they lack strict metric properties.

Summary updated

BibTeX
@inproceedings{monteiro2023measuring,
  author = {Miguel Monteiro and Fabio De Sousa Ribeiro and Nick Pawlowski and Daniel C. Castro and Ben Glocker},
  title = {{Measuring axiomatic soundness of counterfactual image models}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=lZOUQQvwI3q},
}
Figure