Exploring the Effectiveness of Mask-Guided Feature Modulation as a Mechanism for Localized Style Editing of Real Images

Snehal Singh Tomar, Maitreya Suin, A. N. RajagopalanarXiv 2022

TL;DR

The SemanticStyle Autoencoder (SSAE) enables highly localized, photorealistic style editing of real images without the need for computationally expensive GAN inversion or manual latent direction discovery. By modulating the latent space of a pretrained Swapping Autoencoder using predicted semantic masks, it achieves a massive 10,000x speedup over state-of-the-art inversion-based methods.

What Problem Does This Paper Address?

Deep generative models excel at image editing, but modifying specific regions (like changing just someone's hair color or skin texture) usually requires two costly steps: inverting the real image into the model's latent space, and finding the exact "direction" in that latent space that controls the target feature. Both steps are slow, and finding controllable directions often requires tedious human supervision.

The authors tackle these bottlenecks to make localized style editing fast, automatic, and weakly supervised, eliminating the need for human intervention post-training.

Methods

The proposed SSAE pipeline consists of three main components:

  1. Semantic Mask Prediction Network (SMPN): A ResNet18-based encoder-decoder network that generates binary masks for five specific Regions of Interest (ROIs): hair, skin, nose, eyes, and lips/mouth.
  2. Style Manipulation Network (SMN): Built on top of a pretrained Swapping Autoencoder (SAE). Instead of applying a uniform style vector across the whole image, the authors inject standard Gaussian noise into the spatial style vector only within the region defined by the predicted mask.
  3. Refinement Block (RB): A convolutional network with skip connections operating at full resolution. It fuses the coarsely edited image with the original image to preserve fine details and uses a discriminator to ensure the final style looks realistic.
An illustration of the SMN and the Refinement Block

Datasets

The specific datasets used for training and evaluation are not explicitly discussed in the main text of this student abstract (the authors note that dataset details are provided in the supplementary material). However, the qualitative results demonstrate performance on real human face images.

Key Insights and Ideas

  • Spatial Style Modulation: Traditional Swapping Autoencoders broadcast a single global style vector uniformly across all pixel locations. The core "aha moment" here is realizing that by varying this style vector spatially using a binary mask, you can restrict style changes to a precise local region.
  • Bypassing Inversion: By injecting noise directly into the latent layers of an autoencoder framework during the forward pass, the method completely avoids the iterative optimization loop typically required by GAN inversion methods.
  • Eliminating Human Supervision: Because the network doesn't need to map out semantic trajectories in the latent space post-training, it removes the need for human annotators to identify which latent directions control which features.

Key Results

  • Massive Speedup: The proposed method takes only 0.01143 seconds to perform a texture edit per ROI, compared to 120.602 seconds for SemanticStyleGAN—a speedup of over 10,000x.
  • Quality Metrics: It achieves a Frechet Inception Distance (FID) score of 9.83255 and a Learned Perceptual Image Patch Similarity (LPIPS) score of 0.1252, demonstrating strong perceptual similarity and structure preservation.
  • Qualitative Success: As shown in Figure 3, the model successfully isolates and modifies specific facial features (hair, skin, etc.) while keeping the rest of the image intact.
Figure 3: Row 1 - Localized Style Editing results. Semantic ROIs of the input image have been edited in accordance with the column label. Row 2 - SMPN ouput.

Limitations and Future Work

The authors note that the localized style changes are sometimes subtle and "not very highly pronounced." They attribute this to the Refinement Block being too aggressive, effectively smoothing out or suppressing some of the intended style modifications to maintain realism.

As a future direction, the team plans to study ablations of the Refinement Block to strike a better balance between style intensity and image quality, alongside improving its overall architecture.

Summary updated

BibTeX
@misc{tomar2022exploring,
  author = {Snehal Singh Tomar and Maitreya Suin and A. N. Rajagopalan},
  title = {{Exploring the Effectiveness of Mask-Guided Feature Modulation as a Mechanism for Localized Style Editing of Real Images}},
  year = {2022},
  eprint = {2211.11224},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.11224},
}

Loading related content...

Figure