一、Faster RCNN 做目标检测的关键步骤
- 基础网络做特征提取;
- 特征传 RPN 网络做候选框提取;
- 分类层对候选框内的物体进行分类,回归层对候选框内的
(x, y, w, h)
进行精细调整。
二、Faster RCNN 网络结构
- Conv layers。作为一种 CNN 网络目标检测方法,Faster RCNN 首先使用一组基础的 conv+relu+pooling 层提取 image 的 feature maps。该 feature maps 被共享用于后续 RPN 层和全连接层。
- 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 获得检测框最终的精确位置。
三、Region Proposal Networks(RPN)
RPN 网络实际分为 2 条线,上面一条通过 softmax 分类 anchors 获得 positive 和 negative 分类,下面一条用于计算对于 anchors 的 bounding box regression 偏移量,以获得精确的 proposal。而最后的 Proposal 层则负责综合 positive anchors 和对应 bounding box regression 偏移量获取 proposals,同时剔除太小和超出边界的 proposals。其实整个网络到了 Proposal Layer 这里,就完成了相当于目标定位的功能。