[Model] Mask-RCNN
The Mask R-CNN was published March 2017, by the Facebook AI Research (FAIR).
* Projects Using this Model.
Mask R-CNN for object detection and instance segmentation on Keras and TensorFlowhttps://github.com/matterport/Mask_RCNN
* lilianwen's blog 不错的,认真的博客
Object Detection for Dummies Part 3: R-CNN Family
* How to use it in c++/python
c++ code: https://github.com/spmallick/learnopencv/blob/master/Mask-RCNN/mask_rcnn.cpp
Using Mask R-CNN successfully on a new data set would be a good indication that the algorithm is generic enough to be applicable to many problems. However, the number of publicly available data sets with enough images to train this algorithm is limited because collecting and annotating data for 50,000+ images is expensive and time-consuming.
五万张照片?有点多:)
一、应用
OSM:openstreetmap project
Code: https://github.com/jremillard/images-to-osm

二、指标
[TensorBoard]
The losses for the Region Proposal Network:
-
- Loss/RPNLoss/localization_loss/mul_1: Localization Loss or the Loss of the Bounding Box regressor for the RPN
- Loss/RPNLoss/objectness_loss/mul_1: Loss of the Classifier that classifies if a bounding box is an object of interest or background
The losses for the Final Classifier:
-
- Loss/BoxClassifierLoss/classification_loss/mul_1: Loss for the classification of detected objects into various classes: Cat, Dog, Airplane etc
- Loss/BoxClassifierLoss/localization_loss/mul_1: Localization Loss or the Loss of the Bounding Box regressor

三、原理
Ref: Mask Region based Convolution Neural Networks - EXPLAINED!
Ref: 先理解Mask R-CNN的工作原理,然后构建颜色填充器应用
Mask R-CNN 是一个两阶段的框架,
第一个阶段扫描图像并生成提议(proposals,即有可能包含一个目标的区域),
第二阶段分类提议并生成边界框和掩码。
-
主干架构
Mask R-CNN 实现中使用的是 ResNet101+FPN 主干网络
Feature Pyramid Networks (FPN) for Object Detection
特征金字塔网络(FPN)
-
区域建议网络(RPN)
[Anchor box]
RPN 扫描的区域被称为 anchor,这是在图像区域上分布的矩形。

展示 49 个 anchor box 的简化图示
[RPN的输出]
RPN 是一个轻量的神经网络,它用滑动窗口来扫描图像,并寻找存在目标的区域。

RPN 为每个 anchor 生成两个输出:
- anchor 类别:前景或背景(FG/BG)。前景类别意味着可能存在一个目标在 anchor box 中。
- 边框精调:前景 anchor(或称正 anchor)可能并没有完美地位于目标的中心。因此,RPN 评估了 delta 输出(x、y、宽、高的变化百分数)以精调 anchor box 来更好地拟合目标。
-
ROI 分类器和边界框回归器
/* 略 */
-
分割掩码
到第 3 节为止,我们得到的正是一个用于目标检测的 Faster R-CNN。而分割掩码网络正是 Mask R-CNN 的论文引入的附加网络。
掩码分支是一个卷积网络,取 ROI 分类器选择的正区域为输入,并生成它们的掩码。其生成的掩码是低分辨率的:28x28 像素。但它们是由浮点数表示的软掩码,相对于二进制掩码有更多的细节。掩码的小尺寸属性有助于保持掩码分支网络的轻量性。在训练过程中,我们将真实的掩码缩小为 28x28 来计算损失函数,在推断过程中,我们将预测的掩码放大为 ROI 边框的尺寸以给出最终的掩码结果,每个目标有一个掩码。
四、训练 Transfer learning
Ref: https://github.com/Shirhe-Lyh/mask_rcnn_test
需要自己手动添加这些代码。
五、与 UNet对比
Ref: mask-r-cnn,unet,unet++三种算法实现细胞分割的对比心得
End.

浙公网安备 33010602011771号