How AI Face Recognition Machines Work
How face recognition machines match an identity, what masks and lighting change, how spoof detection works, and the biometric data duties to understand before you install one.
Face recognition machines are used for attendance, office access, and gym entrances. Behind what looks like a brief moment, the device captures an image, turns the face into mathematical data, and calculates how closely that data resembles an enrolled identity. The result is a decision based on a similarity threshold, and it can be wrong.
Understanding the process helps you choose a device with reasonable expectations. It also lets you prepare rules for the moments when a face is not recognized.
From an image to numbers
First, the camera finds a face and checks whether the image quality is sufficient. The image is then aligned and processed by a neural network. Modern models produce a series of numbers often called an embedding or face template.
The model is trained so that two photos of the same person give numbers that lie close together, while photos of different people lie further apart. FaceNet research, for example, used the distance between embeddings as a measure of similarity. This differs from the popular picture of a machine that simply measures eye spacing and nose width. The features are learned from training data and cannot always be explained one by one.
At enrollment, the template is stored with an identity. When someone arrives, a new template is compared with it. Some products also keep the enrollment photo or a photo of each tap, so check with each product whether it really stores only numbers.
Verification and identification
Verification is a one-to-one comparison. An employee enters a number, for example, and the machine checks the face. Identification compares one face with many templates, as when a gym member simply faces the device without a card.
The difference matters. The more people in an identification database, the more comparisons are made. Test the device with a user count close to your real need, not just five people in a demonstration.
Two kinds of error
A false acceptance occurs when a different person is treated as a match. A false rejection occurs when a legitimate user is not recognized. Raising the similarity threshold generally reduces false acceptances but makes more users try again.
Attendance and a medicine store have different needs. For attendance, a rejection can be handled with a correction. For the medicine store, a company may choose a stricter threshold and add a PIN. Ask how the threshold is set, but do not change it without testing.
Results can also differ between groups. A 2019 evaluation by the US National Institute of Standards and Technology (NIST) found demographic differences in most of the algorithms tested, with widely varying size. The finding cannot be applied directly to every machine sold today, so a trial should include a varied group of users from your own site.
Masks, glasses, and light
A mask hides part of the face. In NIST’s July 2020 report, the best pre-pandemic algorithms failed to match about 5% of faces with digitally added masks, while many others failed on 20% to 50%. The December 2020 report showed improvement in some newer algorithms, with the best at about 2.4% to 5%. The study used digital masks and one-to-one comparison, so these figures are not the specification of a particular attendance machine.
Clear glasses are often not a problem, while sunglasses, reflections, a low cap, or a changed appearance can reduce the available information. A headscarf that leaves the face uncovered usually shows more of it than a mask does. Test all of these, because results depend on the model and the enrollment photo.
Light from behind can make a face dark. Wide Dynamic Range (WDR) helps manage contrast, and infrared helps in low light. Install the machine in shade, away from direct sun, and follow the manufacturer’s recommended height and distance.
Preventing spoofing
Someone may try to use a photo, a video, or a mask of another person. Presentation attack detection (PAD), often called liveness detection, tries to tell a real face from an artifact. Some devices use infrared cameras or depth sensors, while others analyze an ordinary image.
NISTIR 8491 tested 82 software-based PAD algorithms on two-dimensional images. Accuracy varied widely by algorithm and attack type. Some types were detected well by several developers, while others produced high error rates with every implementation tested. The study did not test 3D or infrared sensors, so a device claim still needs suitable evidence, such as testing under ISO/IEC 30107-3.
Duties when handling biometric data
Indonesia’s Law 27/2022 on Personal Data Protection classes biometric data as specific personal data. The data controller must have a valid legal basis for processing. Article 34 also requires an impact assessment for high-risk processing, which includes specific data. The implementing regulation, Government Regulation (PP) 33/2026, is scheduled to take effect on 16 January 2027.
In practice, explain the purpose, what is stored, for how long, who can access it, and how to request deletion. Delete templates when the purpose ends unless another legal duty applies. Do not reuse attendance faces for new monitoring without reviewing the legal basis and the notice. Legal counsel can advise whether consent is the right basis, particularly in an employment relationship.
Always offer an alternative, such as a card or a staff member. This helps people who cannot be recognized, do not wish to use biometrics, or arrive when the device is down.
Testing before you buy
- Enroll at least a few dozen prospective users of varied age, skin tone, and facial attributes.
- Test in the morning, at midday, and at night in the actual location.
- Record rejections of legitimate users and waiting times.
- Try people who are not enrolled, and photos on paper and on a screen.
- Disconnect the network, then check what was kept once it reconnects.
- Deactivate one user and confirm that access disappears on every device.
For use in fitness centers, read the guide to gym attendance with face recognition or see face access in FitYo!. For employees, see connecting attendance machines to payroll.