首页 > 解决方案 > 卷积神经网络的特征图和参数总数

问题描述

假设我有一个尺寸为 125 * 125 的RGB图像,并且我使用了 10 个尺寸为 5 * 5 且步幅 = 3 的过滤器,那么这一层的特征图是什么?我猜测特征图的参数总数是多少
:10*((125-5)/3)+1 = (41 * 41 * 10)(no of filters) 但是 RGB 图像或灰度图像有什么区别图像,所以对于 RGB 图像,它应该是 41 * 41 * 30 (过滤器数量 * 输入图像的通道数量)?对于参数总数:5 * 5 * 3 * 10=750 ?

标签: machine-learningdeep-learningneural-networkconv-neural-network

解决方案


注意:关于 CNN 如何在 Data Science Stack Exchange 上工作的直觉,我有一篇广受欢迎的文章。也请检查一下。

您对特征图的形状是正确的,具有给定的步幅。

CNN 中的参数总数由下式给出 -

Params = (n*m*l+1)*k

where, l = number of input feature maps / image channels, 
       k = number of output feature maps / # of filters, 
       n*m = filter dimensions

Important! - The +1 in the formula is because each of the output feature
maps have a bias term added, which is also a trainable parameter. So, don't
forget to add that!

因此,对于您的情况,可训练参数的数量:((5*5*3+1)*10) = 760

而且,对于灰度,它是:((5*5*1+1)*10) = 260


我发现一个非常好的可视化可以直观地显示过滤器如何创建特征图。

在此处输入图像描述

如果它是第input feature maps一个 CNN 层,则与输入图像的通道数相同。由于 CNN 通常是堆叠的,因此将先前 CNN 的输出通道调用input feature maps到当前 CNN 层。

在此处输入图像描述


推荐阅读