Abstract
Composed Image Retrieval (CIR) involves retrieving a target image based on a composed query of an image paired with text that specifies modifications or changes to the visual reference. CIR is inherently an instruction-following task, as the model needs to interpret and apply modifications to the image. In practice, due to the scarcity of annotated data in downstream tasks, Zero-Shot CIR (ZS-CIR) is desirable. While existing ZS-CIR models based on CLIP have shown promising results, their capability in interpreting and following modification instructions remains limited. Some research attempts to address this by incorporating Large Language Models (LLMs). However, these approaches still face challenges in effectively integrating multimodal information and instruction understanding. To tackle above challenges, we propose a novel embedding method utilizing an instruction-tuned Multimodal LLM (MLLM) to generate composed representation, which significantly enhance the instruction following capability for a comprehensive integration between images and instructions. Nevertheless, directly applying MLLMs introduces a new challenge since MLLMs are primarily designed for text generation rather than embedding extraction as required in CIR. To address this, we introduce a two-stage training strategy to efficiently learn a joint multimodal embedding space and further refining the ability to follow modification instructions by tuning the model in a triplet dataset similar to the CIR format. Extensive experiments on four public datasets: FashionIQ, CIRR, GeneCIS, and CIRCO demonstrates the superior performance of our model, outperforming state-of-the-art baselines by a significant margin.
Introduction
Composed Image Retrieval (CIR) is a computer vision task where a user provides a "source image" and a "modifier text" (the instruction) to find a specific "target image." For example, given a photo of a dog sitting on grass and the instruction "the dog is running," the system should retrieve a similar image of the same dog in motion.
Traditional approaches rely on Vision-Language Models (VLMs) like CLIP. However, CLIP acts primarily as a matching engine rather than an instruction follower; it often fails to grasp the nuance of specific modifications while maintaining visual consistency. Furthermore, training these systems is hindered by the scarcity of "triplet data" (source image, text, target image). To overcome these hurdles, we introduce InstructCIR, a framework that repurposes instruction-tuned Multimodal Large Language Models (MLLMs) for the CIR task.
Methodology
1. The "Generative to Embedding" Shift
MLLMs are inherently designed for autoregressive text generation. To adapt them for retrieval, which requires a single vector embedding, we append a special [EOS] (End of Sentence) token to the input sequence. The hidden state of this token serves as the global representation of the combined image-text query.
2. Two-Stage Training Strategy
To effectively bridge the gap between generative pre-training and contrastive retrieval, we employ a two-stage training process:
- Stage 1 (Modality Alignment): The model is trained on standard image-caption pairs. This teaches the MLLM to represent visual features within its internal embedding space, aligning them with textual descriptions.
- Stage 2 (Instruction Contrastive Tuning): The model is fine-tuned on triplets to learn the logic of modifications. We utilize hard negatives—specifically using the original caption as a negative example for the modified query—to force the model to distinguish fine-grained visual changes.
3. Automated Data Engine
To address the lack of high-quality triplet data, we developed an automated pipeline using GPT-4o. By providing GPT-4o with image captions from the CC3M dataset, we prompted it to generate creative modification instructions and corresponding target captions. This resulted in CC3M-Instruct, a synthetic dataset of 300k high-quality triplets that significantly improves the model's instruction-following capabilities.
Experimental Results
InstructCIR was evaluated across four major zero-shot CIR benchmarks, setting new state-of-the-art (SOTA) records:
- CIRCO: Achieved an mAP@5 of 22.32%, nearly doubling the performance of previous SOTA models like SEARLE (11.68%).
- CIRR: Reached a Recall@1 of 35.18%, a substantial improvement over the previous best LLM-based model, MCL (26.22%).
- FashionIQ & GeneCIS: Demonstrated strong cross-domain generalization, proving that instruction-following capabilities learned on natural images transfer effectively to specialized domains like fashion.
Discussion and Conclusion
The success of InstructCIR highlights that MLLMs are inherently "instruction-aware," making them superior to standard VLMs for complex compositional queries. While CLIP treats text as a "bag of words," MLLMs can follow the logic of a modification command.
However, challenges remain. MLLMs (even "mini" versions like Phi-3.5) have higher computational overhead than CLIP-based encoders, which may impact real-time performance at scale. Additionally, while synthetic data is highly effective, it can occasionally introduce noise. Future work will focus on scaling the triplet dataset and exploring dynamic high-resolution vision encoders to further refine retrieval accuracy.
Summary updated