Convolutional Neural Networks

Dive into Deep Learning · §6

Convolutional Neural Networks: Geometry-Aware Vision Layers
locality · translation equivariance · cross-correlation · padding · channels · pooling · LeNet

Flattening Images Destroys Spatial Geometry

Motivation & Inductive Bias

  • Permutation blindness: Scrambling all 784 pixels of Fashion-MNIST with one fixed permutation leaves an MLP’s accuracy unchanged (\approx 87\%).
  • Parameter explosion at scale: A 1-megapixel RGB dense layer needs (3 \times 10^6)^2 = 9 \times 10^{12} weights (36 TB in float32).
  • Geometric prior: Enforcing locality and translation equivariance collapses trillions of weights into a shared kernel of a few hundred parameters.

Receptive Fields in Biological and Silicon Vision

From Visual Cortex to ConvNets

Hubel and Wiesel discovered that early visual cortex neurons respond to oriented edges within localized receptive fields, inspiring hierarchical filter banks swept across space:

  • Local filter bank (left \to right): Six oriented edge filters convolved with a natural image produce sparse activation maps that highlight local contours at different orientations and scales.
  • End-to-end learning: Rather than hand-crafting filter banks, convolutional neural networks (CNNs) learn the kernel weights across all layers simultaneously via backpropagation.

Mathematical and Architectural Roadmap of Chapter 6

Chapter Architecture

  • §§6.1–6.2 (Symmetry & Conv Layer): Translation equivariance and locality yield 2D cross-correlation \mathbf{Y} = \mathbf{X} \star \mathbf{K}, executed via im2col GEMM.
  • §§6.3–6.4 (Geometry & Channels): Padding p, stride s, dilation d, 4D filter banks (c_\textrm{o}, c_\textrm{i}, k_\textrm{h}, k_\textrm{w}), and 1 \times 1 bottlenecks.
  • §§6.5–6.6 (Pooling & LeNet): Parameter-free pooling and end-to-end LeNet verification against our MLP.

Concrete Benchmarks Across Chapter 6

Quantitative Anchors

  • Resolution-independent weights: A 3 \times 3 RGB-to-64-channel stem uses 1{,}792 parameters at any image resolution; 1 \times 1 bottlenecks cut deep 3 \times 3 cost by 8.5\times.
  • Geometric reach & shift tolerance: Strides (2,2,1) or dilations (1,2,4) double 3-layer reach from r=7 to r=15; 2 \times 2 pooling absorbs 50\% of 1-px shifts.
  • LeNet resource split: Convolutions hold 4.2\% of weights yet perform 85.9\% of MACs.

Concept Check & Chapter Study Strategy

Check & Synthesis

  • 1. Resolution scaling (224^2 \to 448^2): How do parameter count, MACs, and activation RAM scale when height and width double?
  • 2. Inductive bias test: Why does a CNN beat an MLP on natural images, yet lose that advantage under a fixed random pixel permutation?
  • Answer: Parameters stay 1\times (fixed by c_\textrm{o}, c_\textrm{i}, k), while MACs and activations scale 4\times with area H \times W. Shuffling destroys 2D locality.