当前位置:网站首页>Depthwise Separable Convolution详解
Depthwise Separable Convolution详解
2022-07-21 10:04:00 【wzw12315】
常规卷积运算
假设输入层为一个大小为64×64像素、三通道彩色图片。经过一个包含4个Filter的卷积层,最终输出4个Feature Map,且尺寸与输入层相同。整个过程可以用下图来概括。
此时,卷积层共4个Filter,每个Filter包含了3个Kernel,每个Kernel的大小为3×3。因此卷积层的参数数量可以用如下公式来计算:
N_std = 4 × 3 × 3 × 3 = 108
- 1
Separable Convolution
Separable Convolution在Google的Xception[1]以及MobileNet[2]论文中均有描述。它的核心思想是将一个完整的卷积运算分解为两步进行,分别为Depthwise Convolution与Pointwise Convolution。
Depthwise Convolution
同样是上述例子,一个大小为64×64像素、三通道彩色图片首先经过第一次卷积运算,不同之处在于此次的卷积完全是在二维平面内进行,且Filter的数量与上一层的Depth相同。所以一个三通道的图像经过运算后生成了3个Feature map,如下图所示。
其中一个Filter只包含一个大小为3×3的Kernel,卷积部分的参数个数计算如下:
N_depthwise = 3 × 3 × 3 = 27
- 1
Depthwise Convolution完成后的Feature map数量与输入层的depth相同,但是这种运算对输入层的每个channel独立进行卷积运算后就结束了,没有有效的利用不同map在相同空间位置上的信息。因此需要增加另外一步操作来将这些map进行组合生成新的Feature map,即接下来的Pointwise Convolution。
Pointwise Convolution
Pointwise Convolution的运算与常规卷积运算非常相似,不同之处在于卷积核的尺寸为 1×1×M,M为上一层的depth。所以这里的卷积运算会将上一步的map在深度方向上进行加权组合,生成新的Feature map。有几个Filter就有几个Feature map。如下图所示。
由于采用的是1×1卷积的方式,此步中卷积涉及到的参数个数可以计算为:
N_pointwise = 1 × 1 × 3 × 4 = 12
- 1
经过Pointwise Convolution之后,同样输出了4张Feature map,与常规卷积的输出维度相同。
参数对比
回顾一下,常规卷积的参数个数为:
N_std = 4 × 3 × 3 × 3 = 108
- 1
Separable Convolution的参数由两部分相加得到:
N_depthwise = 3 × 3 × 3 = 27
N_pointwise = 1 × 1 × 3 × 4 = 12
N_separable = N_depthwise + N_pointwise = 39
- 1
- 2
- 3
相同的输入,同样是得到4张Feature map,Separable Convolution的参数个数是常规卷积的约1/3。因此,在参数量相同的前提下,采用Separable Convolution的神经网络层数可以做的更深。
边栏推荐
- quartz简单用法及其es-job
- 871. 约数之和
- SSL Error: Unable to verify the first certificate
- leetcode:169. 多数元素
- Ali Er Mian: what is MMAP? (not MMP)
- With a wave of operations, I have improved the efficiency of SQL execution by 10000000 times
- Codeforces Round #578 (Div. 2) C - Round Corridor 【数论+规律】
- SQL每日一练(牛客新题库)——第3天: 条件查询
- Why does a very simple function crash
- 07.01 Huffman tree
猜你喜欢
Introduction to web security TCP stress testing and defense
Construction practice of pipeline engine of engineering efficiency ci/cd
[sklearn] data set split sklearn moduel_ selection. train_ test_ split
Redis基础知识、应用场景、集群安装
VLAN and layer 3 switch
有一说一,要搞明白优惠券架构是如何演化的,只需10张图!
WDK开发入门1-基础环境搭建和第一个驱动程序(VS2010)
COM编程入门1-创建项目并编写接口
I, AI doctoral student, online crowdfunding research topic
mysql.h: No such file or directory
随机推荐
Network wiring and number system conversion
Grafana visual configuration chart table
网络层协议介绍
网络布线与数制转换
Chapter 2 software process and thought section 1 Foundation
SVD singular value decomposition matrix compression
MySQL. Pas de fichier ou de répertoire
Leetcode 104. 二叉树的最大深度
SQL每日一练(牛客新题库)——第3天: 条件查询
MySQL performance optimization (I): MySQL architecture and core issues
MySQL advanced (XIV) implementation method of batch update and batch update of different values of multiple records
VMware Workstation Pro virtual machine network three types of network cards and their usage
Redis到底是单线程还是多线程
基于JSP实现OA办公系统
Kuberntes云原生实战一 高可用部署架构
70. Climb stairs: suppose you are climbing stairs. You need n steps to reach the roof. You can climb one or two steps at a time. How many different ways can you climb to the roof?
Why does a very simple function crash
Layer 3 switching and VRRP
Raspberry pie 3B builds Flink cluster
通过ATL库CRegKey读注册表(简单方便)