CLAY: Conditional Visual Similarity Modulation in Vision-Language Embedding Space

Sohwi Lim, Lee Hyoseok, Jungjoon Park, Tae-Hyun Oh

TL;DR

CLAY is a training-free, highly efficient method for text-conditioned image retrieval that adaptively modulates the embedding space of pretrained Vision-Language Models (VLMs). By decoupling visual feature extraction from the text-conditioning process, CLAY allows users to search for images based on specific attributes (like color, action, or species) without needing to re-encode the database or train new models.

What Problem Does This Paper Address?

Standard image retrieval systems rely on a static definition of visual similarity. When you pass a query image through a Vision-Language Model like CLIP, it computes a single, monolithic embedding. However, human perception of similarity is inherently flexible and subjective. As shown in Figure 1, if you provide an image of a brown dog running on grass, you might want to find other dogs of the same species, other animals performing the same action, or images in the same location.

Figure 1. Our proposed concept-based conditional image retrieval method retrieves images focusing on the semantic aspects specified by the text condition. Given a query image, our method adaptively computes conditioned similarity by modulating the similarity space to align with various conditions, e.g., species, location, action, category, and color.

Existing conditional retrieval methods attempt to solve this by training neural network modulators to fuse text conditions with image features. Unfortunately, this introduces a massive computational bottleneck: whenever a user changes the text condition, the features for every single image in the database must be recomputed from scratch. This makes symmetric conditional retrieval (where both the query and database are conditioned) impractical for large-scale, real-world applications.

Methods

CLAY (Conditional Visual Similarity Modulation) introduces a training-free framework that keeps the database's visual embeddings completely fixed. Instead of altering the image features, it alters the similarity space itself.

Figure 2. Illustration of the concept of CLAY. Our method adap- tively computes conditional similarity between images by modulat- ing the original similarity space into a conditional similarity space within the representation space of VLMs.

The pipeline consists of two main phases:

  1. Manifold-Aware Textual Subspace Construction: Given a text condition (e.g., "Action"), CLAY uses an LLM to generate a set of related prompts (e.g., "a photo of running", "a photo of jumping"). These are encoded using the VLM's text encoder. Because VLM embeddings naturally lie on a unit hypersphere rather than a flat Euclidean space, CLAY maps these text features onto a local tangent space using a mathematical logarithm map. It then applies Singular Value Decomposition (SVD) to find the top-$k$ singular vectors, forming a condition-specific projection matrix ($P_c$).

  2. Inference and Similarity Modulation: At inference time, the fixed visual features of the query and database images need to be projected onto this textual subspace. However, because of the "conic effect" (the modality gap between text and vision embeddings), a naive projection distorts relationships. CLAY solves this by applying an orthonormal rotation ($H$) that aligns the mean of the visual features with the mean of the textual features. The rotated visual features are then mapped to the tangent space, projected via $P_c$, and evaluated using standard cosine similarity.

Figure 3. Conditional similarity computation pipeline. (a) Given a condition, we construct the manifold-aware textual subspace with the condition text features in advance, and generate the condition-aware projection matrix Pc. (b) At inference, we compute the conditional similarity between the query and database images by projecting the visual features onto the textual subspace with Pc.

Datasets

The authors evaluated CLAY across both real-world and synthetic datasets:

  • Real-World Datasets: Stanford40 (for actions) and various fine-grained classification datasets including OxfordPets (species), PPMI, Flowers102, StanfordCars, FGVC-Aircraft, and Food-101.
  • Synthetic Datasets: CLEVR4 (shape, color, texture, count).
  • CLAY-EVAL (New Benchmark): To address the lack of multi-conditional retrieval benchmarks, the authors created a synthetic dataset using the FLUX.1-dev diffusion model. It contains 7,325 object images (categorized by category, sub-category, color) and 6,745 human images (categorized by age, action, background), allowing for rigorous multi-attribute testing.

Key Insights and Ideas

  • Decoupling is Key to Efficiency: By separating the textual conditioning from visual feature extraction, database images only need to be encoded once. The condition-specific projection matrices can be precomputed, making the system incredibly fast at runtime.
  • Geometry Matters: Treating VLM embedding spaces as flat Euclidean spaces leads to suboptimal projections. Approximating the hypersphere via local tangent spaces yields much more accurate condition-aware relationships.
  • The Power of Rotation: Simply projecting visual features onto a text space fails because the two modalities cluster in different regions. Rotating the visual feature space to align its mean with the textual mean preserves intra-visual relationships while enabling effective text-guided filtering.

Key Results

  • State-of-the-Art Accuracy: CLAY consistently outperformed baseline VLMs and competing conditional retrieval methods (like GeneCIS, InstructBLIP, and MagicLens) in mean Average Precision (mAP) across almost all single-condition tasks. For instance, on Stanford40 (Action), CLAY achieved 66.2 mAP compared to GeneCIS's 50.0 mAP.
  • Multi-Condition Excellence: Unlike prior works dedicated only to single conditions, CLAY naturally scales to multi-conditional queries (e.g., searching by both "Color" and "Category" simultaneously), showing significant performance gains on the CLAY-EVAL dataset.
  • Computational Efficiency: In a controlled evaluation of inference latency for subsequent queries, CLAY demonstrated a massive speedup (taking only 0.092 to 0.126 seconds) compared to symmetric deep-learning modulators like Qwen3-VL, which require over 12 seconds per query due to database re-encoding.

Limitations and Future Work

While CLAY delivers impressive speed and accuracy, it has two notable limitations:

  1. Focus on Core Attributes: The method is designed around primary attributes present in an image and may struggle in complex, cluttered scenes containing multiple distinct objects.
  2. VLM Dependency: Because CLAY uses frozen visual features, it cannot recover or utilize attributes that the base VLM failed to encode originally (such as very small objects that the CLIP image encoder typically suppresses).

As a future direction, the authors suggest extending the framework to accept more direct, localized user conditions, such as segmentation masks, to help recover fine-grained attributes.

Summary updated

BibTeX
@inproceedings{lim2026clay,
  author = {Sohwi Lim and Lee Hyoseok and Jungjoon Park and Tae-Hyun Oh},
  title = {{CLAY: Conditional Visual Similarity Modulation in Vision-Language Embedding Space}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=vridFUkzGv},
}
Figure