Filter / Kernel

A small value tile that carries what to look for

  • Basics
  • 6 min read
  • 3 diagrams

Key points

  • A filter is the small value tile that scans across a photo. It's also called a kernel.
  • Every square on the tile carries a number, and that arrangement of numbers decides what it looks for.
  • In a convolutional neural network, the numbers on the tile aren't written by a person — they're values that fall into place through training.
  • One layer doesn't hold just one tile — it holds dozens to hundreds, each hunting for a different pattern at once.
  • A tile is usually tiny — three squares by three squares is the most common — and instead it gets reused across many layers.

The analogy

Picture a stencil ruler from a stationery store — a thin strip with a circle, a triangle, and a long slot cut clean through it. Whatever shape is cut into that strip is exactly what the stencil can trace. A shape that isn't cut through, the stencil can do nothing with. The strip itself is a kind of declaration: "this is the shape I handle."

Now lay that stencil over a drawing. Lay down the one with the tall, narrow slot, and wherever a column stands in the drawing, the slot fills right up. Swap in the one with the wide, flat slot, and wherever a shelf sits, that slot fills up instead. The drawing never changes, but swap the stencil and a completely different set of spots lights up. Line up a whole set of stencils and try each one, and a single drawing reveals several different textures at once.

In detail

Where the cutouts sit, there are really numbers

What look like open and blocked squares on a stencil are really numbers underneath. A spot that should be bright carries a large positive number; a spot that should be dark carries a negative one; a spot where it doesn't matter either way carries something close to zero.

Lay the tile over a photo, and overlapping squares get multiplied together and summed. When a bright point lands on the tile's positive squares and a dark point lands on its negative squares, the sum comes out large. Flip that arrangement and you get a large negative number; land on a pattern the tile has nothing to do with and the sum lands near zero. So the arrangement of numbers written on the tile is exactly "what it looks for."

It matters that the same tile gets reused across every corner of the photo. The tile hunting for a vertical line in the top left and the one hunting for a vertical line in the bottom right are the same tile, so remembering just the nine numbers on one tile is enough to handle a photo of any size.

Nobody decides what to look for by hand

The numbers on a tile start out meaningless. Watching a huge pile of labeled photos, and nudging the numbers a little every time the answer is wrong, gets repeated over and over until the tile settles into a genuinely useful shape on its own.

What's interesting is that, without anyone directing it, the tiles in the first layer almost always settle into shapes that hunt for lines, smudges, and color boundaries. That's simply because those turn out to be the most useful fine patterns in photo data. Go deeper and what a tile is looking for gets harder to put into words — something like "a pattern with two vertical stripes over a circle" — hard to pin a name on.

That's why reading meaning off a trained tile isn't easy. Early layers are recognizable by eye, but later layers often stay a mystery even when drawn out as a picture.

A layer holds more than one tile

If a layer had only one tile, it could only find one thing. So in practice a layer holds dozens to hundreds of tiles, each scanning separately. Sixty-four tiles produce sixty-four result pictures.

The next layer takes in that whole stack at once. So the next layer's tile isn't a flat sheet — it's a block as thick as the number of pictures the previous layer produced: still three squares wide and tall, but sixty-four layers deep. The very first layer, working on a color photo, is the same way — three layers deep, for red, green, and blue.

Small tiles get reused many times over

A bigger tile can take in a wider range at once. But make it bigger and the numbers to store climb fast — a three-square tile needs nine numbers, a seven-square tile needs forty-nine.

That's why a small tile scanned several times is the more common choice. Scan twice with a three-square tile and you end up covering a five-square range, needing only eighteen numbers. It's why deep architectures have long leaned mostly on small tiles. More recently, some designs have brought back large tiles alongside ways of saving computation.

More precisely

A filter is the learnable weight bundle held by a convolution layer. One tile is a block of values with width, height, and depth, paired with one reference value. The number of filters in a layer decides how many result pictures that layer produces, and the filter count together with the tile size decides the layer's parameter count.

The stencil analogy breaks down in one place. A stencil's cutout shape is plainly visible to the eye, but the numbers on a filter don't carry meaning that's easy for a person to read — especially in later layers, where a tile operates on the results the previous layer already produced, so what shape in the original photo it responds to isn't obvious at a glance.

And a stencil, once stamped out, keeps its cutout forever, but a filter keeps changing bit by bit while training runs; only once training finishes do the values lock in place. Taking a tile already trained elsewhere and only teaching the later layers something new is also a widely used trick.

Try it yourself

Common misconceptions

  • It's easy to think a filter is something completely different from a photo-editing app's blur or sharpen effect, but actually those effects are the same calculation too: sliding a small value tile across the image. An app's color-tone filters are usually a different calculation that only changes colors. The difference is that in an app a person sets the values ahead of time and uses the result to make the picture look nicer, while an AI filter has its values set by training and passes its pattern scores on to the next layer.

  • It's easy to assume a person writes the shape to look for into the filter, but actually the values settle into place on their own during training, and a person decides the framework — the tile's size, how many there are, and how far it steps each time.

  • It's easy to think a bigger filter finds things better, but actually stacking small tiles across several layers often costs fewer values and gives better results.

One-line summary

In short

A filter is a small value tile with a number written in every square, where that arrangement of numbers decides what it looks for, and the values themselves are set through training.

Spotted an error or have a better analogy? Suggest an edit · Last updated 2026-10-17