Multi-channel convolution calculationUnderstanding multi-channel convolution calculation

Multi-channel convolution calculation

For a single-channel image, if 10 convolution kernels are used for convolution calculation, 10 feature maps can be obtained; if the input is a multi-channel image, the number of output feature maps is still the number of convolution kernels (10) . 
1. Single-channel multiple convolution kernel convolution calculation

 
The feature extraction obtained by one convolution kernel is insufficient. We can add multiple convolution kernels, such as 32 convolution kernels, so that 32 kinds of features can be learned.

2. Multi-channel and multiple convolution kernel convolution calculation 
pictures: Assume that the width of the picture is width:W, the height is height:H, and the number of channels of the picture is D. Generally, RGB three-channel D=3 is currently used, for versatility , the number of channels is represented by D; 
convolution kernel: the size of the convolution kernel is K*K. Since the processed image is of D channel, the convolution kernel is actually the size of K*K*D. Therefore, for RGB three channels Image, under the premise of specifying kernel_size, the real convolution kernel size is kernel_size*kernel_size*3. 
For each channel of the D-channel image, two-dimensional convolution is performed on each channel, and then the D channels are added to obtain the two-dimensional convolution output at that position. For the RGB three-channel image, it is On the R, G, B three channels, use the corresponding kernel_size*kernel_size kernel on each channel to deconvolve the W*H image on each channel, and then convolve the output obtained by the three channels. Add to get the two-dimensional convolution output result. Therefore, if there are M convolution kernels, M two-dimensional convolution output results can be obtained. In the case of padding, the output image size can be kept the same as the original, so it is output(W, H, M).

The following figure dynamically shows the calculation process of the three-channel image convolution layer:

The following picture is an image of 7*7*3, 3 channels, with 2 convolution kernels of 3*3*3, also known as 3*2=6 convolution kernels

There are pictures with 7*7*M channels in the tutorial , and the output channel is n, then the convolution kernel has m*n convolution kernels in total.

Original animation address:

http://cs231n.github.io/convolutional-networks/

Copyright statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission. https://blog.csdn.net/yudiemiaomiao/article/details/72466402

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325861473&siteId=291194637