# Receptive field

> The input region that can affect one unit. It grows by (k − 1) times the product of earlier strides at every layer, so strides, pooling and dilation grow it fast; but the effective field is a Gaussian-like blob much narrower than the theoretical one.

Source: https://www.mlfoundry.in/learn/receptive-field  
Section: Deep Learning › Convolutional Neural Networks  
Level: core · 11 min read · updated 2026-10-11

**Receptive field:** of a unit in a CNN is the region of the input image whose pixels can change that unit's value. For a stack of convolutions and poolings it is a square of side $r_l$ (the **theoretical** receptive field), and its centres on neighbouring units are $j_l$ pixels apart (the **jump**, or cumulative stride).

The term comes from neuroscience. Hubel and Wiesel (1959, 1962) mapped the patch of the visual field that drives a single neuron in the cat's visual cortex, and found that cells further along the pathway have larger fields and respond to more complex patterns. Fukushima's neocognitron (1980) built that layout into a network, and every CNN since has inherited it. A unit in layer 1 sees a $3\times3$ patch. A unit in the last stage of a ResNet sees, in principle, more than the whole image.

The receptive field decides what a unit **can** know. A detector whose field is smaller than the object cannot recognise the object as a whole. A segmentation network whose output units see only 100 pixels cannot use the context of a 500-pixel scene. Architecture choices such as strides, pooling, dilation and depth are, among other things, ways of growing $r$.

## The recursion

$$
r_l=r_{l-1}+(\hat k_l-1)\,j_{l-1}=r_{l-1}+(\hat k_l-1)\prod_{i=1}^{l-1}s_i,\qquad j_l=j_{l-1}\,s_l,\qquad \hat k_l=d_l(k_l-1)+1
$$

- $r_l$: receptive-field side of a unit in layer $l$, in input pixels; $r_0=1$ (a pixel sees itself)
- $j_l$: jump: input-pixel distance between neighbouring units of layer $l$; $j_0=1$. Also called the output stride
- $k_l,\ s_l,\ d_l$: kernel size, stride and dilation of layer l (pooling layers count, with their window and stride)
- $\hat k_l$: effective kernel size: a $3\times3$ kernel with dilation 2 spans 5 positions

Why it works: a layer-$l$ unit reads $\hat k_l$ units of layer $l-1$. Neighbouring units of layer $l-1$ sit $j_{l-1}$ input pixels apart, so the $\hat k_l$ of them span $(\hat k_l-1)j_{l-1}$ pixels between their centres. Each one also brings its own field of $r_{l-1}$ pixels, which adds $(r_{l-1}-1)/2$ on either side. Summing gives the recursion. Unrolled, $r_L=1+\sum_l(\hat k_l-1)\prod_{i<l}s_i$: **every layer adds $(\hat k-1)$ times the stride accumulated below it.** A $3\times3$ conv after four stride-2 layers adds 32 pixels; the same conv at the start adds 2.

Seen from the gradient, the field is the support of $\partial y/\partial x$. The value of a layer-$L$ unit $y$ depends on input pixel $x_p$ only if some chain of kernel taps connects them, and $\partial y/\partial x_p$ is a sum over those chains. Pixels outside $r_L$ have no chain and an exactly zero gradient.

**How each ingredient grows r**

- **Stride-1 conv, k×k:** adds $(k-1)j$: linear growth with depth. Ten $3\times3$ layers: $r=21$
- **Stride or pooling:** multiplies $j$ by $s$, so every **later** layer adds $s$ times more. Exponential growth if repeated
- **Dilation d:** $\hat k=d(k-1)+1$ with no extra weights and no loss of resolution. Doubling $d$ each layer gives $r=2^{L+1}-1$
- **1×1 conv:** adds nothing ($\hat k-1=0$), but a strided $1\times1$ still multiplies $j$
- **Global pooling / attention:** the whole input in one step
- **Padding:** does not change $r$; it changes where the field sits and how much of it falls outside the image

> Figure: Top: the units of every layer that feed one top unit, for a 1-D stack. Bottom: the effective receptive field, the number of paths from each input pixel to the top unit (with uniform weights this is proportional to ∂y/∂x). Six 3×3 layers give r = 13 but the ERF has σ = 2.0 px and 95% of it lies in the central 9 px (69%); at twelve layers r = 25 while the 95% window is 11 px (44%). Stride 2 on every second layer reaches r = 253 at depth 12 (jump 64), and doubling the dilation reaches r = 127 at depth 6 while the ERF still fills 86% of it. The ResNet-50 preset follows torchvision's main path: r = 427, jump 32, σ = 51 px, 95% within 199 px; in 2-D that window is 22% of the theoretical area.

## Worked example

A five-layer stack, computed with the recursion (and checked with the figure's lib)

| Layer | k | s | d | k̂ | j before | r after | j after |
| --- | --- | --- | --- | --- | --- | --- | --- |
| input |  |  |  |  |  | 1 | 1 |
| conv 3×3 | 3 | 1 | 1 | 3 | 1 | $1+2\cdot1=3$ | 1 |
| conv 3×3, stride 2 | 3 | 2 | 1 | 3 | 1 | $3+2\cdot1=5$ | 2 |
| max-pool 2×2, stride 2 | 2 | 2 | 1 | 2 | 2 | $5+1\cdot2=7$ | 4 |
| conv 3×3, dilation 2 | 3 | 1 | 2 | 5 | 4 | $7+4\cdot4=23$ | 4 |
| conv 3×3 | 3 | 1 | 1 | 3 | 4 | $23+2\cdot4=31$ | 4 |

The dilated layer contributes 16 of the 31 pixels: it has a large effective kernel and it comes after a jump of 4. The last ordinary $3\times3$ conv adds 8, four times what the first one added. The same recursion gives the well-known VGG-16 values: $r=196$ at conv5_3 and $r=212$ after the last pooling layer, with jump 32.

**Theoretical receptive field of ResNet-50 (torchvision)**

1. Stem: $7\times7$ conv with stride 2 gives $r=7$, $j=2$. The $3\times3$ max-pool with stride 2 adds $2\cdot2$: $r=11$, $j=4$.
2. Only the $3\times3$ convs grow $r$ (the $1\times1$ convs add nothing). Stage 1 has three of them at $j=4$: $r=11+3\cdot8=35$.
3. torchvision puts each stage's stride on the first $3\times3$ conv ("ResNet v1.5"). Stage 2: four $3\times3$ at $j=4,8,8,8$: $r=35+8+3\cdot16=91$, $j=8$.
4. Stage 3: six $3\times3$ at $j=8,16,\dots$: $r=91+16+5\cdot32=267$, $j=16$. Stage 4: three at $j=16,32,32$: $r=267+32+2\cdot64=427$, $j=32$.
5. So a final $7\times7$ unit has a theoretical field of **427 px** on a 224 px image. The original placement (stride on the first $1\times1$ conv, as in He et al. 2015) multiplies $j$ one layer earlier and gives 483 px. Either way, much of the field lies in the zero padding.

## The effective receptive field is much smaller

Not all pixels in the field matter equally. A central pixel reaches the top unit through many chains of taps, a pixel near the border through only a few. With uniform weights and no nonlinearity, $\partial y/\partial x_p$ is proportional to the number of chains, and that count is the convolution of every layer's tap pattern. By the central limit theorem it approaches a Gaussian.

$$
\frac{\partial y}{\partial x_p}\;\propto\;\big(u_1*u_2*\dots*u_L\big)[p]\;\approx\;\mathcal N\!\Big(0,\ \sum_{l}\sigma_l^2\Big),\qquad r\propto L,\quad \sigma_{\mathrm{ERF}}\propto\sqrt L
$$

- $u_l$: layer $l$'s taps on the input grid: $k_l$ equal weights spaced $d_lj_{l-1}$ pixels apart
- $\sigma_l^2$: variance of one layer's taps; $2/3$ for a stride-1 $3\times3$, so six layers give $\sigma=\sqrt{4}=2$
- $\sqrt L$: the ERF widens like the square root of depth while $r$ grows linearly, so the ratio shrinks like $1/\sqrt L$

Luo, Li, Urtasun and Zemel (NeurIPS 2016, "Understanding the Effective Receptive Field in Deep Convolutional Neural Networks") made this precise. They showed that the ERF is approximately Gaussian, that it occupies only a fraction of the theoretical field, and that this fraction shrinks as $O(1/\sqrt n)$ with depth $n$. Subsampling and dilated convolutions enlarge it quickly, while dropout leaves its Gaussian shape unchanged. With ReLUs it becomes less smooth but stays concentrated near the centre, and training on real data makes it grow. The figure reproduces the uniform-weight case: in 2-D the 95% window of ResNet-50's path count covers only 22% of its theoretical area.

> **What this means in practice:** Treat the theoretical $r$ as an upper bound. To give a unit real context, $r$ has to be well above the object size, because only the central part of the field carries much weight. This is one reason why segmentation models add dilated convolutions or pyramid pooling (DeepLab, PSPNet), why dilated stacks (see **Dilated convolution**) grow the dilation rate layer by layer, and why global operations such as non-local blocks and **Self-Attention** help on tasks that need scene-level context.

> **Stride buys field, but costs resolution:** Strides and pooling are the cheapest way to grow $r$, but each one also multiplies the jump: ResNet-50's last map has one unit every 32 pixels, and small objects fall between units. Dilation grows $r$ at full resolution, but stacking the same dilation leaves gaps (gridding). A stack with dilation 2 everywhere touches only every second pixel. Mix dilation rates (e.g. 1, 2, 5) or interleave ordinary convs.

```python
import torch, torch.nn as nn

def receptive_field(layers):
    """layers: list of (k, s, d). Returns [(r, j)] after each layer."""
    r, j, out = 1, 1, []
    for k, s, d in layers:
        r += d * (k - 1) * j
        j *= s
        out.append((r, j))
    return out

print(receptive_field([(3,1,1), (3,2,1), (2,2,1), (3,1,2), (3,1,1)]))
# [(3, 1), (5, 2), (7, 4), (23, 4), (31, 4)]

vgg16 = [(3,1,1)]*2 + [(2,2,1)] + [(3,1,1)]*2 + [(2,2,1)] + ([(3,1,1)]*3 + [(2,2,1)])*3
print(receptive_field(vgg16)[-1])   # (212, 32)

# Effective RF: gradient of one central output unit w.r.t. the input (Luo et al. 2016)
from torchvision.models import resnet50
body = nn.Sequential(*list(resnet50(weights=None).children())[:-2]).eval()
x = torch.randn(1, 3, 448, 448, requires_grad=True)   # not zeros: ReLU'(0) = 0
y = body(x)                               # (1, 2048, 14, 14)
y[0, :, 7, 7].sum().backward()            # one central location, all channels
erf = x.grad.abs().sum(1)[0]              # (448, 448) map of |dy/dx|
ys, xs = (erf > 0).nonzero(as_tuple=True)
print(ys.min().item(), ys.max().item())   # nonzero support: at most 427 rows wide
# The mass is concentrated near the centre: compare the 95%-energy box with 427.
```

Compute r and j for a model, and measure the effective receptive field by backprop

> **Strided convolutions and the ERF ripple:** With strides, the uniform-weight path count is not smooth: some input pixels sit under more tap chains than their neighbours, so the ResNet-50 ERF in the figure has a comb-like ripple on top of its Gaussian envelope. It is closely related to the uneven overlap behind the checkerboard artefacts of **Transposed convolution**. Trained weights smooth much of it out, but the envelope remains.

**Strengths**

- One closed-form recursion gives the field of any conv/pool stack
- Tells you whether a unit can see a whole object or the needed context
- Explains design choices: strided stems, stacked 3×3 convs (VGG), dilated segmentation backbones
- The ERF view predicts that depth alone grows useful context only like √depth

**Limitations**

- The theoretical field overstates what a unit uses: the effective field is Gaussian and much smaller
- Ignores padding: border units have part of their field outside the image
- Skip connections create paths of several lengths; the formula gives the longest path's field
- Says nothing about which pixels a trained unit actually relies on: measure gradients for that

**Question:** A stack has a 7×7 conv with stride 2, a 3×3 max-pool with stride 2, then two 3×3 convs with stride 1. What is the receptive field of the last layer?

- A. 15
- B. 19
- C. 27
- D. 11

**Answer:** C. 27 — After the stem $r=7$, $j=2$. The pool adds $(3-1)\cdot2=4$: $r=11$, $j=4$. Each $3\times3$ conv then adds $(3-1)\cdot4=8$: $r=19$ after the first and $r=27$ after the second. 19 is the answer for one conv; forgetting the jump (adding 2 per conv) would give 15.

**Question:** You stack more 3×3, stride-1 conv layers. How do the theoretical receptive field r and the width of the effective receptive field grow with depth L?

- A. Both linearly
- B. r linearly, the ERF like √L
- C. r like √L, the ERF linearly
- D. Both exponentially

**Answer:** B. r linearly, the ERF like √L — Each layer adds 2 pixels to $r$, so $r=2L+1$. The ERF is the $L$-fold convolution of a 3-tap kernel, a near-Gaussian with $\sigma=\sqrt{2L/3}$. The fraction of the field that matters therefore shrinks like $1/\sqrt L$ (Luo et al. 2016).

**Key points**

- $r_l=r_{l-1}+(\hat k_l-1)\,j_{l-1}$ and $j_l=j_{l-1}s_l$, with $\hat k=d(k-1)+1$: every layer adds its kernel span times the stride accumulated below it.
- Stride-1 convs grow r linearly; strides, pooling and doubling dilations grow it exponentially.
- ResNet-50 (torchvision): r = 427 px with jump 32; VGG-16 pool5: r = 212.
- The effective receptive field is roughly Gaussian with width $\propto\sqrt{\text{depth}}$, a shrinking fraction of the theoretical field (Luo et al. 2016).
- Large fields are bought with stride (losing resolution), dilation (risking gridding) or global operations (pooling, attention).

---

From MLFoundry (https://www.mlfoundry.in). The web page adds interactive figures and diagrams.
