Inspiration

Schools handle attendance and the identification of struggling students manually and separately. Roll calls eat into class time, and teachers usually learn a student is struggling only after the results are already bad. We wanted one tool a teacher can use day to day: a live classroom camera that marks attendance through biometric face recognition and also flags at-risk students early, while there is still time to help.

What it does

Biometric face-recognition attendance: a live classroom camera identifies registered students in real time and automatically logs student ID, subject, date and time. Duplicates are impossible because of a database-level UNIQUE constraint on student, subject and date. Syllabus management: subjects are registered once, globally, and reused for both marks entry and attendance. Flexible marks entry: the teacher picks a subject, types any exam name, sets a total mark, and fills a spreadsheet-style grid with live percentages. Reopening the same subject and exam loads the existing marks for editing instead of creating duplicates. Early risk prediction: attendance %, marks average % and previous GPA go into a machine learning model that outputs a predicted score, a performance category and a risk level. Dashboard and reports: live Chart.js dashboard (present/absent today, attendance %, risk buckets, 7-day trend) plus Matplotlib reports exportable as PNG or a combined PDF, and CSV exports. Role-based access: separate Admin and Teacher logins with hashed passwords.

How we built it

Backend: Python and Flask with SQLite, organized into route blueprints. Computer vision: OpenCV with insightface’s buffalo_l pack, using SCRFD for detection and ArcFace for recognition. Detection runs on every frame, while the heavier embedding and gallery matching runs only for new faces or every 15 frames, using a lightweight centroid tracker. This cuts recognition calls by roughly 15x. Privacy by design: we store only 512-dimensional face embeddings, never raw face images. Machine learning: Linear Regression, Decision Tree and Random Forest are compared with 5-fold cross-validation, and the lowest-error model wins. Random Forest gets tuned with grid search. A versioned model registry promotes a retrained model only if it is at least as good as the live one, and supports rollback. Drift monitoring: compares live feature averages against the training baseline and flags retraining when they shift by more than 15%. Data handling: inputs are validated and cleaned before training, and the target score is never used as a prediction input, to avoid data leakage. Frontend: server-rendered Jinja2 templates with HTML, CSS, JavaScript, Bootstrap 5 and Chart.js. Quality: 38 automated tests, plus the full workflow (register a subject, enter marks, train, predict, export a PDF) verified against the running application. Challenges we ran into No ground-truth label: marks entry has no fixed “final exam” category, so real data has no outcome label to train against. We train on a labeled synthetic baseline and apply the model to real students’ current attendance, marks and GPA. This keeps data entry simple for teachers and keeps the prediction honest about what it can claim. Camera responsiveness: running full recognition on every frame made the live view laggy. We split the pipeline into a fast every-frame path and a heavier on-demand path with tracking. Streaming vs. the dev server: the live video stream hung the camera page because Flask handled one request at a time. Enabling threaded serving fixed it. Easy installation: we needed strong accuracy without a painful setup, which led us to ArcFace via insightface, with no CMake, dlib or compiler needed on Windows. Fair model comparison: we made sure the model comparison isn’t rigged. On our near-linear synthetic data, Linear Regression genuinely beat Random Forest, and the system picks it. Accomplishments that we’re proud of A complete, working end-to-end workflow rather than isolated demos. Attendance % computed from real records, so it can’t be entered wrongly by hand. A safe model registry with drift monitoring, which is rare for a prototype. A privacy-conscious design that stores only embeddings, never face images. A marks-entry flow simple enough for real classroom adoption. What we learned

Integration is the hard part. Face recognition and predictive modeling are each well established, but combining them into one workflow a teacher can actually use took the most design effort. We also learned to be upfront about what a model can and can’t claim when real outcome data isn’t available yet.

What’s next for SmartAttend: Attendance and Early Risk Prediction Liveness detection and anti-spoofing to defend against photo-based attacks. Multi-camera and multi-classroom support. Notifications for at-risk students and their faculty. Explainable predictions (e.g. SHAP values) on the prediction page. Validating and retraining the model on real, consented historical outcomes once enough data exists.

Built With

Share this project:

Updates

Submission history