全局平均池化(global-average-pooling)

全局平均池化在很多视觉任务中会用到。之前对darknet-53结构分析的时候,特别留意了一下全局平局池化。

其实,这个操作就是它的字面意思:把特征图全局平均一下输出一个值,也就是把W*H*D的一个张量变成1*1*D的张量。下列引用来自stackoverflow:

With Global pooling reduces the dimensionality from 3D to 1D. Therefore Global pooling outputs 1 response for every feature map. This can be the maximum or the average or whatever other pooling operation you use.

It is often used at the end of the backend of a convolutional neural network to get a shape that works with dense layers. Therefore no flatten has to be applied.

可以看darknet-53的例子:

看到Darknet-53在平均池化前的张量输出是8x8x1024,对每个8x8的特征图做一个平均池化(取一个平均数),就可以得到1024个标量了,然后在进入一个1000结点的全连接层,最后通过softmax输出。这就是一个分类网络的主干了。

参考:https://stackoverflow.com/questions/42070528/what-does-global-pooling-do

参考:https://blog.csdn.net/JNingWei/article/details/80064451

猜你喜欢

转载自blog.csdn.net/leviopku/article/details/82805368