RPNs 从任意尺寸的图片中得到一系列的带有 objectness score 的 object proposals。具体流程是:使用一个小的网络在最后卷积得到的特征图上进行滑动扫描,这个滑动的网络每次与特征图上n*n 的窗口全连接,然后映射到一个低维向量,例如256D或512D, 最后将这个低维向量送入到两个全连接层,即box回归层(box-regression layer (reg))和box分类层(box-regression layer (reg))。
Translation-Invariant Anchors
这里作者说的平移不变性,其实就是以窗口中心进行多个尺度、宽高比的采样。如上图右边,文中使用了3 scales and 3 aspect ratios (1:1,1:2,2:1), 就产生了 k = 9 anchors at each sliding position. Anchors 这个词不知道应该怎么翻译,原文写的是:The k proposals are parameterized relative to k reference boxes, called anchors。
A Loss Function for Learning Region Proposals 作者将 anchors 分为两类:与 ground-truth box 有较高的 IoU 或 与任意一个 ground-truth box 的 IoU 大于0.7 的 anchor 都标为 positive label; 与 所有 ground-truth box 的IoU 都小于0.3的 anchor 都标为 negative label。其余非正非负的都被丢掉。
对于每一个 anchor box i, 其 loss function 定义为:
其中, 是一个二分类(是或者不是object)的 softmax loss 。regression loss , 表示只针对 positive anchors ( , 文中设为10,表示更倾向于box location。
使用 back-propagation and stochastic gradient descent (SGD) 对这个RPN进行训练,每张图片随机采样了256个 anchors , 这里作者认为如果使用所有的anchors来训练的话,this will bias towards negative samples as they are dominate。所以这里作者将采样的正负positive and negative anchors have a ratio of 1:1.
新增的两层使用高斯来初始化,其余使用 ImageNet 的 model 初始化。详见论文。
通过交替优化来学习共享的特征,主要有4步:
Implementation Details每个 anchor , 使用 3 scales with box areas of pixels, and 3 aspect ratios of 1:1, 1:2, and 2:1. 忽略了所有的 cross-boundary anchors 。在 proposal regions 上根据 cls scores 进行了 nonmaximum suppression (NMS) 。其余详见论文。