Course contentsShow
← Machine Learning and Deep Learning
Lesson 881 of 3,53820. Convolutional Neural Networks: FundamentalsFree lesson

Receptive Field Formula

Apply the recursive formula to compute effective receptive field size for any layer in a network.

Receptive Field Formula

You'll learn: how to use a recursive formula to compute the exact receptive field size at any layer in your convolutional network.

The Core Idea

In the previous lesson, you learned to trace receptive fields layer-by-layer. Now you'll master the mathematical formula that lets you calculate the receptive field size directly without manual tracing.

The recursive formula builds from the output back toward the input:

RF_out = RF_in + (kernel_size - 1) × stride_cumulative

More precisely, for a layer l:

RF(l) = RF(l-1) + (k - 1) × ∏(strides of all previous layers)

Where:

  • RF(l) = receptive field size at layer l
  • k = kernel size of current layer
  • The product term accumulates how much each input pixel "spreads" through previous strides

Why It Matters

Instead of drawing diagrams for deep networks, you can compute receptive fields algebraically. For example:

  • Layer 1: 3×3 conv, stride 1 → RF = 3
  • Layer 2: 3×3 conv, stride 1 → RF = 3 + (3-1)×1 = 5
  • Layer 3: 3×3 conv, stride 2 → RF = 5 + (3-1)×1 = 7
  • Layer 4: 3×3 conv, stride 1 → RF = 7 + (3-1)×2 = 11

Notice how stride compounds: by layer 4, each step back covers 2 input pixels due to layer 3's stride.

This formula works for any sequence of convolutions, pooling (treating pool size as kernel), and strides.

Key Takeaway: The receptive field formula RF(l) = RF(l-1) + (k - 1) × stride_product lets you calculate how much input context any neuron "sees" without manual tracing, essential for designing networks with appropriate spatial awareness.