Computer vision · 2025

Face recognition attendance

Attendance from ordinary cameras with a liveness check, SCRFD detection and ArcFace recognition in ONNX, served by FastAPI over HTTP and WebSocket to a Next.js front end.

+5 % accuracy vs YOLOv5 on real cameras, 10 % less compute

Camera frame with detected faces and recognised identities
Full write-up: problem, architecture, results, training, lessons. One-minute summary. Switch to Deep dive for the full write-up.
Problem
Taking attendance from a camera fails on real footage: small faces, motion blur, mixed lighting. A single detector-classifier trained end to end (the YOLOv5 baseline) could not keep up as the number of people grew.
Approach
A liveness check first, then two decoupled stages: SCRFD for face detection and ArcFace (ResNet-50, Additive Angular Margin Loss) for identity embeddings, matched against enrolled faces with a similarity threshold of 0.4. Both models run in ONNX behind FastAPI, over a POST endpoint and a WebSocket for live frames, with a Next.js front end that exports attendance to CSV.
Result
5 % higher accuracy than the YOLOv5 baseline on real-world cameras. Decoupling detection from recognition cut compute cost by 10 % while raising overall accuracy by 12 %, because each stage could be sized and retrained independently.

Problem

[Who used it, how many people, which cameras. Describe the failure modes of the baseline you replaced: for example new enrolments forcing a retrain of the whole model, or small faces at the back of the room.]

Architecture

Pipeline — select a block to read what it does

Results

Pipeline Accuracy on real cameras Compute
YOLOv5 single-stage baseline reference reference
SCRFD + ArcFace, decoupled +5 % vs YOLOv5; +12 % overall after decoupling −10 %

[Replace “reference” with the absolute numbers and say how accuracy was measured: number of sessions, number of identities, threshold used.]

Challenges and lessons

  • Thresholds matter more than the model. [Note how you chose the cosine threshold and what false-accept / false-reject trade-off you landed on.]
  • Enrolment quality. [What enrolment protocol you used: how many photos, which angles, how you rejected bad ones.]
  • ONNX export. [Any operator or precision issue when exporting ArcFace, and the latency you measured on CPU vs GPU.]

The demo is hosted at attendance-frontend-sandy.vercel.app. Nothing loads until you ask.