1 of 16

ARTIFICIAL INTELLIGENCE

FACE DETECTION SYSTEM FOR ATTENDANCE

Aalekh Raghuvanshi-24BDS001

Bhavya Khare-24BDS012

Devam Sharma-24BDS017

Hemant Kumar-24BDS025

Saksham Kushwah-24BDS072

COURSE INSTRUCTOR –

DR. ANIMESH CHATURVEDI

2 of 16

The Attendance Problem: Why Change is Needed

Outdated Methods

Traditional attendance systems, such as punch cards and fingerprint scanners, are inherently slow, prone to errors, and susceptible to fraudulent activities like 'buddy punching'. These methods can lead to inaccuracies and security vulnerabilities.

Operational Inefficiencies

Manual attendance tracking consumes valuable time for administrative staff, diverting resources from more critical tasks.

Furthermore, physical contact systems pose hygiene concerns, especially heightened in a post-pandemic world.

Lack of Insight & Scalability

Current systems often fail to provide real-time attendance insights, hindering quick decision-making. As organizations grow, these methods struggle to scale effectively, leading to increased administrative burden and potential data inaccuracies.

3 of 16

Introducing AI Face Detection for Attendance

Our system is an AI-powered Face Recognition Attendance Platform designed to automate and modernize the attendance-taking process across classrooms, offices, and institutions.

It uses advanced facial recognition technology (InsightFace) to identify individuals in real time with high accuracy, completely eliminating manual roll calls and touch-based biometric systems.

This product captures live video from a camera, detects faces instantly, matches them with pre-trained embeddings, and automatically marks attendance within seconds(<100ms).

The system is designed to be fast, fully automated, contactless, and scalable, making it suitable for modern smart campuses and workplaces.

4 of 16

TECH STACK

Frontend (UI & Preview)

  • React.jsx (Vite)�Frontend interface to control attendance, show stats, and display live camera feed.

  • Fetch API (HTTP requests)�Used for calling backend APIs (start, stop, attendance) every second.

  • Lucide React :- To use Modern icon library

5 of 16

TECH STACK

Backend

  • FastAPI�Used to build REST API endpoints (/api/start, /api/stop, /api/attendance, /video_feed).�Handles asynchronous requests and connects the frontend with the face recognition logic.

  • Uvicorn�ASGI server used to run the FastAPI backend on port 8000.

  • InsightFace (buffalo_l model)�Used for face detection + generating 512-dimensional embeddings for face recognition.

  • OpenCV (cv2)�Used for accessing the webcam, reading frames, flipping images, drawing bounding boxes, and JPEG encoding for live video streaming.

  • NumPy�Used for similarity calculation between embeddings using dot product (cosine similarity).

  • Pickle�Used to load and store the trained embeddings in face_embeddings_insightface.pkl.

6 of 16

TECH STACK

Model Training

InsightFace FaceAnalysis�Used to extract embeddings from training images for each student.

�Stored in .pkl file for fast matching during attendance.

OpenCV�Used to load training images, detect faces, crop them, and process them before embedding extraction.

7 of 16

TECH STACK

Data Storage

Local File Storage

trained_model/face_embeddings_insightface.pkl — embeddings + labels

attendance_logs/*.csv — daily attendance saved with timestamps

8 of 16

TECH STACK

Other Tools / Libraries

Python 3.10 — core language for backend + training pipeline

Threading — used to run face recognition loop in background

CORS Middleware — to allow React (localhost) to communicate with FastAPI

9 of 16

SYSTEM ARCHITECTURE

10 of 16

How our project works

1. Face images are collected for each student�Multiple images are captured to cover different angles and lighting conditions.

2. InsightFace extracts a unique embedding for each face�A 512-dimension vector is generated (like a digital signature of the face) and stored with the student’s name.

3. Backend opens the camera and processes live video�FastAPI starts a background thread that continuously reads frames from the webcam.

4. Faces in each frame are detected and converted into embeddings�InsightFace identifies faces in real-time and generates embeddings for each detected face.

11 of 16

How our project works

5. Embeddings are compared with the trained database�Using cosine similarity (dot product), the system finds the closest match from stored student embeddings.

6. If the match is above the confidence threshold, attendance is marked�The student’s name is added to the “present” list only once.

7. The backend updates recent detections and statistics�Every recognized face and its confidence score is stored temporarily for the UI.

8. Frontend shows live camera preview + real-time attendance status�React displays the live feed, present count, and detection logs by fetching updates every second.

9. Attendance is saved automatically or when the user clicks “Stop & Save”�A CSV file is generated with names, timestamp, and confidence level.

12 of 16

KEY CHALLENGES

  1. Real-Time Processing Bottleneck

Handling continuous video frames and running AI inference caused performance slowdowns, especially on CPU-only systems.

2. Webcam Compatibility Issues

Different operating systems (Windows, macOS) use different camera drivers, leading to failures in accessing the webcam consistently through API endpoints.

3. Accuracy in Real-World Conditions

Lighting changes, side angles, and partial occlusions affected face detection and recognition stability.

4. Frontend Rendering Lag

Displaying live camera feed in the frontend caused heavy lag, especially when streaming frames over HTTP.

5. Heavy Model Initialization

InsightFace (Buffalo_L) is a large model and requires time and system resources to initialize and run efficiently.

13 of 16

SOLUTIONS

1. Performance Optimization :-Processed every alternate frame for faster recognition.

Used NumPy vectorized similarity matching for rapid embedding comparison.

Reduced camera resolution for smoother processing.

2. Cross-Platform Webcam Handling :-Used OpenCV backend switching: CAP_DSHOW for Windows AVFoundation for macOS

Added fallback logic to retry camera initialization.

3. Improved Recognition Stability :-Used InsightFace with strict thresholds:

Similarity > 0.4

Confidence > 70%

Added multiple training images per user for better embedding coverage.

4. Backend-Only Video Handling:-Removed browser-based camera handling to reduce load.

Backend processes the feed; frontend receives only processed recognition data.

5. Model Caching & Efficient Startup:-Loaded InsightFace once during FastAPI startup.

Cached all embeddings and metadata for instant access during recognition.

14 of 16

BENEFITS

1. Fully Automated Attendance

Eliminates manual roll-calls and reduces human effort. Saves time for teachers and increases classroom productivity.

2. High Accuracy Recognition

InsightFace ensures reliable face matching even in varied lighting or angles, minimizing false attendance entries.

3. Real-Time Processing

Attendance is updated instantly as students appear, creating a smooth and seamless experience.

4. Secure & Tamper-Proof

Face recognition prevents proxy attendance or manipulation since every person is uniquely verified.

5. Scalable & Flexible

Works with multiple classes, batches, and larger student groups with minimal resource requirements.

15 of 16

IMPACT

1. Increased Efficiency

Time spent on attendance is drastically reduced, contributing to more effective use of classroom hours.

2. Better Record Accuracy

Automated logs reduce errors, maintain accurate timestamps, and improve administrative transparency.

3. Enhances Tech-Enabled Learning Environment

Brings intelligent automation into educational institutions, promoting digital transformation.

4. Reduces Administrative Burden

No need for manual entries or maintaining registers — all logs are automatically generated and stored.

5. Supports Data-Driven Decisions

Attendance analytics helps faculty track trends, identify irregularities, and improve student engagement.

16 of 16

Thank You

  • Our AI-powered Face Attendance System provides a fast, accurate, and automated method for marking attendance.

  • By combining InsightFace, FastAPI, and a modern UI, the system ensures real-time recognition with high reliability.

  • This project demonstrates how AI can solve real-world problems, reduce manual effort, and enhance efficiency in educational environments.

CONCLUSIONS