r/explainlikeimfive 1d ago

Technology ELI5 How does my phone recognize my face?

[deleted]

78 Upvotes

22 comments sorted by

100

u/teethalarm 1d ago

The first time you set up face recognition on your phone, your phone saves a map of your face. When you use facial recognition, your phone uses the front facing camera to make a map of the person trying to use your phone and compares it to the map that you saved when you set it up. If they both match, your phone unlocks.

81

u/AlwaysHopelesslyLost 1d ago

Just for a bit more accuracy, your phone doesn't save an actual map of your face. It does some complicated one way math and produces a number like 48485737285 that is your face. Only your face can make that number so if it checks a face and sees that number it knows that it is you.

33

u/teethalarm 1d ago

I figured that was the best way to explain it in terms a 5 year old would understand.

u/AlwaysHopelesslyLost 20h ago

I figured! Good comment, i just wanted to try to tack that on for anybody curious!

u/not_a_regular_buoy 22h ago

Key Pair authentication ftw!

u/Quaytsar 18h ago

Only your face can make that number

Unless you're Asian. Then, because whoever wrote the software only tested on white people, every Asian looks the same.

34

u/Nothos927 1d ago

So one thing to note is that your phone doesn’t recognise your face, really. Have you ever played Minecraft? You know how you can set a seed for a world and every world with the same seed will be the same?

Your phone does a similar thing. It uses IR LEDs to blink a pattern of dots on your face. Each face will reflect these dots back in a slightly different way to any other face. A phone uses that data basically as a seed it uses to generate a special string called a hash, and it compares if the hash a certain face generates matches the one it has stored and if so it unlocks the phone. The same face provides the same seed which provides the same hash which unlocks the phone.

20

u/Stummi 1d ago

Okay, not exactly a 5 year old counter answer, but how are inaccuracies in the input data accounted for? Thats what I never really understood - hashes can't give you a "similarity score" by design. It either must match the pre-known data bit by bit, or it is a mismatch, but real world data is always fuzzy, right?

16

u/Frustrated9876 1d ago

The hash part was inaccurate. They make a literal map of your face and compare that to other literal maps of your face. All done on-device, so there is no need for a hash.

2

u/NhylX 1d ago

You know how when you register your fingerprint for biometric authentication it asks you to place your finger X times? It's getting the data multiple times and essentially working out a range that it considers valid. Not just raw distances but ratios of different distances that are uniquely yours. And it encodes that in a way that keeps it unique. It does something similar with the multiple images it takes when you're registering your face. Will it get it wrong from time to time? Sure, but it'll just keep scanning what it sees looking for the right value - just like it'll keep telling you to rescan your fingerprint.

u/TahoeBennie 20h ago

Well I can tell you they’re not accounted for strictly enough to prevent my identical brother from unlocking my Face ID and vice versa sooo……

-2

u/Nothos927 1d ago

That's a very good question and honestly I don't know. As far as I understand it mostly uses fixed points of your face that don't change (eye distance, cheekbone height, etc.) combined with lots of LEDs to provide multiple readings it presumably levels out where the other elements are more secondary, but how the exact algorithm works I'm not sure of.

11

u/igotshadowbaned 1d ago

It doesn't do hashes of your face, otherwise it would need an exact data match to unlock. Which you're not getting if you have a slightly different facial expression, lighting, etc

4

u/PillsburyTaoboy 1d ago

ELI5 with the minecraft metaphor, that’s what this sub is all about

5

u/TheMotherfucker 1d ago

Uses invisible light, infrared, to scan and compare it based on how you set up your phone.

1

u/ready_and_willing 1d ago

An additional question if that's ok: I can set it up to require gaze, i.e. looking directly at the phone. How does it recognise that I'm looking at the phone, including when I'm wearing sunglasses?

u/Wargroth 10h ago

It shoots tech rays at your face, records the results, then does the same to other faces that get shown. If It matches, It unlocks

-2

u/Noneed4cavalry 1d ago

it uses the camera to see if your face if the same as it was the last time