In this lesson: what a computer really gets when it "looks" at a picture, why light, turning, size and covering change its guess, and what a sure-score does and doesn't tell you.
1. What does the computer get?
You draw an L on a 5×5 drawing board. What does the computer receive: the letter, a little picture, or something else? Guess, then read on.
To a computer, a picture is only a grid of tiny squares, and each square is a number for how dark it is (a colour picture uses three: how much red, green and blue). Nothing in it says "L".
Here is a capital L on a 5×5 grid, with 0 for white paper and 9 for the darkest ink:
9 0 0 0 0
9 0 0 0 0
9 0 0 0 0
9 0 0 0 0
9 9 9 9 9
You see a letter. The computer gets 25 numbers.
You see an L; the computer gets 25 numbers
2. "Seeing" is a rule over the numbers
What we call the computer "seeing" is a rule it runs over those numbers. We asked an AI to write one. Its rule was: the grid has a full row of dark squares and a full column of dark squares, and they meet at a corner. Run that over the 25 numbers above and it says "L".
Every time the picture changes, the rule runs again on the new numbers. It has nothing else to go on.
The rule runs again on every new grid
3. Why it gets fooled
Think of a friend's homework photographed in a dim room, or a test paper handed out upside down. You still know what it is, because you know the thing itself. The computer only has numbers:
- Darker: add 5 to every square (9 stays 9, the top) and the white paper becomes 5s. The AI said its rule still found the L, since the ink is still 9 and only the paper changed. That holds only while "dark" means 9. But a rule that should also catch a faint pencil L, drawn in 5s, has to count 5 or more as dark. On the darker grid every square is 5 or more, so that rule finds full rows everywhere and says "L" for any darkened drawing, even a smiley or a plus sign.
- Turned: a quarter turn makes the dark column the top row and the dark row the left column. The AI's rule still said "L". That sounds like a win, but it means the rule says "L" for a corner shape turned any way, even a backwards 7 or the corner of a box. A rule can be fooled both ways: missing the thing, or seeing it where it isn't.
- Half covered or smaller: the numbers the rule looks for simply aren't where it looks. We also asked the AI for a plus-sign rule: "the middle row and the middle column are all dark". With the plus sign's right half covered, that rule could no longer be checked, because the right part of the middle row was hidden. The AI said the rule only works if you assume the hidden half matches. Draw the L smaller, three squares tall, and there is no full row or column any more, so the rule says it isn't an L.
The thing didn't change; the numbers did, and so the guess can change. Here is a wrong line to watch for: "Its rule works on my clear drawing, so it will recognise the same shape in any drawing, darker, turned or smaller." One drawing working is a fact; "any drawing" is a conclusion it doesn't support. Catch it by testing: darken it, turn it, shrink it, and watch what happens.
Same thing, new numbers: the guess can change
4. The sure-score
A picture guesser, a program that, like our rule, names what a picture shows, can also give a sure-score, from 0 (sure it isn't) to 1 (very sure): the more the numbers look like what it is looking for, the higher the score.
The score is how well the numbers fit, not a promise of how often it is right. A score of 0.9 doesn't promise "right 9 times in 10", and on pictures unlike the ones it was made for it promises even less. It can be sure and wrong. And a guesser that always names something, even at 0.2, will tell a friend who drew a wobbly little circle in a corner that it is a ball or a plus sign. A better one says "I can't tell" when the score is low.
A sure-score: how well it fits, not a promise
5. Real picture AI, and sound
Real picture AI doesn't use rules a person wrote; it finds its own patterns from lots of examples (lesson "It learns from examples"). But it still only gets numbers, so changes it saw too little of while learning (odd light, unusual angles, things half hidden) can still fool it. Sound is the same: to a computer, a voice is a long list of numbers, one for each tiny moment of the sound wave, and the noise of a busy canteen is added into every one of them. Chat AIs that read a photo of your homework or answer your voice work the same way: the photo becomes numbers first, so a dark, blurry or tilted photo can make it misread a word or a number and still sound sure. Check what it read before you trust what it answered.
It learns its patterns, but still gets numbers
6. What this means when you build
- Put the numbers on show. Next to a drawing board, show the picture as a grid of numbers, the rule in one sentence and the sure-score. When you darken or turn the drawing, you watch the numbers and the score change while the rule stays the same, instead of trusting that "it can tell".
- Show the score, and say "I can't tell". Decide only when it is sure enough.
- Test the hard cases. Try dark, turned, half-covered and small pictures before your friends do, and let them draw their own.
- Sure isn't right. A high score means sure, not correct. See the same "sure but wrong" on sentences in the ML Lab Mood Sorter, step Trick it.
Show the numbers and the score; test hard ones