GAN Dissection: Visualizing and Understanding Generative Adversarial Networks

David Bau, Jun-Yan Zhu, Hendrik Strobelt, Bolei Zhou, Joshua B. Tenenbaum, William T. Freeman, Antonio Torralba

TL;DR

This paper introduces "GAN Dissection," a framework for visualizing and understanding the internal representations of Generative Adversarial Networks (GANs). By combining semantic segmentation with causal interventions (ablation and insertion), the authors demonstrate that GANs don't just memorize pixels; they develop internal "units" that correspond to human-interpretable concepts like trees, doors, and even visual artifacts.

What Problem Does This Paper Address?

While GANs have become incredibly adept at generating photorealistic images, they have largely remained "black boxes." We know they work, but we don't know how they represent the visual world internally.

Specifically, the authors tackle three questions:

  1. Representation: Does a GAN have explicit internal variables for objects (like a "door unit"), or are objects just emergent pixel patterns?
  2. Causality: If these units exist, do they actually cause the generation of the object, or are they merely correlated with it?
  3. Context: How does the network handle relationships between objects? (e.g., Why does it know a door belongs on a building but not in the sky?)

Methods

The authors propose a two-phase analytic framework:

  1. Dissection (Correlation): They use a pre-trained semantic segmentation network (trained on the ADE20K dataset) to label the output of a GAN. They then compare the upsampled feature maps of individual units (neurons) in the GAN's generator to these semantic masks. If a unit's activation consistently overlaps with a specific object class (like "sofa"), it is labeled as an interpretable unit using an Intersection-over-Union (IoU) metric.
  2. Intervention (Causality): To move beyond mere correlation, they perform interventions:
  3. Ablation: They "turn off" specific units to see if the corresponding object disappears from the generated image.
  4. Insertion: They "force on" units at specific locations to see if they can trigger the generation of an object.
  5. ACE (Average Causal Effect): They quantify the impact of these interventions to identify the specific sets of units that have the strongest causal link to an object class.

Key Insights and Ideas

Visualizing GAN Dissection: Identifying, ablating, and activating units for trees and artifacts.
  • The Semantic Middle: Interpretable object units are not distributed evenly. Early layers of the generator are "entangled" (representing abstract geometry), and late layers focus on low-level pixel patterns (edges, textures). The "semantic" representation of objects peaks in the middle layers (typically layers 4–7).
  • Causal Control: The authors found that they could successfully remove objects (like trees from a church scene) or insert them (adding a door to a building) by manipulating a small set of causal units.
  • Contextual Veto Power: This is perhaps the most fascinating finding. When the authors tried to insert a "door" unit into a region of "sky" or "trees," the generator often suppressed the signal. The network has learned structural constraints: it "knows" a door cannot exist in the sky, and later layers will effectively veto the insertion if the surrounding context is inappropriate.
  • Artifact Units: "Glitches" in GAN images are often caused by specific "artifact units." By identifying and ablating these units, the authors could significantly improve the visual quality of the generated images without retraining the model.

Key Results

  • Quality Improvement: By ablating 20 manually identified "artifact units" in a bedroom generator, the authors improved the Fréchet Inception Distance (FID)—a standard measure of GAN quality—from 43.16 to 27.14.
  • Human Validation: In Amazon Mechanical Turk studies, users preferred the "de-artifacted" images 72.4% of the time compared to the originals.
  • Model Comparison: The framework allowed the authors to quantify how different training techniques (like pixelwise normalization or minibatch stddev) affect the number of interpretable concepts a model learns. They found that better-performing models generally contain a higher number of interpretable units.

Limitations and Future Work

  • Dependence on Segmenters: The method's ability to "see" concepts is limited by the vocabulary of the pre-trained segmentation model. If the segmenter doesn't have a label for a concept, GAN Dissection can't identify the corresponding unit.
  • Structural Constraints: Some objects are so fundamental to a scene's definition (like chairs in a conference room) that they cannot be easily ablated. The network seems to view these as mandatory structural elements rather than optional objects.
  • Direction for Future Work: The authors suggest applying this to other generative architectures like VAEs and exploring how the GAN's "veto" mechanism works in more detail—specifically, how signal suppression propagates through the later layers of the network.

Summary updated

BibTeX
@inproceedings{bau2019gan,
  author = {David Bau and Jun-Yan Zhu and Hendrik Strobelt and Bolei Zhou and Joshua B. Tenenbaum and William T. Freeman and Antonio Torralba},
  title = {{GAN Dissection: Visualizing and Understanding Generative Adversarial Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=3PK1CCu75EE},
}
Figure