Convolutional Layer Basics - these are hyperparameters of the basic conv operation
Receptive Field Analysis - stride and dilation directly expand receptive field
Pooling Layers - stride provides alternative to pooling for downsampling
Semantic Segmentation Architectures - dilated convolutions critical for dense prediction
Network Depth vs Width - dilation allows depth without excessive parameters
Recall Explain to a 12-Year-Old
Imagine you're taking photos of a long wall with paintings on it:
Stride is how far you walk between photos. Stride 1 = take a photo every step (lots of photos, see everything in detail). Stride 2 = take a photo every 2 steps (fewer photos, faster, but might miss small details between steps).
Padding is like adding extra blank space around the wall edges so when you stand at the very ends, your camera still captures the edge paintings fully. Without padding, the corner paintings only appear in one photo. With padding, they appear in several!
Dilation is like looking through a net with holes in it. A regular 3×3 net looks at9 neighboring tiles closely packed. A dilated net spreads those 9 viewing spots farther apart—you're still only looking at 9 tiles, but now they're spread over a bigger area, so you can see if distant tiles have patterns without neding a giant net. It's like sampling: instead of checking every tile in a big area (expensive!), you check 9 carefully-spaced tiles that give you a good sense of what's happening across that area.
#flashcards/ai-ml
What is stride in convolution? :: The number of pixels the filter moves between applications. Stride s controls the step size and downsampling factor.
What is the output size formula for stride s, kernel k, padding p?
Wout=⌊(Win+2p−k)/s⌋+1
What is "same padding"?
Padding that preserves input spatial dimensions. For stride 1 and odd kernel k: p=(k−1)/2
What is dilation rate d?
The number of pixels between consecutive kernel elements. Dilation d inserts (d−1) gaps between weights.
What is the effective kernel size for dilation d?
keff=k+(k−1)(d−1). This is the actual receptive field span, though only k2 parameters exist.
How does stride differ from dilation?
Stride controls output sampling (which positions we compute). Dilation controls input sampling (which pixels each kernel sees). Stride reduces output size; dilation expands receptive field without changing output size.
Why use dilation instead of larger kernels?
Exponentially fewer parameters. A 3×3 kernel with d=4 covers 11×11 receptive field with9 parameters vs 121 for a true 11×11 kernel.
What does padding prevent?
Spatial dimension shrinkage across layers, and underepresentation of border pixels in early layers.
For a 28×28 input with 5×5 kernel, stride2, padding 2, what is output size?
Convolution ke teen main parameters hain jo control karte hain ki filter input koaise sample karega. Stride matlab kitne pixels chhod ke filter move karega—jaise agar stride=2 hai toh har dosri position pe convolution hoga, output chhota ho jayega aur computation bhi kam. Padding ka matlab hai input ke charo taraf extra pixels (usually zero) add karna taki borders ki information lost na ho aur output size control mein rahe. Agar padding sahi set karo (same padding) toh input aur output ka size same rakh sakte ho, jo deep networks ke liye zaroori hai.
Dilation thoda alag concept hai—yeh kernel ke elements ke bech gaps daal deta hai. Matlab 3×3 kernel hai lekin usme gaps hain toh w 5×5 yazyada bade area ko cover kar sakta hai bina parameters badhaye. Yeh technique un cases mein useful hai jahan large receptive field chahiye lekin parameters kam rakhne hain, jaise semantic segmentation mein. Dilated convolutions se ap multi-scale context capture kar sakte ho efficiently—atrous convolutions ya ASPP (Atrous Spatial Pyramid Pooling) mein yahi technique use hoti hai jahan differentilation rates parallel mein lagaye jate hain.
Output size calculate karne ka formula simple hai: effective kernel size nikalo (dilation se adjust karke), padding add karo input mein, phir stride se divide karo aur floor le lo plus one. Yeh teen parameters milke tumhe architecture design karne ki flexibility dete hain—tum decide kar sakte ho kitni downsampling chahiye, spatial information kitni preserve kar hai, aur receptive field kitna bada chahiye. Real CNs mein inn parameters ko carefully tune karte hain task ke hisaab se.