Skip to main content
QUICK REVIEW

[论文解读] Scalable Vision Transformers with Hierarchical Pooling

Zizheng Pan, Bohan Zhuang|arXiv (Cornell University)|Mar 19, 2021
Image Processing Techniques and Applications被引用 12
一句话总结

本文提出分层视觉变换器(HVT),一种可扩展的视觉变换器架构,通过分层池化逐步下采样视觉标记,以减少序列长度和计算成本。通过用 patch 标记的平均池化替代类别标记,HVT 在保持相似 FLOPs 的情况下,将 ImageNet 上的 top-1 准确率相比 DeiT 提升了 3.03%,同时实现了深度、宽度、分辨率和 patch 大小的高效扩展,且无需增加计算量。

ABSTRACT

The recently proposed Visual image Transformers (ViT) with pure attention have achieved promising performance on image recognition tasks, such as image classification. However, the routine of the current ViT model is to maintain a full-length patch sequence during inference, which is redundant and lacks hierarchical representation. To this end, we propose a Hierarchical Visual Transformer (HVT) which progressively pools visual tokens to shrink the sequence length and hence reduces the computational cost, analogous to the feature maps downsampling in Convolutional Neural Networks (CNNs). It brings a great benefit that we can increase the model capacity by scaling dimensions of depth/width/resolution/patch size without introducing extra computational complexity due to the reduced sequence length. Moreover, we empirically find that the average pooled visual tokens contain more discriminative information than the single class token. To demonstrate the improved scalability of our HVT, we conduct extensive experiments on the image classification task. With comparable FLOPs, our HVT outperforms the competitive baselines on ImageNet and CIFAR-100 datasets. Code is available at https://github.com/MonashAI/HVT

研究动机与目标

  • 解决标准视觉变换器(ViT)在推理过程中保持完整 patch 序列长度所导致的高计算成本以及缺乏层次化表示的问题。
  • 通过逐步池化减少序列长度,提升模型可扩展性,实现深度、宽度、分辨率和 patch 大小的高效扩展。
  • 证明平均池化的视觉标记比单个可学习类别标记包含更多判别性信息,从而无需依赖后者进行分类。
  • 通过重新分配节省的 FLOPs 提升模型容量,在不增加计算成本的前提下,实现在图像分类基准上的最先进性能。

提出的方法

  • 引入一种分层池化机制,在多个阶段逐步下采样序列长度,类似于卷积神经网络中的空间下采样。
  • 将 ViT 块划分为多个阶段,并在每个阶段后应用平均池化或最大池化,以逐步减少序列长度和计算负载。
  • 用所有 patch 标记的全局平均池化替代可学习的类别标记,以生成最终的预测向量。
  • 设计架构以独立缩放深度、宽度、输入分辨率和 patch 大小,利用节省的 FLOPs 提升模型容量。
  • 在部分实验中使用 2D 池化变体,探索通过减小 patch 大小实现的空间下采样,需仔细调整头数和块调度。
  • 训练具有不同注意力头数、输入分辨率和 patch 大小的模型,以评估可扩展性与性能之间的权衡。
Figure 1 : Performance comparisons on ImageNet. With comparable GFLOPs (1.25 vs. 1.39), our proposed Scale HVT-Ti-4 surpasses DeiT-Ti by 3.03% in Top-1 accuracy.
Figure 1 : Performance comparisons on ImageNet. With comparable GFLOPs (1.25 vs. 1.39), our proposed Scale HVT-Ti-4 surpasses DeiT-Ti by 3.03% in Top-1 accuracy.

实验结果

研究问题

  • RQ1在视觉变换器中引入分层池化是否能减少序列长度和计算成本,同时保持或提升准确率?
  • RQ2用 patch 标记的平均池化替代类别标记,是否能带来比使用专用类别标记更好的分类性能?
  • RQ3在保持相似 FLOPs 的前提下,通过分层池化,模型容量(在深度、宽度、分辨率和 patch 大小方面)能扩展到何种程度?
  • RQ4在 ImageNet 和 CIFAR-100 上,在相似 FLOP 约束下,HVT 的性能与 DeiT 等强基线相比如何?
  • RQ52D 池化对模型性能有何影响?通过适当的架构调整,能否实现进一步提升?

主要发现

  • 在相似 FLOPs(1.25 vs. 1.39 GFLOPs)下,HVT-Ti-4 在 ImageNet 上的 top-1 准确率比 DeiT-Ti 高出 3.03%。
  • 在 CIFAR-100 上,HVT-S-4(patch 大小为 8)达到 77.29% 的 top-1 准确率,比 32-patch 变体高出 9.14%。
  • 将输入分辨率从 160 提升至 384,top-1 准确率从 73.84% 提升至 76.31%,证明了高分辨率表示的优势。
  • HVT-S-4(16 个注意力头)达到 75.43% 的 top-1 准确率,比 3 头变体高出 6.79 个百分点。
  • HVT-S-2(使用 2D 池化)在 CIFAR-100 上达到 77.58% 的 top-1 准确率,优于 DeiT-S(71.99%),且 FLOPs 几乎相同。
  • 平均池化的视觉标记始终表现优于类别标记,表明其具有更强的判别能力。
Figure 2 : Overview of the proposed Hierarchical Visual Transformer. To reduce the redundancy in the full-length patch sequence and construct a hierarchical representation, we propose to progressively pool visual tokens to shrink the sequence length. To this end, we partition the ViT [ 11 ] blocks i
Figure 2 : Overview of the proposed Hierarchical Visual Transformer. To reduce the redundancy in the full-length patch sequence and construct a hierarchical representation, we propose to progressively pool visual tokens to shrink the sequence length. To this end, we partition the ViT [ 11 ] blocks i

更好的研究,从现在开始

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

无需绑定信用卡

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