Wirebook

Wirebook › Lesson 11 of 18

How does face unlock know it's you?

About 7 minutes · hands-on · nothing you type leaves your browser unless a button says so

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.

The face-print machine

First, design a face with the sliders and save it to the phone. Then nine visitors try to unlock it. Some are you on a different day; some definitely aren't. Change how picky the lock is and switch the safety checks on and off to see who gets in. Everything happens in your browser: no camera, no photos.

Who's at the door?

  1. Save a face to the phone first.

Design a face, then press "Save my face to the phone".

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.

Where is my face kept? Could a hacker steal it? On the big phone brands, the numbers stay on the phone, locked inside a special part of the chip that apps can't read, and aren't sent to the phone maker. When an app (like a bank app) lets you log in with your face, it never sees your face or the numbers: the phone just tells it "yes, it's the owner" or "no". And because only numbers are stored, there's no photo of you in there to steal.

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.

Could a disguise fool it? A big fake moustache and swimming goggles? Probably not in the way you'd hope. Goggles hide the eyes, so the "eyes open and looking" check fails and the phone asks for the passcode instead; a moustache changes only a few of the numbers, so it may still be you. And a face drawn on a potato? The potato already has eyes, but a depth camera sees a lumpy oval with no nose or brow in the right places, and an ordinary camera finds the proportions all wrong. Phone makers do test against masks and lookalikes, which is why fooling a good face lock is much harder than in films.

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.

Keep your passcode secret too. Face unlock is a shortcut, not the real lock. Your passcode is the master key: after a restart, or after a few failed face tries, the phone asks for it. A long passcode keeps the whole thing safe.

Words from this lesson

Earn your stamp

Get all 3 right to collect the Face unlock stamp. Wrong answers are fine: just try again.

1. What does face unlock keep to compare with your face?

2. Why might an identical twin get in when a stranger can't?

3. How can a phone tell a printed photo from a real face?

Try another lesson

  1. 12How does a game remember where you got to?6 min · interactive
  2. 13How does a game know you really won?6 min · interactive
  3. 14How can lots of people play the same game together?7 min · interactive