In face recognition, the key metrics are Precision and Recall. Precision tells us how many faces identified as a person are actually correct. Recall tells us how many faces of that person the system found out of all the faces it should find. Both matter because we want to avoid mistakes like wrongly recognizing someone (low precision) and missing a person's face (low recall). The F1 score balances these two, giving a single number to check overall performance.
Confusion Matrix for Face Recognition
| Predicted Positive | Predicted Negative |
|--------------------|--------------------|
| True Positive (TP) | False Negative (FN) |
| False Positive (FP) | True Negative (TN) |
Example:
Suppose we have 100 face images of a person.
- TP = 85 (correctly recognized faces)
- FN = 15 (faces missed)
- FP = 10 (wrongly recognized as this person)
- TN = 200 (correctly identified as not this person)
Total samples = TP + FP + TN + FN = 85 + 10 + 200 + 15 = 310
Precision vs Recall Tradeoff in Face Recognition
Imagine a security system that unlocks doors using face recognition.
High Precision: The system rarely lets in the wrong person. This is important to keep the place safe.
High Recall: The system recognizes almost all authorized people, so they don't get locked out.
If the system focuses only on precision, it might miss some authorized people (low recall). If it focuses only on recall, it might let in some wrong people (low precision). We must find a good balance depending on what is more important.
What Good vs Bad Metrics Look Like for Face Recognition
Good: Precision and Recall both above 90%. This means the system correctly recognizes most faces and rarely makes mistakes.
Bad: Precision below 70% means many false recognitions. Recall below 70% means many missed faces. Either case makes the system unreliable.
Common Metrics Pitfalls in Face Recognition
Accuracy Paradox: If most images are of different people, a model that always says "not this person" can have high accuracy but be useless.
Data Leakage: If the same face images appear in training and testing, metrics will look better than reality.
Overfitting: Very high training metrics but poor test metrics mean the model memorizes faces instead of learning to recognize new ones.
Self Check: Your model has 98% accuracy but 12% recall on recognizing a person's face. Is it good?
No, it is not good. The high accuracy is misleading because most images are not that person's face, so the model guesses "not this person" most of the time. The very low recall means it misses almost all faces of that person, which defeats the purpose of face recognition.
Key Result
Precision and recall are key for face recognition; high accuracy alone can be misleading.
Practice
(1/5)
1. What is the main goal of face recognition in computer vision?
easy
A. To convert images into black and white
B. To detect objects like cars and trees in images
C. To generate new faces from random noise
D. To identify or verify a person using their facial features
Solution
Step 1: Understand the purpose of face recognition
Face recognition is designed to find out who a person is by looking at their face.
Step 2: Compare with other options
Options A, B, and C describe different tasks unrelated to identifying people by faces.
Final Answer:
To identify or verify a person using their facial features -> Option D
Quick Check:
Face recognition = Identify person by face [OK]
Hint: Face recognition means finding who the face belongs to [OK]
Common Mistakes:
Confusing face recognition with object detection
Thinking face recognition creates new images
Mixing up image color processing with recognition
2. Which of the following is the correct step to train a face recognition model?
easy
A. Collect face images with labels and train the model to learn features
B. Randomly assign labels to images without training
C. Use face images only without any labels
D. Train the model using only text data about faces
Solution
Step 1: Identify training requirements
Training a face recognition model needs images and their correct labels to learn who is who.
Step 2: Eliminate incorrect options
Options A, B, and D miss key parts: no labels (A), random labels (B), or no images (D), which won't train properly.
Final Answer:
Collect face images with labels and train the model to learn features -> Option A
Quick Check:
Training needs images + labels [OK]
Hint: Training needs labeled face images, not random or unlabeled data [OK]
Common Mistakes:
Ignoring the need for labels during training
Thinking unlabeled images are enough
Confusing text data with image data for training
3. Given this Python snippet for face recognition, what will be the output?
known_faces = {"Alice": [0.1, 0.2, 0.3], "Bob": [0.4, 0.5, 0.6]}
new_face = [0.1, 0.2, 0.31]
# Simple distance check
def recognize(face):
for name, features in known_faces.items():
dist = sum((f - nf) ** 2 for f, nf in zip(features, face)) ** 0.5
if dist < 0.05:
return name
return "Unknown"
print(recognize(new_face))
medium
A. Bob
B. Alice
C. Unknown
D. Error
Solution
Step 1: Calculate distance between new_face and known faces