Abstract
Traditional image search engines often struggle with complex logical queries and fine-grained visual feedback, typically relying on brittle keyword matching or global image similarity. We present an "intent expansion" framework that transforms image search into an iterative, multi-modal dialogue. By leveraging Large Language Models (LLMs) for structured logic parsing and the Segment Anything Model (SAM) for precise visual selection, our system enables users to express sophisticated search intents—including logical operators like AND, OR, and NOT—and refine results through interactive visual previews. Evaluation on NFT and fashion datasets demonstrates significant improvements in search accuracy and user satisfaction compared to standard cross-modal baselines.
Introduction: The Brittle Nature of Modern Search
Despite the advancements in vision-language models like CLIP, current image search platforms—ranging from general-purpose engines like Google Images to niche marketplaces like OpenSea—remain surprisingly limited. These systems primarily operate on "proximity measurements," calculating the distance between a text embedding and an image tag or comparing global visual features.
This paradigm suffers from three critical flaws:
- Logical Blindness: Standard engines struggle with Boolean operators. A query for "a penguin with a hat but not glasses" frequently returns images containing both attributes because the model prioritizes the presence of keywords over their logical relationships.
- Metadata Mismatch: There is often a disconnect between visual features and structured non-visual data (e.g., "the most expensive NFT in this collection").
- Coarse Feedback Loops: When a user finds an image that is "almost right," existing systems typically offer a "search for similar" feature that aggregates the entire image. This prevents users from focusing on specific sub-elements, such as a particular accessory or color.
Methods: From Query Rewriting to Intent Expansion
To address these limitations, we propose a two-stage framework that moves beyond "black-box" query processing. The core of our approach is the translation of natural language and visual interactions into a machine-comprehensible logical structure.
1. Multi-Modal Intent Parsing
The system decomposes user input into two streams:
- Textual Parsing: Using LLMs with few-shot learning, natural language queries are translated into a structured taxonomy. This taxonomy includes metadata categories, specific trait tags, and descriptive visual features.
- Visual Parsing: We integrate the Segment Anything Model (SAM) to allow for fine-grained interaction. Users can "brush" over specific elements in a result image to isolate them as part of the search intent for subsequent rounds.
2. Logic Composition and Contextual Interaction
Unlike traditional systems that pass a raw string to a search bar, our framework uses Chain-of-Thought (CoT) prompting to build a nested list of "Logical Units." These units represent operations such as Union (OR), Intersection (AND), Exclusion (NOT), and Change.
The "Change" operation is particularly innovative. It allows users to select an object and specify a modification (e.g., "change this hat to red"). The system then utilizes InstructPix2Pix to generate a visual preview of the modified intent. This provides a "sanity check" for the user before the backend retrieval process begins, bridging the gap between user expectation and system understanding.
3. Backend Retrieval
For efficient searching, we store CLIP embeddings in a Ball Tree structure. The retrieval process is not a simple similarity search; it incorporates custom ranking rules that prioritize the logical constraints parsed in the first stage, ensuring that "NOT" conditions are strictly enforced.
Evaluation and Results
We evaluated the framework using two distinct datasets: a custom NFT Dataset containing over 500,000 images from OpenSea and the Deepfashion2 benchmark for photo-realistic fashion images.
Quantitative Performance
On the Deepfashion2 dataset, the intent expansion method demonstrated a substantial performance leap. For text-to-image search tasks involving complex attributes, Top-1 accuracy increased from 37.0% (baseline) to 60.8% using our framework. This suggests that explicit logical parsing is far more effective than relying on the latent reasoning of embedding models.
User Study Insights
A user study (N=16) revealed that participants significantly preferred our system over unimodal and standard CLIP-based baselines. Key findings included:
- Usability: Users found the "brushing" interaction via SAM much more intuitive than attempting to describe complex visual features in text.
- Flexibility: The ability to explicitly exclude traits (the NOT operator) was cited as a major improvement over existing commercial tools.
- Engagement: The iterative nature of the search, supported by visual previews, made the search process feel more like a collaborative dialogue than a static query.
Discussion and Future Directions
The primary insight of this work is that LLMs are most effective when used as structured parsers rather than simple query rewriters. By treating visual elements as logical variables in a multi-modal equation, we can provide users with unprecedented control over image retrieval.
However, challenges remain. The current implementation of visual parsing (SAM) can be unforgiving; if a mask is incorrectly generated, users often have to restart the selection process. Furthermore, while the system excels in the relatively "clean" environment of NFTs, cluttered real-world scenes still pose a challenge for both segmentation and CLIP-based alignment. Future work will focus on improving the "editability" of masks and allowing users to "weight" different parts of their query.
Summary updated