arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2308.01944cs.CV
收藏

面向语义分割的动态令牌传递Transformer

Dynamic Token-Pass Transformers for Semantic Segmentation

East China Normal University(华东师范大学);DAMO Academy, Alibaba Group(阿里巴巴达摩院)

Yuang Liu, Qiang Zhou, Jing Wang, Fan Wang, Jun Wang, Wei Zhang

AI总结:

本文提出动态令牌传递视觉Transformer(DoViT)用于语义分割,通过自适应停止简单令牌的自注意力计算降低推理成本,在减少40%~60% FLOPs的同时mIoU下降不超0.8%,Cityscapes上ViT-L/B推理速度超2倍提升。

摘要:

视觉Transformer(ViT)通常通过在自注意力层中从头到尾前向传播所有令牌来提取特征。本文提出了用于语义分割的动态令牌传递视觉Transformer(DoViT),它能够针对不同复杂度的图像自适应地降低推理成本。DoViT会逐步停止部分简单令牌的自注意力计算,仅保留困难令牌继续前向传播,直至满足停止准则。我们采用轻量级辅助头来做出令牌传递决策,将令牌划分为保留/停止两部分。通过令牌分离计算,自注意力层借助稀疏令牌实现了加速,且仍能与硬件友好兼容。我们还构建了令牌重建模块,用于将分组后的令牌收集并重置到其在序列中的原始位置,这对于预测正确的语义掩码是必不可少的。我们在两项常见的语义分割任务上开展了大量实验,结果表明,该方法大幅减少了约40%~60%的浮点运算量(FLOPs),且针对各类分割Transformer的平均交并比(mIoU)下降幅度控制在0.8%以内。在Cityscapes数据集上,ViT-L/B的吞吐量和推理速度提升至原来的2倍以上。

英文摘要:

Vision transformers (ViT) usually extract features via forwarding all the tokens in the self-attention layers from top to toe. In this paper, we introduce dynamic token-pass vision transformers (DoViT) for semantic segmentation, which can adaptively reduce the inference cost for images with different complexity. DoViT gradually stops partial easy tokens from self-attention calculation and keeps the hard tokens forwarding until meeting the stopping criteria. We employ lightweight auxiliary heads to make the token-pass decision and divide the tokens into keeping/stopping parts. With a token separate calculation, the self-attention layers are speeded up with sparse tokens and still work friendly with hardware. A token reconstruction module is built to collect and reset the grouped tokens to their original position in the sequence, which is necessary to predict correct semantic masks. We conduct extensive experiments on two common semantic segmentation tasks, and demonstrate that our method greatly reduces about 40% $\sim$ 60% FLOPs and the drop of mIoU is within 0.8% for various segmentation transformers. The throughput and inference speed of ViT-L/B are increased to more than 2$\times$ on Cityscapes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑