AI Teading - TeensTry AI for yourself

Part 2 · AI that sees and hears

2.2

How a computer finds features

Lay two pictures on top of each other and a small tilt ruins it. So a computer looks at the pieces instead.

H1 Matching by overlapP2 Filter playgroundP3 Looking layer by layer

How a computer finds features

Lab H1

Write a number, then move the tilt slider.

Did you see the left side fall apart?

That method compares the whole shape at once. It lays your handwriting on top of a reference picture and counts how many pixels don't match. So tilt it a little, or write it a little bigger, and the mismatch count jumps.

You can read a crooked 3 just fine. That's because you know what a 3 looks like — a bump at the top, a pinch in the middle, another bump at the bottom. Those are its .

But how do you get a computer to find them?

Sweeping a little window across

The trick is surprisingly simple. You make a little window and slide it across the picture. That little window is called a .

The little window moves across the picture one step at a time.

The filter holds nine numbers. Wherever it lands, you multiply the nine brightness values under it by the nine numbers in the filter, then add everything up. That sum is the result for that spot.

Multiplying and adding. That's all it does. But depending on which numbers you put in the filter, this simple sum will pick out vertical lines, or horizontal ones.

Lab P2

Press Vertical lines, then change the numbers yourself. At the end, try building a filter that finds horizontal lines.

One layer isn't enough

A single filter only finds one kind of line. But you're not trying to spot lines. You're trying to spot a cat.

So you stack them.

You take all the lines the first layer found, and sweep more filters over those. Now you get patterns made of lines. Sweep again, and you get shapes made of patterns.

The higher the layer, the bigger the thing it recognises.

Lab P3

Look at what each layer reacts to. In layer 1, see if you can find a filter that looks like the one you built yourself.

Line-finding filters really are in layer 1. Yours doesn't have to look identical — if it does the same job, it lives in the same place. Go up to layer 3 and you'll start seeing eyes and faces.

Stacking like this means the computer works its way up: lines → patterns → shapes.

Lab H1

Let's pull up that number you wrote earlier. Can you tell now why the right side holds up?

The right side never compares the whole shape. It hunts for features, bit by bit, and adds them up. Tilt the number a little and the features are still there.

But who picks those numbers?

You might have noticed something odd.

You had a go at building the filter that finds horizontal lines. But there are thousands of things worth spotting — cat ears, car wheels, letter strokes, leaf shapes. Could a person really write all of those out, one by one?

No. And real AI doesn't have people write them.

So who picks them? That's what the next part is about.

Sources for this chapter

  1. 15 OCR-A (American Type Founders, 1968) · ANSI X3.17-1981 · ISO 1073-1
  2. 27 United States Postal Service, 1997 Annual Report, p.43 — the Remote Computer Reader, built on University at Buffalo (CEDAR) handwritten address interpretation
  3. 28 OCR trade histories on the first commercial installations (Shepard / Intelligent Machines Research Corp. at Reader's Digest, mid-1950s) — decade only; no primary source located

See the full list