深度学习论文: EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers及其PyTorch实现
EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers
PDF: ​​​https://arxiv.org/pdf/2205.03436.pdf​​​ PyTorch代码: ​​https://github.com/shanglianlm0525/CvPytorch​​ PyTorch代码: ​​https://github.com/shanglianlm0525/PyTorch-Networks​

1 概述

EdgeViTs通过引入一个基于Self-attention和卷积的最优集成的高效率的local-global-local(LGL)信息交换瓶颈来实现视觉模型在准确性和设备效率之间的权衡中达到最佳轻量级CNN的性能。

2 EdgeViTs

2-1 Overview

Transformer Block引入了一个比较划算的Local-Global-Local(LGL) Bottlneck。LGL通过一个稀疏注意力模块进一步减少了Self-attention的开销(图2©),实现了更好的准确性-延迟平衡。

深度学习论文: EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers及其PyTorch实现_pytorch

2-2 Local-Global-Local bottleneck

LGL Bottleneck只对输入Token的子集计算Self-attention,但支持完整的空间交互。减少Token的作用域的同时保留全局建模和局部上下文的潜在信息流。

深度学习论文: EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers及其PyTorch实现_深度学习_02


LGL 将Self-attention分解为连续的模块,处理不同范围内的空间Token。

  1. Local aggregation:仅集成来自局部近似Token信号的局部聚合, 对于每个Token,利用Depth-wise和Point-wise卷积在大小为k×k的局部窗口中聚合信息;
  2. Global sparse attention:建模一组代表性Token之间的长期关系,其中每个Token都被视为一个局部窗口的代表,对均匀分布在空间中的稀疏代表性Token集进行采样,每个深度学习论文: EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers及其PyTorch实现_卷积_03窗口有一个代表性Token。这里,r表示子样本率。然后只对这些被选择的Token应用Self-attention;
  3. Local propagation:将委托学习到的全局上下文信息扩散到具有相同窗口的非代表Token, 通过转置卷积将代表性Token中编码的全局上下文信息传播到它们的相邻的Token中;

因此LGL Bottleneck就能够以低计算成本在同一特征映射中的任何一对Token之间进行信息交换。

最终,LGL bottleneck可以表达为:

深度学习论文: EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers及其PyTorch实现_人工智能_04

2-3 Architectures

不同计算复杂度的网络

深度学习论文: EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers及其PyTorch实现_人工智能_05

3 Experiments

深度学习论文: EdgeViTs: Competing Light-weight CNNs on Mobile Devices with Vision Transformers及其PyTorch实现_人工智能_06