论文的主题及主要改进的东西:
主要通过改变dilation rate来变化receptive field的大小,测试不同的receptive field 对识别不同大小的目标的影响。最后证明receptive field确实是对识别有影响。
模型结构:
分为3个branch,每个branch都相同,只是dilation rate不同,甚至连weights都是共享的。因为都相同,所以只说一个branch。
一个branch是resnet,
(1)具体怎么修改每个conv block如图:
(2)而resnet有那么多block,修改哪些block?具体文中做了实验,结果如下
文中没有提到deformable具体加在哪?不清楚。
另贴deformable 原论文中是如何添加deformable convolution 的,其仅仅是在最后一个部分添加了可变形卷积:
阅读源代码,可以看到,其只更改了第四个卷积部分,其他部分和resnet一样,只有第四部分变了
c1 = cls.resnet_c1(data, use_3x3_conv0, use_bn_preprocess, norm_type, norm_mom, ndev) c2 = cls.resnet_c2(c1, num_c2_unit, 1, 1, norm_type, norm_mom, ndev) c3 = cls.resnet_c3(c2, num_c3_unit, 2, 1, norm_type, norm_mom, ndev) c4 = cls.resnet_trident_c4(c3, num_c4_unit, 2, branch_dilates, norm_type, norm_mom, ndev, num_trident_block, num_branch, branch_ids, branch_bn_shared, branch_conv_shared, branch_deform) # stack branch features and merge into batch dim c4 = cls.stack_branch_symbols(c4) c5 = cls.resnet_c5(c4, num_c5_unit, 1, 2, norm_type, norm_mom, ndev)
而第四部分有多个block,具体几个都可以,每个block的dilate按照论文中的1,2,3。只有(3X3)那个卷据修改了dilate,同样只有这个地方会修改为可变型卷积,如代码所示:
conv2_offset = cls.conv_shared( relu2, name=name + "_conv2_offset", num_filter=72, kernel=(3, 3), pad=(1, 1), stride=(1, 1), dilate=(1, 1), no_bias=False, branch_ids=branch_ids, share_weight=branch_conv_shared) conv2 = cls.deform_conv_shared( relu2, name=name + "_conv2", conv_offset=conv2_offset, num_filter=filter // 4, kernel=(3, 3), pad=dilate, stride=stride, dilate=dilate, num_deformable_group=4, branch_ids=branch_ids, share_weight=branch_conv_shared)