Tools ▸ Calculator
Receptive field calculator.
List your network's convolution and pooling layers. For every layer you get the output size and how much of the input one unit can see.
The 13 convolutions and 5 poolings, without the dense layers at the end.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
RECEPTIVE FIELD
212×212 PX
OUTPUT 7×7 · JUMP 32 PX
| # | Layer | Out | Field | Jump | Start |
|---|---|---|---|---|---|
| 0 | INPUT | 224 | 1 | 1 | 0 |
| 1 | CONV 3×3 P1 | 224 | 3 | 1 | 0 |
| 2 | CONV 3×3 P1 | 224 | 5 | 1 | 0 |
| 3 | POOL 2×2 /2 | 112 | 6 | 2 | 0.5 |
| 4 | CONV 3×3 P1 | 112 | 10 | 2 | 0.5 |
| 5 | CONV 3×3 P1 | 112 | 14 | 2 | 0.5 |
| 6 | POOL 2×2 /2 | 56 | 16 | 4 | 1.5 |
| 7 | CONV 3×3 P1 | 56 | 24 | 4 | 1.5 |
| 8 | CONV 3×3 P1 | 56 | 32 | 4 | 1.5 |
| 9 | CONV 3×3 P1 | 56 | 40 | 4 | 1.5 |
| 10 | POOL 2×2 /2 | 28 | 44 | 8 | 3.5 |
| 11 | CONV 3×3 P1 | 28 | 60 | 8 | 3.5 |
| 12 | CONV 3×3 P1 | 28 | 76 | 8 | 3.5 |
| 13 | CONV 3×3 P1 | 28 | 92 | 8 | 3.5 |
| 14 | POOL 2×2 /2 | 14 | 100 | 16 | 7.5 |
| 15 | CONV 3×3 P1 | 14 | 132 | 16 | 7.5 |
| 16 | CONV 3×3 P1 | 14 | 164 | 16 | 7.5 |
| 17 | CONV 3×3 P1 | 14 | 196 | 16 | 7.5 |
| 18 | POOL 2×2 /2 | 7 | 212 | 32 | 15.5 |
What the columns mean
- Field is the receptive field: how many input pixels, along one side, can affect one unit of that layer's output. A field of 212 means each unit depends on a 212×212 square of the input.
- Jump is how far apart, in input pixels, the fields of two neighboring units are. It's the product of every stride so far.
- Start is the input coordinate at the center of the first unit's field. It's negative when that center sits in the padding.
- Out is the output map's width and height.
The formulas
Each layer has a kernel size k, stride s, padding p and dilation d. Starting from field 1, jump 1 and start 0 at the input:
span = d × (k − 1) + 1
out = ⌊(n + 2p − span) / s⌋ + 1
field = field_prev + (span − 1) × jump_prev
jump = jump_prev × s
start = start_prev + ((span − 1) / 2 − p) × jump_prevThe field grows by the kernel's span, measured in the previous layer's jumps. That's why a 3×3 convolution late in a network widens the field far more than one at the start: by then every step it takes covers many input pixels.
What it doesn't tell you
- The field is the largest region that can affect a unit. In a trained network, pixels near the center of the field usually matter much more than those at its edge, so the region that matters in practice is smaller (Luo et al., 2016).
- Channels don't change the field. Neither do 1×1 convolutions, activations or normalization layers, so you can leave them out.
- For networks with branches, enter the longest path. In a ResNet, the shortcuts have smaller fields than the main path, so the main path sets the answer.
- Layers are square. For a non-square kernel or stride, run each axis separately.
Learn where this comes from
Chapter 6 of the book builds the receptive field up one layer at a time, with a stack of maps you can turn and trace: one layer, stacking layers and stride and pooling. For stride, padding and dilation themselves, start with chapter 3.