Abstract
Generative Adversarial Networks (GANs) have achieved impressive results for many real-world applications. As an active research topic, many GAN variants have emerged with improvements in sample quality and training stability. However, visualization and understanding of GANs is largely missing. How does a GAN represent our visual world internally? What causes the artifacts in GAN results? How do architectural choices affect GAN learning? Answering such questions could enable us to develop new insights and better models. In this work, we present an analytic framework to visualize and understand GANs at the unit-, object-, and scene-level. We first identify a group of interpretable units that are closely related to concepts with a segmentation-based network dissection method. We quantify the causal effect of interpretable units by measuring the ability of interventions to control objects in the output. Finally, we examine the contextual relationship between these units and their surrounding by inserting the discovered concepts into new images. We show several practical applications enabled by our framework, from comparing internal representations across different layers, models, and datasets, to improving GANs by locating and removing artifact-causing units, to interactively manipulating objects in the scene.
Introduction: Peering into the Black Box
While Generative Adversarial Networks (GANs) have become incredibly adept at rendering photorealistic images, they have long been treated as "black boxes." We know they work, but we don't know how they organize their internal knowledge. Does a GAN understand the structure of the world? For instance, when a GAN draws a door on a building but never on a tree, is it just repeating a memorized pixel pattern, or does it have an internal variable representing the "concept" of a door? Understanding this is vital for debugging models that produce unrealistic "glitches" (artifacts) and for gaining finer control over generative AI.
Methodology: GAN Dissection
The researchers introduce a two-step framework called "GAN Dissection" to analyze the internal representations of a Progressive GAN.
Identification (Correlation)
The first step involves identifying units that correlate with semantic concepts. Using a pre-trained semantic segmentation network, the authors label objects in GAN-generated images. They then compare these labels to the feature maps (activations) of individual neurons within the GAN. If a specific neuron consistently fires exactly where a "door" appears, it is flagged as a candidate for a "door unit."
Intervention (Causality)
Correlation does not equal causation. To prove that a neuron actually causes an object to appear, the researchers perform interventions. They surgically ablate (turn off) specific units to see if the object disappears, or insert (force on) units to see if the object appears in a new location. They quantify this using the Average Causal Effect (ACE), measuring how the probability of an object class changes when specific units are manipulated.
Key Insights
The framework reveals several fundamental properties of GAN internals:
- Emergent Object Concepts: GANs trained on scenes spontaneously develop neurons that correspond to human-perceived objects (e.g., a "stove unit" in a kitchen GAN) without explicit supervision.
- The "Sweet Spot" of Layers: "Objectness" typically emerges in the middle layers (layers 4–7). Early layers represent raw data, while final layers focus on low-level materials and textures.
- Contextual Veto Power: The GAN enforces learned rules about the world. If a "door unit" is forced to activate in the middle of the sky, later layers often "veto" the signal, refusing to render the door because it violates the learned context.
- Artifact Units: Some neurons are "bad actors" that consistently cause visual glitches. Identifying and silencing these units provides a surgical way to improve model quality.
Results and Applications
The practical utility of GAN Dissection is demonstrated through artifact removal and model comparison. By identifying and ablating 20 "artifact-causing" units, the researchers improved the Fréchet Inception Distance (FID)—a standard measure of image quality—from 52.87 down to 32.11. In side-by-side tests, human evaluators preferred the images with "artifact units" removed 79% of the time. Furthermore, the framework allows for objective comparison of architectures, proving that specific improvements like pixel-wise normalization actually increase the number of interpretable object units learned.
Conclusion
While powerful, the method has limitations. Not every object has a simple, localized causal encoding; for example, objects like tables and chairs are harder to "erase" completely than windows. Future work will investigate the mechanisms behind the network's internal "veto" system. Understanding how GANs suppress signals that don't fit the context could lead to even more robust and controllable generative models.
Summary updated