DEEP LEARNING / 4. CNNS
Convolutional Neural Networks
Exploiting spatial structure — the vision backbone
EXPLANATION
CNNs exploit a key property of images: nearby pixels are related. Instead of connecting every pixel to every neuron (expensive, ignores structure), convolution slides a small filter across the image, detecting features wherever they appear. Three key ideas: • Local connectivity → filter sees small patch at a time (spatial locality) • Weight sharing → same filter used everywhere (translation invariance) • Pooling → progressively reduce spatial size, increase receptive field CNN architecture pattern: [Conv → BN → ReLU] × N → Flatten → Linear → Output Each conv block doubles channels and halves spatial size. The network goes from (H×W×3) raw pixels to (1×1×C) deep feature vectors.
DATA FLOW
Input image: (224 × 224 × 3)
↓ Conv(64, 3×3) + BN + ReLU
(224 × 224 × 64)
↓ MaxPool(2×2)
(112 × 112 × 64)
↓ Conv(128, 3×3) + BN + ReLU
(112 × 112 × 128)
↓ MaxPool(2×2)
(56 × 56 × 128)
↓ ... deeper layers ...
(7 × 7 × 512)
↓ Global Average Pool
(512,)
↓ Linear(512 → num_classes)
(num_classes,)CODE