I'm working with a Convolutional Neural Network in Matlab, and I'm struggling to understand the output dimensionality of a convolutional layer.

The input is an image: 227 x 227 x 3 (last dimension is rgb). Filter size is 11 x 11, and there are 96 filters. Vertical and horizontal stride is 4. There is no padding.

I tried calculating the output dimensionality as follows:

output_width = (Width - FilterWidth + 2*Padding)/StrideHorizontal = (227 - 11 + 0)/4 = 55.

Now, I expected an output of 55 x 55 x 3 x 96, as there are 96 filters, but I get 55 x 55 x 96. What I don't understand is, what happened to the color dimension?


The filter dimension replaces the channels in the convolutional layer: $3$ becomes $96$ it isn't lost.

Each one of the pixels 96 in a specific location are computed as the weighted average of the $11\times11\times3$ pixels in the same region of the image.

For more details on how exactly the convolution operation is computed I'd suggest reading this. It has numerical examples later on to see exactly what's computed.

  • $\begingroup$ Oooh, it's a weighted average. Thank you! $\endgroup$
    – Inkidu616
    Aug 24 '19 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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