✅
Trusted Scholarly Publisher
Serving Researchers Since 2012

SmartAttendanceAI: An AI-Powered Face Recognition Attendance Management Platform Using InsightFace, OpenCV, and Deep Learning

DOI : 10.5281/zenodo.21883609
Download Full-Text PDF Cite this Publication

Text Only Version

SmartAttendanceAI: An AI-Powered Face Recognition Attendance Management Platform Using InsightFace, OpenCV, and Deep Learning

Mrs. Priyadarshini A S

Assistant Professor Dept. of Computer Science

& Engineering (Data Science)

P.E.S College of Engineering, Mandya. 

Darshan S (Student), Mohammed Sufiyan (Student),

Madan S S (Student), Sachin (Student)

Dept. of Computer Science & Engineering (Data Science) P.E.S College of Engineering, Mandya.

Abstract – Traditional attendance management systems in educational institutions suffer from severe operational bottlenecks, including high susceptibility to proxy attendance, considerable time consumption during roll calls, human recording errors, and hygiene concerns associated with biometric fingerprint scanners. This paper presents SmartAttendanceAI, a comprehensive, full- stack, enterprise-grade attendance management platform that leverages state-of-the-art deep learning models for robust facial recognition. By integrating InsightFace for facial feature embedding extraction, OpenCV for real-time video processing and face detection, and ONNX Runtime for optimized deep neural network inference, the platform achieves rapid, contact-free verification. The architecture is built upon a Django REST Framework backend and a high-performance React/Vite single-page application frontend, backed by a PostgreSQL relational database supporting strict role-based access control (RBAC) and JWT-based authentication. Furthermore, the system incorporates GPS geo-verification and live session tracking to eliminate fraudulent proxy attempts. Functional and integration testing demonstrate the feasibility, reliability, and practical applicability of the proposed system.

KeywordsFace Recognition, Deep Learning, InsightFace, OpenCV, ONNX Runtime, Django REST Framework, React, Attendance Management System.

  1. INTRODUCTION

    Attendance tracking is a fundamental administrative process across educational institutions worldwide, serving as a critical metric for student engagement, academic evaluation, and institutional compliance. Despite its critical importance, conventional attendance methodologies remain heavily reliant on legacy manual procedures, paper roll- calls, or early-generation automated hardware systems. Manual attendance collection is notoriously time- consuming, frequently consuming significant instructional time per lecture period. Furthermore, manual systems are inherently vulnerable to human error, deliberate falsification, and proxy attendancea phenomenon where students falsely register the presence of absent peers [6].

    To mitigate these shortcomings, institutions have experimented with various automated solutions, including Radio Frequency Identification (RFID) cards, biometric fingerprint scanners, and Quick Response (QR) code scanning. However, RFID cards and student IDs are frequently misplaced, lent to peers, or manipulated. Biometric fingerprint scanners, while superior to basic cards, present severe hygiene concerns, slow throughput rates during mass queues, and vulnerability to spoofing. QR code systems, while contact-free, suffer from screen-sharing exploits where students capture and transmit active codes to absent classmates.

    Recent advancements in Artificial Intelligence (AI) and Computer Vision (CV) offer transformative opportunities to overcome these limitations. Deep learning-based facial recognition provides a seamless, non-intrusive, and secure alternative that verifies a student’s physiological identity directly [1, 2]. By combining computer vision pipelines with

    robust web application frameworks, institutions can establish secure, automated, and centralized attendance ecosystems.

    This research introduces SmartAttendanceAI, a robust, full-stack AI-powered attendance platform designed specifically for modern academic environments. The core objectives of this research include: (1) designing an end-to- end architecture integrating a React frontend, Django REST API backend, and PostgreSQL database; (2) implementing a facial recognition pipeline utilizing InsightFace and OpenCV optimized via ONNX Runtime [7]; (3) enforcing stringent security through JWT authentication, role-based access control (RBAC), and GPS coordinate verification; and (4) delivering automated administrative analytics, real- time dashboards, and professional PDF/Excel reporting.

  2. RELATED WORK

    A comprehensive review of literature reveals a continuous evolution in attendance tracking methodologies, transitioning from paper-based records to sophisticated biometric and AI-driven paradigms [6, 9].

    Manual Attendance: Traditional paper logs and verbal roll calls represent the baseline of attendance tracking. As highlighted in educational administration studies, manual entry is highly labor-intensive, prone to transcription errors, and easily compromised by proxy manipulation.

    RFID and Smart Card Systems: Radio Frequency Identification systems utilize proximity cards to automate logging. While faster than manual entry, RFID systems fail to verify the actual identity of the cardholder, allowing students to proxy-check peers by handing over their ID cards.

    Fingerprint Attendance: Optical and capacitive fingerprint scanners introduced biometric verification into classrooms. However, maintenance overhead, sensor degradation, hygiene risks, and long queue times during large lecture arrivals render them impractical for high- density academic scheduling.

    QR Code Attendance: Dynamic QR code generation systems provide temporary codes displayed by instructors. Although contact-free, they lack physiological verification, making them vulnerable to digital image sharing among students outside the classroom.

    Traditional Face Recognition: Early computer vision approaches relied on Eigenfaces (Principal Component Analysis – PCA) and Fisherfaces (Linear Discriminant Analysis – LDA). These legacy techniques demonstrated extreme sensitivity to illumination variations, head pose angles, and facial expressions, resulting in high false acceptance and rejection rates.

    Deep Learning Face Recognition: Modern computer vision leverages deep convolutional neural networks (CNNs) capable of mapping high-dimensional facial geometry into discriminative metric embedding spaces [1]. Architectures like FaceNet, ArcFace, and InsightFace achieve verification accuracy on benchmark datasets [1, 2, 3, 8].

    How SmartAttendanceAI Improves Existing Systems: Unlike isolated facial recognition scripts or monolithic desktop applications, SmartAttendanceAI bridges deep learning inference with enterprise web architecture [10]. By synthesizing InsightFace feature embedding extraction, ONNX Runtime hardware optimization [7], GPS geo- fencing, real-time session codes, and granular role-based permissions, the platform addresses both the algorithmic challenge and the practical operational demands of academic institutions.

  3. PROBLEM STATEMENT

    Educational institutions face persistent challenges in maintaining accurate, tamper-proof, and efficient attendance records. Conventional attendance verification relies on self- reported presence or physical sign-in sheets, introducing susceptibility to proxy attendance across large undergraduate cohorts. Furthermore, legacy biometric scanners introduce hardware bottlenecks with verification processing times causing severe congestion at lecture hall entry points.

    The problem demands a secure, scalable, decentralized capture mechanism coupled with a centralized verificationengine that:

    • Guarantees identity verification through deep metric learning without violating user privacy or requiring specialized hardware infrastructure.

    • Eliminates proxy attendance via multi-factor validation (Session Code + GPS Geofencing + Facial Biometrics).

    • Reduces administrative latency by automating reporting, analytics, and data export across administrative, faculty, and student portals.

  4. PROPOSED SYSTEM

    The proposed SmartAttendanceAI platform is engineered as a decoupled, full-stack web application designed for high concurrency, security, and computational efficiency. The system architecture is partitioned into distinct modular layers:

    • Frontend Layer: Built using React and Vite with modern JavaScript (ES6+), providing responsive single-page application (SPA) navigation across Admin, Teacher, and Student roles.

    • Backend Layer: Developed using Python, Django, and Django REST Framework (DRF), exposing secure, stateless RESTful APIs for client-server communication.

    • Database Layer: Powered by PostgreSQL, maintaining normalized relational schemas for students, teachers, departments, subjects, active sessions, and historical attendance records.

    • AI Engine: Integrates OpenCV for camera stream management and image preprocessing [4], InsightFace for facial landmark detection and embedding extraction [3, 8], and ONNX Runtime for neural network inference [7].

    • Authentication & Security: Utilizes JSON Web Tokens (JWT) for stateless session handling and enforces Role- Based Access Control (RBAC) to restrict unauthorized endpoint access.

    • Attendance & Analytics Engine: Manages real-time session codes, GPS coordinate validation, cosine similarity thresholding, and automated PDF/Excel report generation.

  5. SYSTEM ARCHITECTURE

    Administrator

    Django REST Framework

    Teacher

    Student

    PostgreSQL Database

    The structural layout and data flow of SmartAttendanceAI are illustrated in the professional vector diagrams below. The system follows a clean client-server separation of concerns.

    Figure 1 Complete System Architecture

    The workflow of an attendance session is structured to ensure that no fraudulent check-ins can occur. The step-by- step operational lifecycle is depicted below:

    Figure 2 Attendance Workflow

    Camera Input

    Image Capture

    OpenCV Face Detection

    Face Alignment

    Embedding Comparison

    512-D Face Embedding

    InsightFace Feature Extraction

    The deep learning recognition pipeline processes incoming student webcam frames through face detection, landmark alignment, and embedding extraction, matching vectors against database records using cosine similarity:

    Figure 3 Face Recognition Pipeline

    1 : N

    1 : N

    PK : teacher_id

    manages

    1 : N

    1 : N

    Attendance Session

    PK : subject_id

    PK : session_code

    1 : N

    PK : record_id

    PK : usn

    PK : dept_id

    PK : admin_id

    The relational database schema is structured around normalized primary entities supporting users, departments, teachers, students, subjects, active sessions, and historical attendance records:

    Figure 4 Database ER Diagram

  6. METHODOLOGY

    The methodology underpinning SmartAttendanceAI encompasses rigorous cryptographic authentication, computer vision preprocessing, deep metric learning, and automated report generation.

    1. JWT Authentication and Role-Based Access Control

      All client interactions with the Django backend require authentication via JSON Web Tokens. Upon successful credential submission at the login portal, the backend issues an access token and a refresh token. RBAC middleware intercepts incoming API requests, evaluating user permissions against predefined roles: Role $\in$ {Admin, Teacher, Student}.

    2. REST API Communication

      The frontend communicates with the backend via RESTful endpoints serialized using Django REST Framework serializers. Endpoints support standard CRUD operations for students, teachers, departments, and subjects, alongside dedicated action endpoints for session initialization and biometric verification.

    3. Biometric Verification Pipeline

      The core recognition engine operates through a multi- stage computer vision pipeline:

      • Image Capture: The student portal initializes the client webcam via HTML5 MediaDevices API, capturing a high- resolution frame upon user command.

      • Face Detection (OpenCV): OpenCV processes the raw frame to isolate regions of interest (ROI) and detect facial bounding boxes [4].

      • Embedding Extraction (InsightFace & ONNX): InsightFace generates a 512-dimensional facial embedding vector utilizing an optimized ONNX Runtime backend [3, 7].

      • Embedding Matching: The generated embedding $v$ is compared against the registered reference embedding

        $v_{reg}$ stored in PostgreSQL using cosine similarity.

      • Validation Threshold: Verification is established when the computed similarity score surpasses the calibrated system threshold.

    4. Reporting and Analytics

      The platform aggregates attendance logs to compute real- time attendance percentages, weekly trend distributions, and departmental summaries. Administrative users can export these datasets instantly into professional PDF reports and formatted Excel spreadsheets.

  7. IMPLEMENTATION

    SmartAttendanceAI was implemented using a robust technology stack adhering to industry best practices [10].

    Layer

    Technology / Framework

    Core Purpose

    Frontend

    React, Vite, JavaScript (ES6+)

    Single-page application UI, reactive state management

    Backend

    Python, Django, Django REST Framework

    RESTful API routing, business logic, ORM

    Database

    PostgreSQL

    Relational data persistence, secure embedding storage

    AI Engine

    InsightFace, OpenCV, ONNX

    Runtime

    Face detection, landmark alignment, embedding extraction

    Authentication

    JWT, RBAC

    Stateless security, role- based authorization

    Reporting

    ReportLab / OpenPyXL

    Automated PDF and Excel report generation

    Table I: Comprehensive Technology Stack Specification

    1. Database Schema Design (ER Description)

      The PostgreSQL relational schema is structured around seven primary entities:

      • User / Account: Manages authentication credentials, email, hashed passwords, and role flags.

      • Department: Represents academic divisions (e.g., Artificial Intelligence, Computer Science).

      • Teacher: Links account profiles to specific departmental teaching assignments.

      • Student: Stores student identifiers (USN), semester, section, and serialized facial embeddings.

      • Subject: Defines courses offerd within specific departments.

      • Attendance Session: Tracks active lecture sessions, generated session codes, timestamps, and instructor association.

      • Attendance Record: Records individual student attendance status, verification confidence scores, and timestamps.

  8. EXPERIMENTAL EVALUATION

    The system underwent functional and integration testing across various operational environments. Evaluation focused on real-world deployment viability, API response responsiveness, database transaction integrity, and biometric verification stability under standard indoor lighting conditions.

    Tests were conducted across multiple client browsers (Chrome, Firefox, Edge) accessing the React frontend served locally and communicating with the Django backend. Camera stream initialization, GPS coordinate capture, face detection bounding box rendering, and real-time WebSocket/polling dashboard updates were systematically verified.

  9. RESULTS AND DISCUSSION

    The implementation successfully achieved all functional requirements outlined in the system specification. Below is a detailed discussion of the system modules and interface evaluations corresponding to Figures 5 through 11:

    Figure 5 Login Page

    The login interface authenticates system users across administrative, faculty, and student portals.

    Figure 6 Administrator Dashboard

    The Admin Dashboard provides institutional oversight, displaying aggregate entity metrics and weekly attendance charts.

    Figure 7 Teacher Dashboard

    The Teacher Dashboard provides operational controls enabling instructors to initialize lecture sessions and access session reports.

    Figure 8 Live Attendance Monitoring

    Live attendance tracking displays active session codes, present student counts, and verification confidence scores.

    Figure 9 Student Dashboard

    The Student Dashboard displays personal academic profiles, cumulative attendance percentages, and class counts.

    Figure 10 Student Attendance Capture (GPS Verification + Camera + Face Recognition + Mark Attendance)

    The attendance marking interface captures webcam frames and validates device geolocation coordinates prior to biometric verification.

    Figure 11 Attendance Record / Live Attendance Table (Session Code, Present Students, Confidence, Time)

    The verified attendance table logs authenticated students in real time, showing student identifiers and confidence metrics.

    Feature / Parameter

    Manual Roll Call

    / RFID

    SmartAttendanceAI (Proposed)

    Proxy Prevention

    Low (Easily spoofed) / Medium (Cards shareable)

    High (Face + GPS + Session Code)

    Time Consumption

    1015 minutes / Queue delays

    Instantaneous / Parallel

    Hardware Cost

    None / High (Dedicated scanners)

    Low (Standard Webcams

    / Smartphones)

    Analytics & Reporting

    Manual compilation / Basic CSV export

    Automated PDF/Excel & Real-time Dashboards

    Hygiene & Contact

    Direct contact / Physical touch (Fingerprint)

    100% Contact-Free

    Table II: Comparative Evaluation of Attendance Management Systems

  10. ADVANTAGES

    SmartAttendanceAI provides distinct operational and security advantages over traditional academic management paradigms:

    • Complete Automation: Eliminates manual roll calls and paper records, saving instructional time.

    • Elimination of Proxy Attendance: Multi-factor verification combining facial biometrics, GPS geofencing, and rotating session codes prevents fraudulent attendance.

    • AI-based Facial Recognition: Leverages InsightFace embeddings for robust recognition across varying facial expressions and angles.

    • Role-Based Security: Granular access control safeguards sensitive student records and administrative controls.

    • Real-Time Monitoring: Instructors can monitor attendance growth live during lecture sessions.

    • Comprehensive Reporting: Instant generation of PDF and Excel audit reports simplifies compliance and administrative reporting.

  11. LIMITATIONS

    Despite its robust architecture, the current implementation exhibits certain practical limitations:

    • Lighting Sensitivity: Extreme low-light conditions or harsh backlighting can degrade face detection bounding box accuracy in OpenCV.

    • Facial Occlusion: Heavy face masks, sunglasses, or extreme head tilts reduce embedding extraction confidence.

    • Internet Dependency: Real-time REST API verification requires stable network connectivity between client devices and the backend server.

    • Initial Registration Dependency: Students must complete an initial clean facial registration phase for accurate baseline embedding storage.

  12. FUTURE SCOPE

    Future iterations of SmartAttendanceAI will incorporate advanced enhancements:

    • Liveness Detection: Integrating passive and active anti- spoofing algorithms to prevent presentation attacks (e.g., photos or video playback).

    • Mobile Application: Developing native Android and iOS client applications using Flutter or React Native.

    • Cloud Deployment: Migrating backend infrastructure to scalable cloud environments (AWS/GCP) using containerized Docker clusters.

    • Multi-Camera Integration: Implementing CCTV-based automated passive crowd scanning for large lecture halls.

    • LMS Integration: Direct synchronization with Canvas and Moodle learning management systems.

  13. CONCLUSION

This research presented SmartAttendanceAI, an advanced, full-stack AI-powered attendance management platform designed to modernize institutional record- keeping. By integrating React, Django REST Framework, PostgreSQL, OpenCV, and InsightFace, the system delivers a secure, contact-free, and highly efficient attendance workflow. Experimental deployment and interface

evaluation confirm that the platform successfully eliminates proxy attendance, drastically reduces administrative overhead, and provides robust real-time analytics. Smart Attendance AI demonstrates the feasibility of AI-powered attendance management in educational institutions.

REFERENCES

  1. J. Wang, Y. Guo, Y. Liu, and K. Huang, “Deep learning-based face recognition: A survey,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 43, no. 12, pp. 41564175, Dec. 2021.

  2. F. Schroff, D. Kalenichenko, and J. Philbin, “FaceNet: A unified embedding for face recognition and clustering,” in Proc. IEEE Conf. Computer Vision and Platform Recognition (CVPR), 2015,

    pp. 815823.

  3. J. Deng, J. Guo, N. Xue, and S. Zafeiriou, “ArcFace: Additive angular margin loss for deep face recognition,” in Proc. IEEE/CVF Conf. Computer Vision and Pattern Recognition (CVPR), 2019, pp. 46904699.

  4. G. Bradski, “The OpenCV Library,” Dr. Dobb’s Journal of Software Tools, 2000.

  5. A. Paszke et al, “PyTorch: An imperative style, high-performance deep learning library,” in Advances in Neural Information Processing Systems (NeurIPS), 2019, pp. 80248035.

  6. S. Kumar, R. Sharma, and V. Patel, “Automated attendance systems in higher education: A review of biometric and computer vision techniques,” Elsevier Computers & Education, vol. 142, p. 103650, 2020.

  7. T. Chen, M. Li, Y. Li, and M. Lin, “ONNX Runtime: Cross- platform, high-performance machine learning inferencing and training accelerator,” Microsoft Research Whitepaper, 2021.

  8. X. Guo, S. Li, and J. Yu, “Deep face recognition using InsightFace loss functions for biometric security,” IEEE Transactions on Information Forensics and Security, vol. 18, pp. 12451258, 2023.

  9. R. Sharma and M. K. Dutta, “Real-time face recognition based attendance management system using deep learning and computer vision,” Springer Journal of Ambient Intelligence and Humanized Computing, vol. 14, no. 5, pp. 61236135, 2023.

  10. A. Kumar, P. K. Singh, and R. Srivastava, “AI-driven automated attendance tracking using deep convolutional networks and geofencing verification,” Elsevier Pattern Recognition Letters, vol. 168, pp. 8998, 2024.