What is the difference between valid padding and same padding in a stride-1 convolution?
Deep learning, Convolutional networks
Level L1 Beginner. Length One-liner. Nature Th Theoretical.
What's being asked
Whether you can state precisely how valid and same padding treat input borders and change the output spatial size.
Key idea
Valid padding adds no zeros (), so a filter shrinks an input to ; same padding adds enough border zeros on each side, for odd kernel size , so the output keeps the input size at stride .
Steps
- State valid padding: no zero padding (), which only places the filter where it fits completely inside the input, giving output size .
- State same padding: pad each side with zeros (for odd kernel size ) so the output height and width stay equal to when stride .
- Add one practical reason for same padding: without it, feature maps shrink every layer and border pixels are visited far less often than centre pixels.
Common mistakes
- Assuming same padding preserves spatial size when stride ; with stride , output size shrinks to .
- Confusing the total padding added across both borders () with the padding on each side ().
How long your answer should be
One or two sentences.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: What is a "dead" ReLU unit?
Next in Deep learning: When adapting a pretrained image classifier to a new dataset, when should you freeze the backbone and train only a new head versus fine-tuning the whole network?