VSA:在视觉Transformer中学习可变尺寸窗口注意力
VSA: Learning Varied-Size Window Attention in Vision Transformers
AI总结:
提出可变尺寸窗口注意力(VSA)模块,通过窗口回归预测目标窗口的尺寸和位置,自适应建模长程依赖,以微小计算成本显著提升视觉Transformer在分类及多种下游任务中的性能。
摘要:
视觉Transformer中的窗口内注意力已被广泛探索,以平衡性能、计算复杂度和内存占用。然而,当前的模型采用手工设计的固定尺寸窗口设计,这限制了它们建模长程依赖和适应不同尺寸对象的能力。为了解决这一缺陷,我们提出了可变尺寸窗口注意力(VSA),以从数据中学习自适应的窗口配置。具体而言,基于每个默认窗口内的token,VSA采用一个窗口回归模块来预测目标窗口的尺寸和位置,即采样key和value token的注意力区域。通过在每个注意力头中独立采用VSA,它可以建模长程依赖,从多样化窗口中捕获丰富的上下文,并促进重叠窗口之间的信息交换。VSA是一个易于实现的模块,只需微小的修改和可忽略的额外计算成本,即可替代最先进代表性模型中的窗口注意力,同时大幅提升其性能,例如,在ImageNet分类任务上Swin-T提升了1.1%。此外,当使用更大的图像进行训练和测试时,性能增益会增加。在更多下游任务上的实验结果,包括目标检测、实例分割和语义分割,进一步证明了VSA在处理不同尺寸对象时优于普通窗口注意力的优越性。代码将发布于 https://github.com/ViTAE-Transformer/ViTAE-VSA。
英文摘要:
Attention within windows has been widely explored in vision transformers to balance the performance, computation complexity, and memory footprint. However, current models adopt a hand-crafted fixed-size window design, which restricts their capacity of modeling long-term dependencies and adapting to objects of different sizes. To address this drawback, we propose \textbf{V}aried-\textbf{S}ize Window \textbf{A}ttention (VSA) to learn adaptive window configurations from data. Specifically, based on the tokens within each default window, VSA employs a window regression module to predict the size and location of the target window, i.e., the attention area where the key and value tokens are sampled. By adopting VSA independently for each attention head, it can model long-term dependencies, capture rich context from diverse windows, and promote information exchange among overlapped windows. VSA is an easy-to-implement module that can replace the window attention in state-of-the-art representative models with minor modifications and negligible extra computational cost while improving their performance by a large margin, e.g., 1.1\% for Swin-T on ImageNet classification. In addition, the performance gain increases when using larger images for training and test. Experimental results on more downstream tasks, including object detection, instance segmentation, and semantic segmentation, further demonstrate the superiority of VSA over the vanilla window attention in dealing with objects of different sizes. The code will be released https://github.com/ViTAE-Transformer/ViTAE-VSA.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。