通过视觉提示选择注意力头,让模型聚焦目标物体进行图像检索。
Prompt-Guided Attention Head Selection for Focus-Oriented Image Retrieval

- 用视觉提示匹配注意力图,动态选择关注目标的注意力头。
- 在多个数据集上显著提升检索性能,无需重新训练模型。
- 适合需要精准定位目标的图像检索场景,如医疗、工业质检。
本文旨在提升预训练视觉变换器(ViT)模型在聚焦式图像检索(FOIR)任务中的表现,通过视觉提示增强。真实场景中,查询和数据库图像常包含多个物体与复杂背景,用户通常希望检索特定目标对象。标准图像编码器使用单一全局特征向量表示图像,难以在多对象场景下有效定位目标。为此,本文提出提示引导的注意力头选择(PHS)方法,利用ViT多头注意力机制的头级潜力,通过匹配用户提供的视觉提示(如点、框或分割掩码)与注意力图,动态选择关注目标的注意力头。该方法使模型能聚焦于用户感兴趣的物体,同时保留周围视觉上下文信息。值得注意的是,PHS无需模型重训练,也无需修改图像。实验结果表明,PHS在多个数据集上显著提升检索性能,提供了一种实用且无需训练的增强方案。
原文摘要 · Abstract (English)
The goal of this paper is to enhance pretrained Vision Transformer (ViT) models for focus-oriented image retrieval with visual prompting. In real-world image retrieval scenarios, both query and database images often exhibit complexity, with multiple objects and intricate backgrounds. Users often want to retrieve images with specific object, which we define as the Focus-Oriented Image Retrieval (FOIR) task. While a standard image encoder can be employed to extract image features for similarity matching, it may not perform optimally in the multi-object-based FOIR task. This is because each image is represented by a single global feature vector. To overcome this, a prompt-based image retrieval solution is required. We propose an approach called Prompt-guided attention Head Selection (PHS) to leverage the head-wise potential of the multi-head attention mechanism in ViT in a promptable manner. PHS selects specific attention heads by matching their attention maps with user's visual prompts, such as a point, box, or segmentation. This empowers the model to focus on specific object of interest while preserving the surrounding visual context. Notably, PHS does not necessitate model re-training and avoids any image alteration. Experimental results show that PHS substantially improves performance on multiple datasets, offering a practical and training-free solution to enhance model performance in the FOIR task.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。