NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CausalGAN: Learning Causal Implicit Generative Models with Adversarial Training

Murat Kocaoglu, Christopher Snyder, Alexandros G. Dimakis, Sriram Vishwanath

TL;DR

CausalGAN is a framework that enables Generative Adversarial Networks (GANs) to understand and respect causal relationships between data labels. By structuring the generator according to a causal graph, the model can perform "interventions"—generating realistic images for label combinations that rarely or never occur in the training data, such as a woman with a mustache.

What Problem Does This Paper Address?

Standard Generative Adversarial Networks (GANs) are excellent at mimicking the statistical distribution of a dataset. Conditional GANs (cGANs) take this a step further, allowing us to generate images based on specific labels (e.g., "generate a face that is smiling and wearing glasses").

However, standard cGANs only capture correlations, not causality. In the real world, features are often causally linked; for example, "Gender" might causally influence the presence of a "Mustache." If a dataset contains no examples of women with mustaches, a standard cGAN will likely fail to generate one, even if you explicitly ask for it. It treats labels as a flat list of attributes rather than a structured system.

The authors address the challenge of sampling from interventional distributions. In causal inference, an intervention (using the $do$-operator) means forcing a variable to a specific value regardless of its usual causes. CausalGAN aims to create an "implicit causal model" that can handle these "what if" scenarios realistically.

Methods

The authors propose a two-stage "Causal Implicit Generative Model" (CiGM) approach:

  1. The Causal Controller: Instead of feeding random noise and labels directly into an image generator, they first train a separate GAN to generate the labels themselves. The architecture of this controller is strictly constrained by a pre-defined causal graph (a Directed Acyclic Graph). If the graph says "Gender" causes "Mustache," the network's wiring ensures the "Gender" node's output is an input for the "Mustache" node. This is trained using a Wasserstein GAN (WGAN) to produce discrete-looking binary labels.
Neural network architecture structured according to a causal graph.
  1. CausalGAN / CausalBEGAN: This is the image generator. It takes the labels produced by the Controller and turns them into images.
  2. Labeler & Anti-Labeler: To ensure the generator actually listens to the labels and doesn't suffer from "mode collapse" (producing the same face for every label), the authors introduce two helper networks. The Labeler is trained on real data to recognize attributes. The Anti-Labeler is trained on generated data. The generator's goal is to satisfy the Labeler (be accurate) while avoiding being "too predictable" for the Anti-Labeler (maintaining diversity).

The authors provide a theoretical proof showing that their specific loss function, at its global minimum, forces the generator to sample from the true conditional image distribution.

Datasets

  • CelebA: The primary benchmark, consisting of over 200,000 celebrity images with 40 binary attributes. The authors manually defined a causal graph for a subset of these attributes (e.g., Young, Male, Eyeglasses, Bald, Mustache, Smiling).
  • Synthetic Data: Used to validate the theory. They generated data from simple causal structures (Line, Collider, and Complete graphs) to see if the model could recover the true joint distributions.

Key Insights and Ideas

  • Architecture as a Prior: You don't necessarily need to "learn" causality from scratch if you have domain knowledge. By baking the causal graph directly into the neural network's connectivity, the model is forced to respect the hierarchy of features.
  • Intervention vs. Conditioning: This is the "aha" moment of the paper. Conditioning on "Mustache=1" in a biased dataset only gives you men because, in that data, only men have mustaches. Intervening ($do(Mustache=1)$) tells the model: "Give this person a mustache, but don't change their gender or age." CausalGAN can successfully perform the latter.
CausalGAN generating counterfactual images: women with mustaches (top row) via intervention.
  • The Anti-Labeler Trick: Standard GANs often find a "shortcut" to satisfy a label (e.g., always generating the exact same mustache). The Anti-Labeler acts as a secondary adversary that prevents the generator from becoming too repetitive, ensuring a wide variety of faces for any given label set.

Key Results

  • Qualitative Success: The model successfully generated "counterfactual" images. When intervening on the "Mustache" label, CausalGAN produced both male and female faces with mustaches, whereas a standard conditional model only produced males.
  • Quantitative Convergence: On synthetic data, the authors showed that when the generator's architecture matched the true causal graph, the Total Variation Distance (TVD) between the generated and real distributions dropped significantly compared to using the "wrong" graph.
  • Image Quality: By extending the Boundary Equilibrium GAN (BEGAN) into CausalBEGAN, the authors achieved high-resolution, realistic face synthesis that remained strictly consistent with the causal constraints.

Limitations and Future Work

  • Requires a Known Graph: The model assumes the causal graph is provided by an expert. It cannot currently discover the causal structure from the images themselves.
  • Binary Constraints: The implementation focuses on binary labels (Yes/No attributes). Extending this to continuous variables (like "intensity of a smile") or categorical variables remains an open challenge.
  • Deterministic Labels: The theoretical guarantees rely on the assumption that labels are a deterministic function of the image (i.e., an oracle can always look at an image and definitively say if it has a mustache), which may not always hold in noisy, real-world data.

Summary updated

BibTeX
@inproceedings{kocaoglu2018causalgan,
  author = {Murat Kocaoglu and Christopher Snyder and Alexandros G. Dimakis and Sriram Vishwanath},
  title = {{CausalGAN: Learning Causal Implicit Generative Models with Adversarial Training}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=BJE-4xW0W},
}
Figure