Faster R-CNN[1] 在其 Implementation Details 提到:
We also note that for ZF and VGG nets, the total stride on the last conv layer is 16 pixels on the re-scaled image, and thus is ∼10 pixels on a typical PASCAL image (∼500×375).
这个 stride 是用作 feature map 与 original image 的座标对应关系。对于一张 [500, 375, 3]
的 image(所谓典型 PASCAL image size),当用 VGG16 做 backbone,所得 feature map 的 size 就是 [31, 23, 512]
,其中
500
31
≈
375
23
≈
16
\frac{500}{31}\approx\frac{375}{23}\approx 16
31500≈23375≈16。
这在生成 anchor 时用到。以 [2] 这份复现为例,这个参数就是 feat_stride。Faster R-CNN 基于 feature map(的形状)产生 anchors,然后基于 anchors(相当于 base bbox)和 box-regression layer 输出的 refinement 参数产生 predicted bbox,参考 [3]。
然而 ground-truth bbox 是在 original image 上的,anchor 是在 feature map 上的,要将 anchor 映射回 original image。操作就是以 feature map 上各位置为 anchor centroid,乘以 feature stride 得到将这些 anchor centroids 映射回 original image 上时的座标。