Enabling Local Editing in Diffusion Models by Joint and Individual Component Analysis

Theodoros Kouzelis, Manos Plitsis, Mihalis A. Nikolaou, Yannis Panagakis

Introduction

Diffusion Models (DMs) have established themselves as the leading paradigm for high-fidelity image synthesis. However, precise control over specific image regions remains a significant challenge. Unlike Generative Adversarial Networks (GANs), which possess well-mapped latent spaces, DMs often suffer from semantic entanglement. Modifying a specific feature, such as eye shape, frequently results in unintended global changes to identity, lighting, or background.

A recent study by Kouzelis et al. introduces an unsupervised framework to enable "precision surgery" on DM-generated images. By decomposing the latent space into joint and individual components, the researchers achieve localized editing without the need for text prompts or external guidance models like CLIP.

The Challenge: Semantic Entanglement in $H$-space

Recent findings identified the bottleneck layer of a DM’s U-Net, known as the $H$-space, as a semantic latent space. While this space contains interpretable directions, existing discovery methods are typically global. Applying a "smile" direction in $H$-space might successfully alter the mouth but often inadvertently modifies the chin or overall facial illumination. True local editing requires identifying latent directions that influence only a specific set of pixels.

Local editing results on CelebA-HQ. The method identifies individual components for specific regions (Lips, Eyes, Brows, Nose) and allows for precise manipulation along these directions ($+v_i, -v_i$) while keeping other regions and global attributes constant.

Methodology: Jacobian Analysis and JIVE

The proposed method rests on three mathematical pillars designed to isolate local variations:

  1. Jacobian of the Denoising Network: The sensitivity of specific image regions to changes in $H$-space is captured via the Jacobian matrix. This matrix of first-order partial derivatives reveals which latent directions affect which pixels.
  2. Efficient Subspace Iteration: Given the massive parameter count of modern DMs (often exceeding 6 billion), computing the full Jacobian is computationally prohibitive. The authors employ a subspace iteration method to approximate the most significant directions efficiently.
  3. Joint and Individual Variation Explained (JIVE): This is the core innovation. JIVE factorizes the latent subspaces of multiple regions of interest (e.g., eyes and mouth) into:
  4. Joint Components: Directions that induce changes across all regions, representing global attributes like lighting or gender.
  5. Individual Components: Directions unique to a specific region and strictly orthogonal to the joint space.

By navigating along these "individual" directions, users can perform edits—such as closing eyes or changing lip color—while the rest of the image remains unchanged.

Experimental Validation

The method was evaluated using pre-trained, unconditional DDPM models across three datasets: CelebA-HQ (faces), METFACES (artistic portraits), and LSUN-Churches (architecture).

Key Findings

  • Unsupervised Localization: The approach is entirely unsupervised, learning image structure directly from the pre-trained network's geometry rather than relying on text-based guidance.
  • Generalization: Directions discovered for one image (e.g., "close eyes") generalize effectively to other images, allowing for "plug-and-play" editing without re-computing the Jacobian for every instance.
  • Fidelity and Precision: Quantitative analysis using the Region of Interest Ratio (ROIR) demonstrated that this method achieves significantly higher localization than state-of-the-art alternatives like Asyrp and Haas et al. Furthermore, Fréchet Inception Distance (FID) scores confirmed that the resulting edits maintain high visual realism and identity preservation.

Conclusion

This research provides a robust mathematical framework for disentangling the latent space of diffusion models. By isolating individual components through Jacobian analysis and JIVE, it transforms the "black box" of DMs into a precise tool for localized image manipulation. Future work may explore extending these principles to video diffusion models and automating the discovery of regions of interest.

Summary updated

BibTeX
@inproceedings{kouzelis2024enabling,
  author = {Theodoros Kouzelis and Manos Plitsis and Mihalis A. Nikolaou and Yannis Panagakis},
  title = {{Enabling Local Editing in Diffusion Models by Joint and Individual Component Analysis}},
  booktitle = {BMVC},
  year = {2024},
  doi = {10.48550/arxiv.2408.16845},
}
Figure