š AI-Based Student Attendance System (Flask)
š§ About the System
This is an AI-based Student Attendance System built with Flask that uses facial recognition to automate and secure attendance tracking.
ā Key Features
ā¢ā ā High Accuracy: The system uses 128-dimensional face embeddings and a KNN model, delivering high-precision recognition even with similar faces. ā¢ā ā Real-Time Detection: Detects and recognizes students live via webcam. ā¢ā ā Retrainable Model: You can easily add new students, and the system will retrain the KNN model to include them. ā¢ā ā Scalable & Lightweight: Suitable for small to medium-sized classrooms; works well with limited hardware. ā¢ā ā Two-layered Storage:
- XML file: Stores the 128-value face embeddings per student.
- SQLite DB: Stores course , and attendance records.
š§ How It Works
1.ā ā Student Registration
- student takes a photo .
- System extracts a 128-dimension face embedding and stores it in an XML file.
2.ā ā Recognition / Attendance
- Capture a face image.
- The embedding is extracted and compared using KNN to existing embeddings.
- If a match is found, attendance is marked.
| Layer | Technology |
|---|---|
| Backend | Python + Flask |
| Face | face_recognitionāÆā |
| Embedding | |
| ML Model | K-Nearest Neighbors (KNN) |
| Storage | XML for face data |
| Frontend | HTML, CSS, JS |
š Sample XML Structure
ā ```xml 1 Mohamed el afia 20 MALE STUDENT -0.14117948959271112 ... ...
šø Frontend Features
ā¢ā ā Register new student (upload image) ā¢ā ā Take attendance (real-time or image upload) ā¢ā ā View attendance history ā¢ā ā Admin-friendly interface
šļø Data Storage
ā¢ā ā Face Embeddings: Stored in an XML file (128-dimensional vectors for each registered student). ā¢ā ā Course & Attendance Data: Stored in a SQLite database:
- Tables:
- ā āÆcoursesāÆā ā list of available courses.
- ā āÆattendanceāÆā ā records of attendance with timestamps and recognized names.
š Future Enhancements
ā¢ā ā Admin login/authentication ā¢ā ā Export attendance reports (CSV/PDF)