Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Blog › Explore in 3D

25 November 2026 · 3 min readInteractive 3D

Abstract artwork of the inside of an AI chip
Photo by Google DeepMind on Unsplash

What is convolution? How AI finds edges

A tiny 3×3 grid of numbers slides across an image and builds a new one. Change the filter and watch edges appear.

Before an AI can recognise a face, it has to notice simpler things: edges, corners, patches of texture. It finds them with convolution, a small filter that slides across the picture one step at a time.

The flat layer is the image, the floating layer is the result. Try each filter.

Multiply, add, move

  1. Place the 3×3 filter over a 3×3 patch of pixels.
  2. Multiply each pixel by the filter number on top of it.
  3. Add the nine results: that is one output pixel.
  4. Slide one step and repeat across the whole image.

Different filters, different findings

  • Blur: every number is 1/9, so each output is the average of its neighbourhood.
  • Edges: a big centre minus its neighbours, so flat areas give 0 and changes light up.
  • Vertical edges: negative on the left, positive on the right, so only left-to-right changes show.

In a vision network, nobody writes these filters. The network learns thousands of them during training, and the early ones usually end up looking a lot like these.

A worked example

Take a row of pixel brightnesses [10, 10, 10, 90, 90, 90] and the filter [−1, 0, 1]. Slide the filter along: at each position multiply matching numbers and add.

  1. Over 10, 10, 10: −10 + 0 + 10 = 0 (flat)
  2. Over 10, 10, 90: −10 + 0 + 90 = 80 (edge!)
  3. Over 10, 90, 90: −10 + 0 + 90 = 80 (edge!)
  4. Over 90, 90, 90: 0 (flat again)

The output is large only where the brightness jumps, so the filter has found the edge. A 3 × 3 filter does the same thing in two dimensions over a whole picture.

Stride, padding and pooling

Stride is how far the filter moves each step; a stride of 2 halves the output size. Padding adds a border of zeros so the edges of the image are not lost. Pooling then shrinks the result, for example by keeping the largest value in each 2 × 2 block, so later layers see a bigger area of the picture.

From edges to faces

A convolutional network stacks many layers of filters. Early layers find edges and colours, middle layers combine them into textures and shapes, and late layers respond to whole objects like eyes or wheels. Nobody designs these filters; training learns them from labelled pictures.

The same filter is used across the whole image, so a network that learns to spot a cat in one corner can spot it anywhere.

Beyond pictures

Convolution works on any data laid out in a grid or a line. Speech recognisers slide filters along sound waves, doctors’ tools scan medical images, and weather models scan maps of pressure. Wherever nearby values relate to each other, convolution can find patterns.

Glossary

  • Filter or kernel: the small grid that slides over the image.
  • Feature map: the output of one filter.
  • Stride: how far the filter moves each step.
  • Padding: a border added around the image.

Try these yourself

  1. Q1. Row [5, 5, 5] with filter [−1, 0, 1]: 0, no edge
  2. Q2. Row [0, 0, 100] with the same filter: 100, an edge
  3. Q3. 6 × 6 image, 3 × 3 filter, no padding, stride 1: output 4 × 4
  4. Q4. 2 × 2 max pooling on [1, 3; 2, 8]: 8

In short

Convolution slides a small filter over an image to find features. Stacked layers turn edges into shapes and shapes into objects.

Keep going

  • Lesson: convolution
  • Glossary: convolution
  • Lesson: images as tensors
  • What does a matrix actually do? Watch it stretch space
  • What is a determinant? How a matrix grows a shape
  • What is gradient descent? How AI learns downhill

Read and listen in

Indian languages

World languages

Questions people ask

What is convolution in image processing?

Sliding a small grid of numbers (a filter) over an image, multiplying and adding at each spot, to highlight features such as edges.

Why do CNNs use convolution?

It reuses the same small filter everywhere, so the network needs far fewer numbers and can find a feature wherever it appears.

What does pooling do?

It shrinks the feature map, keeping the strongest responses, so later layers see more of the picture at once.

More articles

  • What does a matrix actually do? Watch it stretch space
  • What is a determinant? How a matrix grows a shape
  • What is gradient descent? How AI learns downhill