ResNet-50 backbone trained with ArcFace loss on VGGFace2 — production-grade face embeddings for real-world identity verification.
This model is part of a broader comparative study of deep face recognition loss functions (ArcFace, SphereFace, Triplet Loss). After systematic evaluation across three experimental rounds, ArcFace was selected as the production model based on its training stability, numerical reliability at scale, and consistent generalization gains as data grows.
📊 Model Performance
Metric
Value
Training Accuracy
99%
Validation Accuracy
85%
Training Loss
0.03
Validation Loss
4.00
Training Identities
3,000
Images per Identity
~200
Epochs
100
Validation loss reflects expected open-set generalization behavior — the model is trained on a closed identity set and evaluated against unseen faces. This gap narrows with more training data.
This model powers a complete two-stage attendance system:
Stage 1 — Database Population (build_database.py)
Registers known identities by computing gallery embeddings and storing them in ChromaDB (vector similarity search) linked to identity metadata in MongoDB. Runs a built-in Top-K evaluation on held-out probe images after registration.
Reads a live webcam feed, detects faces with MTCNN, embeds each crop through this model, and queries ChromaDB for the nearest registered identity. Recognized faces are labeled with name and similarity score; unknown faces are flagged. A cooldown timer prevents duplicate attendance logs.
📈 Gallery Evaluation Results
Evaluated on 50 registered identities (250 held-out probe images, never seen during training or registration):
Metric
Result
Top-1 Accuracy
92.00% (230 / 250)
Top-3 Accuracy
96.00% (240 / 250)
Top-5 Accuracy
96.80% (242 / 250)
Failed reads
0 / 250
Probe images are drawn from the same VGGFace2 distribution as the gallery but are a completely separate split — never used during model training or gallery registration.
🔬 Why ArcFace for Production
ArcFace was selected over SphereFace (the Round 3 LFW leader) based on engineering considerations critical for deployment:
Additive angular margin has a direct geometric interpretation on the hypersphere — the decision boundary is fixed and predictable, making threshold calibration reliable across unseen identities.
Numerical stability at scale — SphereFace's multiplicative margin becomes sensitive as class count increases. ArcFace's formulation remains stable regardless.
Consistent data scaling — validation accuracy improved monotonically from 83% (1,000 identities) to 85% (3,000 identities), confirming predictable generalization gains as the training set grows.
Industry standard — ArcFace is the de facto choice in production face recognition systems, with extensive tooling for quantization, ONNX export, and edge deployment.
1@inproceedings{deng2019arcface,
2 title = {ArcFace: Additive Angular Margin Loss for Deep Face Recognition},
3 author = {Deng, Jiankang and Guo, Jia and Xue, Niannan and Zafeiriou, Stefanos},
4 booktitle = {CVPR},
5 year = {2019}
6}
⚠️ Limitations & Responsible Use
This model was trained on a subset of VGGFace2. Performance may degrade on faces from demographics underrepresented in the training data.
The model is intended for attendance and access control systems where subjects have consented to enrollment.
Do not use for surveillance, tracking, or identification of individuals without explicit consent.
Threshold selection (default: 0.5 cosine similarity) should be calibrated to your deployment environment — lower thresholds increase false acceptances, higher thresholds increase false rejections.