CNN Layer Visualizer

Build a stack of convolution and pooling layers and watch the output shape, the cumulative receptive field and the parameter count update as you type. Then step through max and average pooling one window at a time.

Please verify you are human to use the visualiser.

Output Shape, Downsampling and Receptive Field

Output Shape

Every conv and pooling layer applies floor((in + 2p − d(k−1) − 1) / s) + 1. Chain a few and the feature map size stops being obvious, which is where most shape mismatches come from.

Downsampling

Resolution comes down two ways: a strided convolution, which learns how to summarise, or a pooling layer, which applies a fixed rule and carries no parameters.

Receptive Field

A unit deep in the network sees a patch of the original image. If that patch is smaller than the object you are detecting, no amount of training will fix it.

Max and Average Pooling

Max pooling keeps the strongest response in each window; average pooling keeps the mean. The animation shows the window contents and which cell wins.

Shape Arithmetic in a Real Network

Most of the time spent wiring up a convolutional network goes on shapes. A stride-2 layer near the input halves the resolution for everything after it, an off-by-one in padding shifts the whole stack, and the first fully connected layer needs an exact number that depends on all of it. The table above carries the arithmetic forward layer by layer and emits the equivalent nn.Sequential, so the numbers can be checked against a real session rather than trusted.

The receptive field is the number worth watching. It tells you how much of the original image a single deep unit can see, and it is the reason architectures place their downsampling where they do. The dilated preset shows the alternative: dilation widens the field without touching the resolution, which is why segmentation networks reach for it when losing boundary detail is expensive.

To see the convolution itself rather than its shape, our 2D convolution visualiser animates a single kernel sliding across an input. For the implementation, our tutorial on Convolutional Neural Networks from Scratch builds conv2d in NumPy and checks it against PyTorch, batch normalisation from scratch covers what sits between these layers, and reading features off a trained conv layer probes the 4x4 stage of an MNIST network built exactly like the one above and finds single units carrying two digits at once, and vision transformers from scratch shows what replaces the pooling hierarchy when patches take over from convolutions.

Architecture choices of this kind are usually the cheap part. What decides whether an imaging model reaches production is how much labelled data the task needs, what accuracy is worth deploying, and who reviews the failure cases. That work sits inside our AI pilot design engagements, and for imaging under clinical governance, our medical AI consulting.

Related Tools

Stay in the loop

Get notified when new tutorials and deep-dives are published. No spam, unsubscribe anytime.

CNN Layer Visualizer FAQ

Common questions about output shape, pooling, receptive field and transposed convolution