Description
Establish ground-truth accuracy metrics for the voice/speech detection system used in proctoring.
The frontend currently uses MediaPipe's AudioClassifier with the YAMNet model to classify audio and flag isSpeaking when the top category is "Speech" with score > 0.5. However, no accuracy evaluation exists — the confidence scores are discarded after thresholding, and no test set validates behavior across exam-room acoustic conditions (typing, background noise, etc.).
Current Implementation
- Detection:
frontend/src/components/ai/SpeechDetector.tsx uses @mediapipe/tasks-audio AudioClassifier with YAMNet model
- Thresholding: Lines 84-88 — flags
isSpeaking when top class is "Speech" with score > 0.5 (generic YAMNet default, not tuned for proctoring)
- Backend logging:
backend/src/modules/anomalies/controllers/AnomalyController.ts /record/audio endpoint stores evidence files but no confidence scores
Work Required
-
Build a labeled audio test set (~100–200 clips, 500ms windows) covering:
- Silence (empty room)
- One person speaking (normal exam scenario)
- Background chatter/TV/video
- Typing/keyboard noise
- Music or other sound sources
- Mixed scenarios (person talking + typing)
-
Persist confidence scores — modify voice anomaly endpoints to include YAMNet's top-class confidence score and full class distribution
-
Run offline evaluation against the test set:
- Compute precision/recall/F1 for the
"Speech" class at threshold 0.5
- Sweep the threshold (0.3–0.9) and build ROC/PR curves
- Break down performance by condition (clean speech, background noise, etc.)
- Identify optimal threshold that minimizes false positives (typing flagged as speech) while keeping false negatives low
-
Document results in a test report with:
- Accuracy metrics at current (0.5) and recommended thresholds
- False positive/negative rates by scenario
- ROC/PR curves
- Recommendation: should threshold be tuned? Is accuracy acceptable?
Acceptance Criteria
Related
Description
Establish ground-truth accuracy metrics for the voice/speech detection system used in proctoring.
The frontend currently uses MediaPipe's AudioClassifier with the YAMNet model to classify audio and flag
isSpeakingwhen the top category is"Speech"withscore > 0.5. However, no accuracy evaluation exists — the confidence scores are discarded after thresholding, and no test set validates behavior across exam-room acoustic conditions (typing, background noise, etc.).Current Implementation
frontend/src/components/ai/SpeechDetector.tsxuses@mediapipe/tasks-audioAudioClassifier with YAMNet modelisSpeakingwhen top class is"Speech"withscore > 0.5(generic YAMNet default, not tuned for proctoring)backend/src/modules/anomalies/controllers/AnomalyController.ts/record/audioendpoint stores evidence files but no confidence scoresWork Required
Build a labeled audio test set (~100–200 clips, 500ms windows) covering:
Persist confidence scores — modify voice anomaly endpoints to include YAMNet's top-class confidence score and full class distribution
Run offline evaluation against the test set:
"Speech"class at threshold 0.5Document results in a test report with:
Acceptance Criteria
Related