How much of the image one output actually sees
A single number deep in a network was computed from a patch of the original image. The size of that patch is the receptive field, and it decides what the unit can possibly detect.
- : the receptive field after layer .
- : that layer's kernel size.
- : the stride of each earlier layer.
Each layer adds its kernel size minus one, multiplied by every stride below it. The product is why a stride early in the network matters far more than a stride late.
The input pixel sees itself, and the recurrence builds from there.
Worked, on a small stack
- A 3 by 3 convolution with stride 1 gives a receptive field of 3.
- A second 3 by 3 gives 5, since the strides below it are all 1.
- A 2 by 2 pool with stride 2 gives 6, and doubles the multiplier for everything above.
- A third 3 by 3 now adds 2 rather than 2 by 1, giving 10.
- A second pool gives 12, and the multiplier becomes 4.
After five layers the field is 12 pixels wide. After a typical 50-layer network it is larger than the input, which is the intended state for a classifier.
Why 3 by 3 twice beats 5 by 5 once
The same reach costs 28 percent fewer parameters, and it passes through two nonlinearities instead of one.
That single observation is the design of VGG and of almost every convolutional network since. Large kernels went away because stacking small ones is strictly better.
Effective, not theoretical
The formula gives the patch that can influence the output. It does not say that every pixel in it matters equally.
Contributions from the centre pass through many more paths than contributions from the corners, so the actual influence falls off roughly as a Gaussian.
The effective receptive field grows only with the square root of depth, so it is substantially smaller than the theoretical one and stacking layers has diminishing reach.
When it is the bug
A model that cannot detect large objects usually has a receptive field smaller than they are, and no amount of training fixes an architecture that never sees them whole.
Dilated convolutions insert gaps in the kernel, multiplying its reach by the dilation rate without adding a single parameter.
That is how segmentation networks obtain a large field while keeping the output at full resolution, since they cannot afford to pool the detail away.