我随机抽取了一个内核,并将其应用于具有padding ='valid',stride =(1,1)的图像,内核的大小=(3,3)。
这是正常的图像:
这是应用滤镜后的图像:
然后我将原始图像旋转了90度,然后更改为:
然后,我在旋转后的图像上应用了相同的滤镜,并将其作为输出:
然后旋转此输出图像,以使其旋转与先前的特征图相同。旋转此旋转特征图并将其与以前的特征图进行比较之后,我注意到它们并不相同。
这是两个特征图的图像:
As you can see, they both are clearly not the same.
This means that feature maps changes as the location of features in the input image changes.
But why does this happen? Eg: lets say we have a kernel that detects 'eye', after training the kernel on images of 'eye' present at the center of the image, we give it an image, where this time, the 'eye' is present at top-left of the image. It would still do a good job, because it would search the eye on every (5,5) part of the image (assuming the kernel is of size (5, 5)), so it shouldn't matter where the feature is present in the image.
So, why did the feature map when we changed the location of features in the input image, in the example of '5'?
您有2个不同的要素图,因为当您将原始图像旋转90度时,不再以相同的方式应用内核。这是一个示范:
假设这是您的图片:
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
这是您的2 x 2内核:
1 2
3 4
如果将此滤镜应用到图像的2 * 2凝视部分,则会得到以下值:
(1*1) + (2*2) + (1*3) + (2*4)
= 16
将图像旋转90度时,它变为:
5 5 5 5 5
4 4 4 4 4
3 3 3 3 3
2 2 2 2 2
1 1 1 1 1
现在,在该图像上应用相同的内核,但是由于滤镜图将再次旋转,因此我们将在旋转图像的左下角计算滤镜图的卷积。(很难理解为什么我们在旋转图像的左下角应用滤镜。)
(2*1) + (2*2) + (1*3) + (1*4)
= 13
由于13和16不相等,因此您获得了不同的特征图。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句