In-N-Out: Faithful 3D GAN Inversion with Volumetric Decomposition for Face Editing

Yiran Xu, Zhixin Shu, Cameron Smith, Seoung Wug Oh, Jia-Bin Huang

Introduction

3D-aware Generative Adversarial Networks (GANs), such as EG3D, have revolutionized facial image synthesis and editing. However, applying these models to real-world images—a process known as GAN inversion—remains challenging when the input contains "out-of-distribution" (OOD) features. Elements like heavy theatrical makeup, bulky sunglasses, or facial accessories often fall outside the training distribution of standard datasets like FFHQ.

Existing inversion methods face a fundamental reconstruction-editability trade-off: they either fail to capture these OOD details accurately or over-fit the model to the specific image, which destroys the latent space and prevents subsequent semantic editing (e.g., changing age or expression). "In-N-Out" proposes a novel volumetric decomposition framework to resolve this conflict.

Volumetric Decomposition Framework

The core innovation of In-N-Out is the separation of the scene into two distinct neural radiance fields (NeRFs) during the inversion process:

  1. In-Distribution (InD) Field: This field utilizes a pre-trained 3D GAN (EG3D) to represent the "natural" face. By keeping this field's latent code ($w+$) within the learned distribution, the system preserves the GAN's inherent editing capabilities.
  2. Out-of-Distribution (OOD) Field: A separate, newly initialized tri-plane representation and a lightweight MLP decoder are dedicated to capturing the non-standard elements (makeup, accessories, etc.) that the primary GAN cannot model.

Composite Rendering and Regularization

To produce the final image, the two fields are merged during volume rendering using a learned blending weight ($b$). This weight determines the contribution of color and density from each field at every 3D point. To ensure a clean separation, the authors employ an entropy loss on the blending weights and latent code regularization to keep the face field within a natural range. Finally, a refinement of the GAN’s Super-Resolution (SR) module ensures high-frequency OOD details are rendered crisply.

Figure 6: Qualitative results demonstrating faithful reconstruction and semantic editing on OOD faces. The method allows for complex edits like changing age or expression while preserving OOD features like face paint or sunglasses.

Key Results

In-N-Out demonstrates superior performance in both reconstruction fidelity and editability compared to state-of-the-art baselines like PTI and HFGI3D.

  • Reconstruction Fidelity: On a custom dataset of 20 challenging OOD videos, the method achieved an LPIPS score of 0.2237, significantly better than PTI's 0.3144.
  • Identity Preservation: When performing semantic edits (e.g., applying a "surprised" expression), In-N-Out maintained an identity similarity score of 0.9360, outperforming optimization-based methods that often "break" the identity during the inversion process.
  • 3D Consistency: Because the decomposition occurs in 3D space, the OOD elements remain correctly aligned with the face during novel view synthesis (head rotation).

Limitations and Future Work

While highly effective, the current framework has limitations. The OOD field lacks a structured semantic latent space, meaning users cannot yet edit the OOD features themselves (e.g., changing the color of sunglasses). Additionally, the per-image optimization process is slower than encoder-based methods, and extreme side profiles can still lead to degradation in reconstruction quality. Future research may focus on creating a more controllable latent space for the OOD components.

Summary updated

BibTeX
@inproceedings{xu2024n,
  author = {Yiran Xu and Zhixin Shu and Cameron Smith and Seoung Wug Oh and Jia-Bin Huang},
  title = {{In-N-Out: Faithful 3D GAN Inversion with Volumetric Decomposition for Face Editing}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  doi = {10.1109/cvpr52733.2024.00690},
}
Figure