3.4.5 · D2Convolutional Neural Networks

Visual walkthrough — CNN architecture design

1,985 words9 min readBack to topic

Before we start, three words we will earn with pictures, not assume:

  • Convolution — sliding a small window (a "kernel") across a grid and computing one number per position. Built in the convolution operation note; here we only need the sliding window picture.
  • Kernel size — the width (and height) of that window. A kernel is a -wide square.
  • Receptive field () — for one neuron deep in the network, the number of original input pixels that can influence its value.

Step 1 — What can a single output neuron "see"?

WHAT. We place one kernel on the input and produce one output number.

WHY. Before we stack anything, we must nail the base case: a single convolution. Everything deeper is just this, repeated. If we get the base case wrong, every later count is wrong.

PICTURE. In the figure, the input is the peach grid. The magenta square is the kernel. Every input pixel under the square feeds into the one violet output neuron. Count them: a window covers pixels across. So this neuron's receptive field is wide.

Figure — CNN architecture design

Step 2 — Stack a second conv: overlap, don't add

WHAT. We feed the output grid of layer 1 into a second conv, and ask: how many original input pixels does one layer-2 neuron see?

WHY. The tempting wrong answer is "." That double-counts the pixels shared between neighbouring windows. We need to see the overlap to get the true count.

PICTURE. One layer-2 neuron (orange) reads neighbouring layer-1 neurons. But those layer-1 neurons come from overlapping input windows — they share pixels in the middle. Slide your eye along the input: neuron A covers pixels 1–3, neuron B covers 2–4, neuron C covers 3–5. Total distinct pixels = 1 through 5 = 5, not 6.

Figure — CNN architecture design

Step 3 — The recurrence: how RF grows per layer

WHAT. We turn the Step-2 observation into a rule you can apply layer after layer.

WHY. A single formula beats re-drawing overlaps forever. We want a machine we can crank times.

PICTURE. The figure shows three stacked layers as three coloured bands. Each arrow up adds a "reach" on each side. The receptive field is the widening cone at the bottom.

Figure — CNN architecture design

Check against Steps 1–2: . Then . ✅ Matches the picture.


Step 4 — Close the recurrence into

WHAT. We unroll the recurrence for layers of convs and get a closed formula.

WHY. Architects don't want to iterate by hand; they want "how deep for RF = X?" in one line. This is the exact result the parent note stated.

PICTURE. The figure stacks the increments as a staircase: start at (a lone pixel), climb per layer, land at the top. The height of the staircase is the formula.

Figure — CNN architecture design

Start from the recurrence with (so ):

Unrolling: each of the layers contributes , but layer 1 already gave us . Group it as one seed pixel plus steps of :


Step 5 — The pooling case (the big jumps)

WHAT. We add pooling to the picture: it halves spatial size, which multiplies how far each later pixel reaches back.

WHY. Convolutions grow slowly ( each). To see a whole object in a image, that's too slow. Pooling gives the big leaps. Architects mix both; we must show both.

PICTURE. Below the conv, a pool merges 2 input columns into 1 output column. Now every pixel above the pool, when it reaches back "one step," lands on two input pixels. The reach scale doubles.

Figure — CNN architecture design

Step 6 — The stride case (jumps with a cost)

WHAT. We show stride: instead of sliding the kernel one pixel at a time, jump pixels.

WHY. Stride is the other way to grow fast (parent Principle 1). But it skips pixels, so it loses information — we must show why and when it's risky.

PICTURE. Left panel: stride-1, windows touch every pixel. Right panel: stride-2, windows leap over pixels (the greyed-out gaps are never sampled by this layer). The reach multiplies by , but the pale gaps are the lost information.

Figure — CNN architecture design

Step 7 — Degenerate & edge cases (never leave the reader stranded)

WHAT. We test the formula at its boundaries.

WHY. The contract: cover every degenerate input. A formula you only trust in the "nice" middle is a bug waiting to happen.

PICTURE. Four mini-panels: (a) , (b) , (c) huge , (d) conv.

Figure — CNN architecture design

The one-picture summary

Figure — CNN architecture design

The figure compresses the whole derivation: a seed pixel at the bottom, conv layers each widening the cone by , a pooling layer that doubles the cone's spread, and the final neuron at the top whose cone width is the receptive field. Three growth engines — conv (), pool (), stride () — and one seed.

Recall Feynman retelling — say it back in plain words

Imagine one deep neuron and ask: which original pixels could I nudge to change this neuron? Start with a single conv window — it sees pixels across. Stack another conv on top: it doesn't see pixels, because neighbouring windows overlap by one column, so each new layer only reaches out by more pixels. Do that times starting from one seed pixel and you get , which for kernels is . That growth is slow and linear, so to see a whole object we add pooling (which halves the grid, so every later reach counts double: ) or stride (jump pixels: , but you skip information). Sanity checks: no layers → you see just yourself (); convs → never grows (they only mix channels); overcounting by multiplying is the classic mistake. That's the entire logic behind why VGG stacks tiny kernels, why every architecture pools, and why bottlenecks are "free" context-wise.

Recall Quick self-test

One 5×5 conv vs two stacked 3×3 convs — same receptive field? ::: Yes, both give ; the two 3×3s use fewer params and add an extra nonlinearity. After stacked convs, what is ? ::: . Why does a conv not grow the receptive field? ::: Because , so it adds reach per layer — it only mixes channels. Why does pooling grow faster than stacking convs? ::: Pooling multiplies the reach ( for ) while convs only add ; multiply beats add.


Related: ↑ Parent: CNN architecture design · deeper kernels feed transfer learning, and receptive-field budgeting interacts with hyperparameter tuning and model compression.