Facial Recognition For Student Attendance Using Python
Facial Recognition For Student Attendance Using Python
net/publication/379970899
CITATIONS READS
0 516
2 authors:
All content following this page was uploaded by Fardeen Hossain Bhuiyan on 21 April 2024.
Abstract—The Facial Recognition System for Student Atten- a significant amount of time and energy to manually tracking
dance Management project introduces an automated solution to attendance. This manual procedure takes up significant instruc-
streamline attendance tracking in educational institutions. By tional time and resources, detracting from the activities that
leveraging facial recognition technology, the system eliminates
manual entry errors, reduces administrative overhead, and en- promote teaching and learning. Furthermore, human error in
hances security. Through integration with database management the process of collecting attendance frequently leads to errors
and user-friendly interface design, the system offers a reliable and inconsistencies in attendance records, compromising the
and efficient way to record attendance. The feasibility study accuracy of attendance data and metrics used in student
confirms the project’s technical, financial, operational, and legal evaluations. Furthermore, the manual method takes a lot of
viability, paving the way for successful implementation. This
project aims to revolutionize attendance management practices, time, which cuts into the amount of instructional time that
benefiting educators, administrators, and students. may be used for genuine academic engagement. Vulnerabilities
in paper-based systems, such as forgeries and illegal access,
I. I NTRODUCTION put data integrity at risk and give rise to security concerns.
The Facial Recognition System for Student Attendance Additionally, the administrative work involved in manually
Management project introduces an innovative approach to maintaining attendance data places additional strain on teach-
address the challenges associated with traditional methods ers and support personnel, hindering operational effectiveness.
of attendance tracking in educational institutions. In today’s
digital era, manual attendance processes are not only time- III. R ESEARCH O BJECTIVES
consuming but also prone to errors, leading to discrepancies
in attendance records. This project aims to automate the This research aims to address the shortcomings of man-
attendance tracking process by leveraging advanced facial ual attendance management systems by developing a Facial
recognition technology, streamlining administrative tasks, and Recognition System for Student Attendance Management. The
enhancing overall efficiency. objectives of the proposed system include:
The implementation of a facial recognition system offers 1) Automating Attendance Tracking: Develop a robust fa-
several advantages over conventional attendance-taking meth- cial recognition system capable of automatically identi-
ods. Not only does it eliminate the need for manual data fying and recording student attendance, eliminating the
entry, but it also provides a more accurate and reliable means need for manual intervention.
of identifying students. Additionally, biometric authentication 2) Integrating Database Management: Implement a
enhances security and reduces the risk of forgery or imper- database management system to securely store student
sonation, ensuring the integrity of attendance records. profiles and attendance records, facilitating efficient
Moreover, adopting facial recognition technology aligns data retrieval and management.
with the broader trend of digital transformation in educa- 3) Enhancing Security and Integrity: Utilize biometric au-
tion, enabling institutions to embrace innovative solutions thentication through facial recognition to enhance the
to optimize operational processes. By developing a Facial security and integrity of attendance records, mitigating
Recognition System for Student Attendance Management, this risks of forgery and unauthorized access.
project seeks to contribute to the advancement of attendance- 4) Improving Administrative Efficiency: Streamline admin-
tracking practices, ultimately benefiting both educators and istrative tasks associated with attendance management
students alike. by automating data processing and report generation,
II. P ROBLEM I DENTIFICATION reducing administrative overhead.
5) Ensuring User-Friendly Interface: Design an intuitive
Whether paper-based or computerized, manual attendance
graphical user interface (GUI) that facilitates easy in-
procedures are labor-intensive, requiring educators to devote
teraction with the system for educators, administrators,
Identify applicable funding agency here. If none, delete this. and other stakeholders.
IV. P ROJECT S COPE AND D IRECTION • Cost Savings: The transition to a digital attendance
The primary intention of this project is to resolve the system eliminates the need for paper-based processes,
limitations encountered in traditional attendance systems while resulting in substantial cost savings associated with paper
introducing an innovative smart solution to enhance conve- usage, printing, and storage.
• Time Efficiency: With automated calculations and pro-
nience for educational institutions. The project entails the
development of an application capable of facial recognition cesses, the system offers time-efficient attendance man-
for individual identification and automated recording of atten- agement. Tasks such as attendance tracking and reporting
dance data into a centralized database system. Additionally, are streamlined, reducing administrative burden and en-
the system will generate an Excel sheet containing student hancing overall efficiency.
attendance records, which will be directly emailed to the In summary, this project aims to address the shortcomings of
respective faculty members. traditional attendance systems by introducing a more efficient,
The project scope includes the following components: cost-effective, and user-friendly solution.
• Targeted Users: The attendance monitoring system is V. L ITERATURE R EVIEW
tailored for students and staff within an educational A. Attendance System Using NFC Technology with Embedded
institution. Camera on Mobile Device
• Database Capacity: The attendance management system
can accommodate up to 2000 individual records. According to the research journal “Attendance System
• Single Recognition: The facial recognition process is
Using NFC (Near Field Communication) Technology with
designed to handle recognition for one person at a time. Embedded Camera on Mobile Device” [1], the attendance
• Automated Reporting: An Excel sheet containing student
system is improved by using NFC technology and a mobile
attendance data will be automatically generated and sent application. Each student is given an NFC tag with a unique
via email to the respective faculty members. ID during their enrollment into the college. Attendance for
• Connectivity Requirement: The system necessitates a
each class is then taken by touching or moving these tags
Wi-Fi or Ethernet connection for continuous database on the lecturer’s mobile phone. The embedded camera on the
updates. phone captures the student’s face to send all the data to the
• Portable Operation: The application will run on devices
college server for validation and verification. The advantages
powered by a power bank to enhance portability and of this method include the simplicity of NFC use and the high
flexibility in deployment. speed of connection establishment, significantly speeding up
the attendance taking process. However, this system cannot
By addressing these key components, the project aims to
automatically detect violations when the NFC tag is not
revolutionize attendance management processes in educational
personally tagged by the original owner. Additionally, the
institutions, offering a streamlined and efficient solution that
reliance on personal mobile phones for attendance tracking
improves accuracy, reliability, and convenience for both stu-
may inconvenience lecturers, especially if they forget to bring
dents and faculty members.
their phones to work. Hence, using unique student information
A. Impact, Significance and contributions such as biometrics or face recognition is proposed to replace
the NFC tag, ensuring attendance is taken accurately by the
In this project, we aim to overcome the inefficiencies actual student.
and lack of information sharing commonly found in existing
attendance management systems. The following improvements B. Face Recognition Based Attendance Marking System
and enhancements will be implemented: The research journal “Face Recognition Based Attendance
• Encouraging Punctuality: By implementing a system Marking System” [2] proposes a system based on face recogni-
where attendance can only be taken in person, students tion to address the challenges of previous attendance systems.
will be incentivized to attend classes promptly. This This system uses a camera to capture images of individuals
approach not only fosters punctuality but also prevents for face detection and recognition. The captured image is
unethical practices such as signing attendance for absent compared with a face database to mark attendance when a
peers. match is found. The main advantage of this system is that at-
• Resource Optimization: Leveraging technology for atten- tendance is marked on a secure server, preventing unauthorized
dance monitoring reduces the need for manual supervi- attendance marking. Additionally, the face detection algorithm
sion, leading to significant savings in human resources. is enhanced using skin classification techniques to improve
The application operates autonomously, eliminating the accuracy. However, the system’s lack of portability due to its
need for constant human oversight. reliance on standalone computers may limit its suitability for
• Portable Operation: The application can operate on any student attendance tracking, especially considering the need
device with Wi-Fi or Ethernet connectivity, allowing for for students to report attendance at multiple classes per day. To
flexible deployment in various locations. For instance, address this issue, the entire attendance management system
the system can be positioned at classroom entrances to can be developed on a portable module, enabling execution by
streamline attendance taking. a Python program.
C. Fingerprint Based Attendance System Using Microcon- B. Libraries Development
troller and LabView The development of libraries involves installing and con-
The research journal “Fingerprint Based Attendance Sys- figuring essential software libraries required for the func-
tem Using Microcontroller and LabView” [3] proposes a tioning of the attendance monitoring system. These libraries
fingerprint-based attendance system utilizing microcontrollers. provide critical functionalities and tools necessary for image
The system captures fingerprint patterns using a fingerprint processing and facial recognition. In addition to OpenCV, the
sensor, with the information transmitted to microcontroller following libraries are integral to the system:
1 for processing. Microcontroller 1 then communicates with 1) OpenCV: OpenCV is a powerful library of programming
microcontroller 2 to check against a database for student functions primarily aimed at real-time computer vision appli-
matches. Upon finding a match, the details are sent to a cations. Originally developed as an Intel Research initiative,
PC for display via serial communication. While this design OpenCV offers a wide range of functionalities essential for
accelerates development and maintains design flexibility, its image processing and analysis. The main objectives of the
attachment to a PC may limit portability. Additionally, ac- OpenCV project include:
cessibility of attendance information for concerned parties, • Advancing Vision Research: OpenCV provides opti-
such as parents, may be challenging. To address this, the mized code for basic vision infrastructure, facilitating
information can be uploaded to a web server for easy access, advancements in vision research by eliminating the need
with authentication enforced through a login screen. to reinvent the wheel.
D. RFID based Student Attendance System • Dissemination of Vision Knowledge: By offering a
The research journal “RFID based Student Attendance common infrastructure, OpenCV enables developers to
System” [4] proposes a system similar to the NFC-based build on existing code, making it more accessible and
system, utilizing RFID technology for attendance tracking. transferable across different projects.
• Support for Commercial Applications: OpenCV offers
In this system, tags and readers are used to track student
attendance, with attendance information accessible through a portable, performance-optimized code for vision-based
web portal. However, like previous systems, this system’s lack commercial applications, promoting innovation in various
of portability and reliance on PC connectivity may limit its industries.
effectiveness. Additionally, the use of RFID tags may result OpenCV’s extensive range of application areas includes:
in inaccuracies in attendance information due to their generic • 2D and 3D feature toolkits
nature. • Egomotion estimation
• Facial recognition system
VI. SYSTEM DESIGN
• Gesture recognition
The system design of the attendance monitoring system
• Human–computer interaction (HCI)
encompasses two key aspects: hardware and software. The
• Mobile robotics
hardware component lays the foundation for the software
• Motion understanding
to operate effectively. Additionally, essential libraries are re-
• Object identification
quired for the software to function efficiently. This section
• Segmentation and recognition
outlines the hardware requirements and the development of
• Stereopsis stereo vision: depth perception from 2 cameras
necessary libraries for the project.
• Structure from motion (SFM)
A. Hardware Development • Motion tracking
The hardware development phase focuses on acquiring • Augmented reality
and setting up the necessary physical components to support Furthermore, OpenCV includes a comprehensive statistical
the attendance monitoring system. The following hardware machine learning library, which encompasses algorithms such
components are essential for the system: as boosting, decision tree learning, gradient boosting trees,
• Camera Module: A high-resolution camera module ca- expectation-maximization algorithm, k-nearest neighbor algo-
pable of capturing clear images for facial recognition rithm, naive Bayes classifier, artificial neural networks, random
purposes is required. The camera should have sufficient forest, and SVM. These algorithms play a crucial role in
megapixels to ensure accurate identification. training and implementing facial recognition models within
• Power Supply Cable: A reliable power supply cable is the attendance monitoring system.
necessary to ensure uninterrupted operation of the system. 2) Facial Recognition and Dlib: Facial Recognition and
It should be compatible with the camera module and other dlib are additional libraries utilized for facial recognition
hardware components to provide consistent power. tasks within the attendance monitoring system. These libraries
• Micro SD Card: A high-capacity Micro SD card with provide advanced functionalities for detecting and identifying
Class 10 specifications is essential for storing data and faces in images. Facial Recognition, in conjunction with dlib,
system files. The 16GB storage capacity ensures ample enhances the accuracy and efficiency of face recognition
space for storing captured images, configuration files, and algorithms, ensuring reliable attendance tracking based on
other relevant data. facial biometrics. Integrating these libraries into the system
enables robust facial recognition capabilities, contributing to 4) Login Authentication: Upon login attempts, compare
the overall effectiveness of the attendance monitoring solution. the encoded facial features of the individual with those
stored in the database. If a match is found, grant access
VII. PROGRAM USAGE to the system; otherwise, prompt the user to register as
a new user.
C. User Registration
1) New User Registration: If a login attempt fails due to
unrecognized facial features, prompt the user to register
as a new user.
2) User Data Storage: Store the captured facial images
and corresponding user IDs in the database directory
for future authentication.
3) Success Notification: Notify the user upon successful
registration, confirming their enrollment in the atten-
dance management system.
D. System Implementation
1) Graphical User Interface (GUI): Develop a user-
friendly GUI using Tkinter to facilitate user interaction
Fig. 1. System Flowchart with the attendance management system.
2) Real-time Image Processing: Implement real-time im-
age processing to continuously capture and process
VIII. M ETHODOLOGY facial images from the camera feed.
Based on the provided code, the methodology for the 3) Attendance Logging: Maintain a log file to record the
attendance management system can be summarized as follows: attendance data, including user IDs and timestamps of
login attempts.
A. Portrait Acquisition and Registration By following these steps, the attendance management sys-
1) Capture Portraits: Utilize a camera module to capture tem can effectively capture, process, and authenticate user
facial images of individuals. identities based on facial recognition technology.
2) Face Detection: Implement a face detection algorithm
IX. E XPERIMENT
to identify and locate faces within the captured images.
If no face is detected, prompt the user to recapture their A. Dataset Description
image until a face is successfully detected. The dataset utilized in this experiment comprises facial
3) Multiple Portrait Capture: Once a face is detected, images obtained from diverse individuals. These images were
capture multiple portraits of the individual to ensure a systematically organized into a structured dataset directory,
diverse set of images for facial recognition. Continue wherein each subdirectory represents a distinct individual.
capturing images until the required number of portraits Within each subdirectory, one or more images of the cor-
per individual is obtained. responding individual were stored, captured under varying
4) Pre-processing: Process the captured images to prepare conditions and poses.
them for facial recognition. This includes converting the
images to grayscale and cropping the faces to ensure uni- B. Preprocessing
form size and alignment. These pre-processing steps are Prior to training, the facial images underwent preprocessing
essential prerequisites for facial recognition algorithms. steps to ensure compatibility with the neural network archi-
tecture. The preprocessing steps included:
B. Facial Recognition and User Authentication 1) Loading and Validation: Facial images were loaded
1) Facial Encoding: Utilize the facial recognition library from the dataset directory, and their validity and format
to encode facial features from the captured images into were verified.
numerical representations (embeddings). 2) Resizing: Images were resized to a standardized dimen-
2) Database Management: Maintain a database directory sion to facilitate uniform processing.
containing the encoded facial embeddings of registered 3) Color Format Conversion: Images were converted to
users. the appropriate color format to ensure consistency in
3) Matching Algorithm: Implement a matching algorithm input data.
to compare the encoded facial features of individuals 4) Label Encoding: String labels were encoded into nu-
attempting to log in with the entries in the database merical labels using the LabelEncoder module from
directory. scikit-learn.
Fig. 2. Accuracy and Loss Curve
C. Feature Extraction
Feature extraction was conducted using the
face_recognition library, renowned for its robust
facial recognition capabilities. Specifically, the library’s
face_encodings function was employed to extract
distinctive facial features from each image. These extracted
features were subsequently represented as a set of numerical
encodings for each facial image.
D. Training Setup
The experiment employed a deep neural network architec-
ture implemented using TensorFlow and Keras. The architec-
ture comprised the following layers:
• Input Layer: A dense layer with a Rectified Linear Unit
(ReLU) activation function.
• Dropout Layer: A regularization layer incorporating a
dropout rate of 0.5 to mitigate overfitting.
• Output Layer: A dense layer with a softmax activation
function for multiclass classification. Fig. 3. Face Detection
The model was compiled utilizing the Adam optimizer
and trained using the sparse categorical cross-entropy loss
function. The training process spanned 30 epochs. merely save resources but also reduces human intervention
in the whole process by handling all the complicated task
E. Results to the machine. The only cost to this solution is to have
As seen in Figure 2 below, after training the model over sufficient space in to store all the faces into the database
30 epochs, the validation accuracy of the model increased storage. Fortunately, there is such existence of micro SD that
along with the training accuracy. This indicates that our model, can compensate with the volume of the data. In this project,
improved its prediction capability as the epochs progressed. the face database is successfully built. Apart from that, the
In addition, the training and validation loss values demon- face recognizing system is also working well. At the end, the
strated a consistent decrease throughout the training process, system not only resolve troubles that exist in the old model but
indicating continuous learning within the model. However, it also provide convenience to the user to access the information
is noteworthy that while both training and validation losses collected by mailing the attendance sheet to the respected
decreased, a noticeable disparity between the two sets was faculty.
observed. This suggests potential areas for improvement in
R EFERENCES
the model, particularly in reducing the variance between the
training and validation losses. [1] “Attendance System Using NFC Technology with Embedded Camera
on Mobile Device” (Bhise, Khichi, Korde,Lokare, 2015)
ACKNOWLEDGMENT [2] K.SenthamilSelvi, P.Chitrakala, A.AntonyJenitha, ”Face Recognition
Based Attendance Marking System”, IJCSMC, Vol. 3, Issue. 2, February
Before the development of this project. There are many 2014.
loopholes in the process of taking attendance using the old [3] “Fingerprint Based Attendance System Using Microcontroller and Lab-
View” (Kumar Yadav, Singh, Pujari, Mishra, 2015)
method which caused many troubles to most of the institutions. [4] “RFID based Student Attendance System” (Hussain, Dugar, Deka,
Therefore, the facial recognition feature embedded in the atten- Hannan, 2014)
dance monitoring system can not only ensure attendance to be [5] OpenCvDocumentation -https://opencv.org
[6] DlibDocumentation -http://dlib.net
taken accurately and also eliminated the flaws in the previous
system. By using technology to conquer the defects cannot