CNN Convolution Output Size Calculator
Compute the spatial output size, receptive field and per-pixel FLOPs of a 2D convolution from input size, kernel, stride and padding.
How to Use the CNN Convolution Output Size Calculator
- Enter input spatial size.
- Enter kernel size, stride and padding.
- Click Calculate to see output size and receptive field.
Cas d'utilisation
- •Hand-sizing a CNN for an embedded device.
- •Debugging shape mismatches in PyTorch.
- •Teaching convolution fundamentals.
Formule
Output = ⌊(input + 2 × padding − kernel) / stride⌋ + 1. Receptive field for one layer equals the kernel size.
Questions fréquemment posées
What is "same" padding?
Padding that keeps the output size equal to the input size. For a kernel k and stride 1 the required padding is ⌊k/2⌋.
Why does the output have to be integer?
Fractional outputs indicate mis-matched padding. Most frameworks floor the result, losing the right/bottom pixel row — which is why asymmetric padding is sometimes used.
Does this include bias and channels?
No. Multiply params and FLOPs by input × output channels to get layer totals, and add one bias term per output channel.