Skip to main content
QUICK REVIEW

[论文解读] Bridging the Gap Between Vision Transformers and Convolutional Neural Networks on Small Datasets

Zhiying Lu, Hongtao Xie|arXiv (Cornell University)|Oct 12, 2022
Advanced Neural Network ApplicationsComputer Science被引用 38
一句话总结

这篇论文提出 Dynamic Hybrid Vision Transformer (DHVT),一种非层级的 ViT,具有卷积的 patch embedding、动态聚合 FFN,以及 head tokens,以在从头开始在小数据集上训练时缩小与 CNN 的差距。它在 CIFAR-100 上实现了最先进的结果,在 ImageNet-1K 上具有竞争力。

ABSTRACT

There still remains an extreme performance gap between Vision Transformers (ViTs) and Convolutional Neural Networks (CNNs) when training from scratch on small datasets, which is concluded to the lack of inductive bias. In this paper, we further consider this problem and point out two weaknesses of ViTs in inductive biases, that is, the spatial relevance and diverse channel representation. First, on spatial aspect, objects are locally compact and relevant, thus fine-grained feature needs to be extracted from a token and its neighbors. While the lack of data hinders ViTs to attend the spatial relevance. Second, on channel aspect, representation exhibits diversity on different channels. But the scarce data can not enable ViTs to learn strong enough representation for accurate recognition. To this end, we propose Dynamic Hybrid Vision Transformer (DHVT) as the solution to enhance the two inductive biases. On spatial aspect, we adopt a hybrid structure, in which convolution is integrated into patch embedding and multi-layer perceptron module, forcing the model to capture the token features as well as their neighboring features. On channel aspect, we introduce a dynamic feature aggregation module in MLP and a brand new "head token" design in multi-head self-attention module to help re-calibrate channel representation and make different channel group representation interacts with each other. The fusion of weak channel representation forms a strong enough representation for classification. With this design, we successfully eliminate the performance gap between CNNs and ViTs, and our DHVT achieves a series of state-of-the-art performance with a lightweight model, 85.68% on CIFAR-100 with 22.8M parameters, 82.3% on ImageNet-1K with 24.0M parameters. Code is available at https://github.com/ArieSeirack/DHVT.

研究动机与目标

  • 找出在小数据集上从头训练时,ViTs 相对于 CNN 性能不佳的原因,原因在于对空间相关性和通道表示的归纳偏置较弱。
  • 提出一种混合架构(DHVT),加强空间局部性与通道交互以提升数据效率。
  • 引入机制(SOPE、DAFF、head tokens),将局部特征与通道级表示融合以实现鲁棒分类。
  • 用轻量化模型在 CIFAR-100 上展示最先进的性能,在 ImageNet-1K 上也取得竞争力的结果。

提出的方法

  • Sequential Overlapping Patch Embedding (SOPE) 将卷积整合到 patch embedding 并保留细粒度特征。
  • Dynamic Aggregation Feed Forward (DAFF) 在 FFN 内使用深度卷积,并对 class token 进行类似 squeeze-excitation 的通道重新校准。
  • Head Token 机制用于创建 head tokens,以实现注意力头之间的交互并融合不同的通道表示。
  • Head-Interacted Multi-Head Self-Attention (HI-MHSA) 在 MHSA 之前将 head tokens 与 patch token 和 class token 拼接。
  • 非层级的 DHVT 块具有共享的编码器配置,支持可变的 token 长度并实现从头开始的高效训练。

实验结果

研究问题

  • RQ1加强空间相关性和多样化的通道表示是否能缩小 ViT 与 CNN 在小数据集上的数据效率差距?
  • RQ2在 patch embedding 和 MLP 中整合卷积是否能改善 ViT 的低层特征保留和局部上下文学习?
  • RQ3动态 token 机制(DAFF 和 head tokens)是否能增强通道交互,从而产生更强的整体表征?
  • RQ4在 CIFAR-100、DomainNet 小域和 ImageNet-1K 上从头训练时,DHVT 的表现与 CNN 和其他 ViT 相比如何?

主要发现

  • DHVT 在像 CIFAR-100 这样的小数据集上缩小了 CNN 与 ViT 之间的性能差距,达到 85.68% 的准确率,参数量为 22.8M(Small model)。
  • DHVT-T 在 CIFAR-100 上达到 83.54%,DHVT-S 达到 85.68%,在从头训练下超越了若干强基线 CNN 和 ViT。
  • 在 ImageNet-1K 上,DHVT-S 达到 82.3% 的准确率,参数量 24.0M,对非层级 ViT 从头训练来说是一个强结果。
  • SOPE 加上 DAFF 和 head tokens 提供显著增益,消融实验在 CIFAR-100 上显示全部组件使用时最高增益可达 +13.26 的准确率。
  • Head tokens 使注意力头之间能够交互,改善特征融合和分类性能。
  • DHVT 在 DomainNet 小域数据集(ClipArt、Painting、Sketch)上显示出竞争力,在这些设置中优于 ResNet-50 基线。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。