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