从图像中减去平均值

2024-04-27 03:53:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在和西亚诺一起实施CNN。在报纸上,我必须在训练CNN之前做这个图像预处理

We extracted RGB patches of 61x61 dimensions associated with each poselet activation, subtracted the mean and used this data to train the convnet model shown in Table 1

你能告诉我“减去平均数”是什么意思吗?告诉我这些步骤是否正确(这是我所理解的) 1) 计算整个图像的红色通道、绿色通道和蓝色通道的平均值 2) 对于每个像素,从红色值中减去红色通道的平均值,从绿色值中减去绿色通道的平均值,蓝色通道的平均值相同 3) 负数正确吗?还是我用了腹肌?

谢谢大家!!


Tags: ofthe图像rgbcnn蓝色平均值dimensions
2条回答

我假设本文中提到的平均值是训练集中使用的所有图像的平均值(分别为每个通道计算)。

几种迹象:

这当然只是间接证据,因为我不能解释为什么会发生这种事。事实上,我在试图弄清楚这一点的时候,偶然发现了这个问题。

//编辑:

与此同时,我发现一张source确认我的索赔单(我加上了突出显示):

There are three common forms of data preprocessing a data matrix X [...]

Mean subtraction is the most common form of preprocessing. It involves subtracting the mean across every individual feature in the data, and has the geometric interpretation of centering the cloud of data around the origin along every dimension. In numpy, this operation would be implemented as: X -= np.mean(X, axis = 0). With images specifically, for convenience it can be common to subtract a single value from all pixels (e.g. X -= np.mean(X)), or to do so separately across the three color channels.

如我们所见,用整个数据来计算平均值。

你应该仔细阅读论文,但最有可能的是它们的意思是补片的平均值,所以你有N矩阵61x61像素,这相当于长度向量61^2(如果有三个通道,那么3*61^2)。他们所做的-他们简单地计算每个维度的平均值,所以他们计算这些向量相对于每个维度的平均值。结果他们得到了一个长度为3*61^2(或平均矩阵/平均斑块平均向量如果你愿意的话),并且他们从所有这些N斑块中减去它。生成的面片会有负值,这是非常好的,你不应该取abs值,神经网络更喜欢这种数据。

相关问题 更多 >