VisualAI
Chapter 5 · Beyond Text

How AI Sees

Before AI can recognise a face it has to find edges. One tiny sliding window does that — the seed of all computer vision.

8 minLesson 12 of 23

Everything so far has been about text. But the same machine that writes essays can also recognise a face — and it all starts with one humble trick: a tiny window sliding across an image, hunting for edges.

Remember that an image is just a grid of brightness numbers. How does a network get from that grid to “there's a cat”? It doesn't look at the whole picture at once. It starts small — scanning for the simplest possible features, like edges and corners — using a little grid of numbers called a kernel (or filter).

Here's the move: slide that 3×3 kernel over every spot in the image. At each spot, multiply the nine pixels underneath by the nine kernel numbers, add them up, and that sum becomes one pixel of a brand-new image. Different kernels reveal different things. Play:

Kernel Explorer

Try the presets, then edit the kernel numbers yourself

Original
After the filter

Filter preset

The kernel (edit me)

Each output pixel = the 9 neighbours, each multiplied by its kernel number, summed up. That one tiny operation, repeated, is the foundation of how AI sees.

One little grid of numbers, slid across the image, is the atom of all computer vision.
Try this

Hit Edge detect— the shapes' outlines suddenly glow while the flat areas go dark. That's the kernel responding only where brightness changes. Try Blur, Sharpen, Emboss. Then go off-script: edit the nine numbers and invent a filter no one named.

This operation has a name

Sliding a kernel across an image and summing is called a convolution. A network layer that does this is a convolutional layer, and a network built from them is a CNN— the workhorse behind photo tagging, medical imaging, and self-driving cars. The twist: the network doesn't use kernels we picked. It learns the kernel numbers itself, the same way it learned weights — by gradient descent.

Key idea

Vision begins with tiny local filters that detect simple patterns. Stack layers of them and the early edges combine into textures, then shapes, then whole objects — a learned hierarchy from “there's an edge here” up to “that's a cat.” Nobody programs the cat-detector; it emerges.

A real network learns hundreds of these filters per layer. Peek inside one and the first layer is full of edge- and colour-detectors; deeper layers respond to eyes, wheels, fur, faces — increasingly abstract, built entirely out of those first humble edges.

The payoff

That's how AI sees. The natural next question is how it paints— how tools like Midjourney conjure a brand-new image out of nothing. The answer is gloriously strange: they start from pure noise and remove it, step by step. That's next.