NicheCalcs

Conv2D Output Size Calculator

Use this calculator to compute the output height and width of a Conv2D (2D convolutional) layer in a convolutional neural network, using standard deep learning formulas.

Share on Reddit

What this calculator is doing

This calculator uses the standard Conv2D output size formula: \[ \text{Output Dimension} = \left\lfloor \frac{\text{Input Dimension} + 2 \times \text{Padding} - \text{Dilation} \times (\text{Kernel Size} - 1) - 1}{\text{Stride}} \right\rfloor + 1 \] It applies the formula separately for height and width: \[ \text{Output Height} = \left\lfloor \frac{H_{\text{in}} + 2P_h - D_h \times (K_h - 1) - 1}{S_h} \right\rfloor + 1 \] \[ \text{Output Width} = \left\lfloor \frac{W_{\text{in}} + 2P_w - D_w \times (K_w - 1) - 1}{S_w} \right\rfloor + 1 \] Where:
- \( H_{\text{in}} \), \( W_{\text{in}} \): Input dimensions
- \( K_h \), \( K_w \): Kernel dimensions
- \( P_h \), \( P_w \): Padding
- \( S_h \), \( S_w \): Stride
- \( D_h \), \( D_w \): Dilation (optional, default = 1)

This is critical when building CNN architectures to ensure the correct output shape flows through your model layers.

Disclaimer: These calculators are provided for informational purposes only. Always verify your designs against relevant engineering standards and consult a qualified professional. We do not take responsibility for any errors or damages resulting from the use of these calculations.