Skip to main content
QUICK REVIEW

[Paper Review] Anycost GANs for Interactive Image Synthesis and Editing

Ji Lin, Richard Zhang|arXiv (Cornell University)|Mar 4, 2021
Generative Adversarial Networks and Image SynthesisComputer Science79 references8 citations
TL;DR

This paper proposes Anycost GAN, a single generator architecture that supports variable-resolution and adaptive-channel inference for interactive image synthesis and editing. By training a unified generator with weight-sharing, stage-wise optimization, and a generator-conditioned discriminator, it enables perceptually consistent previews at up to 11.9× speedup on CPU and 8.5× on edge GPU, with minimal quality drop compared to the full model.

ABSTRACT

Generative adversarial networks (GANs) have enabled photorealistic image synthesis and editing. However, due to the high computational cost of large-scale generators (e.g., StyleGAN2), it usually takes seconds to see the results of a single edit on edge devices, prohibiting interactive user experience. In this paper, we take inspirations from modern rendering software and propose Anycost GAN for interactive natural image editing. We train the Anycost GAN to support elastic resolutions and channels for faster image generation at versatile speeds. Running subsets of the full generator produce outputs that are perceptually similar to the full generator, making them a good proxy for preview. By using sampling-based multi-resolution training, adaptive-channel training, and a generator-conditioned discriminator, the anycost generator can be evaluated at various configurations while achieving better image quality compared to separately trained models. Furthermore, we develop new encoder training and latent code optimization techniques to encourage consistency between the different sub-generators during image projection. Anycost GAN can be executed at various cost budgets (up to 10x computation reduction) and adapt to a wide range of hardware and latency requirements. When deployed on desktop CPUs and edge devices, our model can provide perceptually similar previews at 6-12x speedup, enabling interactive image editing. The code and demo are publicly available: https://github.com/mit-han-lab/anycost-gan.

Motivation & Objective

  • To enable interactive image editing on resource-constrained devices by reducing inference latency of high-fidelity GANs.
  • To train a single generator that supports multiple computational budgets without retraining or fine-tuning.
  • To maintain perceptual consistency across sub-generators of varying resolution and channel count during image projection and editing.
  • To stabilize training in a multi-player GAN setting with shared weights and diverse sub-architectures.
  • To develop encoder and optimization techniques that ensure consistent latent code mapping across different generator configurations.

Proposed method

  • Training a unified generator with shared weights across sub-generators of varying resolution and channel count, enabling direct inference at any cost budget.
  • Using stage-wise training: first train multi-resolution sub-generators with full channels, then reduce channels adaptively.
  • Introducing a generator-conditioned discriminator that adapts its supervision based on the sub-generator's architecture.
  • Applying sampling-based multi-resolution training and adaptive-channel training to stabilize optimization across diverse configurations.
  • Developing consistency-aware encoder training that minimizes reconstruction loss for both full and sub-generators.
  • Using iterative latent code optimization with L-BFGS, initialized from the encoder’s output, to improve projection fidelity.

Experimental results

Research questions

  • RQ1Can a single GAN generator be trained to support multiple inference costs while maintaining perceptual consistency?
  • RQ2How can adversarial training be stabilized when multiple sub-generators with shared weights coexist in a minimax optimization framework?
  • RQ3To what extent can sub-generators serve as accurate proxies for full generator previews during interactive editing?
  • RQ4How does consistency-aware encoder training improve image projection accuracy across different generator configurations?
  • RQ5What is the achievable speedup in inference latency on CPU and edge devices while preserving visual quality?

Key findings

  • Anycost GAN achieves up to 11.9× walltime speedup on Intel Xeon CPU and 8.5× speedup on NVIDIA Jetson Nano GPU, with perceptually consistent outputs.
  • The model provides 12.2× speedup on Xeon CPU and 8.5× on Jetson Nano, with super-linear speedup on CPU due to cache efficiency.
  • Consistency-aware encoder training reduces the LPIPS gap between full and sub-generator reconstructions from 0.07 to 0.02, improving projection consistency.
  • Image editing results show consistent attribute changes (e.g., smiling, hair color) across full and sub-generators, validating cross-configuration reliability.
  • The method outperforms distillation-based compression and separate small generator training in both image quality and consistency.
  • Evolutionary search identifies optimal sub-generators under various computational budgets, achieving >10× computation variation with high fidelity.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.