RMT: 保留网络遇见视觉变换器
RMT: Retentive Networks Meet Vision Transformers
AI总结:
本文提出RMT视觉骨干网络,通过将RetNet的时间衰减机制扩展到空间域并引入基于曼哈顿距离的空间衰减矩阵,结合注意力分解形式,以线性复杂度实现显式空间先验,在ImageNet、COCO和ADE20K等任务上取得优异性能。
摘要:
近年来,视觉变换器(ViT)在计算机视觉领域受到越来越多的关注。然而,ViT的核心组件——自注意力机制,缺乏显式的空间先验,并且具有二次方的计算复杂度,从而限制了ViT的适用性。为了缓解这些问题,我们从自然语言处理领域最近的保留网络(RetNet)中汲取灵感,提出了RMT,一个具有显式空间先验的通用强视觉骨干网络。具体而言,我们将RetNet的时间衰减机制扩展到空间域,并提出了一种基于曼哈顿距离的空间衰减矩阵,以将显式空间先验引入自注意力机制。此外,我们提出了一种适应显式空间先验的注意力分解形式,旨在在不干扰空间衰减矩阵的情况下,降低建模全局信息的计算负担。基于空间衰减矩阵和注意力分解形式,我们可以灵活地将显式空间先验集成到具有线性复杂度的视觉骨干网络中。大量实验表明,RMT在各种视觉任务中表现出卓越的性能。具体来说,在没有额外训练数据的情况下,RMT在ImageNet-1k上分别以27M/4.5GFLOPs和96M/18.2GFLOPs的规模达到了84.8%和86.1%的top-1准确率。对于下游任务,RMT在COCO检测任务上达到了54.5的框AP和47.2的掩码AP,在ADE20K语义分割任务上达到了52.8的mIoU。代码可在https://github.com/qhfan/RMT获取。
英文摘要:
Vision Transformer (ViT) has gained increasing attention in the computer vision community in recent years. However, the core component of ViT, Self-Attention, lacks explicit spatial priors and bears a quadratic computational complexity, thereby constraining the applicability of ViT. To alleviate these issues, we draw inspiration from the recent Retentive Network (RetNet) in the field of NLP, and propose RMT, a strong vision backbone with explicit spatial prior for general purposes. Specifically, we extend the RetNet's temporal decay mechanism to the spatial domain, and propose a spatial decay matrix based on the Manhattan distance to introduce the explicit spatial prior to Self-Attention. Additionally, an attention decomposition form that adeptly adapts to explicit spatial prior is proposed, aiming to reduce the computational burden of modeling global information without disrupting the spatial decay matrix. Based on the spatial decay matrix and the attention decomposition form, we can flexibly integrate explicit spatial prior into the vision backbone with linear complexity. Extensive experiments demonstrate that RMT exhibits exceptional performance across various vision tasks. Specifically, without extra training data, RMT achieves **84.8%** and **86.1%** top-1 acc on ImageNet-1k with **27M/4.5GFLOPs** and **96M/18.2GFLOPs**. For downstream tasks, RMT achieves **54.5** box AP and **47.2** mask AP on the COCO detection task, and **52.8** mIoU on the ADE20K semantic segmentation task. Code is available at https://github.com/qhfan/RMT
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。