Convolution Output Size Calculator
Convolution Output Size Calculator
Designing a CNN architecture requires knowing exactly how spatial dimensions shrink or stay the same after each convolutional layer - this calculator applies the standard formula.
Output Size = floor((Input Size - Kernel Size + 2 x Padding) / Stride) + 1
Example
224x224 input, 3x3 kernel, stride 1, padding 1 (a very common "same padding" configuration):
Output Size = floor((224 - 3 + 2) / 1) + 1 = 224 x 224 (unchanged spatial size)
Why "Same" Padding Is So Common
Choosing padding specifically to keep output size equal to input size ("same" padding) is a common design choice that avoids the need to manually track feature map shrinkage across many stacked convolutional layers - without it, deep networks with many layers can shrink feature maps down to nothing before reaching the final layers.
A Common Design Pitfall
Stacking layers with incompatible kernel/stride/padding combinations can shrink a feature map to zero or negative size, which causes an immediate runtime error when actually building the model - this calculator lets you verify a layer configuration works before writing any code.