Distilling portable Generative Adversarial Networks for Image Translation

Hanting Chen, Yunhe Wang, Han Shu, Changyuan Wen, Chunjing Xu, Boxin Shi, Chao Xu, Chang Xu

Abstract

Despite Generative Adversarial Networks (GANs) have been widely used in various image-to-image translation tasks, they can be hardly applied on mobile devices due to their heavy computation and storage cost. Traditional network compression methods focus on visually recognition tasks, but never deal with generation tasks. Inspired by knowledge distillation, a student generator of fewer parameters is trained by inheriting the low-level and high-level information from the original heavy teacher generator. To promote the capability of student generator, we include a student discriminator to measure the distances between real images, and images generated by student and teacher generators. An adversarial learning process is therefore established to optimize student generator and student discriminator. Qualitative and quantitative analysis by conducting experiments on benchmark datasets demonstrate that the proposed method can learn portable generative models with strong performance.

Introduction

Generative Adversarial Networks (GANs) have revolutionized image-to-image translation, enabling tasks like semantic-to-photo synthesis and style transfer. However, state-of-the-art models like CycleGAN and pix2pix are computationally expensive, often requiring billions of floating-point operations (FLOPs) and tens of millions of parameters. This makes them impractical for deployment on resource-constrained mobile and edge devices.

While compression techniques like pruning and quantization are effective for classification, they struggle with GANs. GANs lack a fixed ground truth and rely on a delicate minimax game between a generator and a discriminator. Simple pixel-wise distillation often results in blurry outputs that lack high-frequency details. This paper addresses these challenges by introducing a specialized knowledge distillation framework for GANs.

Methodology

The proposed framework employs a teacher-student paradigm that distills knowledge into both the generator and the discriminator to maintain visual fidelity during compression.

The proposed GAN distillation framework, showing the interaction between teacher and student components.

Distilling the Generator

To move beyond simple pixel matching, the student generator is optimized using a perceptual loss derived from the teacher's discriminator. By extracting features from the early layers of the teacher discriminator, the student learns to replicate high-level semantic structures and textures. This is more effective than using a generic classifier (like VGG) because the teacher discriminator is already specialized in the target image domain.

Distilling the Discriminator

A student discriminator is introduced to guide the student generator more effectively. It is trained using images generated by the teacher as "real" samples, providing a high-quality reference. Furthermore, a triplet loss is applied to the student discriminator's feature space. This loss encourages the discriminator to group real images and teacher-generated images together while pushing lower-quality student-generated images away, creating a more informative gradient for the student generator.

Experimental Results

The method was evaluated on benchmark datasets including Cityscapes (paired translation) and ImageNet subsets (unpaired horse-to-zebra and summer-to-winter translation).

Quantitative Performance

On the Cityscapes dataset, the teacher model (54.4M parameters) achieved 52.17% per-pixel accuracy. A student model with only 1/4 of the parameters (13.61M) trained with the proposed method slightly outperformed the teacher at 52.22%. Even a highly compressed student with only 3.4M parameters maintained a strong accuracy of 51.57%.

Qualitative Comparison

In unpaired translation tasks like horse-to-zebra, the framework achieved dramatic compression. The generator was reduced to ~1/16th of its original size (from 11.38M to 715K parameters) while maintaining visual fidelity.

Qualitative results for horse-to-zebra translation, comparing the proposed student model against the teacher and other baselines.

As shown in the figure above, the student model produces sharp, realistic zebra stripes, avoiding the blurry artifacts common in models trained from scratch or with vanilla distillation methods like Aguinaldo et al.

Conclusion

This paper presents a novel distillation framework that enables the creation of portable, high-performance GANs. By leveraging the teacher's discriminator for perceptual loss and employing a triplet loss for the student discriminator, the method effectively transfers complex generative capabilities to lightweight models. While the approach requires careful hyperparameter tuning and an initial heavy teacher model, it represents a significant step toward deploying sophisticated image translation models on mobile devices.

Summary updated

BibTeX
@inproceedings{chen2020distilling,
  author = {Hanting Chen and Yunhe Wang and Han Shu and Changyuan Wen and Chunjing Xu and Boxin Shi and Chao Xu and Chang Xu},
  title = {{Distilling portable Generative Adversarial Networks for Image Translation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i04.5765},
}
Figure