Instruct-CLIP: Improving Instruction-Guided Image Editing with Automated Data Refinement Using Contrastive Learning
Sherry X. Chen, Misha Sra, Pradeep Sen
TL;DR
Instruct-CLIP (I-CLIP) addresses the data bottleneck in instruction-guided image editing by learning semantic changes between original and edited images and refining edit instructions to better reflect actual edits. It employs a dual-branch contrastive framework that maps visual changes and instructions into a shared space, with a DINOv2 front-end to robustly extract visual features and a DeCap-style decoder to recover refined instructions. The approach extends to latent-diffusion training through LD-DINOv2, enabling robust handling of latent representations and timesteps, and it leverages this to produce a refined IP2P dataset of over 120K samples for fine-tuning. Empirical results show improved alignment with instructions and user preference over prior methods, though limitations remain due to the inherent constraints of the underlying generative models. Overall, I-CLIP provides a scalable, self-supervised route to enhance instruction-guided image editing by aligning semantic changes with textual guidance and refining training data accordingly.
Abstract
Although natural language instructions offer an intuitive way to guide automated image editing, deep-learning models often struggle to achieve high-quality results, largely due to the difficulty of creating large, high-quality training datasets. To do this, previous approaches have typically relied on text-to-image (T2I) generative models to produce pairs of original and edited images that simulate the input/output of an instruction-guided image-editing model. However, these image pairs often fail to align with the specified edit instructions due to the limitations of T2I models, which negatively impacts models trained on such datasets. To address this, we present Instruct-CLIP (I-CLIP), a selfsupervised method that learns the semantic changes between original and edited images to refine and better align the instructions in existing datasets. Furthermore, we adapt Instruct-CLIP to handle noisy latent images and diffusion timesteps so that it can be used to train latent diffusion models (LDMs) and efficiently enforce alignment between the edit instruction and the image changes in latent space at any step of the diffusion pipeline. We use Instruct-CLIP to correct the InstructPix2Pix dataset and get over 120K refined samples we then use to fine-tune their model, guided by our novel I-CLIP-based loss function. The resulting model can produce edits that are more aligned with the given instructions. Our code and dataset are available at https://github.com/SherryXTChen/Instruct-CLIP.git.
