Stand-Alone Self-Attention in Vision Models

Stand-Alone Self-Attention in Vision Models review - Jaehwi's ML Log

Convolutions are a fundamental building block of modern computer vision systems. Recent approaches have argued for going beyond convolutions in order to capture long-range dependencies. These efforts focus on augmenting convolutional models with content-based interactions, such as self-attention and non-local means, to achieve gains on a number of vision tasks. The natural question that arises is whether attention can be a stand-alone primitive for vision models instead of serving as just an augmentation on top of convolutions. In developing and testing a pure self-attention vision model, we verify that self-attention can indeed be an effective stand-alone layer. A simple procedure of replacing all instances of spatial convolutions with a form of self-attention applied to ResNet model produces a fully self-attentional model that outperforms the baseline on ImageNet classification with 12% fewer FLOPS and 29% fewer parameters. On COCO object detection, a pure self-attention model matches the mAP of a baseline RetinaNet while having 39% fewer FLOPS and 34% fewer parameters. Detailed ablation studies demonstrate that self-attention is especially impactful when used in later layers. These results establish that stand-alone self-attention is an important addition to the vision practitioner’s toolbox.

论文提出stand-alone self-attention layer,并且构建了full attention model,验证了content-based的相互关系能够作为视觉模型特征提取的主要基底。在图像分类和目标检测实验中,相对于传统的卷积模型,在准确率差不多的情况下,能够大幅减少参数量和计算量,论文的工作有很大的参考意义。

目前卷积网络的设计是提高图像任务性能的关键,而卷积操作由于平移不变性使其成为了图像分析的主力。受限于感受域的大小设定,卷积很难获取长距离的像素关系,而在序列模型中,已经能很好地用attention来解决这个问题。目前,attention模块已经开始应用于传统卷积网络中,比如channel-based的attention机制 Squeeze-Excite和spatially-aware的attention机制Non-local Network等。这些工作都是将global attention layers作为插件加入到目前的卷积模块中,这种全局形式考虑输入的所有空间位置,当输入很小时,由于网络需要进行大幅下采样,通常特征加强效果不好。
因此,论文提出简单的local self-attention layer,将内容之间的关系(content-based interactions)作为主要特征提取工具而不是卷积的增强工具,能够同时处理大小输入,另外也使用这个stand-alone attention layer来构建全attention的视觉模型,在图像分类和目标定位上的性能比全卷积的baseline要好。

论文地址:https://arxiv.org/pdf/1906.05909.pdf

发表评论

邮箱地址不会被公开。 必填项已用*标注