Feature Pyramid Network(FPN) 特征金字塔网络

搬运工:

https://engineering.matterport.com/splash-of-color-instance-segmentation-with-mask-r-cnn-and-tensorflow-7c761e238b46

原论文最后一版:2017.4.19

https://arxiv.org/abs/1612.03144


功能

While the backbone described above works great, it can be improved upon. The Feature Pyramid Network (FPN) was introduced by the same authors of Mask R-CNN as an extension that can better represent objects at multiple scales.

backbone就是基础网络,比如ResNet50 和ResNet101,就是现成的,不用自己写,拿来用就好了。

FPN更适用于检测尺寸大小差异很大的情况。比如,如下图片中,飞机很大啊,人很小啊,而且人和飞机的框框的横竖比例也不一样,人是竖着的矩形,飞机是躺着的矩形,如果不用FPN,要么你能检测出人,要么你能检查飞机,很难两个同时搞定的。


原理

The early layers detect low level features (edges and corners), and later layers successively detect higher level features (car, person, sky).

我们都知道,普通的标准CNN是底层检测低级的特征(如边缘、转角,就是视野很窄,只能看到局部),到了后面高层就可以检测更大的特征了(如车,人,天空,可见这时候视野已经比较大了),但是细小的东西就看不见了,所以这时候有了FPN。

补充:

前面说的CNN其实就是下图中左侧那一组,最下面橙色框框里是一个输入图片,越往上层,视野越大,但是由于卷积和池化,图片的尺寸实际是越来越小的,所以上面用越来越小的方块代表没一层的输出,整体看起来,就像是金字塔一样,这就是Pyramid这个词的来源了。

那FPN就是在原来CNN一个金字塔旁边又增加了一个金字塔,所以我总感觉这个算法应该叫Double Pyramid balabala。。。


FPN improves the standard feature extraction pyramid by adding a second pyramid that takes the high level features from the first pyramid and passes them down to lower layers. By doing so, it allows features at every level to have access to both, lower and higher level features.

FPN增加一个金字塔是要干什么那?实际是想要在大视野的时候还能看见小东西。所以,如果把前一个金字塔中大视野特征(如左侧金字塔最高层特征)拿到后一个金字塔的底层中,这样就可以在小视野中也能看见大视野中的图像了。这类似于井底之蛙看不见外面的大好景色,但是你可以录视频拿到井底放给他看,他就一样能知道外面的世界有什么了。这里有个好玩的事情,就是能不能掉过来那,就是相当于把底层特征(小视野特征)引入大视野中,还有待考察。


编程提示

Code Tip:

 The FPN is created in MaskRCNN.build(). The section after building the ResNet. 

编程的时候直接用这个函数就行了,MaskRCNN.build()

RPN introduces additional complexity: rather than a single backbone feature map in the standard backbone (i.e. the top layer of the first pyramid), in FPN there is a feature map at each level of the second pyramid. We pick which to use dynamically depending on the size of the object. I’ll continue to refer to the backbone feature map as if it’s one feature map, but keep in mind that when using FPN, we’re actually picking one out of several at runtime.

RPN的编程相对有一点复杂,原因如下:

原始CNN中只有一个最高层的特征作为最后输出预测。但是RPN中添加了第二个金字塔,并且每一层都获取第一个金字塔里更高层的特征同时输出一个预测结果(图中的predict)。因此,实际我们可以拿来用的预测输出有好多个(第二个金字塔有几层就有几个可用输出),但是最终我们会在众多的predict输出中,根据检测对象的大小选择使用哪一个,并且随着检测对象大小的不同,最终选的predict也会动态变化。总之,我们输出一堆,可是每次只用一个哦。

猜你喜欢

转载自blog.csdn.net/o0haidee0o/article/details/80833741