Face Recognition System
Face Recognition System
I confirm that I understand my coursework needs to be submitted online via Google Classroom under the
relevant module page before the deadline in order for my assignment to be accepted and marked. I am
fully aware that late submissions will be treated as non-submission and a marks of zero will be awarded
CU6051NI
Table of Contents
1. INTRODUCTION...................................................................................................... 1
1.1. AI Concept Used ................................................................................................ 1
1.2. Problem Domain ................................................................................................ 1
2. BACKGROUND ....................................................................................................... 2
2.1. Research Work Done on FRAS (Facial Recognition Attendance System) ......... 2
2.1.1. AI in a Vague Part of Facial Recognition Attendance System. .................... 2
2.1.2. AI in specific Part of the project (FRAS) ...................................................... 5
2.1.3. Advantages Of Facial Recognition Attendance System. ............................. 6
2.1.4. Disadvantages Of Facial Recognition Attendance System. ......................... 7
2.1.5. Dataset ........................................................................................................ 8
2.2. Review and Analysis of existing work ................................................................ 9
2.2.1. Review Of Existing System........................................................................ 10
2.2.2. Summarized Review and analysis. ............................................................ 11
3. SOLUTION ............................................................................................................. 12
3.1. Algorithm Of the System. ................................................................................. 12
3.2. Pseudo-Code. .................................................................................................. 13
3.3. Logical Flow chart. ........................................................................................... 14
3.4. State Transition Diagram. ................................................................................ 15
3.5. Development Process. ..................................................................................... 15
3.5.1. Tools Used ................................................................................................ 15
3.5.2. Tool Kit Used ............................................................................................. 17
3.5.3. Python Libraries Used. .............................................................................. 18
3.5.4. Explanation of development process. ........................................................ 18
3.5.5. Achieved Results. ...................................................................................... 21
4. CONCLUSION ....................................................................................................... 24
Bibliography .................................................................................................................. 25
APPENDIX ...................................................................... Error! Bookmark not defined.
CU6051NI
Table of Figures
Figure 1 Flow chart........................................................................................................ 14
Figure 2 System architecture diagram........................................................................... 15
Figure 3 Installing required packages............................................................................ 18
Figure 4 Importing required libraries.............................................................................. 18
Figure 5 Loading and encoding photos. ........................................................................ 18
Figure 6 creating array for known face and their names. .............................................. 19
Figure 7 Setting webcam to default. .............................................................................. 19
Figure 8 Initiating loop for real time face recognition and capturing video frame. .......... 19
Figure 9 detecting face location and encoding faces in video frame. ............................ 19
Figure 10 Matching faces and handling matches. ......................................................... 19
Figure 11 Writing to csv file. .......................................................................................... 19
Figure 12 Drawing rectangle and labelling faces. .......................................................... 20
Figure 13 Displays resulting frames. ............................................................................. 20
Figure 14 Existing the loop. ........................................................................................... 20
Figure 15 Releasing resource and closing window. ...................................................... 20
Figure 16 Detected unknown undefined faces. ............................................................. 21
Figure 17 successful face detection. ............................................................................. 22
Figure 18 Generated Csv with known faces date and attendance time......................... 23
CU6051NI
Table of tables
1. INTRODUCTION
In the Field of Artificial Intelligence, Combination of Machine learning and computer vision
has made a way for innovative solutions to everyday challenges. For this coursework I
am making an AI project named “Facial Recognition Attendance System”(FRAS). This
system will be able to successfully recognize the face of a user saved in the database
and will be able to record the name and date of the user.
The concept used in this project is Machine Learning. Machine learning is a subset of AI
which plays a main role in this project. Supervised Learning, i.e. a process where the
system learns patterns from the labeled data, is the main point to process of facial
recognition.
When there are large number of students in university, it becomes hard to list the
attendance of the student and it consumes time. Traditional ideas to mark attendance are
proving inaccurate and are continuously facing problems. The old methods like calling out
student’s names and verifying ID-cards of students is a hassle. Especially in the lecture
class where there are large number of students old techniques fails. Thus, the face
recognition attendance system is proposed to overtake the manual attendance methods.
Furthermore, The Facial recognition attendance system will be able to overcome the fraud
approach and lecturers will not have to make sure the number of students presence in
the class several times by counting the name list.
1
22015633 Aarohan Subedi
CU6051NI
2. BACKGROUND
The earliest pioneers of facial recognition were Woody Bledsoe, Helen Chan Wolf, and
Charles Bisson. In 1964 and 1965, Bledsoe, along with Wolf and Bisson began work using
computers to recognize the human face. Due to the funding of the project originating from
an unnamed intelligence agency, much of their work was never published. However, it
was later revealed that their initial work involved the manual marking of various
“landmarks” on the face such as eye centers, mouth etc. These were then mathematically
rotated by a computer to compensate for pose variation. The distances between
landmarks were also automatically computed and compared between images to
determine identity. These earliest steps into Facial Recognition by Bledsoe, Wolf and
Bisson were severely hampered by the technology of the era, but it remains an important
first step in proving that Facial Recognition was a viable biometric (G.Robinson-Riegler,
2008).
2
22015633 Aarohan Subedi
CU6051NI
• Trends: The system integrates with the workplace environment to handle the
employee information and automation for their payroll. The aim is to record
the details for coordination with the HR system.
Coordinating educational fields with facial recognition results as automated
attendance reports and gives a path to analyze the attendance patterns for
the management systems.
The use of facial recognition for security purposes is high these days. It is used
to control access over secured areas as it verifies the identity of an authorized
individual. This system is used even in law enforcement fields for criminal
identifications as they can match faces in surveillance recording with the criminal
databases.
• Approach: The advanced computer programs which are specially using deep
learning are helping computers recognize faces more easily and accurately.
Also, these computer programs have taken advancement in figuring out if a
face is real, helping to stop fake faces tricking the system.
3. Automotive Industry:
In the field of automotive industry, facial recognition can be used for the
convenient and secure access of vehicles. The key based entry can be replaced
by facial recognition system. Further, it can also be used for the safety purpose
of monitoring driver’s facial features while driving.
3
22015633 Aarohan Subedi
CU6051NI
• Approach: The live detections such as eye movements, blinking of eye, facial
expressions, 3D depth sensing along with challenge respond protocol is the
approach that covers the technical and ethical aspect while implementing the
facial recognition system.
Facial recognition can be applied to any individual to log in into their devices. The
system authenticates and authorizes the individual making them an ease without
the need for passwords. Certain platforms use facial recognition for secure
authentication ensuring the user’s account/device’s security.
5. Healthcare:
In the field of healthcare, facial recognition can identify the patient on the
database and can assist in providing the details while monitoring and recording
the patient’s status. It helps reduce the risk of errors and maintains the accuracy
of timely conditions while monitoring the patient.
4
22015633 Aarohan Subedi
CU6051NI
Facial recognition attendance systems are powerful applications that leverage computer
vision technology to automate and streamline the attendance tracking process. The
system uses a camera to capture real-time video images, extract facial features from it,
and uses advanced algorithms to generate a facial encoding. By comparing these facial
coding with pre-registered facial coding, the system identifies a person and marks their
presence. During operation, the system continuously captures individual images,
recognizes faces, and encodes facial features for comparison to a database of known
faces. When a face is detected, the system associates it with the corresponding ID and
records the presence information in a CSV file. CSV files typically contain important
details such as the person's name, date, and time of attendance, etc. This application has
several benefits, primarily improving accuracy, efficiency, and security of time and
attendance management. Traditional methods such as manual time and attendance
management and card-based systems can be error-prone and time-consuming. Facial
recognition eliminates the need for physical contact or additional identification methods,
ensuring a contactless and seamless experience. Additionally, system automation
reduces administrative burden and allows attendance data to be tracked and reported in
real-time. Additionally, the generated CSV file provides a convenient and organized time
and attendance record, facilitates integration with other systems, and simplifies data
analysis. Additionally, facial recognition attendance systems enhance security by
ensuring that attendance records match individuals based on unique facial
characteristics, thereby minimizing the risk of fraudulent attendance. This application is
widely used in various educational institutions, corporate offices, and other organizations
where accurate attendance tracking is essential. Overall, it represents a modern and
efficient time and attendance solution that leverages the power of facial recognition
technology to provide a reliable and user-friendly experience.
5
22015633 Aarohan Subedi
CU6051NI
6
22015633 Aarohan Subedi
CU6051NI
Addressing the challenges below is essential for the responsible development and
deployment of Facial recognition attendance system.
• Privacy Concerns:
Facial recognition attendance systems include the collection and handling of delicate
biometric information, driving to concerns around the potential attack of individuals'
security.
The storage of facial information in frameworks like CSV records raises the hazard of
unauthorized access and abuse, requiring strong security measures.
• Precision Challenges:
Inconstancy in lighting conditions, facial expressions, and picture quality within the
dataset can result in mistakes, driving to false positives or negatives during
identification.
Biases within the training data may contribute to unfair results, affecting certain
statistical groups and raising moral concerns.
• Technical Restrictions:
Executing a viable facial recognition system may require high-quality cameras and
critical handling capabilities, posturing potential monetary limitations for organizations
with restricted assets.
Continuous support and upgrades are vital to adjust to advancing innovative guidelines
and upgrade security measures.
• Legal and Ethical Issues:
Compliance with information security regulations, such as GDPR, is significant,
requesting meticulous consideration to consent, transparency, and secure information
handling.
Ethical considerations include issues of mass observation, individual consent, and the
mindful use of facial recognition technology, emphasizing the need for a adjusted and
moral approach.
7
22015633 Aarohan Subedi
CU6051NI
2.1.5. Dataset
• Demographic Representation:
The dataset is carefully curated to include a differing representation of student
demographics, considering variables such as sex, ethnicity, and age. These differences
improve the FRAS's capacity to recognize and separate among a wide range of student
faces, promoting inclusivity.
8
22015633 Aarohan Subedi
CU6051NI
• Practical Applicability:
The dataset's focus on students inside a class specifically addresses the practical issue
of attendance tracking in an educational system. This significance upgrades the FRAS's
applicability and viability within the setting for which it is designed.
The review and analysis of the system related to Facial recognition attendance system
is necessary to make sure the system I am trying to make is free from the mistakes
done by the previous developers for smooth running and deployment of the system.
9
22015633 Aarohan Subedi
CU6051NI
Face Recognition system uses offline data or real time input, based on the application
of the project. In this research a real time face recognition system is made using CNN
(Convolutional Neural Network) is proposed.
• Large Pose face alignment through CNN based dense 3D Model Fitting.
Author name: Amin Jourabloo, Xiaoming Liu. Year: 2016 (Amin Jourabloo,
2016).
They proposed a method to fit a 3D dense shape to a face image with large poses by
combining cascade CNN repressors and the 3D Morph Able Model (3DMM). They put
forward two types of pose invariant features for boosting the precision of face alignment.
10
22015633 Aarohan Subedi
CU6051NI
The research paper shows a face recognition approach using PCA and Neural Network
techniques. The obtained result is compared with K-means, Fuzzy Ant with fuzzy C-
means and presented technique provides a better recognition rate then the other two.
3. SOLUTION
3.1. Algorithm Of the System.
The code employs the given face recognition library, which is built on top of the dlib
library. The fundamental face recognition algorithm utilized by dlib could be a
combination of profound learning and classic picture preparing strategies. The key
calculation for face recognition is the confront encoding calculation, which changes
over a face picture into a numerical representation, or encoding, that can be compared
to other face encodings to decide if they match.
12
22015633 Aarohan Subedi
CU6051NI
Attendance Log: If the match is found the script logs the attendance by writing the
name of the known student and the current time to a new CSV file.
3.2. Pseudo-Code.
IMPORT face_recognition as fr
IMPORT cv2
IMPORT csv
FROM date time IMPORT datetime
LOAD the known images and their encodings
OPEN the video capture device
WHILE the video is running:
READ the next frame
FIND all faces in the frame
FOR each face:
COMPARE the face to the known face encodings
IF a match is found, write the name of the person to a CSV file
DRAW a rectangle around the face
WRITE the name of the person on the face
DISPLAY the frame
IF the `q` key is pressed, stop the video
RELEASE the video capture device
END
13
22015633 Aarohan Subedi
CU6051NI
14
22015633 Aarohan Subedi
CU6051NI
Python:
Python serves as the essential programming dialect in Python Idle, advertising a flexible
and expressive sentence structure. Famous for its straightforwardness and coherence,
Python empowers consistent improvement of the confront acknowledgment framework.
Its broad library back and community commitments make it an perfect choice for
actualizing machine learning and computer vision calculations.
OpenCV:
OpenCV, consistently coordinates into Python Sit still, could be a effective computer
vision library. It prepares the extend with comprehensive picture preparing
functionalities basic for confront location and acknowledgment. OpenCV's feature-rich
toolkit incorporates apparatuses for picture control, protest following, and design
acknowledgment, making it crucial for extricating significant data from visual
information.
15
22015633 Aarohan Subedi
CU6051NI
NumPy:
NumPy, congruous with Python Sit out of gear, may be a essential library for numerical
computing. Its cluster operations and mathematical capacities improve the effectiveness
of information control, basic for preparing picture information within the venture.
NumPy's multidimensional clusters encourage complex computations, advertising a
strong establishment for dealing with and analyzing numerical information in a brief and
expressive way.
Face_recognition Library:
The face_recognition library, consistently coordinates with Python Sit still, disentangles
complex confront acknowledgment errands. Leveraging pre-trained models, it
streamlines the method of confront discovery and acknowledgment. By abstracting
complicated calculations, face_recognition permits engineers to center on the
application's high-level rationale, upgrading efficiency and diminishing the complexity
related with actualizing facial acknowledgment highlights.
Dlib:
Dlib, interfaces with Python Sit still, could be a C++ library known for its productivity in
machine learning and computer vision errands. Within the face acknowledgment
extend, Dlib's part is vital for facial point of interest discovery, contributing to the exact
recognizable proof of key facial highlights. Its strong facial investigation capabilities
make it an important device for improving the precision and unwavering quality of the
confront acknowledgment framework.
Python Idle:
Python Idle serves as the essential improvement environment, giving an natural
interface for composing, testing, and executing Python code. Its simplicity makes it an
open choice for designers, particularly those modern to programming. Python IDLE's
16
22015633 Aarohan Subedi
CU6051NI
Dlib:
Task:
Dlib serves as a foundational C++ library with effective instruments for machine learning
and computer vision. Within the confront acknowledgment extend, Dlib's essential part
is facial point of interest location, contributing to the exact distinguishing proof of facial
highlights.
Importance:
Dlib's vigorous capabilities in facial investigation improve the exactness and unwavering
quality of the confront acknowledgment framework. Its productive execution guarantees
the project's capacity to distinguish key facial landmarks, a basic step within the in
general acknowledgment handle.
face_recognition Framework:
Task:
The face_recognition system disentangles complex confront acknowledgment
assignments by leveraging pre-trained models for confront location and
acknowledgment.
17
22015633 Aarohan Subedi
CU6051NI
Importance:
By abstracting complex calculations, face_recognition permits for a higher-level usage
of facial acknowledgment highlights. This contributes to expanded efficiency,
decreasing the complexity related with the usage of facial acknowledgment
assignments.
18
22015633 Aarohan Subedi
CU6051NI
Figure 8 Initiating loop for real time face recognition and capturing video frame.
20
22015633 Aarohan Subedi
CU6051NI
21
22015633 Aarohan Subedi
CU6051NI
22
22015633 Aarohan Subedi
CU6051NI
Figure 18 Generated Csv with known faces date and attendance time.
23
22015633 Aarohan Subedi
CU6051NI
4. CONCLUSION
Analyzing the work done in the development of facial recognition attendance systems
reveals the effectiveness and importance of the research. This system satisfies the
objectives outlined in the introduction and provides an efficient and accurate way to
automate attendance tracking. Using facial recognition technology, the system matches
her face with known identities and creates a CSV file for her with relevant attendance
details. In addition to achieving its technical goals, this project demonstrates the
practicality of integrating facial recognition into time and attendance systems and
demonstrates the accuracy and speed of real-time recognition.
Bibliography
A. S. SYED NAVAZ1, T. D. S. &. P. M., 2013. researchgate. [Online]
Available at:
235950165_FACE_RECOGNITION_USING_PRINCIPAL_COMPONENT_ANALYSIS_
AND_NEURAL_NETWORKS
Amin Jourabloo, X. L., 2016. CVF Open Access. [Online]
Available at:
https://openaccess.thecvf.com/content_cvpr_2016/papers/Jourabloo_Large-
Pose_Face_Alignment_CVPR_2016_paper.pdf
Anaconda.com, 2023. anacondanevigator. [Online]
Available at:
https://docs.anaconda.com/free/navigator/index.html#:~:text=Anaconda%20Navigator%
20is%20a%20desktop,line%20interface%20(CLI)%20commands.
G.Robinson-Riegler, 2008. NEC. [Online]
Available at: https://www.nec.co.nz/market-./publications-media/a-brief-history-of-facial-
recognition/
Jupyter.org, 2023. JupyterLab. [Online]
Available at: https://jupyter.org/
Omkar Sawant, Y. j., 2019. researchgate. [Online]
Available at: https://ijarcce.com/wp-content/uploads/2019/05/IJARCCE.2019.8456.pdf
PranavK.B, M., 2020. researchgate. [Online]
Available at:
https://www.researchgate.net/publication/341903551_Design_and_Evaluation_of_a_Re
al-Time_Face_Recognition_System_using_Convolutional_Neural_Networks
T.Sharanya, 2020. Researchgate. [Online]
Available at:
https://www.researchgate.net/publication/342176980_Online_Attendance_using_Facial
_Recognition/link/5ee76c0d92851ce9e7e3d13d/download?_tp=eyJjb250ZXh0Ijp7ImZp
cnN0UGFnZSI6InB1YmxpY2F0aW9uIiwicGFnZSI6InB1YmxpY2F0aW9uIn19
25
22015633 Aarohan Subedi