Introduction
Generative Adversarial Networks (GANs), particularly architectures like StyleGAN, have revolutionized the field of image synthesis and semantic editing. By manipulating the latent space of these models, users can perform complex transformations such as changing a subject's age, expression, or accessories. However, a significant bottleneck remains: GAN inversion. To edit a real-world image, it must first be mapped into the GAN's latent space. Because GANs are limited by the distribution of their training data, they often fail to reconstruct "Out-of-Domain" (OOD) details—such as specific hand positions, unique hats, or complex backgrounds—that were not present in the original training set. This paper introduces a novel framework designed to preserve these OOD details while maintaining the powerful editing capabilities of GANs.
The Problem: The OOD Reconstruction Gap
Traditional GAN inversion methods attempt to find a latent code that perfectly reconstructs the input image. When the input contains OOD elements, the GAN (acting as a "local specialist" for the data it was trained on) typically ignores or distorts these features. For example, a GAN trained on faces might reconstruct a person holding a microphone by removing the microphone entirely. Consequently, any subsequent semantic edit applied to the latent code will result in an output where the microphone is missing. Existing solutions often struggle to balance the fidelity of the original image with the flexibility of the GAN's editing space.
Methodology
The authors propose a composition-decomposition paradigm that shifts the focus from perfect global reconstruction to precise local editing. The framework consists of three primary components:
1. Differential Activation Module (Diff-CAM)
The core innovation is the Differential Activation Module. While standard Class Activation Mapping (CAM) identifies features relevant to a specific class (e.g., "face"), it is often too broad for precise editing. Diff-CAM instead analyzes the difference between the feature maps of the unedited GAN reconstruction and the edited GAN reconstruction. By identifying where the activations change, the module generates a precise semantic mask that highlights only the regions affected by the edit (e.g., a new beard or a change in expression).
2. Image Composition
Rather than relying on the GAN to reconstruct the entire scene, the framework uses the Diff-CAM mask to blend the GAN-generated edit into the original real-world image. This allows the system to keep the original OOD details (like a unique hat or background) from the source photo while seamlessly integrating the semantic changes produced by the GAN.
3. Deghosting Network
Simple mask-based blending often introduces "ghosting" artifacts—blurry edges or misalignments where the GAN output meets the original image. To resolve this, the authors developed a Deghosting Network. This network leverages the hierarchical priors of the GAN to "heal" the blended regions, ensuring high-quality textures and smooth transitions between the edited and original parts of the image.
Experimental Results
Datasets and Evaluation
The researchers trained their modules using the FFHQ (Flickr-Faces-HQ) dataset and conducted quantitative evaluations on CelebA-HQ. To demonstrate the framework's versatility, they also applied the method to the car domain, showing that the approach is not limited to human faces.
Performance
- Quantitative: The proposed method outperformed state-of-the-art models like StarGAN and AttGAN in key metrics. Specifically, it achieved superior scores in FID (Fréchet Inception Distance), indicating higher image realism, and LPIPS (Learned Perceptual Image Patch Similarity), confirming that non-edited regions were preserved with high fidelity.
- Qualitative: The framework successfully handled challenging scenarios where subjects wore "uninvertible" items like lion hats or held microphones. While traditional inversion would erase these details, this method preserved them perfectly while still allowing for significant semantic edits like aging or adding eyeglasses.
Conclusion and Future Work
This research provides a robust solution to the OOD problem in GAN inversion by treating the GAN as a tool for local modification rather than global reconstruction. By utilizing differential activations, the framework ensures that unique real-world details are not sacrificed for the sake of editability. While the method is currently dependent on the quality of the underlying GAN inversion, future work may focus on extending this logic to even more diverse domains and streamlining the process for multi-attribute editing.
Summary updated