Why this formula? Start with the padded input size H+2p. Subtract the filter "reach" k to get the last valid position. Divide by stride s to count how many steps fit. Add 1 because positions are fencepost-counted (if you can place the filter at positions 0, 1, 2, you have 3 outputs, not 2).
If you have Cout filters in a convolutional layer, you produce Cout feature maps stacked as a 3D tensor of shape (Cout,Hout,Wout). Each channel is the "opinion" of one filter.
Key insight: A neuron in layer L doesn't "see" the input directly. It sees layer L−1, which saw layer L−2, etc. The receptive field accumulates this chain.
Derivation from scratch:
Base case: At layer 0 (the input), R0=1 (a pixel sees itself).
Layer 1: A k1×k1 filter with stride s1 looks at k1 consecutive pixels in the input. The center pixel's receptive field is k1 wide. If stride s1>1, adjacent outputs skip s1 input pixels, but the receptive field size is still k1 for the first layer: R1=k1.
Layer 2: Each pixel in layer 1 has R1=k1. Layer 2's k2×k2 filter spans k2 pixels in layer 1. Each of those layer-1 pixels covers k1 input pixels, and layer-1 used stride s1. So the layer-2 receptive field is:
R2=R1+(k2−1)⋅s1=k1+(k2−1)s1
The (k2−1) is the "extra" layer-1 pixels beyond the center, scaled by s1 to input space.
General: At layer l, the extra coverage is (kl−1) in layer-l−1 space, which maps to (kl−1)∏i=1l−1si input space.
Simplification for uniform layers: If all layers have kernel k and stride s:
Rl=k+(k−1)i=0∑l−2si=k+(k−1)s−1sl−1−1
For s=1 (no downsampling): Rl=1+l(k−1) (linear growth).
For s=2: Rl=k+(k−1)(2l−1−1) (exponential growth).
Recall Explain Feature Maps and Receptive Fields Like I'm 12
Imagine you have a huge poster of a beach scene. You're an art detective trying to find patterns—like "where are the umbrellas?" You can't look at the whole poster at once, so you use a magnifying glass that only shows a small square.
Feature map: You slide your magnifying glass across the poster row by row. Every time you see an umbrella-like shape, you put a checkmark on a separate piece of paper in the same position. When you're done, your paper is covered with checkmarks showing "umbrella locations." That paper is a feature map—it's the output of one "umbrella detector" filter.
Now imagine you have 100 different detectors (magnifying glasses with different colored lenses)—one for umbrellas, one for waves, one for people, etc. You get 100 different papers (feature maps), each showing where that pattern appears.
Receptive field: At first, your magnifying glass only shows a 3×3 square of the poster (tiny!). You can only detect tiny edges. Then you stack another detective on top of you: they look at your checkmark paper with their magnifying glass. Now they're combining your tiny detections into bigger patterns—maybe "this cluster of edge checkmarks forms a circle." Since they're looking at your paper (which summarized 3×3 patches), they're indirectly seeing 5×5 of the original poster. That 5×5 is their receptive field—how much of the original poster influences one of their decisions.
Add a third detective looking at the second's paper, and now they see 7×7 of the original poster. The higher up you go, the bigger the "field of view" back to the original scene. That's how CNNs understand context—low layers see pixels, high layers see objects.
The 2D output produced when a single convolutional filter slides across an input. It shows the spatial locations where the filter responds strongly. If you have Cout filters, you get Cout feature maps.
How do you calculate the spatial size of a feature map?
Hout=⌊(H+2p−k)/s⌋+1, where H is input height, p is padding, k is kernel size, s is stride. Same formula for width.
What is the receptive field of a neuron in a CNN?
The region in the original input image that can influence that neuron's activation value. It grows with depth due to stacking convolutions.
How does stride affect receptive field growth?
Stride s multiplies the receptive field expansion. Formula: Rl=Rl−1+(kl−1)∏i=1l−1si. Stride-2 pooling causes exponential growth; stride-1 causes linear growth.
Does a pooling layer affect the receptive field, and how?
Yes. A kp×kp pool with stride sp expands the receptive field by (kp−1)× (cumulative previous strides), AND its stride sp multiplies all future layers' expansions.
What is the receptive field of a single 3×3 conv layer (stride 1)?
R1=3 (the kernel size itself, since it looks directly at the input).
If you stack two 3×3 convs (stride 1), what is the receptive field at layer 2?
R2=3+(3−1)⋅1=5. Each layer-2 pixel sees a 5×5 patch of the input.
Why do deeper CNNs have better context understanding?
Deeper layers have exponentially larger receptive fields (especially with pooling), so neurons "see" more of the input image—enabling recognition of large-scale patterns and spatial relationships.
What happens to feature map size with padding p=(k−1)/2 and stride 1?
The output size equals the input size (spatial dimensions preserved). Example: k=3,p=1 keeps Hout=H.
How does dilated convolution affect the effective kernel size and receptive field?
The effective kernel size is keff=k+(k−1)(d−1) for dilation d. At d=1 this equals k; larger d inflates the receptive field without adding parameters. Example: 3×3 with dilation 2 has effective size 5×5.
Chalo ise simple tareeke se samajhte hain. Socho ek CNN ek building ki tarah hai jisme kai floors hain. Sabse pehla floor sirf chhote-chhote patches dekh sakta hai — jaise sirf edges ya lines detect karna. Aage ke floors in edges ko combine karke corners, textures, aur phir badi shapes jaise aankh ya wheel banate hain. Har layer thoda wider area dekhti hai aur higher-level concept mein sochti hai. Yaha do important cheezein hain: feature map yaani ek filter ki "opinion" — ek pura grid jo batata hai ki filter image mein kahan-kahan "fire" ho raha hai. Aur receptive field yaani original image ka kitna hissa ek single pixel ko influence kar raha hai.
Feature map ka size nikalne ke liye ek formula hai: input size H+2p mein se filter reach k subtract karo, phir stride s se divide karo, aur last mein +1 karo (kyunki positions fencepost-style count hoti hain — agar 0,1,2 positions hain to 3 outputs hote hain, 2 nahi). Jaise agar H=32,k=5,s=1,p=2 ho to output bhi 32 aata hai, matlab padding 2 wala 5×5 conv spatial size ko preserve kar leta hai. Aur agar layer mein Cout filters hain to utni hi feature maps banti hain, sab ek 3D tensor mein stack ho jaati hain — har channel ek alag filter ki opinion.
Receptive field ka concept isliye zaroori hai kyunki koi bhi deep neuron input ko directly nahi dekhta — woh apni pichhli layer ko dekhta hai, jo apni pichhli ko, aur ye chain recursively expand hoti jaati hai. Formula hai Rl=Rl−1+(kl−1)⋅∏si, jisme pooling layers bhi count hoti hain. Iska matlab ye hai ki jaise-jaise hum deeper jaate hain, receptive field exponentially badhta hai, jisse neuron context samajh pata hai — jaise "ye edge ek face ka part hai, koi random line nahi". Yahi baat CNN ko itna powerful banati hai image samajhne mein, kyunki woh chhoti details se lekar badi meaning tak sab hierarchy mein capture kar leta hai.