Built
Face Attendance System
Webcam attendance that recognises employees and records when they arrive and leave.
The context
Employees shouldn't have to sign a register or punch a card. The system recognises a face and saves clock-in and clock-out times in a database.
What I built
- First version with a Haar Cascade for face detection and OpenCV's LBPH recogniser
- MySQL tables for employees, attendance records and daily summaries, with SQL for first entry, last exit and present status
- Second version with YuNet for detection and SFace for 128-number face embeddings
- Cosine similarity matching that rejects anyone below a set threshold
- Head-turn liveness check, so a still photo can't mark attendance
- 17 unit tests for the attendance rules, all passing
The hard parts
Unknown people were accepted
The first version had no confidence limit. The rebuild compares embeddings and rejects anyone below the threshold.
Recognising the wrong area
Recognition ran on the full camera frame instead of only the face. The rebuild detects the face first, then recognises only that region.
A model that did nothing
The first version's CNN was only copying its input, so it wasn't improving the images. Pre-trained models replaced it.
Attendance flickering
Clock-in and clock-out kept switching every few seconds. Now the same person must appear in 5 frames in a row, with a 60-second cooldown.
The result
A second version that rejects strangers, resists photo spoofing and records attendance reliably, with 17 passing tests.