设计理念
- 1x1卷积进行平衡输入和输出的通道大小;
- 组卷积要谨慎使用,注意分组数;
- 避免网络的碎片化;
- 减少元素级运算。
-
ShuffleNet v2中弃用了1x1的group convolution操作,而直接使用了input/output channels数目相同的1x1普通conv。它更是提出了一种ChannelSplit新的类型操作,将module的输入channels分为两部分,一部分直接向下传递,另外一部分则进行真正的向后计算。到了module的末尾,直接将两分支上的output channels数目级连起来,从而规避了原来ShuffleNet v1中Element-wise sum的操作。然后我们再对最终输出的output feature maps进行RandomShuffle操作,从而使得各channels之间的信息相互交通。。精彩至极,看至此处已然拍案叫绝。
-
backbone: # [from, number, module, args] # Shuffle_Block: [out, stride] [[ -1, 1, CBRM, [ 32 ] ], # 0-P2/4 [ -1, 1, Shuffle_Block, [ 128, 2 ] ], # 1-P3/8 [ -1, 3, Shuffle_Block, [ 128, 1 ] ], # 2 [ -1, 1, Shuffle_Block, [ 256, 2 ] ], # 3-P4/16 [ -1, 7, Shuffle_Block, [ 256, 1 ] ], # 4 [ -1, 1, Shuffle_Block, [ 512, 2 ] ], # 5-P5/32 [ -1, 3, Shuffle_Block, [ 512, 1 ] ], # 6 ] # YOLOv5 v6.0 head head: [[-1, 1, Conv, [256, 1, 1]], [-1, 1, nn.Upsample, [None, 2, 'nearest']], [[-1, 4], 1, Concat, [1]], # cat backbone P4 [-1, 1, C3, [256, False]], # 10 [-1, 1, Conv, [128, 1, 1]], [-1, 1, nn.Upsample, [None, 2, 'nearest']], [[-1, 2], 1, Concat, [1]], # cat backbone P3 [-1, 1, C3, [128, False]], # 14 (P3/8-small) [-1, 1, Conv, [128, 3, 2]], [[-1, 11], 1, Concat, [1]], # cat head P4 [-1, 1, C3, [256, False]], # 17 (P4/16-medium) [-1, 1, Conv, [256, 3, 2]], [[-1, 7], 1, Concat, [1]], # cat head P5 [-1, 1, C3, [512, False]], # 20 (P5/32-large) [[14, 17, 20], 1, Detect, [nc, anchors]], # Detect(P3, P4, P5) ]
深度学习之图像分类(十四)--ShuffleNetV2 网络结构_木卯_THU的博客-CSDN博客
ShuffleNetV2:轻量级CNN网络中的桂冠 - 知乎 (zhihu.com)