Description
Establish ground-truth accuracy metrics for the face recognition system used in proctoring identity verification.
The frontend uses @vladmandic/face-api (TinyFaceDetector + FaceRecognitionNet) to compare captured face embeddings against a reference enrollment photo. Identity mismatch is flagged when Euclidean distance exceeds MATCH_THRESHOLD = 0.55 (hardcoded). However, no accuracy evaluation exists — the similarity scores are not persisted, and no test set validates performance across varied conditions (lighting, angle, glasses, etc.).
Current Implementation
- Detection + Recognition:
frontend/src/components/ai/FaceRecognitionComponent.tsx uses @vladmandic/face-api with TinyFaceDetector, FaceLandmark68, and FaceRecognitionNet
- Threshold: Line 16 —
MATCH_THRESHOLD = 0.55 (Euclidean distance in 128-dim embedding space)
- Anomaly mapping: Flags
AnomalyType.FACE_RECOGNITION when distance > 0.55 (different person)
- Backend logging:
backend/src/modules/anomalies/controllers/AnomalyController.ts stores captured image evidence but no similarity scores
Work Required
-
Build a labeled test set (~100–200 image pairs per person, 3–5 enrollees) covering:
- Same person, same conditions (baseline — should match)
- Same person, varied conditions (different lighting, angle, expression, glasses/mask, time delta)
- Different person (impostor attempts — should not match)
- Hard negatives (similar face features, different person)
-
Persist similarity scores — modify the recognition component to log Euclidean distance alongside each recognition attempt (both matched and flagged anomalies)
-
Run offline evaluation against the test set:
- Compute True Positive Rate (genuine matches correctly accepted) and False Negative Rate (genuine rejected)
- Compute False Positive Rate (impostor accepted) and True Negative Rate (impostor correctly rejected)
- ROC curve (sweep threshold 0.3–0.8) to find operating point
- Break down performance by condition (time delta, lighting, occlusion, etc.)
-
Document results in a test report with:
- Equal Error Rate (EER) and optimal threshold recommendation
- False Accept Rate (FAR) and False Reject Rate (FRR) at current (0.55) and recommended thresholds
- Accuracy by condition (same-day vs. different-day, lighting, etc.)
- Security assessment: is EER acceptable for exam proctoring? (typical target: EER < 2–5%)
- Comparison to industry baselines (if available)
Acceptance Criteria
Related
- Frontend: frontend/src/components/ai/FaceRecognitionComponent.tsx
- Backend: backend/src/modules/anomalies/controllers/AnomalyController.ts
- Model: @vladmandic/face-api (face-api.js)
- Embedding space: 128-dimensional FaceRecognitionNet output
Description
Establish ground-truth accuracy metrics for the face recognition system used in proctoring identity verification.
The frontend uses @vladmandic/face-api (TinyFaceDetector + FaceRecognitionNet) to compare captured face embeddings against a reference enrollment photo. Identity mismatch is flagged when Euclidean distance exceeds
MATCH_THRESHOLD = 0.55(hardcoded). However, no accuracy evaluation exists — the similarity scores are not persisted, and no test set validates performance across varied conditions (lighting, angle, glasses, etc.).Current Implementation
frontend/src/components/ai/FaceRecognitionComponent.tsxuses@vladmandic/face-apiwith TinyFaceDetector, FaceLandmark68, and FaceRecognitionNetMATCH_THRESHOLD = 0.55(Euclidean distance in 128-dim embedding space)AnomalyType.FACE_RECOGNITIONwhen distance > 0.55 (different person)backend/src/modules/anomalies/controllers/AnomalyController.tsstores captured image evidence but no similarity scoresWork Required
Build a labeled test set (~100–200 image pairs per person, 3–5 enrollees) covering:
Persist similarity scores — modify the recognition component to log Euclidean distance alongside each recognition attempt (both matched and flagged anomalies)
Run offline evaluation against the test set:
Document results in a test report with:
Acceptance Criteria
Related