CNN Filter Size Calculator

Explore CNN kernel choices, output shapes, padding, receptive fields, parameters, memory, MACs, and FLOPs across standard, grouped, depthwise, and pointwise convolution layers instantly online.

Calculator Inputs


Filter Configuration


CNN Layer Stack

Add up to thirty convolution layers. The calculator tracks output shapes, receptive fields, parameters, and cost.


Live Layer Preview

LayerInputOutputParametersMACsStatus

Formula Used

The output dimension uses the padded input, effective kernel, and stride. Dilation expands a kernel without adding weights. Flooring applies when dimensions do not divide evenly.

Output = floor((Input + PaddingBefore + PaddingAfter - EffectiveKernel) / Stride) + 1
EffectiveKernel = Dilation × (Kernel - 1) + 1
Parameters = KernelHeight × KernelWidth × InputChannels × OutputChannels / Groups + Biases
MACs = OutputHeight × OutputWidth × OutputChannels × Batch × KernelHeight × KernelWidth × InputChannels / Groups
FLOPs ≈ 2 × MACs

How to Use

  1. Enter the input tensor width, height, channels, and batch size.
  2. Select a filter size, stride, dilation, padding, and convolution type.
  3. Choose output, filter, or padding calculation mode.
  4. Add optional layers for cumulative network analysis.
  5. Submit the form, then copy or export results.

Example Data

ScenarioInputFilterStridePaddingOutput
Common feature extractor224 × 224 × 33 × 3, 64 filters1Same224 × 224 × 64
Spatial downsampling224 × 224 × 643 × 3, 128 filters2Same112 × 112 × 128
Channel projection56 × 56 × 2561 × 1, 64 filters1Valid56 × 56 × 64

Calculation History

No saved calculations yet.
TimeInputFilterOutputParametersMACs

Frequently Asked Questions

What is a CNN filter?

A CNN filter is a small trainable weight grid. It slides across an input tensor. The operation detects useful local patterns.

How does filter size affect learning?

Larger filters observe more spatial context directly. Smaller filters usually need fewer parameters. Stacked small filters can build wider receptive fields.

What does same padding mean?

Same padding targets an output near input size. Stride one usually preserves spatial dimensions. Some even kernels need asymmetric padding.

Why does the calculator floor dimensions?

Convolution output formulas commonly use floor division. Fractional positions cannot form complete output cells. The calculator warns when truncation occurs.

What is an effective filter size?

Dilation inserts spaces between kernel elements. The weight count remains unchanged. The effective spatial reach becomes larger.

How are grouped parameters calculated?

Grouped convolution splits channels into independent groups. Each group processes fewer input channels. Parameter and compute counts fall accordingly.

What is depthwise convolution?

Depthwise convolution processes each input channel separately. A multiplier may create several outputs per channel. It is usually computationally efficient.

What is pointwise convolution?

Pointwise convolution normally uses a one-by-one kernel. It mixes information across channels. Spatial width and height usually remain unchanged.

Are MACs and FLOPs identical?

A MAC contains one multiplication and accumulation. FLOP conventions vary between tools. This calculator estimates two FLOPs per MAC.

Related Calculators

Convolution Output Size CalculatorCNN Padding CalculatorCNN Stride CalculatorCNN Receptive Field CalculatorPooling Output Size CalculatorCNN Parameter Count CalculatorImage Tensor Size CalculatorCNN Computational Cost Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.