FreestyleRet: Retrieving Images from Style-Diversified Queries

Hao Li, Yanhao Jia, Peng Jin, Zesen Cheng, Kehan Li, Jialu Sui, Chang Liu, Li Yuan · DOI

TL;DR

This paper introduces "Style-Diversified Query-Based Image Retrieval," a new task that allows users to search for images using various query types beyond just text, such as sketches or low-resolution images. They propose a novel, lightweight framework called FreestyleRet that effectively handles these diverse queries by extracting textural and style information and using it to fine-tune pre-trained visual encoders.

What Problem Does This Paper Address?

Traditional image retrieval systems primarily rely on text-based queries. While effective for many scenarios, this approach limits users who might prefer to express their search intent through other modalities like sketches, artistic renderings, or even low-resolution versions of an image. This limitation can lead to ambiguity or bias in user intent, as text alone might not fully capture the desired visual characteristics. The authors identify this gap and propose a new task and framework to enable image retrieval from a broader range of query styles, aiming to better match user intent.

Methods

The core of FreestyleRet lies in its three main modules:

  1. Gram-based Style Extraction Module: This module leverages the Gram Matrix, a technique from image style transfer, to capture the textural and spatial relationships within a query image. This provides a representation of the query's "style."
  2. Style Space Construction Module: Here, the Gram Matrices from all queries are clustered to define a "style space." The centers of these clusters act as style-specific bases. The query's style feature is then represented by a weighted combination of these bases, determined by the query's similarity to each base.
  3. Style-Init Prompt Tuning Module: This module is designed to be lightweight and plug-and-play. It uses a frozen pre-trained visual encoder and introduces trainable prompt tokens. Crucially, these prompt tokens are initialized using the extracted textural (Gram Matrix) and style features. This initialization helps the visual encoder understand and process the diverse query styles more effectively.

Datasets

  • Diverse-Style Retrieval dataset (DSR): A newly introduced dataset specifically for this task, containing 10,000 natural images paired with queries in four styles: text, sketch, low-resolution, and art.
  • ImageNet-X: A larger, coarser dataset also used for evaluation, containing ImageNet images with sketch and art-form versions.

Key Insights and Ideas

  • Beyond Text: The paper convincingly argues that relying solely on text for image retrieval is a significant limitation, and users can benefit from a more versatile query system.
  • Gram Matrix for Style: Using the Gram Matrix, a concept from style transfer, to represent textural and style information in diverse query types is an elegant way to extract meaningful features.
  • Style Space as a Unifying Concept: Creating a "style space" by clustering Gram Matrices provides a structured way to understand and represent different query styles, allowing for more robust feature extraction.
  • Style-Init Prompt Tuning: Initializing prompt tokens with style-specific features is a key innovation that significantly improves the ability of pre-trained models to handle diverse query styles without extensive retraining.
  • Synergistic Retrieval: The paper demonstrates that using multiple query styles simultaneously can mutually enhance retrieval performance, suggesting a powerful direction for future retrieval systems.

Key Results

  • State-of-the-Art Performance: FreestyleRet, particularly its CLIP and BLIP variants, outperforms existing cross-modality and multi-modality models on the proposed style-diversified retrieval task across both the DSR and ImageNet-X datasets. For instance, on the DSR dataset, FreestyleRet-BLIP achieves R@1 scores of 81.6 for Sketch→Image and 90.5 for Low-Res→Image, significantly outperforming baselines.
  • Improved Retrieval Accuracy: The model shows a significant improvement (6%-10%) in complex scenarios like sketch and art style retrieval compared to baselines.
  • Simultaneous Multi-Style Retrieval: The framework effectively handles combined queries (e.g., sketch+text), where auxiliary information from different query types enhances retrieval performance.
  • Computational Efficiency: FreestyleRet is described as lightweight and plug-and-play, with a slight increase in parameters and inference time compared to models like CLIP and BLIP, but maintaining rapid deployment.
  • Qualitative Improvements: Visualizations show that FreestyleRet better clusters query features by semantic class and more accurately retrieves images based on specific pose, category, and color information, even when dealing with challenging query styles.

Limitations and Future Work

  • Dataset Expansion: The authors suggest incorporating a broader range of query styles into their Diversified-Style Dataset in future work.
  • More Efficient Strategies: Exploring more efficient style-based prompt-tuning strategies is also a direction for future research.
  • Computational Cost: While considered lightweight, the prompt tuning still adds some computational overhead compared to zero-shot baselines.
  • Specific Style Performance: While generally strong, the paper notes that fine-tuned BLIP slightly outperforms FreestyleRet in retrieving natural images to low-resolution images, possibly due to the high semantic similarity between these modalities.

Summary updated

Abstract

Image Retrieval aims to retrieve corresponding images based on a given query. In application scenarios, users intend to express their retrieval intent through various query styles. However, current retrieval tasks predominantly focus on text-query retrieval exploration, leading to limited retrieval query options and potential ambiguity or bias in user intention. In this paper, we propose the Style-Diversified Query-Based Image Retrieval task, which enables retrieval based on various query styles. To facilitate the novel setting, we propose the first Diverse-Style Retrieval dataset, encompassing diverse query styles including text, sketch, low-resolution, and art. We also propose a light-weighted style-diversified retrieval framework. For various query style inputs, we apply the Gram Matrix to extract the query’s textural features and cluster them into a style space with style-specific bases. Then we employ the style-init prompt learning module to enable the visual encoder to comprehend the texture and style information of the query. Experiments demonstrate that our model outperforms existing retrieval models on the style-diversified retrieval task. Moreover, style-diversified queries (sketch+text, art+text, etc.) can be simultaneously retrieved in our model. The auxiliary information from other queries enhances the performance within the respective query, which may hold potential significance for the community.
BibTeX
@inproceedings{li2024freestyleret,
  author = {Hao Li and Yanhao Jia and Peng Jin and Zesen Cheng and Kehan Li and Jialu Sui and Chang Liu and Li Yuan},
  title = {{FreestyleRet: Retrieving Images from Style-Diversified Queries}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73337-6\_15},
}
Figure