A production-ready web application that automates classroom attendance using deep-learning face recognition. Capture a photo, detect every face in the frame, and instantly mark attendance โ all in real time.
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ ๐ธ Camera โโโโโโถโ YuNet ONNX โโโโโโถโ ArcFace (ONNX) โโโโโโถโ ๐ Cosine โ
โ Capture โ โ Detection โ โ 512-D Embedding โ โ Similarity โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ ๐ฏ Match Against โโโโโโถโ โ
Mark โโโโโโถโ ๐ก SignalR โ
โ Student DB โ โ Attendance โ โ Broadcast โ
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
- Capture โ A photo is taken from a browser webcam or an RTSP IP camera.
- Detect โ The YuNet ONNX model locates every face in the frame.
- Embed โ Each cropped face is passed through ArcFace (InsightFace) to produce a 512-dimensional embedding.
- Match โ Embeddings are compared against stored student embeddings using Cosine Similarity (threshold โฅ 0.65).
- Record โ Attendance is saved to the database with duplicate-prevention logic.
- Broadcast โ SignalR pushes the result instantly to every connected dashboard.
| Category | Feature |
|---|---|
| ๐ค AI Engine | ArcFace (InsightFace) 512-D embeddings via ONNX Runtime |
| ๐๏ธ Face Detection | YuNet ONNX โ fast, multi-face, rotation-robust |
| โก Real-time Updates | SignalR WebSocket broadcasts for live attendance feed |
| ๐ Security | ASP.NET Core Identity ยท Role-based access ยท CSRF protection |
| ๐ Reports | Filter by Classroom / Faculty / Date Range ยท CSV export |
| ๐น Capture Sources | Browser webcam + RTSP IP camera support |
| ๐งโ๐ Student CRUD | Full student profile management with multi-photo upload |
| ๐ Auto Training | Background model retraining when new photos are added |
| ๐ก๏ธ Duplicate Guard | Configurable time window to prevent re-marking |
| Layer | Technology |
|---|---|
| Framework | ASP.NET Core 8.0 MVC (C#) |
| Database | PostgreSQL ยท Entity Framework Core 8 |
| Face Detection | YuNet ONNX model |
| Face Recognition | ArcFace (InsightFace) ONNX model via Microsoft.ML.OnnxRuntime |
| Image Processing | OpenCvSharp4 (.NET wrapper for OpenCV) |
| Real-time | ASP.NET Core SignalR |
| Auth | ASP.NET Core Identity |
| Frontend | Bootstrap 5 ยท Custom glassmorphism CSS ยท JavaScript |
| Version Control | Git ยท Git LFS (for ONNX model files) |
Auto-Attendance-System-ASP.NET/
โโโ readme.md โ You are here
โโโ Report.pdf โ Project report
โโโ DemoAttendanceSystem/
โโโ .gitignore
โโโ .gitattributes โ Git LFS tracking rules
โโโ README.md โ Technical documentation
โโโ DemoAAS/
โโโ Controllers/
โ โโโ AttendanceController.cs โ Capture, recognize, mark
โ โโโ StudentsController.cs โ Student CRUD + photo upload
โ โโโ HomeController.cs โ Landing page
โโโ Services/
โ โโโ FacialRecognitionService.cs โ Core recognition pipeline
โ โโโ ArcFaceEmbeddingService.cs โ ONNX inference wrapper
โโโ Hubs/
โ โโโ AttendanceHub.cs โ SignalR real-time hub
โโโ Models/
โ โโโ Student.cs
โ โโโ StudentPhoto.cs โ Includes FaceEmbedding field
โ โโโ Attendance.cs
โโโ Data/
โ โโโ ApplicationDbContext.cs
โโโ Views/ โ Razor views (MVC)
โโโ arcface.onnx โ ArcFace model (Git LFS)
โโโ face_detection_yunet.onnx โ YuNet model (Git LFS)
โโโ Program.cs
| Requirement | Version |
|---|---|
| .NET SDK | 8.0+ |
| PostgreSQL | 14+ |
| Docker | 24.0+ (optional) |
| Docker Compose | 2.0+ (optional) |
| Git LFS | 3.0+ (for cloning ONNX models) |
# 1. Install Git LFS (required for ONNX model files)
git lfs install
# 2. Clone the repository
git clone https://github.com/Daku3011/Auto-Attendance-System-ASP.NET.git
cd Auto-Attendance-System-ASP.NET/DemoAttendanceSystem3. Configure the database โ Edit DemoAAS/appsettings.json:
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Database=DemoAAS;Username=postgres;Password=your_password"
}# 4. Apply database migrations
dotnet ef database update --project DemoAAS
# 5. Run the application
dotnet run --project DemoAASRun the entire stack (App + Database) with one command:
# Build and start services
docker-compose up --build -d
# View logs
docker-compose logs -fThe application will be available at
http://localhost:8080.
๐ Open your browser at
https://localhost:5001(or the port shown in the terminal).
Navigate to Students โ Create New. Enter the student's details and upload 3โ5 clear, front-facing photos per student. The system will automatically extract and store face embeddings.
Go to the Attendance page. Click Start Camera, position students in the frame, and hit Capture & Mark Attendance. The system detects all faces, matches them, and logs attendance instantly.
Recognized students appear in the live sidebar via SignalR โ no page refresh needed. Connected dashboards update automatically.
Visit Attendance Records โ filter by Classroom, Faculty, or Date Range โ click Export CSV.
- ArcFace (InsightFace) deep-learning embeddings
- SignalR real-time attendance broadcasts
- ASP.NET Core Identity authentication
- Continuous "Live Mode" scanning without manual capture
- Attendance analytics dashboard with charts
- Docker containerization for one-command deployment
- Mobile-responsive PWA for tablet kiosks