论文:Receptive Field Block Net for Accurate and Fast Object Detection
Github:https://github.com/ruinmessi/RFBNet
ECCV2018
论文基于Receptive Fields (RFs) ,提出了RF Block (RFB) ,然后基于RFB,对以VGG16为基础架构的ssd进行了改进,形成最终的RFBNet。RFBNet是一种one-stage的架构,精度高于传统ssd,速度较传统ssd略慢。
论文贡献:
RFB流程:
RFB模块分为3个分支,每个分支的底层都经过不同大小的卷积核进行处理(1*1,3*3,5*5),然后经过3*3空洞卷积,膨胀率分别为(1,3,5)。这样使得不同分支都具有不同的感受野,最后将所有的feature map连接起来。
Inception,ASPP,Deformable conv,RFB对比:
可以看出Inception,ASPP,Deformable conv,这3种方法的底层输入都是同样感受野的feature map。而RFB的底层输入具有不同的感受野。
RFB算是Inception和ASPP的综合,具有更大的感受野。
RFB模块:
RFB模块分为RFB,RFB-s两种。程序和实现和上面的图示,有略微的区别。
class BasicRFB(nn.Module):
def __init__(self, in_planes, out_planes, stride=1, scale = 0.1, visual = 1):
super(BasicRFB, self).__init__()
self.scale = scale
self.out_channels = out_planes
inter_planes = in_planes // 8
self.branch0 = nn.Sequential(
BasicConv(in_planes, 2*inter_planes, kernel_size=1, stride=stride),
BasicConv(2*inter_planes, 2*inter_planes, kernel_size=3, stride=1, padding=visual, dilation=visual, relu=False)
)
self.branch1 = nn.Sequential(
BasicConv(in_planes, inter_planes, kernel_size=1, stride=1),
BasicConv(inter_planes, 2*inter_planes, kernel_size=(3,3), stride=stride, padding=(1,1)),
BasicConv(2*inter_planes, 2*inter_planes, kernel_size=3, stride=1, padding=visual+1, dilation=visual+1, relu=False)
)
self.branch2 = nn.Sequential(
BasicConv(in_planes, inter_planes, kernel_size=1, stride=1),
BasicConv(inter_planes, (inter_planes//2)*3, kernel_size=3, stride=1, padding=1),
BasicConv((inter_planes//2)*3, 2*inter_planes, kernel_size=3, stride=stride, padding=1),
BasicConv(2*inter_planes, 2*inter_planes, kernel_size=3, stride=1, padding=2*visual+1, dilation=2*visual+1, relu=False)
)
self.ConvLinear = BasicConv(6*inter_planes, out_planes, kernel_size=1, stride=1, relu=False)
self.shortcut = BasicConv(in_planes, out_planes, kernel_size=1, stride=stride, relu=False)
self.relu = nn.ReLU(inplace=False)
def forward(self,x):
x0 = self.branch0(x)
x1 = self.branch1(x)
x2 = self.branch2(x)
out = torch.cat((x0,x1,x2),1)
out = self.ConvLinear(out)
short = self.shortcut(x)
out = out*self.scale + short
out = self.relu(out)
return out
RFB-Net :
实验结果:
RFB和其他基础骨架网络在VOC的对比结果
RFB各模块有效性
RFB和其他增加感受野模块对比
RFB和其他基础骨架网络在coco的对比结果
RFB速度对比
总结:
RFB模块是一种增加感受野的模块,基于此改进的RFB-Net 具有速度和精度的双重优势。