Skip to main content
QUICK REVIEW

[Paper Review] iEdit: Localised Text-guided Image Editing with Weak Supervision

Rumeysa Bodur, Erhan Gündoğdu|arXiv (Cornell University)|May 10, 2023
Generative Adversarial Networks and Image SynthesisComputer Science3 citations
TL;DR

iEdit proposes a weakly-supervised method for localized, text-guided image editing using latent diffusion models (LDMs), leveraging automatically constructed pseudo-target image pairs from LAION-5B and edit prompts generated via BLIP. It achieves state-of-the-art performance in image fidelity, CLIP alignment, and localized editing with only 200K training samples and 2 V100 GPUs.

ABSTRACT

Diffusion models (DMs) can generate realistic images with text guidance using large-scale datasets. However, they demonstrate limited controllability in the output space of the generated images. We propose a novel learning method for text-guided image editing, namely exttt{iEdit}, that generates images conditioned on a source image and a textual edit prompt. As a fully-annotated dataset with target images does not exist, previous approaches perform subject-specific fine-tuning at test time or adopt contrastive learning without a target image, leading to issues on preserving the fidelity of the source image. We propose to automatically construct a dataset derived from LAION-5B, containing pseudo-target images with their descriptive edit prompts given input image-caption pairs. This dataset gives us the flexibility of introducing a weakly-supervised loss function to generate the pseudo-target image from the latent noise of the source image conditioned on the edit prompt. To encourage localised editing and preserve or modify spatial structures in the image, we propose a loss function that uses segmentation masks to guide the editing during training and optionally at inference. Our model is trained on the constructed dataset with 200K samples and constrained GPU resources. It shows favourable results against its counterparts in terms of image fidelity, CLIP alignment score and qualitatively for editing both generated and real images.

Motivation & Objective

  • To address the lack of fully-annotated datasets for text-guided image editing, which are expensive and biased.
  • To improve controllability and localization in image editing while preserving source image fidelity.
  • To enable efficient, lightweight fine-tuning of LDMs using only 200K samples and 2 V100 GPUs.
  • To develop a weakly-supervised training pipeline that avoids subject-specific fine-tuning and mask dependency at inference.
  • To introduce mask-aware loss functions that guide editing to specific regions while preserving non-edited areas.

Proposed method

  • Automatically constructs a weakly-supervised dataset from LAION-5B using multi-modal CLIP embeddings to pair images and generate edit prompts by modifying BLIP-generated captions.
  • Uses a contrastive learning loss ($\mathcal{L}_{global}$) to align edit prompts with generated images.
  • Introduces a mask-guided loss ($\mathcal{L}_{mask}$) using off-the-shelf segmentation models to enforce localized editing and preserve non-edited regions.
  • Applies a perceptual loss ($\mathcal{L}_{perc}$) to improve visual quality and consistency.
  • Employs a local contrastive loss ($\mathcal{L}_{loc}$) to enhance alignment between edit prompts and image regions.
  • Fine-tunes only subcomponents of the LDM backbone, enabling training on limited hardware (2x V100s).

Experimental results

Research questions

  • RQ1Can a weakly-supervised, automatically constructed dataset enable effective text-guided image editing without fully-annotated target images?
  • RQ2How can localization in image editing be improved while preserving semantic and structural fidelity in non-edited regions?
  • RQ3To what extent can a lightweight, fine-tuned LDM achieve performance comparable to full-model training with minimal GPU resources?
  • RQ4Does the use of segmentation masks during training improve localization and editing accuracy compared to global alignment alone?
  • RQ5How does the model perform on both real and generated source images in terms of fidelity and prompt alignment?

Key findings

  • iEdit achieves the highest CLIPScore among all compared methods on both generated and real images, indicating superior alignment with edit prompts.
  • On real images, iEdit achieves the best balance between source image fidelity (SSIM- $\overline{M}$) and editing accuracy (CLIPScore), outperforming DALL-E 2 despite not using ground-truth masks at inference.
  • The ablation study shows that $\mathcal{L}_{mask}$ leads to a large improvement in CLIPScore and FID, while $\mathcal{L}_{perc}$ provides a marginal but consistent boost.
  • Using predicted masks at inference improves all metrics significantly, demonstrating the value of spatial guidance.
  • The model trained on 200K samples with only 2 V100 GPUs outperforms methods requiring full fine-tuning or subject-specific adaptation.
  • iEdit shows strong generalization, successfully editing both real and generated source images with high visual quality and prompt consistency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.