1 ShuffleNetv1
ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices
逐点群卷积(pointwise group convolution)
为了减少1×1 pointwise convolution的计算复杂度,引入了pointwise group convolution。
为什么1×1 pointwise convolution的计算复杂度高,因为需要做n次累加,分组后这些操作可以并行计算,所以会大大减少计算时间。
通道混洗(channel shuffle)
但是分组带来了通道间信息不流通的问题,所以加入了一个通道洗牌的操作,很顺其自然又合乎情理。
shuffle unit
整体结构跟mobilenetv2类似,都是先通过1×1卷积升维,然后DW卷积,最后1×1卷积 降维。
NetWork Architecture
共4个stage,每个stage 一次2× 下采样。每个stage都是堆叠不同个数的shuffle unit,组后接一个global pooling 。
2 ShuffleNetv2
ShuffleNet V2: Practical Guidelines for Efficient
CNN Architecture Design
首先文章大大批判了FLOPs作为计算复杂度衡量指标的不合理,而其中被忽视的一个值memory access cost (MAC),在分组卷积中很耗时。
作者实验论证的4条practical guidelines for efficient network architecture design .
G1) Equal channel width minimizes memory access cost (MAC).
输入输出通道相同可以减少MAC。
We study the kernel shape of the 1 × 1 convolution. The shape is specified by two parameters: the number of input channels c1 and output channels c2。Let h and w be the spatial size of the feature map。
the FLOPs of the 1 × 1 convolution is B = hwc1c2.
MAC = hw(c1+c2)+c1c2.
实验和公式都表明当c1==c2 时MAC值最小。当然这是只考虑速度的情况,作者没有做实验论证这样会不会影响最终的准确率。
G2) Excessive group convolution increases MAC.
过多的分组会增加MAC
G3) Network fragmentation reduces degree of parallelism.
网络分支会减少网络的并行程度,并行程度越低,运行时间越高。
G4) Element-wise operations are non-negligible.
Element-wise操作不可忽视。
shufflenetv2 unit
基于上述4条准则,设计了如下Unit。
v2 中没有用Inverted residual block,而是所有3个卷积输入输出通道数量都相同。
NetWork Architecture
整体网络结构跟v1一模一样。不同的是stage 内部的Unit单元不同,没有了groups参数,增加了channels调节的参数。