摘要
SSD是一种单阶段的目标检测模型,与传统两阶段模型采取 Region Proposals 的方法不同,SSD 使得特征图的每个位置都产生一组尺寸固定的默认边界框,在预测阶段网络直接为每个默认框中的每个类别生成对应的分数,然后再按照分数对边界框进行相应的调整以更好地匹配对象。此外,SSD 支持在不同的尺度下生成特征图再进行检测,和传统两阶段模型如 R-CNN、Fast R-CNN 和 Faster R-CNN 以及单阶段模型 YOLO 相比,SSD 对小目标的检测性能更好。SSD 将输入图像经过基础卷积网络提取特征后,在不同尺度的特征图上生成一系列预定义的默认框,每个默认框预测类别概率和位置调整值以匹配可能的对象。在训练阶段通过匹配默认框与真实对象来计算分类和定位损失并优化网络权重。在推理阶段,应用非极大值抑制(NMS)算法筛选出高置信度且不重叠的最终检测框。SSD 结合了 YOLO 中的回归思想和 Faster R-CNN 中的 Anchor 机制,将全图各个位置的多尺度区域进行回归,既保持了 YOLO 中速度块的特性,又保证了边界框预测像 Faster R-CNN 一样精准。因此,SSD 在识别精度优于当时最先进的 Faster R-CNN,在识别速度上又优于 YOLO,为单阶段目标检测研究提供了新的方向。
Abstract
SSD is a one-stage object detection model that diverges from the traditional two-stage models which employ Region Proposals. Instead, SSD enables each location on the feature map to generate a set of fixed-size default bounding boxes. During the prediction phase, the network directly produces scores for each category within each default box and subsequently adjusts the bounding boxes based on these scores to better match the objects.Moreover, SSD supports generating feature maps at different scales before conducting detection, which results in superior performance on small object detection compared to traditional two-stage models such as R-CNN, Fast R-CNN, and Faster R-CNN, as well as single-stage models like YOLO. SSD processes the input image through a base convolutional network to extract features, then generates a series of predefined default boxes on feature maps of different scales, with each default box predicting class probabilities and location adjustment values to match potential objects. During the training phase, classification and localization losses are calculated by matching the default boxes with ground truth objects to optimize the network weights. In the inference phase, the Non-Maximum Suppression (NMS) algorithm is applied to filter out high-confidence and non-overlapping final detection boxes. By integrating the regression concept from YOLO and the Anchor mechanism from Faster R-CNN, SSD performs regression on multi-scale regions across the entire image. This approach retains the fast speed characteristic found in YOLO while ensuring the precision of bounding box predictions akin to Faster R-CNN.Consequently, SSD achieves higher recognition accuracy than the then state-of-the-art Faster R-CNN and offers faster detection speeds than YOLO, providing a new direction for research in one-stage object detection.
SSD:单阶段多边界框目标检测器
Title: SSD: Single Shot MultiBox Detector
Author: Liu, W (Liu, Wei) ; Anguelov, D (Anguelov, Dragomir) ; Erhan, D (Erhan, Dumitru) ; Szegedy, C (Szegedy, Christian) ; Reed, S (Reed, Scott) ; Fu, CY (Fu, Cheng-Yang) ; Berg, AC (Berg, Alexander C.)
Source: COMPUTER VISION - ECCV 2016, PT I
WOS:https://webofscience.clarivate.cn/wos/alldb/full-record/WOS:000389382700002
研究动机
自从 Selective research 方法提出以来,当时的大部分两阶段目标检测算法目都是遵循这个流程:首先找到边界框,然后对边界框进行分类。
这种方法虽然检测结果很准确,但是计算复杂度太大,即使用到最高端的硬件,对于实时应用程序来说还是太慢。并且在当时研究的方法中,显著提升速度都是以降低精度为代价的,因此,作者就像找到一种像 YOLO 一样既快又准的算法。
解决方法
作者提出了一种叫做 SSD 的算法,当图像输入到单一的网络中会在不同尺度下产生特征图,每张特征图的不同位置都会产生一组默认边界框,每个边界框会包含位置信息(loc)和每个类别的置信度(conf)。浅层的特征图上每个位置的感受野小,可以用来预测小物体,而深层的特征图上每个位置的感受野大,可以用来预测大物体。不同尺度的预测结果结合起来再经过后处理(非极大值抑制)就的可以得到最终的图像结果。
SSD
SSD 的网络结构
SSD 的骨干网络是基于高质量的图像分类架构,比如 VGG-16。SSD 的早期网络结构使用的是在分类层之前的 VGG-16 ,然后再在其后添加各种辅助网络。
为了实现多尺度目标检测,除了在 VGG-16 对于的 Conv5_3 层当作特征图做分类之外,后面的辅助网络要依次做卷积减少特征图大小,然后将每张特征图再拿出来做不同尺度下的检测。
假设一个位置要产生 k 个默认框,总共有 c 类物体需要检测,每个边界框又会产生 4 个位置参数。因此一个位置就需要 ( c + 4 ) k (c+4)k (c+4)k 个卷积核来计算,那么对于一张 m×n 的特征图而言就会产生 ( c + 4 ) k m n (c+4)kmn (c+4)kmn 个输出。
SSD 的损失函数
SSD的损失函数是置信度损失和定位损失的加权和:
L ( x , c , l , g ) = 1 N ( L c o n f ( x , c ) + α L l o c ( x , l , g ) ) L(x, c, l, g) = \frac{1}{N} (L_{conf}(x, c) + \alpha L_{loc}(x, l, g)) L(x,c,l,g)=N1(Lconf(x,c)+αLloc(x,l,g))
其中定位损失采用的是smooth L1损失,具体如下所示:
L l o c ( x , l , g ) = ∑ i ∈ P o s ∑ m ∈ { c x , c y , w , h } x i j k smooth L1 ( l i m − g ^ j m ) L_{loc}(x, l, g) = \sum_{i \in Pos} \sum_{m \in \{cx, cy, w, h\}} x_{ij}^k \text{smooth}_{\text{L1}}(l_i^m - \hat{g}_j^m) Lloc(x,l,g)=