论文地址:SSD: Single Shot MultiBox Detector
SSD相对于YOLO的改进
1、anchor
SSD也使用类似Faster R-CNN中的anchor方法,每个feature map的bin会有k个人工设置的anchor,并且不同size的feature map有不同数量和不同scale的anchor,比如上图(b)是8*8的feature map,anchor数量为4,上图(c)是4*4的feature map,anchor数量为4,但是anchor的scale与8*8中的feature map中的anchor不一样
2、使用多尺度feature map进行detection
YOLO只使用了最后一层feature map划分bin然后进行2个anchor的识别与位置计算,SSD提出对于不同layer也就是不同size的feature map都进行anchor的计算
并且进行classifier计算的时候,YOLO中使用的是FC,在SSD中使用的是3*3的不同channel数的卷积
如m*n的feature map,使用p个channel的3*3卷积进行classifier,p=(anchor num*(classes num+4))
整个网络图如上所示,上图为SSD,下图为YOLO,YOLO的主体网络结构使用VGG16,并且使用ILSVRC CLS-LOC进行pre-trained
可以看到YOLO是在7*7feature map上进行每个bin有2个anchor的detection,所以是有7*7*2(anchor数)=98次detection
而SSD从不同layer的feature map都进行detection,
conv4_3:38*38的feature map,使用(4*(classes+4))个channel的3*3卷积核进行detect,有38*38*4(anchor数)=5776次detection
conv7:19*19的feature map,使用(6*(classes+4))个channel的3*3卷积核进行detect,有19*19*6(anchor数)=2166次detection
conv8_2:10*10的feature map,使用(6*(classes+4))个channel的3*3卷积核进行detect,有10*10*6(anchor数)=600次detection
conv9_2:5*5的feature map,使用(6*(classes+4))个channel的3*3卷积核进行detect,有5*5*6(anchor数)=150次detection
conv10_2:3*3的feature map,使用(4*(classes+4))个channel的3*3卷积核进行detect,有3*3*4(anchor数)=36次detection
conv11_2:1*1的feature map,使用(4*(classes+4))个channel的3*3卷积核进行detect,有1*1*4(anchor数)=4次detection
所以SSD一共做了5776+2166+600+150+36+4=8732次detection
最后依旧是使用Non-Maximum Suppression进行最优框的选择得到最后的检测结果
训练过程:
因为SSD是对6层特征图都进行检测,因此数据准备上首先需要将GT和每层特征图的anchor进行匹配