Content-Aware GAN Compression

Yuchen Liu, Zhixin Shu, Yijun Li, Zhe Lin, Federico Perazzi, Sun-Yuan Kung

Introduction

Generative Adversarial Networks (GANs) have set new standards for high-fidelity image synthesis and editing. However, state-of-the-art models like StyleGAN2 are computationally intensive, requiring up to 74.3 billion FLOPs to generate a single high-resolution image—roughly 250 times the requirement of mobile-optimized architectures like MobileNet. While compression for conditional GANs (e.g., pix2pix) has seen progress, unconditional GANs remain difficult to shrink without significant quality degradation. This paper introduces a "content-aware" framework designed to compress these heavy models by prioritizing regions of interest, such as human faces, during the pruning and distillation processes.

Methodology

The proposed approach addresses the limitations of standard compression by incorporating spatial awareness through two primary mechanisms: Content-Aware Pruning and Content-Aware Distillation.

Content-Aware Pruning

Traditional pruning often relies on the $\ell_1$-norm of incoming weights. The authors found that for GANs, the $\ell_1$-norm of outgoing weights—the filters a channel feeds into—is a more accurate metric for channel importance. To make this process content-aware, they utilize a pre-trained parsing network to identify "Contents of Interest" (COI). By injecting noise into these specific regions and backpropagating the error, the system identifies which channels are most sensitive to changes in the COI. Channels that do not significantly contribute to the generation of these critical regions are pruned.

Content-Aware Distillation

In the distillation phase, a student model is trained to mimic a full-sized teacher model. The authors combine pixel-level distillation with image-level distillation using Learned Perceptual Image Patch Similarity (LPIPS). Crucially, the distillation loss is masked to focus the student's limited capacity on the COI. This allows the model to preserve high-frequency details in important areas (like the eyes and mouth) while allowing the standard GAN loss to manage less critical background elements.

Key Results and Insights

The framework was evaluated on benchmarks including FFHQ (human faces) and CIFAR-10. On the FFHQ dataset, the method achieved an 11× reduction in FLOPs (from 45.1B to 4.1B) while maintaining an FID score of 7.9, significantly outperforming previous state-of-the-art methods like GAN-Slimming (FID 12.4).

Comparison of visual quality, FID scores, and acceleration factors across different compression methods. The proposed method (Ours) achieves the best balance of visual fidelity and computational efficiency.

Beyond raw efficiency, the researchers discovered that compression acts as a regularizer. The compressed models exhibited a lower Perceptual Path Length (PPL), indicating a smoother and better-disentangled latent space. This smoothness translates directly to improved performance in image editing tasks, such as age or gender manipulation, where the compressed model produced fewer visual artifacts than the original full-sized model.

Conclusion and Future Work

By acknowledging that not all pixels are of equal importance to human perception, this content-aware framework enables drastic reductions in GAN complexity with minimal impact on perceived quality. While the current implementation relies on pre-trained parsing networks—a potential limitation for niche domains—future research may focus on automated region discovery. This work paves the way for deploying high-end generative tools on resource-constrained mobile devices.

Summary updated

BibTeX
@inproceedings{liu2021content,
  author = {Yuchen Liu and Zhixin Shu and Yijun Li and Zhe Lin and Federico Perazzi and Sun-Yuan Kung},
  title = {{Content-Aware GAN Compression}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01198},
}
Figure