Machine Learning Basics
A 28×28 single-channel image is convolved with a 5×5 filter (stride 1, no padding), followed by 2×2 max pooling (stride 2). What are the height and width of the output?
- A12×12
- B14×14
- C24×24
Show answer and explanation
Answer: A. 12×12
The output size of a convolution is (N + 2P − F) ÷ S + 1, where N is the input size, F the filter size, P the padding and S the stride. (28 + 0 − 5) ÷ 1 + 1 = 24, so the output after convolution is 24×24. 2×2 max pooling with stride 2 keeps one maximum for each 2×2 region, halving the height and width to 12×12. Pooling has no trainable parameters; it shrinks the data to reduce computation and makes the network less sensitive to small shifts in position.
- A. Correct. Convolution gives 24×24 and pooling gives 12×12.
- B. This skips the convolution and applies pooling directly to the 28×28 image.
- C. This is the size after convolution, without pooling.