Vision-by-Language for Training-Free Compositional Image Retrieval

Shyamgopal Karthik, Karsten Roth, Massimiliano Mancini, Zeynep Akata

TL;DR

CIReVL achieves state-of-the-art Zero-Shot Compositional Image Retrieval (ZS-CIR) without requiring any task-specific training or fine-tuning. By converting a query image into text via a vision-language model (VLM), modifying it using a large language model (LLM), and retrieving the target image with CLIP, it introduces a completely modular, human-interpretable, and highly scalable pipeline.

What Problem Does This Paper Address?

Compositional Image Retrieval (CIR) is the task of searching for an image using a reference image combined with a textual modification request (e.g., taking a photo of a dog and adding the text "make it a cartoon at night").

Traditional approaches rely heavily on supervised training using curated triplets (query image, text modification, target image), which are incredibly expensive and labor-intensive to collect. To bypass this, recent Zero-Shot CIR (ZS-CIR) methods use pre-trained VLMs like CLIP. However, even these zero-shot methods typically require training specialized "textual inversion" networks to map images into pseudo-tokens within a rigid text template. These pseudo-tokens are black boxes—humans cannot read or easily manipulate them, and the rigid templates lack semantic flexibility.

The authors ask: Can we achieve high-performance compositional image retrieval entirely training-free, using only off-the-shelf foundation models, while making the process transparent and flexible?

Methods

The authors introduce CIReVL (Compositional Image Retrieval through Vision-by-Language), a pipeline that shifts the entire compositional reasoning process into the natural language domain.

Figure 1: Compositional Image Retrieval through Vision-by-Language (CIReVL). Given an input image and a text modifier, we use an off-the-shelf vision-language model to caption the image. A LLM processes the generated caption and the text modifier to generate a description of the desired target image. To obtain the final image, we use a vision-language model and perform text-to-image retrieval. CIReVL is modular, training-free and human-understandable in natural language.

The pipeline operates in three distinct, training-free steps:

  1. Image Captioning: An off-the-shelf generative VLM (such as BLIP-2 or CoCa) generates a detailed natural language description ($c_q$) of the input query image.
  2. Language Reasoning: A Large Language Model (such as GPT-3.5, GPT-4, or Llama 2) takes the generated caption and the user's text modifier ($t$). Guided by a simple prompt, the LLM acts as a reasoning engine to synthesize a single, cohesive "target caption" ($c_q^t$) that describes what the final image should look like.
  3. Cross-Modal Retrieval: A standard pre-trained dual-encoder VLM (like CLIP) takes the LLM-generated target caption and performs a standard text-to-image search across the image database using cosine similarity.

Datasets

The authors evaluate CIReVL across four diverse ZS-CIR benchmarks and one domain conversion task:

  • CIRCO: A clean, recent benchmark featuring multiple positive target images per query to handle real-world ambiguity.
  • CIRR: A classic but noisy natural image CIR benchmark.
  • Fashion-IQ: A domain-specific benchmark focused entirely on fashion retrieval (Shirts, Dresses, Toptees).
  • GeneCIS: A benchmark designed to evaluate fine-grained conditional image similarity (focusing on or changing specific attributes/objects).
  • ImageNet Domain Conversion: A task requiring retrieval of the same semantic object but in a different domain (e.g., converting a real goldfish image to a cartoon goldfish).

Key Insights and Ideas

  • Language as a Universal Interface: Moving the "composition" step entirely into the text domain bypasses the need for complex multi-modal feature fusion architectures.
  • The Retrieval Bottleneck: By using fine-grained text-image alignment metrics (TIFA), the authors discovered a surprising truth: the LLM generates highly accurate target descriptions, but the retrieval model (CLIP) often fails to find the matching image. The primary bottleneck in ZS-CIR is not the language reasoning, but the cross-modal retrieval capability of the VLM.
  • Plug-and-Play Scaling Laws: Because the pipeline is completely modular, you can swap out the retrieval model for a larger one without retraining anything else. The authors demonstrate a clear log-linear relationship between retrieval model size and final CIR performance.
  • Human-in-the-Loop Intervenability: Because the intermediate representations are plain text, CIReVL is fully interpretable. If the captioning model makes a mistake, a human user can manually correct the text caption or the prompt, instantly fixing downstream retrieval failures.
Examples of how human intervention at the caption level can easily correct failure cases post-hoc.

Key Results

Despite being entirely training-free, CIReVL significantly outperforms state-of-the-art zero-shot methods that require specialized training:

  • CIRCO Benchmark: Using a standard ViT-L/14 CLIP backbone, CIReVL achieves a 18.57% mAP@5, drastically outperforming the previous state-of-the-art trained zero-shot method, SEARLE (11.68%).
  • Unprecedented Scalability: By simply swapping the retrieval backbone to a massive ViT-G/14 model from OpenCLIP, CIReVL pushes performance to 26.77% mAP@5 on CIRCO—more than doubling previously reported zero-shot results.
  • Fashion-IQ: On ViT-B/32, CIReVL achieves an average 28.55% Recall@10, comfortably beating SEARLE's 22.89%.
  • Supervised Baselines: In cross-dataset settings, CIReVL demonstrates superior generalization compared to fully supervised models (like Combiner), which suffer heavily from domain shift when trained on one dataset and tested on another.

Limitations and Future Work

  • Error Propagation: The pipeline is highly dependent on the initial captioning step. If the generative VLM misses a subtle but crucial detail in the reference image, the LLM will build upon faulty information, leading to incorrect retrieval.
  • CLIP's Compositional Weakness: The final step relies on CLIP, which is notoriously poor at understanding complex spatial relationships, text rendering, or fine-grained attributes.
  • Future Directions: The authors suggest that integrating more advanced, compositionally robust retrieval models or fine-grained cross-modal alignment techniques will be key to breaking the current retrieval bottleneck.

Summary updated

BibTeX
@inproceedings{karthik2024vision,
  author = {Shyamgopal Karthik and Karsten Roth and Massimiliano Mancini and Zeynep Akata},
  title = {{Vision-by-Language for Training-Free Compositional Image Retrieval}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=EDPxCjXzSb},
}
Figure