AE-StyleGAN: Improved Training of Style-Based Auto-Encoders

Ligong Han, Sri Harsha Musunuri, Martin Renqiang Min, Ruijiang Gao, Yu Tian, Dimitris N. Metaxas

Introduction

StyleGAN architectures have set the standard for high-fidelity image synthesis, offering a disentangled latent space ($W$) that facilitates intuitive attribute editing. However, these models are inherently unidirectional, lacking an efficient mechanism for "GAN inversion"—the process of mapping a real image back into its corresponding latent code. Existing solutions typically rely on slow iterative optimization or sub-optimal post-hoc encoder training.

AE-StyleGAN, presented at WACV 2022, addresses these limitations by introducing a framework for the joint, end-to-end training of a StyleGAN generator and a dedicated encoder. By integrating real image reconstruction directly into the training objective, the authors achieve superior inversion fidelity and more disentangled latent representations compared to previous autoencoder-based GANs like ALAE.

Methodology

The core innovation of AE-StyleGAN is a training methodology that treats the generator as part of a symmetric autoencoder from the outset.

Joint vs. Decoupled Training

The authors explored two primary architectural configurations to integrate the encoder ($E$) and generator ($G$):

  1. Decoupled AE-StyleGAN: Uses separate discriminators ($D_1, D_2$) for the generative path (mapping noise $z$ to image $\tilde{x}$) and the reconstruction path (mapping real image $x$ to reconstruction $\hat{x}$).
  2. Joint AE-StyleGAN: Employs a shared discriminator ($D$) for both paths.

Empirical results demonstrated that the joint configuration provides superior stability and performance, ensuring the generator evolves to be "encoder-friendly."

Comparison of Decoupled and Joint AE-StyleGAN architectures.

Training Objectives

Unlike prior models that often reconstruct generated "fake" images, AE-StyleGAN prioritizes real image reconstruction. The loss function is a weighted combination of pixel-wise Mean Squared Error (MSE), VGG Perceptual Loss, and Adversarial Loss. To balance these objectives, the authors utilize an Adaptive Discriminator Weight ($\beta$), which prevents the reconstruction loss from overpowering the GAN's ability to generate realistic textures.

Experiments and Datasets

The model was rigorously evaluated on four high-resolution benchmarks, resized to $128 \times 128$ for consistent comparison:

  • FFHQ: 70,000 high-quality human faces.
  • AFHQ: 15,000 images of cats, dogs, and wildlife.
  • MetFaces: 1,336 portrait artworks.
  • LSUN Church: 126,000 outdoor architectural photos.

Results and Discussion

AE-StyleGAN demonstrates significant improvements in both generation quality and reconstruction fidelity.

Quantitative Performance

  • Generation Quality: AE-StyleGAN achieved a Fréchet Inception Distance (FID) of 7.94 on FFHQ, significantly outperforming ALAE's 12.57.
  • Reconstruction Fidelity: Using the Learned Perceptual Image Patch Similarity (LPIPS) metric, AE-StyleGAN consistently surpassed baselines, indicating better preservation of identity and background details.
  • Latent Space Properties: The model showed improved Perceptual Path Length (PPL), suggesting a smoother and more linear latent space, which is critical for downstream editing tasks.

Qualitative Results

Visual analysis confirms that AE-StyleGAN maintains the original subject's characteristics and background much more effectively than previous joint-training methods. By grounding the encoder in real data distributions from day one, the model preserves fine details that are often lost in pure generative models.

Qualitative results across AFHQ, MetFaces, FFHQ, and LSUN Church datasets.

Key Insights

A major finding of this work is the Inversion-Disentanglement Loop: forcing the generator to be easily invertible (reconstructive) naturally leads to a more disentangled latent space. This suggests that the capacity to represent real-world data accurately is fundamentally linked to the ability to separate semantic features.

Conclusion

AE-StyleGAN successfully bridges the gap between generation and inversion. By grounding the encoder in real data distributions from the start of training, it avoids the "encoder lag" typical of two-stage methods. While currently demonstrated at $128 \times 128$ resolution, future work may explore scaling to higher resolutions and incorporating explicit disentanglement penalties to further refine the latent space.

Summary updated

BibTeX
@inproceedings{han2022ae,
  author = {Ligong Han and Sri Harsha Musunuri and Martin Renqiang Min and Ruijiang Gao and Yu Tian and Dimitris N. Metaxas},
  title = {{AE-StyleGAN: Improved Training of Style-Based Auto-Encoders}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2022},
  doi = {10.1109/wacv51458.2022.00103},
}
Figure