Anchor Box 学习笔记(一)
- what is an anchor box ?
- How and where are anchor boxes proposed over an image?
- When are anchor boxes proposed over an image?
- Ground truth – matching anchors and generating batches
- Anchor boxes and calculating detector losses – how are anchor boxes corrected during training
what is an anchor box ?
anchor box 是指在目标检测过程中,一组预先定义的框的集合,用来标识出被检测到的物体,其width和height 与数据集中物体的width 和 height 相匹配。这些预定义的anchor box的尺寸包含了数据集中所有可能被检测到的物体的尺寸组合,eg. 应该包括不同的ratio 和 scale。通常预先定义 4-10 个anchor box作为图像中各个位置的候选anchor box。
在计算机视觉领域中,深度神经网络在图像分类、目标检测领域表现出了卓越的性能。 首先, 滑窗检测器在前向传播过程中定位单个物体。后来,滑窗检测器被可以处理整个图像并输出多个检测结果的single-shot、 two-stage 检测器所取代。这些检测器很大程度上是基于anchor box 的概念来优化滑窗检测算法的速度和效率。这是因为滑窗检测器需要多次前向传播来处理图像,但大部分前向传播过程只处理了背景像素。
如图所示:
Figure 1: Sliding window detector
训练目标检测网络的典型任务包括提出anchor boxes 或者 用传统computer vision 技术来搜索潜在的anchor。将一部分anchor boxes与 ground truth boxes 进行匹配,剩余未被匹配的anchors被当作背景处理,用这样的思路训练出正确的分类器。需要注意的是,预定义的anchor boxes可以理解为给卷积神经网络输出的feature map上的每一个点都预测固定数量的尺寸不一的boxes。
How and where are anchor boxes proposed over an image?
从本质上讲,提出anchor 就是确定一个适合数据集中大多数物体尺寸的boxes的集合。在图像上放置假设的、间