Wirebook › Lesson 11 of 18
How does face unlock know it's you?
You glance at your phone and it unlocks. It isn't looking at a photo of you and going "yep, that's them". It turns your face into a short list of numbers, and checks whether the face in front of it makes nearly the same numbers. Here's a pretend phone so you can design a face, set up face unlock, and see who it lets in.
Step 1: seeing your face
Some phones use only the ordinary front camera. Others have a special depth camera: a tiny projector sprays tens of thousands of invisible infrared dots across your face, and a camera that sees infrared reads how the dots land. Dots on your nose land closer than dots on your cheeks, so the phone gets a 3D map of the bumps of your face. Infrared light is invisible to us, which is why this works in the dark.
Step 2: turning a face into numbers
The phone doesn't keep the picture. A program squeezes the face into a list of numbers that describe its shape: how far apart the eyes are compared with the width of the face, how long the nose is, the curve of the chin and lots of patterns no person would think to measure. This list is sometimes called a faceprint. Notice that the machine above measures proportions, not sizes, which is why "You, further away" still matches: you look smaller, but your face is the same shape.
Real phones learn which numbers to use by training on huge numbers of faces until faces of the same person come out with similar numbers and different people come out different. That training happens at the phone maker, long before you buy the phone; your own face never needs to be part of it.
Step 3: close enough?
Your face never makes exactly the same numbers twice. Light changes, you squint, you put on glasses. So the phone asks "is this close enough?", and how close counts is a choice. Make the lock very picky and it keeps out your twin, but sometimes keeps out you on a sleepy morning too. Make it relaxed and you always get in, but so might someone who looks like you. Every face lock and fingerprint lock balances these two mistakes. One phone maker says the chance a random stranger's face unlocks its phones is about 1 in a million, and the chance a random stranger's fingerprint unlocks its fingerprint sensor about 1 in 50,000. It also says the chance is higher for twins, brothers and sisters who look alike, and children under 13, whose faces are still changing.
Photos, masks and sleeping people
A face lock that uses only the ordinary camera can sometimes be fooled by a good photo, because a photo has the right shape from the front. A depth camera spots that a photo is flat as paper. Many phones also check that your eyes are open and looking at the screen, so nobody can unlock your phone by holding it up to you while you sleep. Try switching those checks off above and see who sneaks in.
Unlocking a phone vs spotting faces in a crowd
Face unlock does one small job: "is this the one face I know?" That's called one-to-one matching. Spotting a face in a crowd means comparing it with thousands or millions of saved faces (one-to-many). With so many comparisons, even a tiny chance of a mix-up happens a lot, which is one reason people argue about whether cameras in streets and shops should be allowed to recognise faces.