Self-Supervised GAN Compression

Chong Yu, Jeff PoolarXiv 2020

Abstract

Deep learning's success has led to larger and larger models to handle more and more complex tasks; trained models can contain millions of parameters. These large models are compute- and memory-intensive, which makes it a challenge to deploy them with minimized latency, throughput, and storage requirements. Some model compression methods have been successfully applied to image classification and detection or language models, but there has been very little work compressing generative adversarial networks (GANs) performing complex tasks. In this paper, we show that a standard model compression technique, weight pruning, cannot be applied to GANs using existing methods. We then develop a self-supervised compression technique which uses the trained discriminator to supervise the training of a compressed generator. We show that this framework has a compelling performance to high degrees of sparsity, can be easily applied to new tasks and models, and enables meaningful comparisons between different pruning granularities.

Introduction: The Challenge of GAN Compression

Deep learning models are increasingly massive, presenting significant hurdles for deployment on mobile devices or edge hardware due to high latency and memory requirements. While techniques like weight pruning—removing unnecessary neural connections—have been successful for classification models like ResNet, Generative Adversarial Networks (GANs) have proven much more resistant to these methods.

The core difficulty lies in the delicate "Nash Equilibrium" between the Generator and the Discriminator. Pruning the generator often disrupts this balance, leading to severe visual degradations. Standard pruning methods frequently result in "facial artifacts" or "mode collapse," where the generator loses its ability to produce diverse outputs.

Standard pruning techniques often introduce significant facial artifacts and distortions in GAN outputs.

Interestingly, the authors observed that standard training loss curves often appear healthy even when the generated images are unusable, making it difficult for researchers to evaluate compression success without manual inspection.

Methodology: Self-Supervised Generator Compression

To address these issues, the authors propose a Self-Supervised Generator Compression framework. Rather than training a pruned generator from scratch, they leverage the knowledge embedded in the original, uncompressed GAN.

The Discriminator as a Teacher

The original, fully-trained discriminator ($D_O$) is used as a fixed supervisor. The goal is to ensure that the compressed generator produces images that the original discriminator still perceives as authentic.

Dual Consistency Loss

The framework introduces a novel loss function, $L_{Overall}$, consisting of two primary components:

  • Generative Consistent Loss ($L_{GC}$): This ensures the compressed generator’s output maintains the content and structural integrity of the original generator’s output.
  • Discriminative Consistent Loss ($L_{DC}$): This ensures the original discriminator reacts to the compressed generator's images in the same way it did to the original's, preserving the "subjective" quality of the GAN.

Iterative Pruning

The process utilizes Automated Gradual Pruning (AGP), which incrementally increases the sparsity of the generator's weights during the self-supervised training phase.

Key Insights and Results

The researchers evaluated their method across diverse tasks, including StarGAN (facial attributes), Pix2Pix (satellite-to-map), and CycleGAN (style transfer).

Pruning Granularity and Quality

A critical finding of the study is the impact of pruning granularity. Fine-grained pruning (removing individual weights) allows for extreme compression—up to 90% sparsity—with negligible quality loss. In contrast, filter pruning (removing entire neurons), while more hardware-friendly, often leads to "drastic color shifts" and loss of detail even at lower sparsity levels (e.g., 25%).

Comprehensive comparison of pruning methods on StarGAN. The proposed self-supervised method (rows g, h) maintains high fidelity at 75-90% sparsity, while standard methods (rows c-f) fail.

Performance Metrics

On the StarGAN task, the proposed method achieved 50% sparsity with an FID score of 6.929, very close to the original model's 6.113. Standard pruning methods on the same task yielded FID scores as high as 35.677, indicating significant quality degradation. Furthermore, the self-supervised compression process is highly efficient, requiring only 1-10% of the original training time.

Conclusion and Future Work

While the study demonstrates that fine-grained pruning preserves the best image quality, a "hardware-software gap" remains. Most current hardware is optimized for dense computations or coarse-grained pruning. Realizing the speed benefits of 90% sparsity will require specialized sparse inference engines.

Future research may explore even more aggressive compression ratios or hybrid strategies. While the method was robust across most tasks, image super-resolution (SRGAN) showed different sensitivities to pruning types, suggesting that architecture-specific "sweet spots" for sparsity exist.

Summary updated

BibTeX
@misc{yu2020self,
  author = {Chong Yu and Jeff Pool},
  title = {{Self-Supervised GAN Compression}},
  year = {2020},
  eprint = {2007.01491},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.01491},
}
Figure