CNN Convolutional Layer Operations 2 — Questions and Answers
Question 1: What happens to spatial dimensions when a 5×5 filter is applied with stride=2 and no padding to a 32×32 input?
- 14×14 (Correct answer)
- 16×16
- 28×28
- 15×15
Correct answer: 14×14
Output size = floor((32 - 5) / 2) + 1 = floor(13.5) + 1 = 14, giving 14×14.
Question 2: In a convolutional layer, what does 'same' padding ensure?
- Output spatial size equals input spatial size (Correct answer)
- All padding values are the same number
- The filter size matches the input size
- Stride is always 1
Correct answer: Output spatial size equals input spatial size
'Same' padding adds zeros around the input so the output height and width match the input when stride=1.
Question 3: Which operation sums element-wise products between a filter and a receptive field in a CNN?
- Cross-correlation (Correct answer)
- Matrix multiplication
- Dot product of flattened tensors
- Convolution without flipping
Correct answer: Cross-correlation
Cross-correlation (often loosely called convolution in deep learning) computes the sum of element-wise products without flipping the filter.
Question 4: A convolutional layer has 64 filters of size 3×3 applied to a 3-channel input. How many learnable parameters does it have (excluding bias)?
- 1728 (Correct answer)
- 576
- 192
- 9216
Correct answer: 1728
Parameters = filters × kernel_h × kernel_w × input_channels = 64 × 3 × 3 × 3 = 1728.
Question 5: What is the primary purpose of using multiple filters in a single convolutional layer?
- To detect multiple distinct features simultaneously (Correct answer)
- To reduce the number of parameters
- To increase the stride
- To eliminate the need for activation functions
Correct answer: To detect multiple distinct features simultaneously
Each filter learns to detect a different feature (e.g., edge, texture), producing one feature map per filter.
Question 6: When stride > 1 is used in a convolutional layer, what is the primary effect?
- Spatial downsampling of the feature map (Correct answer)
- Spatial upsampling of the feature map
- Increased number of parameters
- Wider receptive field per filter step
Correct answer: Spatial downsampling of the feature map
A larger stride causes the filter to skip positions, reducing the output spatial dimensions (downsampling).
Question 7: Which quantity represents the number of output feature maps produced by a convolutional layer?
- Number of filters (Correct answer)
- Filter spatial size
- Input channel count
- Stride value
Correct answer: Number of filters
Each filter produces exactly one output feature map, so the number of output channels equals the number of filters.
What happens to spatial dimensions when a 5×5 filter is applied with stride=2 and no padding to a 32×32 input?