【ICCV2021】CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification

在这里插入图片描述

论文:https://arxiv.org/abs/2103.14899

代码:https://github.com/IBM/CrossViT

这是来自于美国 MIT-IBM Watson AI实验室在ICCV2021上的工作,研究动机是:how to learn multi-scale feature representation in Transformer models.

该方法的想法非常直接,构建两个网络,分别提取 small patch 特征和 large patch 特征,然后将两个网络进行 cross-attention 融合,如图下图所示:

请添加图片描述

该方法关键的部分是如何将两个网络的结果进行融合,作者探索了4种不同的融合策略:

  • All-attention fusion:两个网络的 token 全部融合。
  • Class-token fusion:class-token是网络的全局表示,将两个网络的 class token 融合作为两个分支后续的 class token。
  • Pairwise fusion:对应空间位置的 token 进行融合。
  • Cross-attention fusion:来自一个分支的 class token 和来自另一个分支的 class token 融合。

经过实验,作者选择 cross-attention 作为融合的方式,该模块细节如下图所示(以大分支为例)。具体过程也比较容易理解 ,这里不再多说。

请添加图片描述

实验部分,作者分析的非常详细。说几个有趣的地方:左右两个网络,很自然的就会想到,到底哪个网络发挥的作用更大?表7中的 B 行提升了 small 网络的特征维度,C行中提升了 small 网络 transformer block 的数量,可以看出,C行的性能提升更明显。作者指出:L-branch has the main role to extract features while S-branch only provides additional information; thus, a light-weight branch is enough。

请添加图片描述

表中的E行是进行将 multi-scale transformer block重复6次,D行是只重复3次但是每次里面 cross-attention计算2次,结果表明计算效率更高的D行效果略好。作者的解释是:Patch token from the other branch is untouched, and the advantages from stacking more than one cross-attention is small as cross-attention is a linear operation without any nonlinearity function. Likewise, using more multi-scale transformer encoders also does not help in performance which is the similar case to increase the capacity of S-branch.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值