Description
Establish ground-truth accuracy metrics for the face count detection system used in proctoring.
The frontend currently uses @tensorflow-models/face-detection (MediaPipe face detector) to flag NO_FACE (0 faces) and MULTIPLE_FACES (>1 face) anomalies. However, no accuracy evaluation exists — the model's confidence scores are discarded, and no test set validates behavior across real exam conditions.
Current Implementation
- Detection:
frontend/src/components/ai/FaceDetectorWorker.ts runs MediaPipe face detector with maxFaces: 10
- Anomaly mapping:
frontend/src/components/floating-video.tsx lines 599-619 — captures screenshot and POSTs to backend
- Backend logging:
backend/src/modules/anomalies/controllers/AnomalyController.ts stores evidence but no confidence scores
Work Required
-
Build a labeled test set (~200–300 frames) covering:
- 0 faces (empty desk, user moved away)
- 1 face (normal exam position)
- 2+ faces (peer present, multiple people in frame)
- Edge cases: masks, partial occlusion, side angles, poor lighting, virtual camera detection
-
Persist confidence scores — modify anomaly endpoints to include per-face detection confidence from the model
-
Run offline evaluation against the test set:
- Compute precision/recall/F1 for NO_FACE and MULTIPLE_FACES flags
- Confusion matrix by face count bucket
- Break down performance by condition (lighting, angle, etc.)
-
Document results in a test report with:
- Accuracy metrics by condition
- False positive/negative rates by scenario
- Recommendations for threshold tuning (if needed)
- Decision: is current accuracy acceptable for proctoring, or does model need retraining/replacement?
Acceptance Criteria
Related
- Frontend: frontend/src/components/ai/FaceDetectorWorker.ts
- Frontend: frontend/src/components/floating-video.tsx
- Backend: backend/src/modules/anomalies/controllers/AnomalyController.ts
Description
Establish ground-truth accuracy metrics for the face count detection system used in proctoring.
The frontend currently uses @tensorflow-models/face-detection (MediaPipe face detector) to flag NO_FACE (0 faces) and MULTIPLE_FACES (>1 face) anomalies. However, no accuracy evaluation exists — the model's confidence scores are discarded, and no test set validates behavior across real exam conditions.
Current Implementation
frontend/src/components/ai/FaceDetectorWorker.tsruns MediaPipe face detector withmaxFaces: 10frontend/src/components/floating-video.tsxlines 599-619 — captures screenshot and POSTs to backendbackend/src/modules/anomalies/controllers/AnomalyController.tsstores evidence but no confidence scoresWork Required
Build a labeled test set (~200–300 frames) covering:
Persist confidence scores — modify anomaly endpoints to include per-face detection confidence from the model
Run offline evaluation against the test set:
Document results in a test report with:
Acceptance Criteria
Related