← Back to Curriculum
Neural Networks·30 min·Intermediate
👁️

Convolutional Neural Networks

How models learn to see images

Discover how convolutional layers slide filters across images to detect edges, shapes, and objects — the architecture behind modern computer vision.

Before We Begin

What we are learning today

If you were explaining how to recognize a cat to a five-year-old, you wouldn't talk about pixels. You'd talk about ears, whiskers, and tails. CNNs work the same way. They look for small patterns first (edges), then combine them into shapes, and finally into objects. A convolutional layer slides a small filter across the image, computing how well the filter matches each location. Stacking many such layers creates a hierarchy: edges become curves, curves become parts, parts become objects.

How this lesson fits

This module introduces the core architecture behind much of modern AI. Students follow information as it moves through layers, is transformed by weights and activations, and eventually becomes a prediction that can be improved through feedback.

The big question

How do large collections of simple numerical operations combine into a model that can recognize patterns humans struggle to hand-code?

Trace a forward pass through a network and explain what each layer contributesExplain why nonlinear activations and gradients make learning possibleRelate abstract neural-network mechanics to practical perception tasks

Why You Should Care

CNNs revolutionized computer vision. From AlexNet in 2012 to the autonomous vehicles and medical imaging systems of today, the convolutional architecture made it practical for machines to recognize patterns in visual data at human or superhuman levels.

Where this is used today

  • Medical imaging: detecting tumors, fractures, and retinal disease from scans
  • Autonomous vehicles: real-time object detection for lane keeping and collision avoidance
  • Face recognition and biometric authentication on smartphones

Think of it like this

Think of a detective examining a photograph with a magnifying glass. They don't look at the whole image at once — they scan small patches, looking for specific clues (a scratch, a fingerprint, a fiber). Each filter in a CNN is a different magnifying glass looking for a different clue. Pooling is the detective stepping back to summarize what they found without losing the key details.

Easy mistake to make

CNNs do not see images the way humans do. They process numeric matrices and learn filters through optimization. The 'hierarchy' emerges from training, not from hard-coded rules.

By the end, you should be able to say:

  • Explain how a convolution filter slides across an image and produces an activation map
  • Describe pooling as a downsampling operation that preserves important information
  • Trace the hierarchy from edges to shapes to objects through stacked conv layers
  • Name key CNN architectures (LeNet, AlexNet, ResNet) and their contributions

Think about this first

If you had to teach a computer to recognize a cat, would you describe every possible pixel pattern, or would you teach it to look for ears and whiskers first? Why?

Words we will keep using

convolutionfilterkernelactivation mappoolingstridepaddingReceptive field

Convolutional Neural Networks

If you were explaining how to recognize a cat to a five-year-old, you wouldn't talk about pixels. You'd talk about ears, whiskers, and tails. CNNs work the same way. They look for small patterns first (edges), then combine them into shapes, and finally into objects.

Conv LayerThe eye. A small window slides over the image looking for specific features.
PoolingThe summary. It shrinks the image, keeping only the most important details.
Deep StackThe hierarchy. Layer 1 sees lines. Layer 2 sees curves. Layer 3 sees faces.

The Convolution Operation

(IK)[i,j]=m,nI[i+m,j+n]K[m,n](I * K)[i,j] = \sum_{m,n} I[i+m, j+n] \cdot K[m,n]

Don't let the math scare you. It just means: "Place the filter on top of the image. If the patterns match, give it a high score."

Darker means a stronger response. Where the filter matches the image well, the activation becomes larger.

CNN Architectures

These named architectures matter mostly because they show how the same core idea kept getting stronger over time.

LeNet-5 (1998): One of the first strong demonstrations that CNNs could read handwritten digits.
AlexNet (2012): A landmark system that showed deep CNNs could dominate large-scale image recognition.
VGGNet (2014): A simpler, deeper design that stacked many small filters.
ResNet (2015): Used skip connections so very deep networks could still train well.
Inception (2014): Mixed several filter sizes at once so one layer could notice different scales of pattern.
Modern (2020+): Vision Transformers now compete strongly, but CNNs are still important because they are efficient and intuitive for image tasks.