本文介绍了卷积神经网络如何处理通道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于CNN常规处理多个通道(例如RGB图像中的3个通道)的方式,我仍然进行了很多解释,但仍然不知所措.

I've looked through a lot of explanations of the way a CNN conventionally handles multiple channels (such as 3 in an RGB image) and am still at a loss.

将5x5x3滤镜(例如)应用于RGB图像的块时,究竟发生了什么 ?实际上是每个通道分别发生3个不同的2D卷积(具有独立的权重)吗?然后将结果简单地加在一起以产生最终的输出以传递到下一层?还是真正的3D卷积?

When a 5x5x3 filter (say) is applied to a patch of an RGB image what exactly happens? Is it in fact 3 different 2D convolutions (with independent weights) that happen separately to each channel? And then the results get simply added together to produce the final output to pass to the next layer? Or is it a truly 3D convolution?

推荐答案

此图片来自吴安德(Andrew Ng)的deeplearning.ai课程. 6 X 6 X 3-其中3对应于3个颜色通道.6 X 6是图像的高度和宽度.对于卷积步骤,我们使用3 X 3 X 3过滤器/内核对输入图像进行卷积.输入图像和滤镜都将具有3层. (输入图像和滤镜的大部分都相同),输出为4 X 4 X 1.3 X 3 X 3为您提供27个特征/参数,您可以将它们与相应的红色,绿色和蓝色通道相乘.最后,将所有这些数字相加得到4 X 4输出图像中[0,0]的值.现在,移动输入图像的黄色立方体,并将其向右滑动1个框,到达右端后,将立方体向下滑动一排,然后继续乘法以填充4 X 4输出.建议您拿着纸和铅笔,在所有多维数据集中输入随机值以及内核,然后求解乘法.

This image is from Andrew Ng's deeplearning.ai course. 6 X 6 X 3 - where 3 corresponds to 3 color channels.6 X 6 being the height and widht of the image.For the convolution step we convolve the input image with 3 X 3 X 3 filter/kernel. The input image and filter both will have 3 layers. (Mostly both are same for input image and filter).The output will be 4 X 4 X 1.3 X 3 X 3 gives you 27 features/parameters which you multiply with the corresponding Red, Green and blue channels. Finally add up all those numbers to get the value for [0,0] in 4 X 4 output image. Now move the yellow cube of the input image and slide it over 1 box to your right and once it reaches the right end, you slide the cube one row down and continue your multiplication to fill the 4 X 4 output. Would suggest you to take a paper and pencil, fill random values in all the cubes for input as well as the kernel and solve the multiplication.

有关更多详细信息,请观看youtube上的这些讲座. https://www.youtube.com/watch?v = KTB_OFoAQcc& index = 6& list = PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF

For more details watch these lectures on youtube.https://www.youtube.com/watch?v=KTB_OFoAQcc&index=6&list=PLkDaE6sCZn6Gl29AoE31iwdVwSG-KnDzF

https://www.youtube.com/watch?v=7g8jpK4llkc& t = 1s

这篇关于卷积神经网络如何处理通道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 02:45