Skip to main content
QUICK REVIEW

[论文解读] What does a platypus look like? Generating customized prompts for zero-shot image classification

Sarah I. Pratt, Covert, Ian|arXiv (Cornell University)|Sep 7, 2022
Domain Adaptation and Few-Shot Learning被引用 5
一句话总结

本文提出 CuPL(基于语言模型的定制提示),一种零样本方法,利用大语言模型(LLMs)为开放词汇图像分类生成丰富、类别特定的提示。通过用描述性、区分性的标题(如“一只大眼睛的树蛙”)替换通用模板,该方法在基准测试中提升了零样本准确率,在 ImageNet 上实现 1.1% 的 top-1 准确率提升,在 Describable Textures 数据集上提升超过 6%,且无需微调或标注数据。

ABSTRACT

Open-vocabulary models are a promising new paradigm for image classification. Unlike traditional classification models, open-vocabulary models classify among any arbitrary set of categories specified with natural language during inference. This natural language, called "prompts", typically consists of a set of hand-written templates (e.g., "a photo of a {}") which are completed with each of the category names. This work introduces a simple method to generate higher accuracy prompts, without relying on any explicit knowledge of the task domain and with far fewer hand-constructed sentences. To achieve this, we combine open-vocabulary models with large language models (LLMs) to create Customized Prompts via Language models (CuPL, pronounced "couple"). In particular, we leverage the knowledge contained in LLMs in order to generate many descriptive sentences that contain important discriminating characteristics of the image categories. This allows the model to place a greater importance on these regions in the image when making predictions. We find that this straightforward and general approach improves accuracy on a range of zero-shot image classification benchmarks, including over one percentage point gain on ImageNet. Finally, this simple baseline requires no additional training and remains completely zero-shot. Code available at https://github.com/sarahpratt/CuPL.

研究动机与目标

  • 解决在零样本开放词汇图像分类中手工设计的通用提示模板的局限性。
  • 通过在提示中引入区分性视觉属性,提升分类准确率,尤其是在细粒度和视觉相似类别上。
  • 通过利用大语言模型自动生成高质量、类别特定的提示,消除对特定任务提示工程的需求。
  • 通过避免对提示生成进行微调或使用标注数据,保持完全的零样本设置。
  • 创建一种可泛化、可扩展的方法,适用于多样化数据集,且无需事先了解数据集特定的表征。

提出的方法

  • 使用大语言模型(LLM)为每个图像类别生成多个描述性标题,重点关注区分性视觉特征。
  • 通过将类别占位符替换为实际类别名称,将每个 LLM 生成的标题转换为提示。
  • 将这些定制化提示输入预训练的开放词汇图像分类器(如 CLIP),以计算图像-文本相似度得分。
  • 使用相似度得分最高的提示对输入图像进行分类,保持零样本推理流程。
  • 利用 LLM 的世界知识生成富含区分性属性的提示(如“大眼睛”用于树蛙),而无需依赖数据集特定模板。
  • 通过不微调或适配视觉模型,并仅通过 LLM 进行提示生成,确保方法完全保持零样本。

实验结果

研究问题

  • RQ1与标准手工设计的模板相比,LLM 生成的类别特定提示是否能提升零样本图像分类的准确率?
  • RQ2在细粒度分类任务中,将区分性视觉属性(如“大眼睛”用于树蛙)融入提示是否能提升模型性能?
  • RQ3一个单一的、固定的 LLM 提示指令集是否能在不了解数据集内容的前提下泛化到多样化数据集?
  • RQ4提示质量与多样性对零样本准确率的影响如何,特别是在视觉模糊或相似类别上?
  • RQ5在 ImageNet 和 Describable Textures 等标准基准上,LLM 生成提示的性能与手工精心设计的提示相比如何?

主要发现

  • 与标准手工设计的提示模板相比,CuPL 在 ImageNet 上实现了 1.1% 的 top-1 准确率绝对提升。
  • 在 Describable Textures 数据集上,CuPL 的零样本准确率提升了超过 6 个百分点,表明在细粒度视觉识别任务中具有显著增益。
  • 该方法在 15 个多样化零样本图像分类基准上均优于标准提示模板,展现出广泛的泛化能力。
  • LLM 生成的提示包含更多区分性视觉属性(如“长而松软的耳朵”用于柯基梗犬),有助于视觉模型聚焦于相关图像区域。
  • 该方法无需额外训练,保持完全的零样本能力,并能以极低的人工成本高效扩展——仅需少数提示指令即可生成数千个类别特定提示。
  • 定性分析表明,CuPL 生成的提示更能捕捉关键区分特征(如“红色沙漏形”用于南方黑寡妇蜘蛛),从而提升模型对关键区分区域的关注。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。