Skip to main content
QUICK REVIEW

[论文解读] On the Connection between Local Attention and Dynamic Depth-wise Convolution

Qi Han, Zejia Fan|arXiv (Cornell University)|Jun 8, 2021
CCD and CMOS Imaging Sensors被引用 70
一句话总结

本论文将局部注意力分析为一个通道维度的局部连接层,具有动态权重,并展示其与深度卷积及其动态变体的联系,通过经验消融和在视觉任务中的比较来支持。

ABSTRACT

Vision Transformer (ViT) attains state-of-the-art performance in visual recognition, and the variant, Local Vision Transformer, makes further improvements. The major component in Local Vision Transformer, local attention, performs the attention separately over small local windows. We rephrase local attention as a channel-wise locally-connected layer and analyze it from two network regularization manners, sparse connectivity and weight sharing, as well as weight computation. Sparse connectivity: there is no connection across channels, and each position is connected to the positions within a small local window. Weight sharing: the connection weights for one position are shared across channels or within each group of channels. Dynamic weight: the connection weights are dynamically predicted according to each image instance. We point out that local attention resembles depth-wise convolution and its dynamic version in sparse connectivity. The main difference lies in weight sharing - depth-wise convolution shares connection weights (kernel weights) across spatial positions. We empirically observe that the models based on depth-wise convolution and the dynamic variant with lower computation complexity perform on-par with or sometimes slightly better than Swin Transformer, an instance of Local Vision Transformer, for ImageNet classification, COCO object detection and ADE semantic segmentation. These observations suggest that Local Vision Transformer takes advantage of two regularization forms and dynamic weight to increase the network capacity. Code is available at https://github.com/Atten4Vis/DemystifyLocalViT.

研究动机与目标

  • 通过网络正则化视角(稀疏连接性与权重共享)以及动态权重计算,激发对局部注意力的理解。
  • 将局部注意力重新表述为一个通道维度的局部连接层,具有动态权重。
  • 同時在理论和经验上研究局部注意力与(动态)深度卷积之间的联系。
  • 在 ImageNet、COCO 和 ADE20K 上评估基于深度卷积的网络(DWNet)相较于基于局部注意力的 Swin Transformer 的性能。
  • 提供关于权重共享和动态权重机制的实用见解,以提升效率与性能。

提出的方法

  • 将局部注意力重新表述为一个通道维度的空间局部连接层,具有动态权重。
  • 比较局部注意力与深度卷积在稀疏连接性、权重共享模式和动态权重计算方面的差异。
  • 在相同架构和窗口设置下,通过用深度卷积替换 Swin Transformer 中的局部注意力来提出 DWNet。
  • 引入基于全局池化的或基于中心位置预测权重的深度卷积的同质和非同质动态变体。
  • 进行消融研究,以评估权重共享、动态权重和窗口采样策略的影响。
  • 在与 Swin Transformer 相似的训练协议下,在 ImageNet、COCO 和 ADE20K 上进行基准测试。

实验结果

研究问题

  • RQ1就连通性、权重共享和动态权重计算而言,局部注意力与深度卷积之间的关系如何?
  • RQ2动态深度卷积变体(DWNet)是否在 ImageNet 分类、COCO 目标检测和 ADE 语义分割中与局部注意力实现具竞争力的性能?
  • RQ3权重共享和动态权重预测在局部注意力与深度卷积的有效性中扮演怎样的角色?
  • RQ4在可比的训练设置下,基于深度卷积的架构(DWNet)是否能够达到或超过 Swin Transformer?

主要发现

  • 局部注意力是一个通道维度的局部连接层,具有动态权重,在通道之间共享权重,并通过每实例权重预测进行耦合。
  • 深度卷积在空间位置间共享权重,并受益于跨通道和/或位置的权重共享,动态变体使用线性投影或基于中心的预测。
  • DWNet及其动态变体在 ImageNet、COCO 和 ADE 语义分割上达到相当甚至略高于 Swin Transformer 的性能,在若干设置下具有更低的计算成本。
  • 跨通道的权重共享有助于降低局部注意力的参数量,而跨位置的共享有助于深度卷积减少参数并实现平移等价表示。
  • 动态权重机制提升了局部注意力和深度卷积的性能,在某些设置中,基于线性投影的动态权重往往优于基于注意力的方案。

更好的研究,从现在开始

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

无需绑定信用卡

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