Guide to AI and Data Courses · Lecture Notes
Chapter 24: Biometric Systems
When we unlock a phone with our face, the device decides in a moment: "this is the owner" or "this is not the owner". Sometimes it fails to recognize the owner and we try again; very rarely it may take a stranger for the owner. The two errors are two faces of the same threshold, and one goes down as the other goes up. The Biometric Systems course studies how this decision is built, how it is measured and how it can be fooled. These notes introduce the course and work through its three core ideas with small examples you can compute by hand.
Learning outcomes
- Verification and identification
- Classify an application as 1:1 verification or 1:N identification and order the enrollment, matching and decision steps.
- Error rates
- Compute FAR and FRR for a threshold from lists of scores, see how the two errors move when the threshold moves, and locate the EER.
- Template matching
- Compute by hand the cosine similarity of two feature vectors and the masked Hamming distance of two binary codes.
- Scale and fusion
- Compute how the chance of a false match grows with gallery size; normalize and combine the scores of two modalities.
- Place of the course
- Tell what separates biometrics from pattern recognition, computer vision, cybersecurity and speech and audio processing.
24.1What question does the course ask?
How is a person recognized from their face, fingerprint or voice?
Biometric systems recognize a person by physical and behavioral traits such as face, fingerprint, iris or voice. The course covers extracting a template from a sample, matching two templates and accepting or rejecting by a threshold; security and privacy are an inseparable part of that decision.
In most classification problems the classes are known in advance: an image is a cat or a dog. In biometrics the "class" is a person; there may be millions of people the system has never seen, and new ones keep arriving. So the system does not train a separate classifier for each person. Instead it extracts a template from the person's sample, stores it, and later compares a new sample with the template. The main output is not a class name but a similarity score; the decision comes from applying a threshold to it.
This structure separates two different questions. In verification (1:1) the person claims an identity and the system compares against a single template: a phone lock, a banking app. In identification (1:N) the person claims nothing and the system looks at every template in the gallery: searching a database for a fingerprint found at a crime scene. Both can use the same matcher, but their error behavior is very different; we will see this with numbers in the third core section.
24.1.1Security and privacy are part of the decision
Compare a biometric trait with a password. A leaked password is replaced; a fingerprint or a face cannot be. A password asks for an exact match; a biometric sample changes a little with every measurement, so matching is always the question "similar enough?" and errors are unavoidable. And an attacker can present a fake sample, such as a photograph. These three differences explain why the course carries error rates, liveness detection and template protection as topics.
24.1.2At a glance
| Criterion | Biometric Systems |
|---|---|
| Approach | matching and verification |
| Input | face, fingerprint, iris, voice |
| Output | identity decision |
| Success measure | FAR, FRR, EER |
| Math load | medium |
| Data needs | few samples per person |
24.2A short history
| Year | Milestone |
|---|---|
| 1892 | Galton publishes "Finger Prints": fingerprints are shown to be unique and permanent. |
| 1901 | Scotland Yard starts using fingerprints with the Henry classification system. |
| 1991 | Turk and Pentland publish eigenfaces for face recognition. |
| 1993 | Daugman publishes his iris recognition method, the basis of today's iris systems. |
| 2013 | Fingerprint sensors (Touch ID) start to spread in smartphones. |
| 2014 | DeepFace and the deep networks after it approach human level in face verification. |
24.3Core concepts
The rest of the course is built on the concepts below. The following sections work through the most important ones with examples.
| Concept | Meaning |
|---|---|
| Enrollment | Extracting a template from a person's sample and storing it. |
| Template | The feature vector stored instead of the raw image. |
| Verification (1:1) | "Is this person who they claim to be?" |
| Identification (1:N) | "Which enrolled person is this?" |
| FAR and FRR | False accept and false reject rates; the threshold trades them off. |
| EER and DET curve | The point where both errors are equal; comparing systems. |
| Liveness detection | Catching attacks with photos, masks or fake fingers. |
| Multimodal biometrics | Combining face with voice, or fingerprint with iris. |
24.4Verification, threshold and error rates
A verification system produces a similarity score for every attempt. Call attempts from the same person genuine and attempts from a different person impostor. In a good system genuine scores are high and impostor scores are low, but the two groups usually overlap. An attempt is accepted if its score reaches the threshold. This gives two separate errors.
FAR (false accept rate) = the fraction of impostor attempts that pass the threshold. FRR (false reject rate) = the fraction of genuine attempts that fail it. Raising the threshold lowers FAR and raises FRR; lowering it does the opposite. The rate at the point where the two are equal is the EER.
Scores of ten genuine and ten impostor attempts (the values are illustrative). An attempt is accepted if its score is greater than or equal to the threshold.
- Genuine: 0.91 0.84 0.77 0.95 0.62 0.88 0.71 0.80 0.93 0.55
- Impostor: 0.12 0.35 0.48 0.22 0.67 0.30 0.41 0.58 0.18 0.74
- Threshold 0.5. No genuine score is below 0.5: FRR = 0/10 = 0. Among impostors 0.67, 0.58 and 0.74 pass: FAR = 3/10 = 0.3.
- Threshold 0.7. 0.62 and 0.55 are rejected: FRR = 2/10 = 0.2. Only 0.74 passes: FAR = 1/10 = 0.1.
- Threshold 0.8. Of the genuine scores 0.77, 0.62, 0.71 and 0.55 are rejected: FRR = 4/10 = 0.4. No impostor passes: FAR = 0.
- EER. At threshold 0.65 the rejected genuine scores are 0.62 and 0.55 and the passing impostors are 0.67 and 0.74: FRR = FAR = 0.2. On this data the EER is about 20%.
Moving the threshold from 0.5 to 0.8 took FAR from 0.3 to 0 and FRR from 0 to 0.4. Which threshold is right comes from the risk of the application, not from the data.
| Application | Costlier error | Threshold |
|---|---|---|
| Phone lock | Repeatedly rejecting the owner (FRR) | moderate; retries are allowed |
| Bank transaction approval | Accepting a stranger (FAR) | high |
| Border gate | Letting a stranger through (FAR) | high; rejected travelers go to an officer |
Comparing systems needs more than the number at one threshold. Sweeping the threshold and plotting FAR on one axis against FRR on the other gives a DET curve; the closer the curve is to the origin, the better the system. The EER is a one-number summary of that curve.
Saying "this system is 98% accurate". It is not clear at which threshold, on which data set, and with which error counted. In the data above, at threshold 0.8 FAR is zero but 40% of genuine users are rejected. Biometric performance is reported as a FAR and FRR pair, or as a DET curve.
24.5Templates and matching
Comparing raw images directly does not work: the same face looks very different pixel by pixel under different light, pose and angle. So features are extracted first and the person is represented by a template. The kind of template depends on the method: positions of ridge endings and bifurcations in a fingerprint (minutiae), a vector of numbers from a deep network in face recognition (an embedding), a binary code in the iris. The matcher fits the kind of template.
24.5.1Cosine similarity for embeddings
If a face or voice template is a vector, the most common similarity is the cosine of the angle between two vectors: cos(a, b) = a·b / (‖a‖ ‖b‖). Vectors pointing the same way give 1, perpendicular ones give 0.
For illustration take two-dimensional embeddings (the values are illustrative). The enrolled template is a = (3, 4); new samples are b = (4, 3) and c = (4, −3). The accept threshold is 0.9.
- Norms. ‖a‖ = √(9 + 16) = 5; ‖b‖ = ‖c‖ = 5.
- For b. a·b = 12 + 12 = 24; cos = 24/25 = 0.96 ≥ 0.9: accept.
- For c. a·c = 12 − 12 = 0; cos = 0 < 0.9: reject.
Real embeddings have 128 or 512 dimensions, but the computation is the same.
24.5.2Hamming distance for iris codes
In Daugman's method the iris texture is turned into a binary code, and the fraction of differing bits between two codes is measured. Bits covered by an eyelid or eyelashes are unreliable; they are marked by a mask, and only bits valid in both codes are counted.
Two 16-bit codes (the values are illustrative):
- a = 1011 0011 1010 0101, mask: first 12 bits valid
- b = 1011 1011 1000 0101, mask: all 16 bits valid
- Jointly valid bits. The intersection of the two masks is the first 12 bits: 12 bits.
- Differences. The codes differ only at the 5th and 11th bits (counting from the left); both are within the first 12: 2 differences.
- Distance. 2/12 ≈ 0.17.
Two measurements of the same iris give a small distance; for different irises the bits behave independently, so the distance stays near 0.5. The threshold goes between these two distributions.
Expecting the distance between two different people to be close to 1. Two random binary codes agree on about half of their bits; "completely unrelated" means a distance of 0.5. A distance near 1 would mean one code is the inverse of the other.
24.6Scale in identification, spoofing and score fusion
In verification each attempt is a single comparison; in identification the sample is compared with every template in the gallery. If the false accept probability of one comparison is FAR, the probability of at least one false match in a gallery of N templates (assuming the comparisons are independent) is:
P = 1 − (1 − FAR)N. When N · FAR is small, P ≈ N · FAR.
The matcher has FAR 10−5. That looks very good for verification (on average 1 false accept in 100,000 attempts).
- Gallery of N = 100,000 people. Expected false matches: N · FAR = 1. Probability: 1 − (1 − 10−5)100000 ≈ 1 − 0.368 = 0.632.
- So in each search an innocent person shows up as a candidate with about 63% probability.
- Tightening the matcher ten times (FAR = 10−6) gives 1 − (1 − 10−6)100000 ≈ 0.095; still about 10%.
This is why large-scale identification sets matchers to a very low FAR, hands the result list to a human examiner, and uses indexing and pre-filtering.
One way to lower the error rates is to combine several modalities. Scores may be on different scales, so they are first brought to the same range (for example min-max normalization: (s − min)/(max − min)) and then added or averaged.
The face score is already between 0 and 1: 0.80. The speaker score is scaled between 20 and 80 and came out as 62 in this attempt.
- Normalize. Voice: (62 − 20)/(80 − 20) = 42/60 = 0.70.
- Combine. Average: (0.80 + 0.70)/2 = 0.75.
- Decide. With threshold 0.7, 0.75 ≥ 0.7: accept.
The main gain of fusion is that when one modality is weak (a noisy room, a dirty finger) the other can carry the decision; an attacker also has to fake both modalities at once.
Assuming that a matcher that does well in verification will do equally well on a large gallery. FAR measures one comparison; as the gallery grows, the probability of a false match grows with N as shown above.
24.6.1Presentation attacks
However good the matcher is, a photograph or a molded finger held to the sensor can fool it. Liveness detection (presentation attack detection) treats this as a separate classification problem: is this a live sample or a fake presentation? It has its own error rates, reported separately from matching errors.
24.7How is the course taught?
24.7.1A typical workflow
A phone's face unlock captures the face with an infrared camera, detects and aligns it, extracts an embedding with a deep network, measures similarity to the enrolled template and unlocks if the score passes the threshold. A liveness check stops a photo from unlocking it.
24.7.2Topics over the semester
- Biometric systems: enroll, verify, identify
- Measuring performance: FAR, FRR, ROC, DET, EER
- Fingerprints: preprocessing, minutiae, matching
- Face detection and alignment
- Face recognition: eigenfaces, LBP, deep embeddings
- Iris: segmentation, Daugman's code, Hamming distance
- Speaker verification from voice
- Behavioral biometrics: signature, gait, keystrokes
- Multimodal biometrics and score fusion
- Presentation attacks and liveness detection
- Template protection and cancellable biometrics
- Large-scale identification, indexing and standards
This is a typical semester; the order and coverage vary between universities.
24.7.3Skills you will gain
- face processing with OpenCV and dlib
- extracting face embeddings with InsightFace
- plotting DET curves and computing EER
- choosing a threshold by application risk
- measuring performance per group
24.7.4Try it yourself
The Try It: Who Should the Gate Let In? slide in the presentation lets you solve a typical problem of this course yourself: A face recognition gate gives each person a similarity score between 0 and 1; if the score passes the threshold, the gate opens. Move the threshold or pick a scenario to see the trade-off between accepting impostors and rejecting genuine users.
24.8Are you ready for this course?
24.8.1Prerequisites
| Course | Why it is needed |
|---|---|
| Pattern Recognition | matching, verification and identification |
| Computer Vision | face recognition |
| Programming | reading images and working with vectors in Python |
| Data Structures | indexing to scan millions of templates quickly in 1:N search |
24.8.2Ask yourself
For every "no", the right-hand column shows where to start. If you can say "yes" to most of them, you are ready.
| Question | If not, start with |
|---|---|
| Can you load an image, crop it and convert it to grayscale? | Image Processing |
| Can you explain a classifier's ROC curve and false positive rate? | Pattern Recognition |
| Can you compute the cosine similarity between two vectors? | Linear Algebra |
| Can you process a folder of images with NumPy arrays in Python? | An intro programming course, then a short NumPy tutorial |
24.9Neighboring courses
24.9.1Where it overlaps
| Relation | Course | Shared ground |
|---|---|---|
| application | This course applies the methods of Pattern Recognition | matching, verification and identification |
| application | This course applies the methods of Computer Vision | face recognition |
| shares methods | Shares methods with AI in Cybersecurity | authentication, spoof detection |
24.9.2Where it differs
- Pattern Recognition: Pattern recognition assigns a sample to classes; biometrics recognizes people, with as many classes as people, always growing.
- Computer Vision: Computer vision tries to understand everything in an image; biometrics is a narrow, security-focused task that asks only identity.
- AI in Cybersecurity: AI in cybersecurity catches attacks; biometrics is authentication itself and must resist spoofing attacks.
- Speech Recognition and Audio Processing: Speech recognition finds what was said; speaker recognition, a biometric, finds who said it.
24.10In practice
24.10.1Applications
| Area | What is done |
|---|---|
| Phone unlock | Unlocking devices by face and fingerprint. |
| Border control | Automated gates using e-passport photos. |
| Forensics | Searching crime-scene prints in databases. |
| Banking | Remote customer verification, payment approval. |
| Access control | Building entry and staff time records. |
| Civil registration | Preventing duplicates in national ID systems. |
24.10.2Risks and ethics
| Risk | Explanation |
|---|---|
| Mass surveillance | Real-time face recognition in public spaces makes it possible to track everyone without asking; many countries restrict it by law. |
| Arrests from false matches | In the US there are documented cases of innocent people being detained on the strength of a false face recognition match. |
| Function creep | Face or fingerprint data collected for door access can be reused for other purposes; GDPR and similar laws treat it as special-category data. |
| Central template stores | Holding millions of templates in one place exposes everyone at once; the 2015 US OPM breach leaked 5.6 million fingerprints. |
These issues are discussed in depth in Explainable AI and AI Ethics.
24.10.3Tools and datasets
Tools: OpenCV, dlib, InsightFace, NIST NBIS, SpeechBrain.
Well-known datasets: LFW (Labeled Faces in the Wild), VGGFace2, FVC2004 (fingerprint), CASIA-Iris, VoxCeleb (speaker).
Biometric data is personal data: it falls under KVKK and GDPR; some face datasets were withdrawn for this reason.
24.11Common misconceptions
Biometric systems make no mistakes.
Every system makes false accepts and false rejects; the threshold chooses between them.
Biometric data can be changed like a password.
A face or fingerprint cannot be changed; a leaked template is a permanent risk, so templates need protection.
Accuracy is the same for everyone.
Performance can vary with age, skin tone and sensor; evaluation is done per group.
A match means the person is there.
Presentation attacks use photos, masks or recorded voice; liveness detection is needed.
24.12Summary
- A biometric system has enrollment (template extraction), matching (similarity score) and decision (threshold) steps; verification is a 1:1 question and identification a 1:N question.
- The threshold trades the two errors: raising it lowers FAR and raises FRR. The EER is where they are equal; systems are compared with DET curves, and a single number such as "98% accurate" is not enough.
- Templates are compared with a matcher that fits them: cosine similarity for embeddings, masked Hamming distance for iris codes; for different people the iris distance is near 0.5.
- As the gallery grows, the probability of at least one false match rises as 1 − (1 − FAR)N, so identification needs a much lower FAR.
- Biometric data is personal data and cannot be changed; presentation attacks call for liveness detection and leaks call for template protection.
24.13Test Yourself
With the score lists from the example, what are FAR and FRR at threshold 0.8? (Genuine: 0.91 0.84 0.77 0.95 0.62 0.88 0.71 0.80 0.93 0.55; impostor: 0.12 0.35 0.48 0.22 0.67 0.30 0.41 0.58 0.18 0.74.) A score greater than or equal to the threshold is accepted.
Answer
Rejected genuine scores are 0.77, 0.62, 0.71, 0.55: FRR = 4/10 = 0.4. The score 0.80 passes. No impostor reaches 0.8: FAR = 0. The threshold is high, so no stranger gets in, but 40% of genuine users are rejected.
The enrolled template is a = (1, 2) and the new sample is b = (2, 1). What is the cosine similarity? What is the outcome with threshold 0.9?
Answer
a·b = 2 + 2 = 4; ‖a‖ = ‖b‖ = √5; cos = 4/5 = 0.8 < 0.9: reject.
Two 8-bit iris codes: a = 10110010, b = 10010110. Mask: only the first 6 bits from the left are valid (in both codes). What is the masked Hamming distance? What would it be if the mask were ignored?
Answer
Counting from the left the codes differ at the 3rd and 6th bits; both are within the first 6. Masked distance 2/6 ≈ 0.33. Ignoring the mask gives 2/8 = 0.25; counting unreliable bits too makes the distance look smaller than it is.
An identification system has FAR 10−4 and a gallery of 2,000 people. What is the approximate probability of at least one false match in one search?
Answer
1 − (1 − 10−4)2000 ≈ 0.181. The approximation N · FAR = 0.2 is a little off because N · FAR is not small.
The face score is 0.60 and the speaker score is 50 (voice scores range from 20 to 80). Min-max normalize and average. What is the outcome with threshold 0.6?
Answer
Voice: (50 − 20)/60 = 0.5. Average (0.6 + 0.5)/2 = 0.55 < 0.6: reject.
A company stores its employees' fingerprint templates on a single server. If the server leaks, how does this differ from a password leak, and what can be done?
Answer
A fingerprint cannot be changed; a leaked template is a lifelong risk for its owner. Templates should be stored encrypted, kept on the device where possible, or protected with cancelable biometrics (transforming the template irreversibly and changing the transform after a leak).
24.14After this course
Biometrics is where pattern recognition and vision meet security. From here you can move to deep face recognition and speaker recognition, to cybersecurity through spoof detection, or to explainable AI and ethics through questions of fairness and privacy.
Related careers: Biometrics engineer, Computer vision engineer, Identity and access management specialist, Digital forensics specialist.
24.15Further reading
- A. K. Jain, A. Ross and K. Nandakumar, Introduction to Biometrics (2011): covers templates, matching, error rates and system design in one book.
- D. Maltoni, D. Maio, A. K. Jain and J. Feng, Handbook of Fingerprint Recognition (3rd ed., 2022): treats fingerprint preprocessing, minutiae and matching in detail.
- J. Daugman, "How Iris Recognition Works", IEEE Transactions on Circuits and Systems for Video Technology (2004): a concise account of the iris code and Hamming distance method from its author.
24.16References
- Jain, Ross and Nandakumar, Introduction to Biometrics, Springer, 2011.
- Li and Jain (eds.), Handbook of Face Recognition, 2nd ed., Springer, 2011.
- Maltoni, Maio, Jain and Feng, Handbook of Fingerprint Recognition, 3rd ed., Springer, 2022.
- Daugman, "How Iris Recognition Works", IEEE Transactions on Circuits and Systems for Video Technology 14(1), 2004.
Related pages: Slides · Slides (PDF) · Course page