A CNN as a stack of layers

Follow an MNIST-style digit through convolution, ReLU, a second filter bank, and scores for digits 0–9. Hover a layer to see that step in detail.

Artificial intelligence HL · Intermediate+ CNN · Layers · MNIST ~12 min
The idea

Same network shape, image-shaped layers

A convolutional neural network (CNN) is still a network: an input, hidden layers, and an output. For digits, the output is ten scores — one for each class 0 through 9.

The hidden layers here are not a single row of neurons. A convolution slides a small filter across the image and writes a feature map. ReLU then turns negative values to zero. A later convolution can combine simpler features (edges) into richer ones (corners). The last stage turns those maps into digit scores.

TipHover or focus a layer to open its detail panel. On Conv 1 you will see one window’s products, sum, and bias — the same idea as a neuron, but shared across the whole image.
Go deeper

This page uses 7×7 patches inspired by MNIST (normally 28×28). The filter weights are teaching examples; a real CNN usually learns them during training. The output scores are a fixed teaching classifier so you can see which digit wins for each preset.

DataMNIST-style input
network.txtLayers
input      7 × 7 patch (digit 0–9 shape)
conv 1     3 × 3 vertical / horizontal edges
ReLU       keep positives only
conv 2     combine edges → corner-like map
dense      flatten features → scores
output     classes 0 … 9

Start with digit 1. Open Conv 1 and step the sliding window.

Interactive

The network

Choose a digit patch, then hover layers from left to right. The output column shows which digit scores highest.

Input · hidden layers · digits 0–9network
Input
Conv 1
Window
Hover or Tab a layer for its detail · ←/→ step the Conv 1 window · Esc close · R reset
Remember

Three CNN ideas

Layers, shared filters, and digit scores.

Shape

Still a network

Input feeds hidden layers; the output is one score per digit from 0 to 9.

Reuse

Shared filter

One 3×3 filter slides everywhere. Hover Conv 1 to watch a single window’s arithmetic.

Stack

Later layers combine

Conv 2 mixes edge maps. The dense stage turns those features into class scores.