Image-to-Image Translation with Disentangled Latent Vectors for Face Editing

Yusuf Dalva, Hamza Pehlivan, Cansu Moran, Öykü Irmak Hatipoğlu, Ayşegül Dündar · DOI

TL;DR

VecGAN++ bridges the gap between end-to-end image translation and GAN inversion methods for high-fidelity facial attribute editing. By learning orthogonal, disentangled latent directions within a deep encoder-decoder framework, it enables precise, continuous control over specific facial features without sacrificing image reconstruction quality or altering unintended attributes.

What Problem Does This Paper Address?

Facial attribute editing (e.g., altering age, smile, or hair color) typically follows one of two paradigms, both of which suffer from distinct drawbacks:

  1. End-to-End Image Translation Networks: These models map images directly from one domain to another. While they preserve identity well, they often treat attributes as discrete styles, lacking a straightforward mechanism to control the intensity of an edit (e.g., making someone slightly more or less smiling).
  2. StyleGAN Inversion-Based Methods: These methods project an image into the latent space of a fixed, pre-trained generative model and navigate along discovered semantic directions. However, they suffer from a strict reconstruction-editability trade-off. If the encoder forces the latent code to perfectly reconstruct the original image's fine details, the code often drifts off the natural GAN manifold, causing subsequent edits to fail or introduce severe artifacts.

VecGAN++ addresses these challenges by training an encoder-decoder architecture end-to-end, learning to simultaneously optimize image reconstruction and linear, highly disentangled editing directions in the latent space.

Methods

VecGAN++ builds upon the authors' previous conference model (VecGAN) by introducing key architectural and loss function improvements:

  • Linear Latent Manipulation: Images are mapped by an encoder $E$ to a latent representation $e$. Edits are performed via simple vector arithmetic: $e' = e + \alpha \cdot A_i$, where $A_i$ is a learnable direction vector for a specific attribute tag $i$, and $\alpha$ represents the shift scale.
  • Dual Pathways: The model supports both latent-guided editing (sampling a target intensity from a distribution) and reference-guided editing (extracting the attribute intensity from a reference image via projection).
  • Attention-Based Skip Connections: To prevent the information bottleneck of a deep encoder-decoder from destroying fine background details, the authors introduce a U-Net-inspired skip network. This network computes an attention mask from the concatenated encoded and decoded features, dynamically routing unedited background pixels directly to the decoder while allowing edited regions to pass through cleanly.
The overall architecture of VecGAN++ showcasing the translation module and attention-based skip connections.
  • Disentanglement Loss: In addition to an adversarial loss and a soft orthogonality constraint on the direction matrix $A$, VecGAN++ introduces an explicit disentanglement loss. This loss penalizes any unintended shifts in the latent scales of non-targeted attributes during an edit.

Datasets

The framework is evaluated on the CelebA-HQ dataset (30,000 high-quality face images) under two distinct protocols:

  • Setting I (Comparison with End-to-End Models): Images are resized to $128 \times 128$, focusing on local attributes like bangs, eyeglasses, and hair color to directly compare against frameworks like HiSD.
  • Setting II (Comparison with GAN Inversion Models): Images are processed at $256 \times 256$ resolution, evaluating both local and complex global attributes (smile, age, gender).

Key Insights and Ideas

  • Bypassing the Inversion Trade-Off: Because the latent space and the generative decoder are trained jointly rather than using a frozen pre-trained GAN, the network ensures that the latent codes remain inherently editable while maintaining high reconstruction fidelity.
  • The Power of Explicit Disentanglement Penalties: Relying solely on geometric orthogonality constraints (like the Frobenius norm on the direction matrix) isn't enough to prevent attribute bleeding. Adding a direct penalty on unintended attribute scale shifts drastically stabilizes training and yields cleaner edits (e.g., changing age without accidentally adding eyeglasses).
  • Smart Feature Routing: The attention-based skip connections act as a dynamic traffic controller. By looking at both the pre-edited and post-edited feature maps, the network accurately isolates modified regions, ensuring the background remains perfectly intact.

Key Results

VecGAN++ demonstrates significant quantitative and qualitative improvements over state-of-the-art baselines:

  • Setting I: VecGAN++ achieves an average Fréchet Inception Distance (FID) of 19.64, outperforming the previous state-of-the-art end-to-end model, HiSD (21.43), and the original VecGAN (20.45).
  • Setting II: When compared against top StyleGAN2 inversion methods (such as e4e, HyperStyle, HFGI, and StyleRes), VecGAN++ consistently delivers lower FID scores across almost all categories. For instance, on the challenging "Smile (+)" task, VecGAN++ achieves an FID of 17.43, compared to StyleRes's 20.53 and e4e's 35.01.
  • User Study: In an A/B test involving 20 users across 30 validation samples, users preferred VecGAN++ over the original VecGAN 73.3% of the time, and over StyleRes 67.3% of the time, citing superior attribute accuracy and fewer visual artifacts.
Fig. 1: VecGAN++ image translation results.

Limitations and Future Work

Despite its strong performance, the authors note that VecGAN++ still struggles with extreme or uncommon facial poses (e.g., heavily rotated or tilted faces), where the model can produce poor edits or noticeable artifacts. Additionally, in some local tasks like bangs removal, the targeted attribute is occasionally incomplete or fails to erase entirely. The authors conclude that robust handling of extreme poses remains an open problem for future face-editing research.

Summary updated

BibTeX
@article{dalva2023image,
  author = {Yusuf Dalva and Hamza Pehlivan and Cansu Moran and Öykü Irmak Hatipoğlu and Ayşegül Dündar},
  title = {{Image-to-Image Translation with Disentangled Latent Vectors for Face Editing}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2023},
  url = {https://openreview.net/forum?id=L2szTklZhY},
}
Figure