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? enter image description here


1 Answer 1


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$
    – Catacroker
    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$
    – noe
    Jun 30 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.