An intelligent, AI-powered automated attendance system that uses advanced face detection, anti-spoofing, and face recognition technology to mark attendance securely. Built with cutting-edge deep learning models and Firebase backend.
The Anti-Spoof AI Attendance System is an automated solution for marking student attendance using facial recognition technology. It leverages state-of-the-art computer vision models to:
This system eliminates the need for manual attendance marking, reduces cheating, and provides a secure, scalable solution for educational institutions.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Anti-Spoof AI Attendance System β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
βΌ βΌ βΌ
ββββββββββββ ββββββββββββ ββββββββββββ
β Frontend β β Backend β β Database β
β(HTML/CSS)β β (Flask) β β(Firestore)
ββββββββββββ ββββββββββββ ββββββββββββ
β β β
ββββββββββββββΌββββββββββββββ
β
ββββββββββ΄βββββββββ
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β ML Pipeline β β Firebase β
β β β Services β
ββββββββββββββββ ββββββββββββββββ
User Input (Group Photo)
β
βΌ
βββββββββββββββββββββββββββββββ
β Image Preprocessing β
β - Resize & Normalize β
β - Convert to RGB β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Face Detection (YOLOv8) β
β - Detect all faces β
β - Get bounding boxes β
β - Extract face regions β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Face Alignment β
β (RetinaFace + Landmarks) β
β - Align to 112Γ112 β
β - Normalize orientation β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Anti-Spoofing Check β
β - Analyze liveness β
β - Filter fake faces β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Face Recognition β
β (AdaFace IR101) β
β - Generate 512-dim β
β embeddings β
β - Extract features β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Similarity Matching β
β - Compare with known faces β
β - Compute cosine distance β
β - Identify students β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Attendance Logging β
β - Record timestamp β
β - Save to Firebase β
β - Update attendance log β
βββββββββββββββββββββββββββββββ
β
βΌ
Attendance Marked β
Anti-Spoof AI System
β
βββ Frontend (web/frontend/)
β βββ index.html # Main UI
β βββ app.js # Client-side logic
β βββ style.css # Styling
β
βββ Backend (web/backend/)
β βββ app.py # Flask application
β βββ __pycache__/ # Compiled Python
β βββ routes/
β βββ / # Main page
β βββ /api/enroll # Student enrollment
β βββ /api/recognize # Face recognition
β βββ /api/attendance # Attendance marking
β βββ /api/analytics # Attendance reports
β
βββ ML Models (models/)
β βββ cvlface_adaface_ir101_webface12m/ # Face recognition
β β βββ model.safetensors
β β βββ pretrained_model/model.pt
β β βββ models/
β β
β βββ private_retinaface_resnet50/ # Face alignment
β βββ model.safetensors
β βββ pretrained_model/model.pt
β βββ aligners/
β
βββ Firebase (firebase/)
β βββ firebase_config.json # Credentials (secrets)
β βββ firebase_service.py # Firebase helper functions
β βββ .env # Environment variables
β
βββ Scripts (scripts/)
β βββ create_admin.py # Create admin account
β βββ email_service.py # Email notifications
β βββ utils.py # Utility functions
β βββ __pycache__/
β
βββ Temporary Files
βββ temp_uploads/ # Temporary uploads
βββ attendance/ # CSV reports
βββ local_cache/ # Local embeddings cache
| Property | Value |
|---|---|
| Model Name | YOLOv8 (arnabdhar/YOLOv8-Face-Detection) |
| Purpose | Detect and locate faces in images |
| Input | Color image (any resolution) |
| Output | Bounding boxes with confidence scores |
| Architecture | Convolutional Neural Network (CNN) |
| Framework | PyTorch |
| Accuracy | Real-time, high-precision detection |
| Speed | β‘ Very fast (~30 FPS on GPU) |
Use Case: First stage - detects all faces in a group photo
| Property | Value |
|---|---|
| Model Name | RetinaFace (minchul/private_retinaface_resnet50) |
| Purpose | Align detected faces and extract facial landmarks |
| Input | Cropped face image |
| Output | 5-point facial landmarks + aligned 112Γ112 face |
| Architecture | ResNet50 with multi-task learning |
| Framework | PyTorch |
| Accuracy | High-precision landmark detection |
| Speed | β‘ Fast per-face processing |
Use Case: Second stage - normalizes faces for consistent recognition
| Property | Value |
|---|---|
| Model Name | AdaFace IR101 (minchul/cvlface_adaface_ir101_webface12m) |
| Purpose | Generate face embeddings for recognition |
| Input | Aligned 112Γ112 face image |
| Output | 512-dimensional face embedding |
| Architecture | ResNet-101 backbone with AdaFace loss |
| Framework | PyTorch |
| Dataset Trained | WebFace12M (12 million faces) |
| Accuracy | Top-tier face recognition accuracy |
| Speed | β‘ Fast embedding generation |
Use Case: Third stage - generates unique embedding for each face for comparison
Input Image
β
βββΊ YOLOv8 (Detection)
β βββΊ Detects & crops faces
β
βββΊ RetinaFace (Alignment)
β βββΊ Normalizes to 112Γ112
β
βββΊ AdaFace (Recognition)
β βββΊ Generates 512-D embeddings
β
βββΊ Similarity Matching
βββΊ Compares with stored embeddings
βββΊ Identifies students
pip install -r requirements.txt)Backend Setup
Frontend Development
Database Setup
git clone https://github.com/npshashank05/AI-Based-Automated-Attendance-System.git
cd AI-Based-Automated-Attendance-System
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
firebase/firebase_config.jsonCreate main_project/firebase/.env:
FIREBASE_CREDENTIALS_PATH=./firebase/firebase_config.json
FIREBASE_STORAGE_BUCKET=your-project-id.appspot.com
cd main_project
python scripts/create_admin.py
cd main_project/web/backend
python app.py
Server runs on: http://localhost:5000
http://localhost:5000POST /api/auth/login - Login userPOST /api/auth/register - Register new userPOST /api/auth/logout - Logout userGET /api/students - List all studentsPOST /api/students/enroll - Enroll new studentGET /api/students/<id> - Get student detailsPUT /api/students/<id> - Update studentDELETE /api/students/<id> - Delete studentPOST /api/attendance/mark - Mark attendance from photoGET /api/attendance/<student_id> - Get student attendanceGET /api/attendance/report - Generate attendance reportPOST /api/attendance/batch - Batch attendance markingPOST /api/recognize - Recognize faces in imagePOST /api/verify - Verify face authenticityAI-Based-Automated-Attendance-System/
βββ README.md # Project documentation
βββ requirements.txt # Python dependencies
β
βββ main_project/
βββ firebase/
β βββ firebase_config.json # Firebase credentials (secrets)
β βββ firebase_service.py # Firebase helper functions
β βββ README.txt
β
βββ models/
β βββ cvlface_adaface_ir101_webface12m/ # Face recognition model
β β βββ model.safetensors
β β βββ pretrained_model/
β β βββ models/
β β βββ wrapper.py
β β βββ config.json
β β
β βββ private_retinaface_resnet50/ # Face alignment model
β βββ model.safetensors
β βββ pretrained_model/
β βββ aligners/
β βββ wrapper.py
β βββ config.json
β
βββ scripts/
β βββ create_admin.py # Admin account creation
β βββ email_service.py # Email notifications
β βββ utils.py # Utility functions
β βββ __pycache__/
β
βββ web/
β βββ backend/
β β βββ app.py # Flask main application
β β βββ __pycache__/
β β
β βββ frontend/
β β βββ index.html # Main page
β β βββ app.js # JavaScript logic
β β βββ style.css # Styling
β β
β βββ templates/ # HTML templates (if using Jinja2)
β βββ static/ # Static assets
β
βββ temp_uploads/ # Temporary file storage
βββ attendance/ # Generated reports
βββ requirements.txt # Dependencies
Contributions are welcome! Please:
git checkout -b feature/AmazingFeature)git commit -m 'Add AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see LICENSE file for details.
Shashank - AI/ML Developer
Q: Does the system require GPU? A: GPU is recommended for faster processing but not required. CPU mode is supported.
Q: How accurate is the face recognition? A: AdaFace achieves industry-leading accuracy (>99.8% on LFW dataset).
Q: Can it detect spoofing attacks? A: Yes, through multi-model analysis and facial feature validation.
Q: Is data secure? A: Yes, Firebase provides enterprise-grade security with encryption.
For issues, questions, or suggestions, please open an issue on GitHub.
Last Updated: February 2026 Version: 1.0.0
An intelligent, AI-powered automated attendance system that uses advanced face detection, anti-spoofing, and face recognition technology to mark attendance securely. Built with cutting-edge deep learning models and Firebase backend.
The Anti-Spoof AI Attendance System is an automated solution for marking student attendance using facial recognition technology. It leverages state-of-the-art computer vision models to:
This system eliminates the need for manual attendance marking, reduces cheating, and provides a secure, scalable solution for educational institutions.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Anti-Spoof AI Attendance System β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
βΌ βΌ βΌ
ββββββββββββ ββββββββββββ ββββββββββββ
β Frontend β β Backend β β Database β
β(HTML/CSS)β β (Flask) β β(Firestore)
ββββββββββββ ββββββββββββ ββββββββββββ
β β β
ββββββββββββββΌββββββββββββββ
β
ββββββββββ΄βββββββββ
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β ML Pipeline β β Firebase β
β β β Services β
ββββββββββββββββ ββββββββββββββββ
User Input (Group Photo)
β
βΌ
βββββββββββββββββββββββββββββββ
β Image Preprocessing β
β - Resize & Normalize β
β - Convert to RGB β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Face Detection (YOLOv8) β
β - Detect all faces β
β - Get bounding boxes β
β - Extract face regions β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Face Alignment β
β (RetinaFace + Landmarks) β
β - Align to 112Γ112 β
β - Normalize orientation β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Anti-Spoofing Check β
β - Analyze liveness β
β - Filter fake faces β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Face Recognition β
β (AdaFace IR101) β
β - Generate 512-dim β
β embeddings β
β - Extract features β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Similarity Matching β
β - Compare with known faces β
β - Compute cosine distance β
β - Identify students β
βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β Attendance Logging β
β - Record timestamp β
β - Save to Firebase β
β - Update attendance log β
βββββββββββββββββββββββββββββββ
β
βΌ
Attendance Marked β
Anti-Spoof AI System
β
βββ Frontend (web/frontend/)
β βββ index.html # Main UI
β βββ app.js # Client-side logic
β βββ style.css # Styling
β
βββ Backend (web/backend/)
β βββ app.py # Flask application
β βββ __pycache__/ # Compiled Python
β βββ routes/
β βββ / # Main page
β βββ /api/enroll # Student enrollment
β βββ /api/recognize # Face recognition
β βββ /api/attendance # Attendance marking
β βββ /api/analytics # Attendance reports
β
βββ ML Models (models/)
β βββ cvlface_adaface_ir101_webface12m/ # Face recognition
β β βββ model.safetensors
β β βββ pretrained_model/model.pt
β β βββ models/
β β
β βββ private_retinaface_resnet50/ # Face alignment
β βββ model.safetensors
β βββ pretrained_model/model.pt
β βββ aligners/
β
βββ Firebase (firebase/)
β βββ firebase_config.json # Credentials (secrets)
β βββ firebase_service.py # Firebase helper functions
β βββ .env # Environment variables
β
βββ Scripts (scripts/)
β βββ create_admin.py # Create admin account
β βββ email_service.py # Email notifications
β βββ utils.py # Utility functions
β βββ __pycache__/
β
βββ Temporary Files
βββ temp_uploads/ # Temporary uploads
βββ attendance/ # CSV reports
βββ local_cache/ # Local embeddings cache
| Property | Value |
|---|---|
| Model Name | YOLOv8 (arnabdhar/YOLOv8-Face-Detection) |
| Purpose | Detect and locate faces in images |
| Input | Color image (any resolution) |
| Output | Bounding boxes with confidence scores |
| Architecture | Convolutional Neural Network (CNN) |
| Framework | PyTorch |
| Accuracy | Real-time, high-precision detection |
| Speed | β‘ Very fast (~30 FPS on GPU) |
Use Case: First stage - detects all faces in a group photo
| Property | Value |
|---|---|
| Model Name | RetinaFace (minchul/private_retinaface_resnet50) |
| Purpose | Align detected faces and extract facial landmarks |
| Input | Cropped face image |
| Output | 5-point facial landmarks + aligned 112Γ112 face |
| Architecture | ResNet50 with multi-task learning |
| Framework | PyTorch |
| Accuracy | High-precision landmark detection |
| Speed | β‘ Fast per-face processing |
Use Case: Second stage - normalizes faces for consistent recognition
| Property | Value |
|---|---|
| Model Name | AdaFace IR101 (minchul/cvlface_adaface_ir101_webface12m) |
| Purpose | Generate face embeddings for recognition |
| Input | Aligned 112Γ112 face image |
| Output | 512-dimensional face embedding |
| Architecture | ResNet-101 backbone with AdaFace loss |
| Framework | PyTorch |
| Dataset Trained | WebFace12M (12 million faces) |
| Accuracy | Top-tier face recognition accuracy |
| Speed | β‘ Fast embedding generation |
Use Case: Third stage - generates unique embedding for each face for comparison
Input Image
β
βββΊ YOLOv8 (Detection)
β βββΊ Detects & crops faces
β
βββΊ RetinaFace (Alignment)
β βββΊ Normalizes to 112Γ112
β
βββΊ AdaFace (Recognition)
β βββΊ Generates 512-D embeddings
β
βββΊ Similarity Matching
βββΊ Compares with stored embeddings
βββΊ Identifies students
pip install -r requirements.txt)Backend Setup
Frontend Development
Database Setup
git clone https://github.com/npshashank05/AI-Based-Automated-Attendance-System.git
cd AI-Based-Automated-Attendance-System
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
firebase/firebase_config.jsonCreate main_project/firebase/.env:
FIREBASE_CREDENTIALS_PATH=./firebase/firebase_config.json
FIREBASE_STORAGE_BUCKET=your-project-id.appspot.com
cd main_project
python scripts/create_admin.py
cd main_project/web/backend
python app.py
Server runs on: http://localhost:5000
http://localhost:5000POST /api/auth/login - Login userPOST /api/auth/register - Register new userPOST /api/auth/logout - Logout userGET /api/students - List all studentsPOST /api/students/enroll - Enroll new studentGET /api/students/<id> - Get student detailsPUT /api/students/<id> - Update studentDELETE /api/students/<id> - Delete studentPOST /api/attendance/mark - Mark attendance from photoGET /api/attendance/<student_id> - Get student attendanceGET /api/attendance/report - Generate attendance reportPOST /api/attendance/batch - Batch attendance markingPOST /api/recognize - Recognize faces in imagePOST /api/verify - Verify face authenticityAI-Based-Automated-Attendance-System/
βββ README.md # Project documentation
βββ requirements.txt # Python dependencies
β
βββ main_project/
βββ firebase/
β βββ firebase_config.json # Firebase credentials (secrets)
β βββ firebase_service.py # Firebase helper functions
β βββ README.txt
β
βββ models/
β βββ cvlface_adaface_ir101_webface12m/ # Face recognition model
β β βββ model.safetensors
β β βββ pretrained_model/
β β βββ models/
β β βββ wrapper.py
β β βββ config.json
β β
β βββ private_retinaface_resnet50/ # Face alignment model
β βββ model.safetensors
β βββ pretrained_model/
β βββ aligners/
β βββ wrapper.py
β βββ config.json
β
βββ scripts/
β βββ create_admin.py # Admin account creation
β βββ email_service.py # Email notifications
β βββ utils.py # Utility functions
β βββ __pycache__/
β
βββ web/
β βββ backend/
β β βββ app.py # Flask main application
β β βββ __pycache__/
β β
β βββ frontend/
β β βββ index.html # Main page
β β βββ app.js # JavaScript logic
β β βββ style.css # Styling
β β
β βββ templates/ # HTML templates (if using Jinja2)
β βββ static/ # Static assets
β
βββ temp_uploads/ # Temporary file storage
βββ attendance/ # Generated reports
βββ requirements.txt # Dependencies
Contributions are welcome! Please:
git checkout -b feature/AmazingFeature)git commit -m 'Add AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see LICENSE file for details.
Shashank - AI/ML Developer
Q: Does the system require GPU? A: GPU is recommended for faster processing but not required. CPU mode is supported.
Q: How accurate is the face recognition? A: AdaFace achieves industry-leading accuracy (>99.8% on LFW dataset).
Q: Can it detect spoofing attacks? A: Yes, through multi-model analysis and facial feature validation.
Q: Is data secure? A: Yes, Firebase provides enterprise-grade security with encryption.
For issues, questions, or suggestions, please open an issue on GitHub.
Last Updated: February 2026 Version: 1.0.0