Composed image retrieval

Also known as: CIR

On this page 7

Composed image retrieval (CIR) is a search task in which the query combines a reference image with a modification text, and the system must return images that look like the reference but reflect the requested change. In Multimodal AI, it sits between image search and text search: a shopper who uploads a photo of a red dress and types “same cut, but in navy with long sleeves” is issuing a composed query.

The task is harder than ordinary cross-modal retrieval because neither input alone describes the target. The image supplies what to keep, the text supplies what to change, and the model must merge both into a single representation that ranks a large gallery correctly.

How composed image retrieval builds a query

A CIR system works by encoding the reference image and the modification text, fusing them into one composed query embedding, and comparing that vector with precomputed embeddings of every gallery image. Ranking usually relies on cosine similarity in a shared vector space, the same mechanism used by CLIP-style search.

The decisive component is the composition function. Early designs such as TIRG used gated residual connections that kept most image features and added a text-conditioned correction. Current systems typically start from a pretrained vision-language model such as CLIP or BLIP and train a lightweight combiner network or fine-tune the text encoder on top of it.

The pipeline below shows the stages that almost every implementation shares, regardless of the backbone it uses.

StageWhat happensTypical choice
Image encodingReference image becomes a feature vectorVision encoder of CLIP, BLIP or SigLIP
Text encodingModification text becomes a feature vectorMatching text encoder
CompositionBoth vectors merge into one queryCombiner network, cross-attention or pseudo-word token
Gallery indexingCandidate images are embedded onceApproximate nearest neighbor index
RankingGallery sorted by similarity to the queryCosine similarity, optional re-ranking
Stages of a typical composed retrieval pipeline

Supervised and zero-shot approaches

Supervised CIR learns from triplets that contain a reference image, a modification text and the correct target image. Triplets are expensive to annotate, because a person must look at two images and write a precise description of their difference, so public training sets contain only tens of thousands of examples.

Zero-shot composed image retrieval (ZS-CIR) removes the need for triplets. Methods such as Pic2Word and SEARLE use textual inversion: they map the reference image to a pseudo-word token and insert it into a sentence such as “a photo of [token] that is navy with long sleeves”, which the frozen text encoder then embeds. Training-free variants caption the reference image and ask a large language model to rewrite the caption according to the modification before running ordinary text-to-image search.

The following comparison summarizes how the main families differ in data needs and behavior.

ApproachTraining dataStrengthWeakness
Supervised fusionAnnotated tripletsHighest accuracy in its domainPoor transfer to new domains
Textual inversionUnlabeled images onlyWorks across domains without tripletsLoses fine visual detail
Caption and rewriteNone beyond pretrained modelsInterpretable intermediate textCaption errors propagate
Synthetic tripletsGenerated image-edit pairsScales training cheaplySynthetic bias in edits
Families of composed retrieval methods

Composed retrieval differs from neighboring tasks in what the query contains and what counts as a correct answer. Plain image-to-image search returns visually similar items and ignores intent, while text-to-image search cannot express a precise visual starting point. Multimodal search in a broad sense may accept several inputs, but CIR specifically treats the text as a relative instruction rather than an independent description.

TaskQueryCorrect result
Image-to-image searchOne imageVisually similar images
Text-to-image searchOne sentenceImages matching the sentence
Composed image retrievalImage plus change textImages matching the edited reference
Text-guided image editingImage plus change textA newly generated image
Composed retrieval compared with neighboring tasks

The last row matters in practice: text-guided image editing produces a synthetic picture, whereas CIR must return an existing item from a catalog. Some recent systems combine both, generating an edited image first and then using it as an additional query vector.

Benchmarks and evaluation metrics

CIR is evaluated with ranking metrics on a handful of public benchmarks, each with a different domain and annotation style. Results are not comparable across benchmarks, and small differences of one or two points are often within the noise of training randomness.

BenchmarkDomainMain metricKnown issue
FashionIQDresses, shirts and topsRecall at 10 and 50Many valid targets left unlabeled
CIRRNatural real-world scenesRecall at K and subset recallAmbiguous or reference-free texts
CIRCOEveryday objects from COCOMean average precision at KSmaller test set
ShoesFootwear product photosRecall at KNarrow visual variety
Common composed retrieval benchmarks

A persistent problem is false negatives: one modification text often fits several gallery images, yet only one is labeled correct. CIRCO addresses this by annotating multiple ground-truth targets per query, which is why it reports mean average precision instead of plain recall.

Limitations and common failure modes

The main weakness of current CIR models is imbalanced modality use. Many systems learn to rely mostly on the text and nearly ignore the reference image, or the opposite, and benchmark scores can hide this shortcut.

  • Negation and counting such as “without a logo” or “two instead of three” are handled poorly by contrastive encoders.
  • Fine attributes such as fabric texture or exact shade are lost when the image is compressed into a single vector.
  • Domain shift between training triplets and a real catalog sharply reduces accuracy.
  • Multi-turn refinement, where a user adds several changes in sequence, accumulates errors unless the system keeps dialog state.

Practitioners therefore test models on their own gallery with realistic queries and inspect failure cases manually, rather than trusting leaderboard recall alone.

The simple explanation

Composed image retrieval is a way to search with a picture and a few words together. The picture shows a starting point. The words say what should be different. The system then looks for real pictures that match the edited idea.

Think of showing a shop assistant a photo of a chair and saying “like this, but in oak”. The assistant keeps the shape in mind and swaps the material. A CIR model does the same with numbers. It turns the photo and the words into one search key and finds the closest items. The key point is simple: the image says what to keep, the text says what to change.

How it is used in practice

An online furniture retailer with a catalog of about 400,000 product photos adds a search box next to each product image. A customer viewing a gray three-seat sofa types “same shape, green velvet, wooden legs”. The system encodes the sofa photo and the sentence with a fine-tuned CLIP backbone, fuses them with a small combiner network, and queries an approximate nearest neighbor index that returns results in under 100 milliseconds.

During a pilot, the team compares composed queries with plain keyword search on 2,000 logged sessions. Composed queries place a purchasable match in the first ten results far more often, especially for style-preserving changes such as color or material. The team also finds that requests involving negation, such as “no armrests”, still fail regularly, so it routes those to a filter-based fallback. The outcome is a measurable increase in product discovery without retraining the whole search stack.