Skip to main content
QUICK REVIEW

[论文解读] SparseFormer: Sparse Visual Recognition via Limited Latent Tokens

Ziteng Gao, Tong Zhan|arXiv (Cornell University)|Apr 7, 2023
Domain Adaptation and Few-Shot Learning被引用 6
一句话总结

SparseFormer 提出了一种稀疏视觉识别框架,通过使用有限数量的可学习潜在标记(低至 49 个)来表示图像,取代对所有 patch 或像素的密集处理。通过仅对显著区域进行注意力计算,并借助对感兴趣区域(RoI)描述符的迭代优化和稀疏特征采样,该方法在性能上与 Swin-T 等密集模型相当,同时显著降低了 FLOPs 并提升了吞吐量,尤其在低算力环境下表现更优。

ABSTRACT

Human visual recognition is a sparse process, where only a few salient visual cues are attended to rather than traversing every detail uniformly. However, most current vision networks follow a dense paradigm, processing every single visual unit (e.g,, pixel or patch) in a uniform manner. In this paper, we challenge this dense paradigm and present a new method, coined SparseFormer, to imitate human's sparse visual recognition in an end-to-end manner. SparseFormer learns to represent images using a highly limited number of tokens (down to 49) in the latent space with sparse feature sampling procedure instead of processing dense units in the original pixel space. Therefore, SparseFormer circumvents most of dense operations on the image space and has much lower computational costs. Experiments on the ImageNet classification benchmark dataset show that SparseFormer achieves performance on par with canonical or well-established models while offering better accuracy-throughput tradeoff. Moreover, the design of our network can be easily extended to the video classification with promising performance at lower computational costs. We hope that our work can provide an alternative way for visual modeling and inspire further research on sparse neural architectures. The code will be publicly available at https://github.com/showlab/sparseformer

研究动机与目标

  • 挑战视觉 Transformer 和 CNN 中主导的密集范式,即对每个像素或 patch 进行均匀处理。
  • 通过可学习的潜在标记,模仿人类视觉识别,仅关注少数显著区域。
  • 通过将操作限制在潜在空间中的稀疏标记集合中,降低计算成本和内存占用。
  • 在仅使用分类信号进行端到端训练,无需定位监督的情况下实现模型训练。
  • 探索一种新型稀疏神经架构范式,适用于视觉任务,具有高效性与通用性,可扩展至图像与视频任务。

提出的方法

  • 引入轻量级的早期卷积编码器,用于提取初始图像特征。
  • 采用潜在聚焦 Transformer,对每个潜在标记的感兴趣区域(RoI)描述符进行迭代优化,使其能够关注具有判别性的图像区域。
  • 通过双线性插值实现稀疏特征采样,从与每个标记 RoI 对应的图像区域中提取特征,避免密集运算。
  • 将生成的潜在标记嵌入通过标准的深层 Transformer 编码器在潜在空间中进行处理,从而实现高精度识别。
  • 以网格状模式初始化标记 RoI(例如,49 个标记对应 7×7),并端到端学习其空间范围和位置。
  • 采用自适应解码与 Xavier 初始化,以稳定训练过程,确保初始行为类似于无条件卷积。
Figure 1 : Dense versus our proposed sparse paradigm for visual recognition. The dense paradigm requires traversing $H\times W$ units to perform convolution or attention, while our proposed sparse paradigm performs transformers over only $N$ latent tokens where $N\ll H\times W$ .
Figure 1 : Dense versus our proposed sparse paradigm for visual recognition. The dense paradigm requires traversing $H\times W$ units to perform convolution or attention, while our proposed sparse paradigm performs transformers over only $N$ latent tokens where $N\ll H\times W$ .

实验结果

研究问题

  • RQ1通过仅处理少量稀疏潜在标记,视觉模型能否在大幅降低 FLOPs 的同时实现具有竞争力的准确率?
  • RQ2仅依赖分类信号引导的稀疏注意力机制,能否在无显式定位监督的情况下学会聚焦于前景物体?
  • RQ3在准确率-吞吐量权衡方面,稀疏架构与 Swin Transformer 等密集模型相比表现如何?
  • RQ4该稀疏设计能否有效扩展至视频识别任务,其中计算成本是主要瓶颈?
  • RQ5该模型在面对随机擦除或零填充等输入扰动时是否表现出鲁棒性?

主要发现

  • SparseFormer-Tiny 在 2.0 GFLOPs 下于 ImageNet-1K 上实现 81.0% 的 top-1 准确率,吞吐量达每秒 1270 张图像,优于 Swin-T(4.5 GFLOPs,81.3% top-1,726 张/秒)。
  • 仅使用 49 个潜在标记,SparseFormer 即实现 81.0% 的 top-1 准确率,表明其在低算力环境下具备出色的效率与性能。
  • 在 Ade20K 语义分割基准上,SparseFormer-T 使用 400 个标记时,在仅 43 GFLOPs 的计算量下达到 43.5% 的 mIoU 和 54.7% 的 mAcc,仅为 Swin-T 计算量的 1/8,且性能保持竞争力。
  • 可视化结果证实,即使无定位监督,SparseFormer 也能在各阶段逐步聚焦于具有判别性的前景区域。
  • 该模型对随机擦除和零填充等输入扰动表现出鲁棒性,训练过程中能自适应调整采样策略,避免无效区域。
  • 该架构在视频分类任务中也表现出良好泛化能力,在 Kinetics-400 上实现有竞争力的性能,且计算量低于密集模型。
Figure 2 : The overall architecture of the proposed SparseFormer. The MHSAs and FFNs are multi-head self-attention over latent tokens and feed-forward networks applied on these tokens, respectively. Note that different from the illustration aimed for details, the cortex Transformer is actually much
Figure 2 : The overall architecture of the proposed SparseFormer. The MHSAs and FFNs are multi-head self-attention over latent tokens and feed-forward networks applied on these tokens, respectively. Note that different from the illustration aimed for details, the cortex Transformer is actually much

更好的研究,从现在开始

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

无需绑定信用卡

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