Can We Find Neurons that Cause Unrealistic Images in Deep Generative Networks?

Hwanil Choi, Wonjoon Chang, Jaesik Choi

TL;DR

This paper investigates why Generative Adversarial Networks (GANs) sometimes produce unrealistic images with "artifacts." They discover that "rarely activated neurons" (LR-neurons) are strongly correlated with these artifacts, suggesting they are responsible for generating diverse but potentially flawed image components. The authors propose a simple "Sequential Ablation" method to remove these LR-neurons, effectively repairing artifacts without complex retraining.

What Problem Does This Paper Address?

Generative Adversarial Networks (GANs) have revolutionized image generation, producing remarkably realistic images of faces, cars, and more. However, they occasionally fail, generating images with unnatural objects or distortions, termed "artifacts." While previous work has attempted to detect and remove these artifacts, a clear understanding of why they emerge and how to systematically fix them without significant computational cost or manual effort has been lacking. This paper aims to bridge this gap by identifying the specific neural components within GANs responsible for these failures and proposing an efficient correction mechanism.

Methods

The core of this paper lies in analyzing the activation patterns of neurons within GANs. They introduce the concept of "frequency rate" for neurons, defining it as the probability that a neuron is activated for a given input.

  • LR-neurons (Low-Rate Neurons): Neurons with a low activation frequency.
  • HR-neurons (High-Rate Neurons): Neurons with a high activation frequency.

The authors hypothesize that LR-neurons are responsible for generating diverse image features, which can sometimes lead to artifacts, while HR-neurons contribute to more general, stable image components.

To test this, they employ a novel method called "Sequential Ablation." This technique iteratively disables (sets to zero) the activations of LR-neurons in specific layers of the generator network. By applying this ablation sequentially through different layers and with varying activation rate thresholds, they observe its impact on generated images. This method is designed to be unsupervised and computationally efficient, requiring no additional training.

Datasets

The paper evaluates their methods on several standard image generation datasets:

  • CelebA-HQ: High-resolution celebrity faces.
  • LSUN-Cat: Cat images.
  • LSUN-Church: Church images.
  • FFHQ: High-quality human faces.

They utilize pre-trained models for PGGAN and StyleGAN2 on these datasets.

Key Insights and Ideas

  • LR-neurons are the artifact culprits: The most significant finding is the strong correlation between rarely activated neurons (LR-neurons) and the presence of artifacts in generated images. This suggests that the diversity-generating mechanisms within GANs, often driven by these less frequently activated neurons, are also the source of their failures.
  • Layer-specific impact: The paper demonstrates that LR-neurons in earlier layers of the generator are more directly linked to spatial layout and object formation, and thus more critical for fixing artifacts related to these aspects. Ablating later layers can negatively impact finer details or overall image structure.
  • Sequential Ablation as an effective repair tool: The proposed "Sequential Ablation" method, by selectively zeroing out LR-neurons in early layers, proves to be an effective and computationally inexpensive way to remove artifacts without significantly degrading image quality or diversity.
  • Trade-off between fidelity and diversity: The study hints at a fundamental trade-off in GANs: encouraging diversity (potentially through LR-neurons) can lead to artifacts, while focusing solely on fidelity (potentially through HR-neurons) might limit the variety of generated outputs.

Key Results

  • Qualitative: Figures and examples throughout the paper visually demonstrate that ablating LR-neurons in early layers (e.g., layers 0, 1, 3) successfully removes artifacts like cracks, distorted features, and unnatural objects from generated images across various datasets and models (StyleGAN2, PGGAN).
  • Quantitative: Table 1 shows that Sequential Ablation with specific layer choices (0, 1, 3) and a rate threshold (R=0.3) achieves the best FID scores for repaired images, indicating improved realism and reduced artifacts compared to not applying ablation or random ablation. Table 2 highlights that images with fewer LR-neurons (Bottom 2K) exhibit higher fidelity and realism but lower diversity, supporting the core hypothesis.

Limitations and Future Work

  • Dataset dependency: The authors note that their approach might perform better on well-aligned datasets. For datasets with sparse features (like LSUN), HR-neurons might play a more crucial role, and the effectiveness of LR-neuron ablation might be nuanced.
  • HR-neuron role: While the focus is on LR-neurons, the paper briefly touches upon the importance of HR-neurons for essential image components. Further investigation into the precise roles of HR-neurons and their interaction with LR-neurons could be beneficial.
  • Generalizability: While tested on PGGAN and StyleGAN2, exploring the applicability of this method to other GAN architectures and more complex artifact types would be valuable.
  • Future work: The authors suggest that their method can be used to detect artifact images and correct defective parts without supervision. Further research could explore more sophisticated ablation strategies or integrate this finding into GAN training procedures to prevent artifacts from forming in the first place.

Summary updated

BibTeX
@inproceedings{choi2022can,
  author = {Hwanil Choi and Wonjoon Chang and Jaesik Choi},
  title = {{Can We Find Neurons that Cause Unrealistic Images in Deep Generative Networks?}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=iDY2gNaQlaI},
}
Figure