MobileNet V1解读

2018-08-01  本文已影响0人  LaLa_2539

Depthwise separable convolution(深度可分离卷积)

核心:深度可分离卷积其实是一种可分解的卷积操作(factorized convolutions),它可以分解为两个更小的操作:depthwise convolution 以及 pointwise convolution

Depthwise separable convolution.png

标准卷积中,每一个卷积核的通道数都和输入的通道数相同

因此传统卷积需要参数 D_K \cdot D_K \cdot M \cdot N \cdot D_F \cdot D_F
D_F : 输出图像尺寸,与输入图像尺寸相同(输出图像的尺寸代表一个卷积核(3维的,包含通道)对输入图像进行的卷积次数)
D_K : 卷积核的大小(二维)
M : 输入图像的通道数,即为卷积核的通道数
N  : 输出图像的通道数,即为卷积核的个数

The standard convolution operation has the effect of filtering features based on the convolutional kernels and combining features in order to produce a new representation.The filtering and combination steps can be split into two steps.

标准的卷积操作依靠卷积核卷积并融合特征图来提取特征,Depthwise separable convolution的思想在于将这两部分分离开来,于是Depthwise separable convolution由两部分组成:①depthwise convolutions and ②pointwise convolutions

①而 depthwise convolution 针对每个输入通道采用不同的卷积核,即一个卷积核仅对一个通道进行卷积,因此M个通道共有M个卷积核,一个卷积核对应一个通道。

因此 depthwise convolution 需要参数 D_K \cdot D_K \cdot M \cdot D_F \cdot D_F  (标准卷积中若有N个卷积核,则N个卷积核都会对某一通道进行卷积)

②但是depthwise convolution只过滤输入通道,并不会结合各个通道产生新的特征,因此需要额外的Pointwise Convolution通过 1*1 的点卷积去结合深度卷积层的输出,另外,MobileNet在每一层后使用batchnorm和ReLU

Pointwise Convolution需要参数 M \cdot N \cdot D_F \cdot D_F
需要的总参数为       
           D_K \cdot D_K \cdot M \cdot D_F \cdot D_F + M \cdot N \cdot D_F \cdot D_F

与传统卷积计算量相比

公式计算             \frac{D_K \cdot D_K \cdot M \cdot N \cdot D_F \cdot D_F + M \cdot N \cdot D_F \cdot D_F}{D_K \cdot D_K \cdot M \cdot N \cdot D_F \cdot D_F} = \frac{1}{N} + \frac{1}{D_k^2}

由此得出,对于3×3的卷积核来说,传统卷积需要的计算量大概是 depthwise convolution 的8~9倍


Network Structure

MobileNet Network.png
上一篇 下一篇

猜你喜欢

热点阅读