In Chapter 2, we slid a small spotlight — a filter — across an image to highlight simple edges. In Chapter 7, we saw that a single straight dividing line is too simple to untangle messy real-world photos. A Convolutional Neural Network (or CNN) marries both ideas in a remarkably elegant way.
Instead of jumping straight from raw pixels to "Cat" or "Bicycle," a CNN builds a hierarchy of vision. The first layer only looks for tiny, simple strokes — a slanted edge here, a bright curve there. The second layer looks at the output of the first layer, combining strokes into textures and loops. The third layer combines those into familiar parts like ears, wheels, or windows. Only at the very end does the network vote on the whole object.
Interactive 8.1 The Visual Hierarchy Explorer
Pick an object, then slide or click through the 4 glowing layers to watch raw shapes transform into edges, curves, parts, and final confidence.
Switch between Cat Face, Bicycle, and House while staying on Layer 1. Notice that the earliest detectors are nearly universal — diagonal edges, upright lines, and curves show up in every picture. The network does not waste effort re-learning what an edge is for every new object; it reuses the same simple alphabet to spell completely different things.
Shrinking to See the Big Picture
There is a subtle catch with small spotlights. If every layer only peeks at a tiny patch of neighbors, how does a later layer ever notice that two pointy ears sit far apart on the same head, or that two wheels belong to the same bicycle?
The trick is beautifully simple: between layers, the network periodically zooms out. It looks at every small 2×2 neighborhood and keeps just the strongest signal from that patch, shrinking the map to half its width and half its height. Vision engineers call this step pooling.
Try stepping out below. Hover over any cell in the shrunken map to see how much of the original picture that single cell now summarizes — or paint your own bright spots on the 8×8 grid and nudge them sideways!
Interactive 8.2 Shrinking to See the Big Picture (Pooling)
Click Step Out (Pool) to summarize each 2×2 patch by its brightest signal. Hover over the summary grid to see its wider field of view, or click the 8×8 grid to paint!
Each time you step out, the map shrinks to a quarter of its cells — yet every surviving cell now represents 4× more area of the original photo. Step out twice, and a single cell watches 16× more area at once! Even better, pressing Nudge Pattern 1 Cell → shows that tiny shifts inside a 2×2 patch barely change the summary at all.
We noticed that a CNN's filters are learned rather than hand-crafted. If you trained one CNN exclusively on photos of lush green forests and another exclusively on blueprints of city bridges, would their Layer 1 detectors look similar, or would their Layer 3 detectors look similar?
Their Layer 1 detectors would look surprisingly alike — both forests and bridges are built out of simple edges, brightness contrasts, and slanted lines. Their Layer 3 detectors would look completely different: the forest network would specialize in leaves, bark grain, and branches, while the bridge network would specialize in steel trusses, arches, and cables!
Chapter 8 Takeaways
- Vision is built in stages: CNNs stack layers so simple edges combine into textures, textures into parts, and parts into whole objects.
- Early layers are universal: Basic edges and curves are shared across almost every kind of image; deeper layers become specialized.
- Pooling trades tiny detail for wide vision: Keeping the strongest signal in each 2×2 patch lets later layers see whole objects and ignore slight wiggles.
- Filters are learned by nudging: Just like Chapter 7's dividing line, every spotlight in a CNN adjusts itself from examples until its votes are right.