用属性指导视觉重编程,让CLIP模型分类更准。
Attribute-based Visual Reprogramming for Vision-Language Models
- 用共性与特异性属性动态优化输入噪声模式
- 12个下游任务上优于现有方法,降低类内差异
- 适合需要精准分类的视觉语言模型应用
视觉重编程(VR)通过在输入中添加可训练噪声模式,复用预训练视觉模型进行下游图像分类。当应用于视觉语言模型(如CLIP)时,现有方法沿用视觉模型的流程,将真实标签插入固定文本模板以引导优化。但该标签驱动方法忽略了CLIP可利用的丰富属性信息,可能导致误分类。本文提出属性驱动的视觉重编程(AttrVR),引入描述性属性(DesAttrs)和区分性属性(DistAttrs),分别刻画各类别的共有与独特特征。针对同类别图像经重编程后可能呈现不同属性的情况,AttrVR对每个样本迭代使用其k近邻的DesAttrs和DistAttrs来优化模式,实现更动态、样本自适应的调整。理论上,该方法可降低类内方差并增大类间分离。实验表明,在基于ViT和ResNet的CLIP模型上,它在12个下游任务中均表现更优。该成果推动了单模态视觉模型的重编程技术向视觉语言模型的有效迁移。代码已开源。
原文摘要 · Abstract (English)
Visual reprogramming (VR) reuses pre-trained vision models for downstream image classification tasks by adding trainable noise patterns to inputs. When applied to vision-language models (e.g., CLIP), existing VR approaches follow the same pipeline used in vision models (e.g., ResNet, ViT), where ground-truth class labels are inserted into fixed text templates to guide the optimization of VR patterns. This label-based approach, however, overlooks the rich information and diverse attribute-guided textual representations that CLIP can exploit, which may lead to the misclassification of samples. In this paper, we propose Attribute-based Visual Reprogramming (AttrVR) for CLIP, utilizing descriptive attributes (DesAttrs) and distinctive attributes (DistAttrs), which respectively represent common and unique feature descriptions for different classes. Besides, as images of the same class may reflect different attributes after VR, AttrVR iteratively refines patterns using the $k$-nearest DesAttrs and DistAttrs for each image sample, enabling more dynamic and sample-specific optimization. Theoretically, AttrVR is shown to reduce intra-class variance and increase inter-class separation. Empirically, it achieves superior performance in 12 downstream tasks for both ViT-based and ResNet-based CLIP. The success of AttrVR facilitates more effective integration of VR from unimodal vision models into vision-language models. Our code is available at https://github.com/tmlr-group/AttrVR.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。