Roadmap/
Lesson 4 of 8

Convolutional Neural Networks

An image is a grid of numbers (pixels). A standard MLP would flatten it into a 1D vector — destroying all spatial structure. A 256×256 image has 65,536 pixels; connecting each to 512 hidden units requires 33 million weights for just one layer.

Convolutional Neural Networks (CNNs) solve this with two key ideas. First, local connectivity: each neuron looks at only a small region (e.g., a 3×3 patch) instead of the whole image. Second, weight sharing: the same filter is slid across the entire image — every patch uses the same weights. This reduces parameters dramatically and builds in translation invariance.

A convolution multiplies a filter element-wise with the patch beneath it and sums the result, producing one value in the feature map. Different filters learn to detect different features: edges, corners, curves, textures. Stacking multiple layers builds a feature hierarchy — early layers detect edges, later layers detect shapes, the final layers detect objects.

Pooling layers (typically MaxPool) downsample the feature maps, reducing spatial dimensions and building robustness to small shifts. Modern architectures like ResNets and EfficientNets are built entirely from these principles.