深入理解CV中的Attention机制之PAN

CV中的Attention机制汇总(三):PAN

PAN: Pyramid Attention Network

论文链接:《Pyramid Attention Network for Segmantic Segmentation》

一、摘要

PAN网络结构:
Overview of pyramid attention network
Pyramid Attention Network (PAN)将注意力机制与空间金字塔相结合来更准确地提取密集特征,提高语义分割的准确率。该方法要解决的问题(motivation)和主要贡献包括:

1.1 提出 Feature Pyramid Attention(FPA) Module

  • Motivation

    The existence of objects at multiple scales cause difficulty in classification of categories.
    同一类别物体的尺寸不一增加了分类难度,而现有算法采用膨胀卷积(ASPP)或金字塔汇聚(PSPNet)的方式增加分类准确率,但是分别存在网格效应和丢失了像素级位置信息的问题。

  • FPA module

    FPA module performs spatial pyramid attention structure on high-level output and combine global pooling to learn a better feature representation. (包含空间金字塔和全局汇聚,作用于深层网络的输出)

1.2 提出 Global Attention Upsample(GAU) Module

  • Motivation

    high-level features are skilled in making category classification, while weak in restructuring original resolution binary prediction.
    深层网络的可以提取更精确的类别信息,但是丢失了位置信息,这对预测某类物体的位置是不利的。

  • GAU module

    GAU module acts on each decoder layer to provide global context as a guidance of low-level features to select category localization details, (深层网络的感受野更大,包含更准确的类别信息,浅层网络包含更准确的位置信息,可以将二者的特点结合提高分割效果。

二、模块详解

2.1 Feature Pyramid Attention

在这里插入图片描述
① 提取局部特征(pixel-wise)
FPA模块分别使用 3 × 3 , 5 × 5 , 7 × 7 3\times 3, 5\times 5, 7\times 7 3×3,5×5,7×7三个尺寸的卷积核进一步提取特征图包含的特征,然后将三种尺寸的特征图依次相加融合;
② 提取全局特征(channel-wise)
增加Global Pooling支路,提取通道特征。(这里思路类似SE模块,区别在于只用了一层卷积,SE用了两层)

2.2 Global Attention Upsample

主要思想:

The main character of decoder module is to repair category pixel localization. Furthermore, high-level features with abundant category information can be used to weight low-level information to select precise resolution details.
“解码”的目的是为了得到每个类别所包含的像素,实现像素级的分类。而深层网络的输出包含了更丰富的类别信息,浅层网络的输出包含更准备的位置信息,因此,可以使用深层网络提取的类别特征引导浅层网络实现更准确的像素级分类。
在这里插入图片描述

实现细节:

  1. 使用 3 × 3 3\times 3 3×3的卷积减少low-level特征图的通道数量;
  2. 使用global average pooling 提取high-level的全局信息, 1 × 1 1\times 1 1×1卷积后加BN层与ReLU激活函数;
  3. high-level输出经过上采样与加权后的low-level的输出特征图逐像素相加。

三、PyTorch代码实现

参考:https://github.com/JaveyWang/Pyramid-Attention-Networks-pytorch

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值