美文网首页
YOLOv3中的Anchor参数是怎么来的?

YOLOv3中的Anchor参数是怎么来的?

作者: LabVIEW_Python | 来源:发表于2021-03-01 06:21 被阅读0次

    YOLOv3的配置文件中有一段对anchors参数的配置

    YOLOv3Head:
      # anchor_masks
      anchor_masks: [[6, 7, 8], [3, 4, 5], [0, 1, 2]]
      # 3x3 anchors
      anchors: [[10, 13], [16, 30], [33, 23],
                [30, 61], [62, 45], [59, 119],
                [116, 90], [156, 198], [373, 326]]
      # norm_decay
      norm_decay: 0.
      # yolo_loss
      yolo_loss: YOLOv3Loss
      # nms 类型参数,可以设置为[MultiClassNMS, MultiClassSoftNMS, MatrixNMS], 默认使用 MultiClassNMS
    

    根据《YOLO9000:Better, Faster, Stronger》文章中所述:

    We encounter two issues with anchor boxes when using them with YOLO. The first is that the box dimensions are hand picked. The network can learn to adjust the boxes appropriately but if we pick better priors for the network to start with we can make it easier for the network to learn to predict good detections.
    Instead of choosing priors by hand, we run k-means clustering on the training set bounding boxes to automatically find good priors

    根据《YOLOv3: An Incremental Improvement》文章中所述:

    We still use k-means clustering to determine our bounding box priors. We just sort of chose 9 clusters and 3 scales arbitrarily and then divide up the clusters evenly
    across scales. On the COCO dataset the 9 clusters were:
    (10×13),(16×30),(33×23),(30×61),(62×45),(59×119),(116 × 90),(156 × 198),(373 × 326).

    YOLOv3算法在COCO数据集上使用K-means类聚了9类anchors,分别应用大中小三种特征图,下图中黄色框为标注框,蓝色框为锚框 YOLOv3的锚框

    从数据集中类聚出来的锚框,相当于预测框的一个参考,基于这个参考,算法生成的预测框仅需要在这个锚框的基础上进行“精修或微调fine-tuning”即可,这样算法可以收敛的更快,检测效果更好。

    相关文章

      网友评论

          本文标题:YOLOv3中的Anchor参数是怎么来的?

          本文链接:https://www.haomeiwen.com/subject/qohifltx.html