Introduction
Generative Adversarial Networks (GANs), particularly StyleGAN, have revolutionized image synthesis and editing. However, applying these models to real-world photos requires "GAN inversion"—mapping a real image into the model's latent space. This process faces a fundamental "inversion-editability trade-off." Mapping images to well-behaved latent regions (like the $W$ space) ensures high editability but sacrifices fine-grained details (fidelity). Conversely, optimizing for perfect reconstruction often distorts the latent space, leading to artifacts during editing. ReGANIE (Rectifying GAN Inversion Errors) addresses this by decoupling reconstruction from editing through a novel two-phase framework.
Methodology
ReGANIE splits the editing task into two distinct stages:
Phase I: Inversion and Editing. The system first uses a standard encoder (e.g., e4e) to project the input image into a highly editable latent space. While this ensures that attributes like pose or age can be easily manipulated, the resulting reconstruction ($\hat{X}$) often lacks specific details found in the original image ($X$).
Phase II: The Rectifying Network. To restore lost details, a dedicated rectifying network is introduced. This network takes the initial reconstruction (or an edited version of it) and a "difference image" ($\Delta X = X - \hat{X}$) as inputs. By learning the systematic errors of the inversion process, the network can "rectify" the image, reintroducing missing features like accessories or complex textures.
A key component is the Spatial and Global (SG) Modulation module. It uses a dual-pathway encoder to process semantic and spatial information separately, ensuring that restored details remain correctly aligned even when the underlying image undergoes significant transformations, such as head rotation.
Experimental Results
The framework was evaluated on diverse datasets, including FFHQ (human faces), CelebA-HQ, MetFace (artistic portraits), and various animal and anime datasets.
Quantitative Performance
ReGANIE consistently outperforms state-of-the-art inversion methods (such as PTI, HyperStyle, and HFGI) in reconstruction quality. It achieves an L2 distance of 0.016 and an LPIPS score of 0.07, indicating superior visual fidelity. Furthermore, in attribute manipulation tasks (e.g., age and yaw), ReGANIE shows higher "attribute control competency," meaning it executes requested edits more accurately than its competitors.
Efficiency
Unlike optimization-based methods like PTI, which can take over a minute per image, ReGANIE is an encoder-based approach. It completes the entire inversion and rectification process in approximately 190ms, making it suitable for interactive applications.
Discussion and Key Insights
The success of ReGANIE stems from the observation that inversion errors are consistent between the original and edited images. By decoupling the tasks, the model avoids the pitfalls of trying to force a single latent code to represent every minute detail perfectly.
While highly effective, the method's performance is still partially dependent on the quality of the Phase I inversion. Extremely large geometric deformations may also challenge the SG module's ability to align rectified details perfectly. Future work could involve extending this framework to domains beyond portraits and exploring its scalability with different base generative models.
Summary updated