How does a computer even look at a thumbnail?
Lesson 2.2 · A Photo Is a Grid of Numbers
Ashley
The app knows it’s a face. The app has never seen a face.
Ashley’s thumbnail for video #14 is her own shocked face.
The video app somehow knows it’s a face. It doesn’t have eyes. So what is it looking at?
The short answer
It learned, from millions of grids that people had labeled “face,” what the numbers tend to look like when a face is there. Certain patterns of light and dark, in certain places. It has never seen a face. It has seen a lot of grids.
Try it yourself
Slide to zoom in on the thumbnail until it comes apart.
Picture
A face, as far as you’re concerned.
What you just did has a name
Encoding
Turning something that isn’t a number, like a picture or a sound, into numbers a computer can work with is called encoding.
Pixels for images, samples for sound, tokens for text. Different tricks, same idea.
A few more things
Sound is a wiggle, written down
A microphone measures air pressure thousands of times a second. Each measurement is a number. A song is a very long list of them. Play the list back fast enough and you get the wiggle again.
Text gets chopped up
Words get split into pieces called tokens, and each token gets a number. “Minecraft” might be two tokens. Module 21 plays with this, and it explains a few famous chatbot mistakes.
Once it’s numbers, the math is the same
This is why one kind of model can learn faces, songs and sentences. Underneath, they’re all grids and lists of numbers, and the machine learns patterns in the numbers.
Go deeper
The longer version, if you want it.
How big the grid is
A phone photo is roughly 4,000 by 3,000 pixels, and each pixel is three numbers from 0 to 255. That’s about 36 million numbers for one photo. Models usually shrink the image first, to something like 224 by 224, because the pattern of a face survives the shrinking and the math gets 240 times cheaper.
A second of CD-quality sound is 44,100 samples. Text is the smallest: a page of writing is a few hundred tokens. That gap in size is one reason image and video models are so expensive to train.
Quick check
You say “set a timer” to a smart speaker. What does the model inside actually receive?
Let’s take it slower
Think of it as translation. Computers speak exactly one language, numbers, so anything else has to be translated before it gets in the door. A picture gets translated into a grid of color numbers. A sound gets translated into a list of pressure numbers. A sentence gets translated into a list of word-piece numbers. Encoding is just the name for the translation step. Once it’s done, the computer isn’t looking at a face or hearing a voice. It’s doing math on the translation.
More examples
Emoji are numbers too
Every emoji is a number under the hood. The thumbs-up is one number, the crying-laughing face is another. Your phone sends the number and the other phone draws its own picture for it, which is why the same emoji looks a little different on your friend’s phone.
Shazam never hears the song
Hold your phone up to a song and the app turns ten seconds of sound into a list of numbers, then compares that list to millions of others. It doesn’t listen. It matches numbers, which is why it works in a noisy car.
Back to the question
So how does the app know the thumbnail is a face?
Show the answer
It learned, from millions of grids that people had labeled “face,” what the numbers tend to look like when a face is there. Certain patterns of light and dark, in certain places. It has never seen a face. It has seen a lot of grids.
One last question
Owen has theories about how computers see. Trust them?
“A photo is stored as a grid of numbers, one set per pixel.”
“The computer sees the face the same way I do, just faster.”
“Sound and text get turned into numbers too, before a model can use them.”
Talk Card
Talk Card · 2.2
A photo is a grid of numbers, a song is a long list of them, and text gets chopped into numbered pieces. Computers only ever see the numbers.
Data to AI · pettigrewlab.com/learn
