Robust GAN inversion

Egor Sevriugov, Ivan V. OseledetsarXiv 2023 · DOI

Introduction

Generative Adversarial Networks (GANs), particularly architectures like StyleGAN, have revolutionized high-fidelity image synthesis. However, a persistent challenge remains in GAN inversion: the process of mapping a real-world image back into the latent space for editing. The core difficulty is the distortion-editability tradeoff. Achieving a perfect reconstruction (low distortion) often requires moving into complex latent spaces or aggressively tuning generator weights, which frequently "breaks" the model's internal logic, making subsequent edits—such as changing age or expression—result in visual artifacts.

Methodology: Randomized StyleGAN 2 (WRanGAN)

To address this, researchers introduced WRanGAN, a novel approach that utilizes adaptive, learnable regularization. Unlike previous methods like Pivotal Tuning Inversion (PTI) that apply a uniform regularization strength, WRanGAN treats generator weights as random variables during the tuning phase.

Weight Randomization and Adaptive Regularization

The model assumes a subset of generator weights follows a normal distribution defined by a trainable mean ($\mu$) and variance ($\sigma$). By employing the reparameterization trick, the inversion process applies varying regularization strengths across parameters. Weights with high learned variance are granted more flexibility to capture unique image details (e.g., specific wrinkles or accessories), while weights with low variance remain tightly regularized to preserve the latent space's semantic structure for editing.

To maintain efficiency, randomization is applied only to the last six convolutional layers, which the authors identified as the most critical for capturing fine-grained details. This targeted approach allows WRanGAN to optimize four times fewer parameters than standard PTI.

Qualitative and quantitative comparison of WRanGAN against StyleGAN 2 baselines, demonstrating the balance between reconstruction accuracy and latent space editability.

Experimental Results

The model was evaluated on high-complexity datasets, including Flickr-Faces-HQ (FFHQ) and LSUN Church. WRanGAN demonstrated significant improvements over state-of-the-art baselines such as e4e, ReStyle, and PTI.

Performance Metrics

  • Distortion: On FFHQ, WRanGAN achieved an MSE of 0.007, a substantial improvement over PTI's 0.024.
  • Image Quality: The model consistently produced lower Fréchet Inception Distance (FID) scores, indicating higher visual fidelity.
  • Editability: Despite deep tuning, the model maintained high classification accuracy (up to 99.9%) for attributes like eyeglasses during latent space manipulation.
  • Efficiency: The method is 1.5 to 2 times faster than PTI and reduces GPU memory consumption by approximately 600 MB.
Distribution of FID scores comparing simple weight tuning to WRanGAN, showing a significant shift toward higher image quality (lower FID).

Conclusion

WRanGAN successfully mitigates the distortion-editability tradeoff by replacing rigid global regularization with a learnable, adaptive framework. By identifying which weights are most sensitive to local details, the model achieves superior reconstruction without sacrificing the ability to perform semantic edits. While some extremely fine details remain challenging to restore perfectly, WRanGAN represents a significant step toward robust and practical GAN inversion for real-world applications.

Summary updated

BibTeX
@misc{sevriugov2023robust,
  author = {Egor Sevriugov and Ivan V. Oseledets},
  title = {{Robust GAN inversion}},
  year = {2023},
  eprint = {2308.16510},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.16510},
}
Figure