Attendance is more than a daily register. A school has to coordinate the timetable, open and close sessions, handle late arrivals and absences, catch people who should not be in a class, and show the right information to teachers, administrators and students. FaceAttend, which I built and delivered through SaleForgers, puts facial recognition inside that whole workflow.
The recognition pipeline
- Detect faces. YuNet, a fast neural face detector available through OpenCV, finds faces in each frame.
- Create an embedding. InsightFace's ArcFace model turns each face into a 512-dimensional vector. Faces of the same person land close together; different people land far apart.
- Compare. Each new embedding is compared with the enrolled students' embeddings using similarity. A match needs to clear a configurable threshold, 0.6 by default.
- Store more than one face. Each student can have several embeddings, which makes recognition more robust to lighting, angle and glasses.
The timetable starts the story
Recognition alone does not make an attendance system. FaceAttend is driven by the timetable:
- A scheduler checks the timetable every minute and creates sessions automatically.
- Sessions move from scheduled to active when the class starts, then to completed.
- Students recognised within the late threshold are marked present; after it, late.
- After the threshold plus a buffer, enrolled students who were not seen are marked absent automatically.
Rules that build trust
- Enrolment is enforced. Only students enrolled in the course can be marked present or late.
- Intruders are logged. A registered student who appears in a class they are not enrolled in is recorded as an intruder.
- Re-entries are flagged. Multiple appearances are logged as suspicious events rather than silently ignored.
- History is kept. Deleting a student is a soft delete, so past records stay intact.
Bugs that taught me the most
Three fixes made the biggest difference to reliability:
- Time zones. The scheduler and the attendance logic must use the same clock. Mixing UTC and local time created sessions at the wrong moment, so everything moved to local time consistently.
- One "now" per operation. Reading the current time once per operation, rather than several times, made late detection consistent.
- Counting correctly. Intruder records were excluded from the "attended" count, so absentees are marked correctly.
Enrolment done right
Most recognition problems start at enrolment, not in the model:
- Capture several photos per student, from slightly different angles.
- Use the lighting of the real classroom where possible.
- Re-enrol when appearance changes a lot, such as new glasses or a beard.
- Keep enrolment supervised, so the right face is attached to the right record.
Choosing the threshold
The similarity threshold is a trade-off. Set it too low and the system may mark the wrong student present, which is a false accept. Set it too high and it misses real students, which is a false reject. For attendance, a false accept is usually worse than a false reject, because a teacher can fix a missed student in seconds but may never notice a wrong one. Start strict, measure on real classes and adjust.
Running it in a real classroom
- Camera placement: at the entrance or facing the class, at face height, away from strong backlight.
- Session detection: the recognition client checks for the active session every 30 seconds until one appears, so it starts on time without manual steps.
- Backend processing: recognition runs on a backend service, so the classroom device only needs to capture and send frames.
What I would add next
The codebase includes a K-of-N stabiliser that requires a student to be recognised in several frames before they are marked. It is not yet wired into the live recognition endpoint, which uses single-pass matching today. Turning it on is the next step for reducing false matches in busy rooms.
Privacy
Biometric data deserves care. FaceAttend matches students by their embeddings, and the public case study shows no student images or biometric records. Visibility is role-based, so teachers, administrators and students see only the attendance information relevant to them.
Beyond attendance
The attendance engine sits inside a wider school platform: student and staff management, fee administration with automatic vouchers and sibling approvals, and examinations with grading and score cards. Attendance is valuable because it connects to everything else.
Read the FaceAttend case study, or see how I approach machine learning and custom software.
