Skip to main content
QUICK REVIEW

[论文解读] TransHP: Image Classification with Hierarchical Prompting

Wenhao Wang, Yifan Sun|arXiv (Cornell University)|Apr 13, 2023
Domain Adaptation and Few-Shot Learning被引用 7
一句话总结

TransHP 提出了一种用于视觉变换器的新型分层提示机制,通过将粗粒度类别提示注入中间层,提升了图像分类的准确性、数据效率和模型可解释性。该方法在 ImageNet 上将 ViT-B/16 的准确率提升了 +2.83%,在仅使用 10% 训练数据的情况下,数据效率提升了 +12.69%。

ABSTRACT

This paper explores a hierarchical prompting mechanism for the hierarchical image classification (HIC) task. Different from prior HIC methods, our hierarchical prompting is the first to explicitly inject ancestor-class information as a tokenized hint that benefits the descendant-class discrimination. We think it well imitates human visual recognition, i.e., humans may use the ancestor class as a prompt to draw focus on the subtle differences among descendant classes. We model this prompting mechanism into a Transformer with Hierarchical Prompting (TransHP). TransHP consists of three steps: 1) learning a set of prompt tokens to represent the coarse (ancestor) classes, 2) on-the-fly predicting the coarse class of the input image at an intermediate block, and 3) injecting the prompt token of the predicted coarse class into the intermediate feature. Though the parameters of TransHP maintain the same for all input images, the injected coarse-class prompt conditions (modifies) the subsequent feature extraction and encourages a dynamic focus on relatively subtle differences among the descendant classes. Extensive experiments show that TransHP improves image classification on accuracy (e.g., improving ViT-B/16 by +2.83% ImageNet classification accuracy), training data efficiency (e.g., +12.69% improvement under 10% ImageNet training data), and model explainability. Moreover, TransHP also performs favorably against prior HIC methods, showing that TransHP well exploits the hierarchical information. The code is available at: https://github.com/WangWenhao0716/TransHP.

研究动机与目标

  • 通过利用 ImageNet 和 iNaturalist 等数据集中的分层语义结构,提升图像分类的准确性。
  • 通过使用粗粒度类别提示,使模型在低数据训练环境下更好地泛化,从而提升数据效率。
  • 通过分层提示引导注意力聚焦于关键局部区域,提升模型的可解释性。
  • 通过使用祖先类别作为动态提示,模仿人类视觉识别过程,聚焦于后代类别之间的细微差异。

提出的方法

  • TransHP 学习一组提示令牌,用于表示层次结构中的所有粗粒度(祖先)类别。
  • 一个中间变换器模块对每张输入图像进行实时的粗粒度类别预测。
  • 将预测的粗粒度类别提示令牌通过交叉注意力机制注入中间特征,从而对后续的特征提取进行条件化。
  • 注入的提示会改变注意力动态,促使模型在粗粒度分类后更关注细粒度的判别性区域。
  • 该方法使用软注意力权重以可微分的方式将提示令牌与图像块令牌和类别令牌进行融合。
  • 该架构在输入之间保持参数固定,从而实现无需参数共享变更的动态注意力调制。

实验结果

研究问题

  • RQ1分层提示能否提升视觉变换器在图像分类任务中的准确性?
  • RQ2分层提示是否能增强数据效率,尤其是在低数据训练环境下?
  • RQ3通过从粗到细的提示,能否使模型的注意力机制更具可解释性?
  • RQ4与现有提示方法和分层分类方法相比,分层提示在性能和鲁棒性方面表现如何?

主要发现

  • 与基线模型相比,TransHP 在 ImageNet 上将 ViT-B/16 的 top-1 准确率提升了 +2.83%。
  • 在仅使用 10% 训练数据的情况下,TransHP 相较于基线模型实现了 +12.69% 的准确率提升,表现出卓越的数据效率。
  • 在数据稀缺条件下,TransHP 的准确率下降幅度显著更小——在 10% 数据下为 40.72%,而基线模型为 50.97%,表明其具有更强的鲁棒性。
  • 在 10% 训练数据下,TransHP 相较于竞争方法 HiMulConE 提升了 7.17%,凸显其在低数据环境下的有效性。
  • 可视化结果表明,提示注入后,TransHP 的注意力从全局区域转向了局部关键区域(例如金鱼的面部和头部装饰),从而提升了关注焦点和可解释性。
  • 该方法成功模仿了人类视觉识别过程,通过使用粗粒度类别作为提示,引导注意力聚焦于细粒度差异。

更好的研究,从现在开始

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

无需绑定信用卡

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