Lesson 10.4 · 6 min read · about 45 min to master at a very slow pace

CNN Components and Feature Hierarchies

The role of each part of a CNN (convolutional layers, activations, pooling and fully connected layers) and how stacking them builds features from edges to textures to whole objects.

Not startedJump to quiz

The parts and their roles

ComponentRole
Convolutional layersApply learned filters to extract local features into feature maps
Activation functions (ReLU)Add non-linearity after each convolution, so stacked layers don't collapse into one linear map
Pooling layersShrink the maps, add tolerance to small shifts, cut computation
Fully connected layersNear the output: combine the extracted features into the final prediction (with softmax for classification)

A typical stack: [convolution → ReLU → pooling] repeated a few times, then flatten, then one or two fully connected layers, then the output.

The feature hierarchy

DepthTypical learned features
Early layersEdges, corners, colour blobs
Middle layersTextures, simple shapes, parts (an eye, a wheel)
Deep layersWhole objects and faces

Each layer combines the features of the layer below, over a larger area of the image. This mirrors how images are actually built (objects from parts, parts from edges), which is why CNNs generalise well on images and why they no longer need hand-crafted features.

Exam-ready summary

"CNNs exploit spatial locality through local connectivity and weight sharing, which cuts parameters dramatically. Stacked convolution, non-linearity and pooling layers learn a hierarchy from edges to parts to objects, and fully connected layers at the end make the prediction."

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

Going deeperHow does a deep unit "see" a large part of the image if each filter is only 3×3?

Through stacking. A unit in layer 2 sees a 3×3 patch of layer-1 maps, and each of those saw a 3×3 patch of the image, so it depends on a 5×5 region of the image. Pooling enlarges this region further. This region is called the receptive field, and it grows with depth.

Cheatsheet

CNN components

Conv: local features. ReLU: non-linearity. Pooling: shrink + shift tolerance. FC: combine features → prediction.

Feature hierarchy

Early: edges, corners. Middle: textures, parts. Deep: objects, faces. Each layer combines the one below over a larger area.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1conceptWhat is the role of the fully connected layers at the end of a CNN?
Q2conceptIn a trained CNN, what do the early layers typically detect?
Q3applyWhy put a ReLU after each convolution?
Q4interpretWhy does the edge → part → object hierarchy help CNNs generalise on images?
Q5conceptA unit in the second 3×3 conv layer sees a 3×3 patch of layer-1 maps. How large a region of the original image does it depend on?