100 beginner machine learning projects with runnable Python code, tests and honest case studies. By Networkers Home, Bangalore.
This small educational project demonstrates a closed-set face-recognition style experiment using synthetic, consent-like embeddings. It explains verification versus identification, offers an unknown-person path, and reports simple rates: top-1 identification accuracy, false-match rate (FMR) and false-non-match rate (FNMR). The code uses small synthetic embeddings that mimic per-person variation across two sessions. This is a classroom prototype only — it is deliberately local, small and non-operational and must not be used for any real identity decision.
The dataset is synthetic: we simulate 12 identities (classes). For each identity we create multiple embedding vectors (128-d) by sampling from a Gaussian centred on a per-identity prototype. A second session for each identity is generated by shifting prototypes slightly to simulate temporal variation. We also generate truly unknown embeddings (not belonging to any enrolled identity) to exercise the unknown-person path. This is a pedagogic stand-in for image embeddings; no photographs are used.
Run python project.py. The script prints a JSON dictionary of metrics for a single deterministic run. To reproduce, call run(seed=42) from Python.
Run pytest. Tests check: the function returns the expected metric keys, metric ranges are sensible, a conservative floor for the held-out top-1 accuracy is met, and the main metric is deterministic for the same seed.
Measured by running python project.py (seed 42) on 2026-10-23; the tests in test_project.py assert the floor.
| Metric | Value |
|---|---|
| top1_accuracy | 1 |
| false_match_rate | 0 |
| false_non_match_rate | 0 |
| unknown_reject_rate | 1 |
| threshold | 0.3200 |
| gallery_size | 12 |
Read the
top1_accuracy,unknown_reject_ratevalue with care: the data here is small and synthetic with a planted, learnable structure, so a near-perfect score shows the pipeline works, not that the method would reach this on real data. See Limitations.
This project uses synthetic embeddings, not face photographs or real consented face data. The simulated embeddings are simplified: they omit many real-world effects (lighting, pose, occlusion, demographic variation, sensor differences, adversarial spoofing). The experiment is educational and not suitable for deployment, surveillance, access control or forensic use. Numerical results here do not generalise to real face-recognition systems.
Possible extensions: replace synthetic embeddings with instructor-provided, ethically consented embeddings; compare different embedding sizes or distance metrics; introduce more realistic session noise; and add calibration experiments for thresholds. All extensions must respect explicit consent, data minimisation and strong review before any operational use.
Full case study, build steps and evaluation checks: Face recognition system on networkershome.com
Built by Networkers Home · Learn the skills in the AI Engineer Course · Part of 100 AI projects with code