论文名称:Learning Efficient Single-stage Pedestrian Detectors by Asymptotic Localization Fitting
代码地址:https://github.com/liuwei16/ALFNet
这是18年行人检测做的结果比较好的一篇论文,如果发现我有写的不对的地方,欢迎指出 .
还是一篇行人检测,使用的是 anchor base 的方法,基本网络结构是SSD,引入了 Cascade Faster RCNN 的想法,在预选框生成的过程中,不断提高IOU最后在目标的附近得到更多的高质量预测框,从而提高检测效果。
因为使用的是SSD,所以网络的速度很快,加入级联结构之后,进一步提升了精度。
一、 网络结构:
前向的网络resnet50,取出其中下采样8,16,32的三层feature map,再补充一层下采样64的。原先的SSD是直接用这些采样得到的feature map 提出预选框。现在 ALFnet 在这些 Feature map 上使用了级联结构 CPB. 左边的图有点奇怪,直接看这图估计都不知道这个结构是怎么运行的,所以来看看代码:
def alf_pred(input,num_anchors,name,filters=256,kersize=(3,3),trainable=True):
# the first layer modified from256 to 512
x = Convolution2D(filters, kersize, padding='same', activation='relu',
kernel_initializer='glorot_normal', name=name + '_conv', trainable=trainable)(input)
x_class = Convolution2D(num_anchors, (1, 1),activation='sigmoid',
kernel_initializer='glorot_normal',
bias_initializer=prior_probability(),
name = name+'_rpn_class',trainable=trainable)(x)
x_class_reshape = Reshape((-1, 1), name=name+'_class_reshape')(x_class)
x_regr = Convolution2D(num_anchors * 4, (1, 1), activation='linear', kernel_initializer='glorot_normal',
name=name+'_rpn_regress',trainable=trainable)(x)
x_regr_reshape = Reshape((-1,4), name=name+'_regress_reshape')(x_regr)
return x_class_reshape, x_regr_resh