[论文解读] SpatialFormer: Semantic and Target Aware Attentions for Few-Shot Learning
本文提出 SpatialFormer,一种基于 Transformer 的新型架构,用于少样本学习,通过利用支持集与查询特征之间的语义级相似性,生成更精确的注意力图。通过引入 SpatialFormer 语义注意力(SFSA)和 SpatialFormer 目标注意力(SFTA),该方法通过突出语义对齐区域和前景目标区域,同时减少背景干扰,增强了判别性特征学习,在 miniImageNet 和 tieredImageNet 基准上实现了新的 SOTA 性能。
Recent Few-Shot Learning (FSL) methods put emphasis on generating a discriminative embedding features to precisely measure the similarity between support and query sets. Current CNN-based cross-attention approaches generate discriminative representations via enhancing the mutually semantic similar regions of support and query pairs. However, it suffers from two problems: CNN structure produces inaccurate attention map based on local features, and mutually similar backgrounds cause distraction. To alleviate these problems, we design a novel SpatialFormer structure to generate more accurate attention regions based on global features. Different from the traditional Transformer modeling intrinsic instance-level similarity which causes accuracy degradation in FSL, our SpatialFormer explores the semantic-level similarity between pair inputs to boost the performance. Then we derive two specific attention modules, named SpatialFormer Semantic Attention (SFSA) and SpatialFormer Target Attention (SFTA), to enhance the target object regions while reduce the background distraction. Particularly, SFSA highlights the regions with same semantic information between pair features, and SFTA finds potential foreground object regions of novel feature that are similar to base categories. Extensive experiments show that our methods are effective and achieve new state-of-the-art results on few-shot classification benchmarks.
研究动机与目标
- 解决由于少样本学习中局部特征建模导致的基于 CNN 的交叉注意力不准确问题。
- 缓解支持-查询对中语义相似但无关区域引起的背景干扰问题。
- 克服标准 Transformer 的局限性,即在少样本设置中假设实例级相似性而非语义级相似性。
- 设计一种基于全局语义级特征对应关系的新注意力机制,以提升少样本分类性能。
- 集成目标感知与任务感知模块,以增强前景表征能力和类间可分性。
提出的方法
- 提出 SpatialFormer,一种新型 Transformer 变体,基于语义级相似性而非实例级相似性来建模空间交叉注意力。
- 引入 SpatialFormer 语义注意力(SFSA),用于突出支持与查询特征之间共享语义内容的区域。
- 引入 SpatialFormer 目标注意力(SFTA),利用基础类别中的类别权重作为参考,以强调新类别特征中潜在的前景目标区域。
- 采用多任务学习框架,引入旋转预测头以提升特征表示质量。
- 集成新型任务注意力(NTA)模块,利用任务特定的分类器权重以增加类间特征距离。
- 将 SFSA 与 SFTA 统一为 STA 模块,以生成具有判别性且聚焦目标的特征,用于度量学习。
实验结果
研究问题
- RQ1是否可通过为语义级相似性设计的基于 Transformer 的注意力机制,在超越实例级相似性假设的前提下,提升少样本分类性能?
- RQ2能否有效利用基础类别中的类别权重作为目标感知参考,以增强新类别中前景区域的注意力?
- RQ3是否通过引入增加类间特征距离的任务感知注意力模块,可提升少样本学习中的泛化能力?
- RQ4通过 SpatialFormer 实现的全局特征建模,是否能减少由局部 CNN 注意力导致的注意力图不准确问题?
- RQ5所提出的模块在 miniImageNet 和 tieredImageNet 等标准少样本基准上的性能提升程度如何?
主要发现
- SpatialFormer 在 miniImageNet 和 tieredImageNet 的 1/5-shot 任务上均一致优于标准 Transformer,1-shot 和 5-shot 设置下准确率分别提升 0.45% 至 0.55%。
- 在 SFTA 中使用类别权重 $W_G$ 作为参考,相比仅使用查询特征,性能提升 0.15% 至 0.35%。
- NTA 模块在 1-shot 任务中提升准确率 0.36% 至 0.82%,在 10-shot 任务中最高提升 1.10%,且随着样本数增加,增益更大。
- 采用旋转分类器的多任务损失与最优 λ=1.0 时性能最佳,相比单任务训练,1-shot 准确率提升 1.45%。
- 可视化结果表明,STANet 生成的类激活图更清晰、更聚焦于目标物体,而 CAN 则因背景注意力而表现不佳。
- STANet 达到新的 SOTA 结果,在 miniImageNet 上使用 WRN-28 主干网络时,1-shot 准确率为 69.86%,5-shot 准确率为 85.16%。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。