Milan Ghimire

Machine Learning

How Convolutional Neural Networks Actually See an Image

May 13, 2026

A friendly tour of the CNN, the architecture behind most image recognition. We follow a picture as it turns from raw pixels into edges, shapes, and finally a confident label.

  • Computer Vision
  • Deep Learning
  • Neural Networks
  • CNN

A convolutional neural network turning pixels into the label cat

To a computer, a photo is not a scene. It is a giant grid of numbers, one per pixel, and each number is just a brightness value with no idea what sits next to it. So the real question in computer vision is almost philosophical. How do you get a machine to move from a wall of numbers to the thought "that is a cat"? The convolutional neural network, or CNN, is the answer that has held up for more than a decade, and the idea at its heart is surprisingly down to earth.

Why we did not just use a normal network

Early on, people tried feeding images into plain neural networks where every pixel connects to every neuron. It works for tiny images and falls apart fast. A modest photo has hundreds of thousands of pixels, so the number of connections explodes, and the network learns almost nothing useful. Worse, it treats a cat in the top left corner as totally unrelated to the same cat in the bottom right. That is clearly wrong. A cat is a cat wherever it stands.

CNNs fix both problems with one clever move. Instead of looking at the whole image at once, they look at small patches with a shared set of weights.

The convolution, in human terms

Picture a tiny window, often three pixels by three pixels, that slides across the image one step at a time. At each stop it looks at the little patch underneath it, does a quick weighted sum, and writes down a single number. Slide it across the whole picture and those numbers form a new, smaller grid called a feature map.

That sliding window is the filter, and the numbers inside it decide what it reacts to. One filter might light up wherever it finds a vertical edge. Another might respond to a patch of a certain colour. The network is not told what these filters should be. It learns them on its own by looking at thousands of examples.

A three by three filter sliding over the input to produce a feature map

The beauty here is reuse. The same filter is applied everywhere, so if it learns to spot an edge, it spots that edge in every corner of the image for free. That is why a CNN can recognise an object no matter where it appears, and why it needs far fewer parameters than a naive network.

Advertisement

Stacking layers to build meaning

One convolution on its own only finds simple things like edges and blobs. The power comes from stacking. The feature maps from the first layer feed into a second layer, which finds patterns in those patterns. Edges combine into corners and curves. Corners combine into eyes, wheels, and letters. A few layers deeper, the network is responding to whole objects.

Features growing from edges to shapes to whole objects across layers

Between these layers you usually find two more ideas doing quiet work. Pooling shrinks each feature map by keeping only the strongest signal in each little region, which makes the network cheaper and less fussy about exact positions. An activation function then adds a splash of non linear behaviour, which is what lets the network learn shapes more complex than straight lines.

From features to a decision

After the stack of convolutions and pooling, the image has been boiled down from a huge grid of raw pixels into a compact summary of what is present. A final set of ordinary layers reads that summary and casts a vote. Ninety two percent cat, five percent dog, three percent other. The highest vote wins, and that is the label you see.

What I find lovely about this is that nobody hand wrote a rule for what a cat looks like. The network discovered the rules itself, layer by layer, simply by being shown many labelled pictures and being nudged toward getting them right.

Why this still matters

Newer architectures have arrived, and vision transformers now challenge CNNs on the biggest datasets. Even so, the convolutional idea is everywhere. It runs in the camera app that blurs your background, the medical tool that flags a tumour, the car that reads a stop sign, and the phone that unlocks when it sees your face. Much of that runs on small devices precisely because CNNs are efficient by design.

If you remember one thing, let it be this. A CNN does not memorise pictures. It learns a ladder of features, from tiny edges at the bottom to full objects at the top, and it climbs that ladder every time it looks at something new. Once that picture is in your head, the rest of computer vision gets a lot easier to follow.

Related articles