赵文清,严海,邵绪强(华北电力大学, 保定 071003)
目的 作为目标检测的后置处理算法，非极大值抑制（NMS）算法被用于移除多余的检测框。然而，NMS算法在每轮迭代中抑制所有与预选取检测框Intersection-over-Union（IoU）值大于给定阈值的检测框，容易造成目标的漏检和误检。此外，阈值的选取对整个算法的效果有着至关重要的影响。针对这个问题，本文提出了改进的NMS算法，分别为分段比例惩罚因子NMS算法和连续比例惩罚因子NMS算法。在连续比例惩罚因子NMS算法中，阈值对算法的运行效果仅有轻微的影响。方法 改进的NMS算法首先根据检测框与预选取检测框的IoU值大小计算出检测框对应的比例惩罚因子；然后将检测框置信度分数乘以比例惩罚因子，通过比例惩罚因子逐轮降低检测框的分数；最后经过多轮迭代后移除分数低于阈值的检测框。结果 基于分段比例惩罚因子NMS算法和连续比例惩罚因子NMS算法的Faster RCNN目标检测模型在PASCAL VOC 2007数据集下，Faster RCNN的检测平均精度均值（mAP）相较于传统的NMS算法分别提高了1.5%和1.6%。其中，以火车类为例，当准确率和召回率均为80%时，火车类检测的漏检率和误检率分别降低了1.8%和1.2%。与传统的NMS算法相比，本文所提出改进的NMS算法可以有效地保留目标检测框和移除目标的假正例检测框，从而降低NMS算法的漏检率和误检率。结论 在时间复杂度相同和运行效率一致的情况下，与传统的NMS算法相比，本文所提出的改进NMS算法mAP值得到了显著的提升，同时本文算法为其他目标检测模型提供了一个通用的解决方法。
Object detection based on improved non-maximum suppression algorithm
Zhao Wenqing,Yan Hai,Shao Xuqiang(North China Electric Power University, Baoding 071003, China)
Objective Object detection has been a popular research topic in the field of computer vision and is an essential component for security video surveillance system and other computer vision applications. Image recognition, which is based on convolutional neural network, has fulfilled remarkable achievements. Many current object detection pipelines due to the deep learning can be divided into three stages as follows:1) extracts region proposals, 2) classifies and refines each region proposal, and 3) removes extra detection boxes that might belong to the same object. Non-maximum suppression (NMS) algorithm is frequently used in Stage 3 as an essential part of object detection and obtains impressive effect. Numerous studies have focused on feature design, classifier design, and object proposals, although the NMS algorithm is a core part of object detection. Few studies on the NMS algorithms exist. The NMS algorithm is used as a post-processing step of object detection to remove the redundant detection boxes. However, this algorithm suppresses all detection boxes with higher intersection-over-union (IoU) overlap than the threshold with pre-selected detection box. NMS algorithm may remove the positive detection box if the positive detection box is adjacent to the pre-selected with a high IoU value. It may also preserve the negative detection box because this box with the pre-selected detection box has a low IoU value. Mean average precision (mAP) decreases as a result of the missing and false positives; thus, the traditional NMS can also be called GreedyNMS. GreedyNMS easily causes missed and false detections. Method To overcome these shortages, an improved NMS algorithm is proposed in accordance with the different IoU values to assign a proportional penalty coefficient to reduce detection scores. The improved NMS algorithm includes the piecewise and the continuous proportional penalty factor NMS algorithms. The piecewise proportional penalty factor NMS algorithm reduces the scores of detection boxes and has a higher IoU than threshold T. The detection boxes with IoU, which is less than the threshold T, maintains its original score. The detection boxes whose scores are lower than another threshold σ are removed after many iterations. The performance of this algorithm remains limited by the threshold T. The continuous proportional penalty factor NMS algorithm no longer uses threshold T but directly reduces all detection boxes, except those with the maximum score in each iteration. In the continuous proportional penalty factor NMS algorithm, the threshold slightly affects the performance of the algorithm. The improved NMS algorithm initially calculates the proportional penalty factors the correspond to the detection boxes in accordance with the IoU value of the pre-selection detection box. The improved NMS algorithm multiplies the confidence scores of the detection boxes by the proportional penalty factors and reduces the detection box scores through the proportional penalty factor after many iterations. Moreover, the improved NMS algorithm removes the detection boxes with a score below the threshold after many iterations. The piecewise and the continuous proportional penalty factor NMS algorithms are used in each iteration in a post-processing step of object detection rather than in a region proposal network. The threshold in the continuous proportional penalty factor is less sensitive to the performance of the algorithm than the influence of the threshold in GreedyNMS. In addition, the computational complexity of the improved NMS algorithm is O(n2), which is the same as that of GreedyNMS, where n is the number of detection boxes. Result This experiment is based on faster RCNN on PASCAL VOC 2007 that has 20 object categories, and the basic network is VGG16. We train the models on the union set of VOC 2007 trainval and evaluate a VOC 2007 test set. Object detection accuracy is measured by the mAP. The improved NMS algorithm obtains significant improvements on standard datasets, such as PASCAL VOC (1.5% for the piecewise proportional penalty factor NMS algorithm and 1.6% for the continuous proportional penalty factor NMS algorithm) using the piecewise and the continuous proportional penalty factor NMS algorithms in a basic faster RCNN. Compared with GreedyNMS, the piecewise proportional penalty factor NMS algorithm has significantly improved by up to 1.5% in the mAP when the threshold is 0.3 or 0.4. However, the performance of the piecewise proportional penalty factor NMS algorithm remains limited by selecting the threshold. Therefore, the influence of the threshold on the performance of the algorithm is weakened in the continuous proportional penalty NMS algorithm. Compared with the GreedyNMS algorithm, the continuous proportional penalty NMS algorithm has significantly improved by up to 1.6% in the mAP, and the threshold is less sensitive to the performance of the algorithm. The missed and misdetection rates decreased by 1.8% and 1.2%, respectively, when the precision and recall rates are 80%. Conclusion The traditional NMS algorithm can easily miss the positive detection boxes and preserve the negative detection boxes. An improved NMS algorithm, which includes the piecewise and the continuous proportional penalty NMS algorithms, is proposed. Compared with the traditional NMS algorithm, the improved NMS algorithm can effectively preserve the object detection boxes and remove the false positive detection boxes. It can also reduce the missed and false detection rates of the NMS algorithm. In addition, the improved and the traditional NMS algorithms have the same time complexity and similar operating efficiency. The experiments show that the detection performance of the faster RCNN has been significantly improved using the improved NMS algorithm. The next step is to continue to improve the algorithm to obtain enhanced generalization capabilities in a single-stage detection model. Simultaneously, the algorithm remains applicable to other object detection models.