CNN Computational Cost Calculator

Estimate every CNN layer’s parameters, MACs, FLOPs, memory, latency, throughput, and training cost while comparing architectures, precision choices, and hardware assumptions clearly and accurately.

Calculated results

CNN cost summary

Layer-by-layer analysis
#LayerTypeInputOutputParametersMACsFLOPsActivationCompute share
Compute distribution

The chart uses each enabled layer’s FLOP estimate.

Bottlenecks and observations
Comparison workspace

Store two result snapshots, then compare their costs.

No comparison snapshots saved.
Complete calculation report

    
Model setup

Input, workload, precision, and counting rules

Training memory

Optimizer and memory assumptions

Includes forward and estimated backward work.
Approximates temporary convolution workspace.
Hardware model

Latency, throughput, and bandwidth estimates

TFLOPS
%
GB/s
%
ms
Runtime values are theoretical estimates. Real kernels, data movement, compilation, and scheduling can change performance.
Architecture builder

Create, load, reorder, and inspect layers

0 layers
Formula used

Core CNN cost equations

A convolution output follows the standard discrete shape equation. Dilation expands the effective kernel without adding weights. Grouping reduces connected input channels per filter.

Hout = floor((Hin + Ptop + Pbottom − Dh(Kh − 1) − 1) / Sh + 1)
Wout = floor((Win + Pleft + Pright − Dw(Kw − 1) − 1) / Sw + 1)
MACs = Hout × Wout × Cout × (Cin / Groups) × Kh × Kw
Parameters = Kh × Kw × (Cin / Groups) × Cout + Biases
How to use

Build and analyse a CNN

  1. Enter the input tensor, precision, batch, and workload.
  2. Choose hardware assumptions for theoretical runtime estimates.
  3. Load a preset or build layers manually.
  4. Check every layer’s dimensions and grouping values.
  5. Select the FLOP convention used by your reference.
  6. Calculate, inspect bottlenecks, compare snapshots, and export results.
Example data

Small classifier example

LayerInputConfigurationExpected output
Conv 132 × 32 × 316 filters, 3 × 3, stride 1, same32 × 32 × 16
Max pool32 × 32 × 162 × 2, stride 216 × 16 × 16
Conv 216 × 16 × 1632 filters, 3 × 3, stride 1, same16 × 16 × 32
Global average16 × 16 × 32Average each feature map1 × 1 × 32
Dense32 features10 outputs10 features
Frequently asked questions

CNN computational cost questions

What is a MAC?

A MAC combines one multiplication and one accumulation. Some references count it as one FLOP. Others count it as two FLOPs.

Why do FLOP totals differ between tools?

Tools may use different MAC conventions. They may include activations, bias, normalization, or pooling. Always compare matching assumptions.

Does parameter count predict runtime?

Not reliably. Activation sizes and data movement also matter. Hardware kernels can favour specific layer shapes.

How is grouped convolution handled?

Each filter sees fewer input channels. Input channels must divide evenly by groups. Output channels must also divide evenly.

How is depthwise convolution calculated?

The group count equals input channels. Each channel receives separate spatial filters. Pointwise mixing is counted separately when selected.

Is training memory exact?

No. Framework workspaces and saved tensors vary. The estimate exposes adjustable memory multipliers.

Why can bandwidth limit latency?

Low arithmetic intensity moves many bytes per operation. Compute units then wait for memory transfers. The calculator reports both limits.

Can this replace hardware benchmarking?

No. It provides transparent theoretical estimates. Benchmark the final exported model on target hardware.

What does activation checkpointing change?

It stores fewer forward activations during training. Backward computation may increase through recomputation. This tool adjusts stored activation memory.

Related Calculators

Convolution Output Size CalculatorCNN Filter Size CalculatorCNN Padding CalculatorCNN Stride CalculatorCNN Receptive Field CalculatorPooling Output Size CalculatorCNN Parameter Count CalculatorImage Tensor Size 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.