Model Pipeline - Face recognition concept
This pipeline identifies who a person is by looking at their face in a photo. It learns from many face pictures, then can recognize new faces by comparing features.
This pipeline identifies who a person is by looking at their face in a photo. It learns from many face pictures, then can recognize new faces by comparing features.
Loss 1.2 |**** 0.9 |*** 0.7 |** 0.5 |* 0.35| Epochs -> 1 2 3 4 5
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 1.2 | 0.45 | Model starts learning basic face features |
| 2 | 0.9 | 0.60 | Accuracy improves as model learns better features |
| 3 | 0.7 | 0.72 | Model refines feature extraction |
| 4 | 0.5 | 0.82 | Face embeddings become more distinct |
| 5 | 0.35 | 0.90 | Model achieves good recognition accuracy |
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))known_faces = {"Alice": [0.1, 0.2, 0.3]}
new_face = [0.1, 0.2, 0.3]
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))Pass the test and this pattern moves unknown