Slimmable Generative Adversarial Networks

Liang Hou, Zehuan Yuan, Lei Huang, Huawei Shen, Xueqi Cheng, Changhu Wang

Abstract

Generative Adversarial Networks (GANs) have achieved remarkable success in image synthesis but often require significant computational resources, complicating deployment on diverse hardware. We present Slimmable GANs (SlimGANs), a framework for training a single "once-for-all" generator that can adjust its width at runtime to accommodate varying power budgets. By leveraging parameter-shared discriminators and stepwise inplace distillation, SlimGANs ensure visual consistency and high image quality across all configurations, often surpassing the performance of individually trained models.

Introduction

The rapid scaling of GAN architectures, such as BigGAN, has led to state-of-the-art image generation at the cost of high computational demands. In practice, hardware capabilities vary significantly between high-end servers and mobile devices. Traditionally, supporting multiple devices required training and maintaining several independent models for different "power budgets," a process that is both computationally expensive and difficult to manage.

Slimmable Neural Networks (SNNs) have addressed similar issues in classification, but applying them to GANs introduces unique challenges:

  1. Divergence Estimation: Training a discriminator to evaluate multiple generators of varying sizes simultaneously.
  2. Consistency: Ensuring that a single latent seed produces the same image structure regardless of the chosen model width.
  3. Label Integration: Managing class-conditional information across varying channel counts.

Methodology

SlimGAN addresses these challenges by focusing on width-slimmability—adjusting the number of channels per layer—which directly reduces the memory footprint during inference.

The SlimGAN architecture utilizes a width-adjustable generator $G$ and a set of parameter-shared discriminators $D$. Stepwise distillation (blue arrows) ensures consistency across widths.

Parameter-Shared Discriminators

Rather than using a single discriminator for all widths or entirely independent discriminators, SlimGAN employs a set of discriminators that share initial layers. This architecture provides the necessary flexibility for different generator scales while benefiting from shared feature learning.

Stepwise Inplace Distillation

To maintain "spatial and time translation consistency," the authors implement a distillation process where wider generator versions act as teachers for narrower ones. This occurs stepwise during training (e.g., 100% width teaches 75%, which then teaches 50%), forcing the models to agree on image content even as detail levels vary.

Sliceable Conditional Batch Normalization (scBN)

For conditional tasks, scBN slices a single large label embedding vector into smaller sub-vectors for narrower widths. This ensures label information is shared across all model versions while minimizing parameter overhead.

Experiments and Results

SlimGAN was evaluated on standard benchmarks including CIFAR-10/100, CelebA, and ImageNet.

Performance and Efficiency

SlimGAN consistently outperformed individually trained GANs. On CIFAR-10, a 0.25× SlimGAN achieved an FID of 37.3, compared to 46.9 for a standalone model of the same size. On ImageNet, SlimGAN surpassed individually trained BigGANs in both Inception Score (IS) and Frechet Inception Distance (FID). Furthermore, the total parameter count for a SlimGAN supporting four widths is nearly identical to a single full-sized model.

Visual Consistency

A key advantage of SlimGAN is its ability to maintain structural consistency across widths. Without the proposed distillation, narrower models often produce inconsistent results, such as altered hair colors or background structures for the same latent code.

Qualitative comparison showing the impact of distillation on consistency and quality across different model configurations.

Discussion and Conclusion

The training of narrow networks appears to provide a "virtuous cycle," where the extra informative signals act as regularization for the wider shared parameters. While this work focuses on width-slimmability, future research may explore depth-slimmable architectures or applications in text-to-image synthesis. SlimGAN represents a significant step toward flexible, efficient, and high-quality generative modeling for real-world deployment.

Summary updated

BibTeX
@inproceedings{hou2021slimmable,
  author = {Liang Hou and Zehuan Yuan and Lei Huang and Huawei Shen and Xueqi Cheng and Changhu Wang},
  title = {{Slimmable Generative Adversarial Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i9.16946},
}
Figure