在聊Feature Pyramid Networks(FPN)和Region Proposal Networks(RPN)之间先相熟一下Faster R-CNN的背景。
Faster RCNN分为四个工作:
- Conv Layers。用几组根底的conv+relu+maxpooling层提取图像的feature map。
- Region Proposal Networks。RPN网络用于生成region proposals。该层通过softmax判断anchors属于positive或者negative,再利用bounding box regression修改anchors取得准确的proposals。
- Roi Pooling。该层收集输出的feature maps和proposals,综合这些信息后提取proposal feature maps,送入后续全连贯层断定指标类别。
- Classification。利用proposal feature maps计算proposal的类别,同时再次bounding box regression取得检测框最终的准确地位。
与one stage算法如yolo系列相比,Faster RCNN做为典型的two stage算法最大的区别就在于其先通过RPN找到proposal,在对proposa分类,经验了两个网络。
RPN
RPN网络的工作是找到proposals。输出:feature map。输入:proposal。
总体流程:生成anchors -> softmax分类器提取positvie anchors -> bbox reg回归positive anchors -> Proposal Layer生成proposals
1.softmax断定positive与negative
在feature map上,设置了稀稀拉拉的候选Anchor。而后用cnn去判断哪些Anchor是外面有指标的positive anchor,哪些是没指标的negative anchor。所以,RPN做的只是个二分类!
2.对proposals进行bounding box regression
图中红框为positive anchors,绿框为GT。anchor和GT的梯度能够有dx, dy, dw, dh四个变换示意,bounding box regression通过线性回归学习到这个四个梯度,使anchor一直迫近GT,从而取得更准确的proposal。
RPN
Reference
1.FPN: https://arxiv.org/abs/1612.03...
2.Faster R-CNN: https://ieeexplore.ieee.org/s...
3.https://zhuanlan.zhihu.com/p/...