In the image you can see the input and output dimensions in the second layer of a CNN. If the input of the convolution is 32 arrays of size 14x14 and we apply 64 kernels to it, shouldn't we get as output 64*32 arrays of size 14x14?
1 Answer
Each of the 64 kernels of the convolutional layer has dimensions $3 \times 3 \times 32$. When applying 1 single kernel over the input matrix of dimensions $14 \times 14 \times 32$, the kernel "convers" the whole depth of the input, and the resulting output has depth 1. This is an animation of how a single kernel is applied in a 2D convolution when the input has 3 channels:

The output of applying the 64 kernels, is like stacking the outputs of applying each of the 64 kernels, therefore, the output has a depth of 64.
-
$\begingroup$ I think I just don't understand it well. How do you get dimension 1 in the output? Summing up the result of all the convolutions with each kernel? $\endgroup$ Jun 30 at 15:21
-
$\begingroup$ I added an animation of how a single kernel is applied: the kernel slides through the input matrix and, for each position, the kernel is multiplied element-wise with the overlapping part, and the results of the multiplications are added together into a single value. After sliding the kernel through the whole, we obtain a new matrix of depth 1. $\endgroup$– noeJun 30 at 15:32