Face Recoog
Face Recoog
ATTENDANCE SYSTEM
A PROJECT REPORT
Submitted by
SUBALAKSHMI (191IG137)
UMAIYAL M R (191IG141)
MARCH 2023
i
BONAFIDE CERTIFICATE
SIGNATURE
SIGNATU
RE
Ms. Nandhini S S Mrs. Kiruthiga R
HEAD OF THE DEPARTMENT, SUPERVISOR,
Assistant Professor Level III, Assistant Professor ,
Department of Information Science and Department of Artificial Intelligence
Engineering, and Data science,
Bannari Amman Institute of Technology Bannari Amman Institute of
Erode – 638401. Technology Erode - 638401.
ii
DECLARATION
SUBALAKSHMI S UMAIYAL M R
(191IG137) (191IG141)
SIGNATURE
Mrs. Kiruthiga R
Supervisor,
Assistant Professor,
Department of Artificial Intelligence and
Data Science,
Bannari Amman Institute of Technology,
Erode - 638401.
iii
ACKNOWLEDGEMENT
SUBALAKSHMI S
(191IG137) UMAIYAL M R
(191IG1
41)
iv
ABSTRACT
v
the recognized student will be marked. The student who is not registered
will also be able to register on the spot and notification will be given if
students sign in more than once. The average accuracy of recognition is 100
% for good quality images, 94.12 % of low-quality images and 95.76 % for
Yale face database when two images per person are trained.
vi
TABLE OF CONTENTS
iv
ACKNOWLEDGEMENT
ABSTRACT v
LIST OF FIGURES x
1.2 Objectives 2
2 LITERATURE REVIEW
3 PROPOSED SYSTEM 12
3.1 Face recognition 12
vii
3.4 Pre Processing 17
3.5 Feature Extraction 19
4 REQUIREMENT SPECIFICATION 31
4.1 Hardware Requirements 31
4.3.1 Python 31
4.3.1.1 Numby 32
4.3.1.2 Pandas 32
4.3.1.3 Sklearn 32
4.3.1.4 MatPlotlib 33
4.3.1.5 Seaborn 33
viii
4.3.2 Java 33
4.3.3 Google Colab 34
5
RESULT AND DISCUSSION 36
5.1 Results 36
5.2 Discussions 40
6 REFERENCES 42
ix
LIST OF FIGURES
x
5.2 Access location 36
xi
LIST OF TABLES
FIGURE PAGE
TITLE
NO NO
detection
various methodologies
Improvement
recognition methodologies.
Summary of Comparison
5.1 39
with Previous Researches
xii
LIST OF SYMBOLS / ABBREVIATONS
χ2 Chi-square statistic
𝑑 distance
𝑚𝑥 mean of x
𝑆𝑥 covariance matrix of x
𝑋𝑐 x coordinate of center pixel
𝑅 radius
𝜃 angle
𝛤𝑖 column vector
𝜑 mean face
xiii
Φ𝑖 mean face subtracted vector
𝐴 𝑇 transpose of 𝐴
𝐶 covariance matrix
𝑢𝑖 eigenvector of 𝐴𝐴 𝑇
𝑣𝑖 eigenvector of 𝐴 𝐴𝑇
λ eigenvalue
𝑈 eigen face
Ω projected image
Ω𝑖 projected image v
xiv
CHAPTER 1
INTRODUCTION
To build an app for face recognition based student attendance system is the
main objective. Considering various aspects of face recognition to achieve
better results, Limiting the test and training images to frontal and upright facial
images and using the Viola-Jones algorithm for segmentation can help improve
performance. Applying median filtering to remove noise and using CLAHE
for contrast enhancement are also great techniques to enhance image. Along
with face recognition, location generation every once 5 minutes are refreshed
to ensure the accurate attendance. Accurate attendance involves how many
minutes does student stays in the class. Also presence time if below minimum
percentage will be considered absent. Automatic message delivery system for
not being present in class will be accomplished and accustomed in admin
bonus features. The students have to register their prime details in the
portal/app to be recognized. The registration of student images can be done
easily with efficient user interface.
1
disputes or damages can only be handled by tech assistants. It's true that face
recognition systems have been around for a while, but there is always room
for improvement. One of the main challenges of face recognition is dealing
with variations in head position and facial expressions, which can make it
difficult to recognize faces accurately.
1.2 Objectives
To build a real time face recognition app with student presence assurance
system, the following are objectives
2
● To create a selection form for choosing classroom size
● To visualize geo – dataframe map.
● To record the data from unwanted noises.
● To classify the data in order to proceed recognition part.
● To record the attendance and mark depending on attendance percentage.
3
CHAPTER 2
LITERATURE REVIEW
RFID card systems can be simple to implement and use, but they do have
limitations. For example, they can be lost or stolen, and it's possible for
someone to use another person's card to gain access or mark attendance.
Fingerprint and iris recognition systems can be more secure, but they do
require more time for verification and can be vulnerable to fraudulent
approaches such as spoofing. These methods also involve the integration of
sensitive biometric data, which raises privacy concerns. Voice recognition can
also be less accurate, especially in noisy environments or for individuals with
speech impediments.
4
Table 2.1 Advantages & Disadvantages recorded from 2017 paper proposed by
ArunKataraetal.,
5
Table 2.2 Difficulties faced during Face detection
6
7
2.1.1 Viola-Jones Algorithm
Overall, the Viola-Jones algorithm has been widely adopted due to its high
accuracy and fast computation time, making it suitable for real-time face
detection applications.
The value of integrating image = the sum of pixels on the left and
the
8
Table 2.4 Different methods of Contrast Improvement
9
10
Table 2.5 Accuracy of Different face recognition methodologies.
11
CHAPTER 3
PROPOSED SYSTEM
The system described here is the methodology for performing face recognition-
based student attendance system. The approach involves several stages, including
image capture, pre-processing, feature extraction, subjective selection. The first
stage of the methodology is image capture. This involves using a simple interface
to capture facial images. Next, the captured facial images are pre-processed to
remove any noise. It's worth noting that the use of both LBP and PCA feature
extraction methods is a common approach in many face recognition systems. LBP
is particularly effective at capturing local facial features, while PCA can reduce
the dimensionality of the feature space, making the classification process more
efficient. The combination of these two techniques can lead to improved accuracy
in face recognition systems. Additionally, the use of subjective selection to choose
the most relevant features can further improve accuracy, as it allows the algorithm
to focus on the most distinctive features of each individual's face.
The flow chart for the proposed system is categorized into two parts,
shown in Figure 3.1 and Figure 3.2 respectively.
12
13
14
3.2 Input Images
Using existing face databases like the Yale face database can be useful in
designing and evaluating a real-time face recognition student attendance system.
The Yale face database provides a diverse set of images that can be used to train
and test the performance of the system. By using a pre-existing database, the
system can be developed and tested with a standardized set of images that have
already been curated and labeled. This can save time and resources that would
otherwise be required to create a custom database from scratch. Additionally,
using a pre-existing database can provide a benchmark for performance
comparison with other system that have used the same database. The Yale face
database is a popular choice for evaluating system because it includes images of
individuals in a variety of poses, expressions, and lighting conditions. This ensures
that the system can recognize faces consistently in different situations and
conditions. Overall, while using a custom database is ideal for a real-time face
recognition student attendance system, using existing databases like the Yale face
database can still be a valuable tool in designing and evaluating the vitality of the
system.
15
3.2.1 Limitations of the Images
The proposed approach has certain conditions that must be satisfied in order for
it to perform well. These conditions include:
Frontal, upright and single face: The input image for the proposed
approach must be a frontal, upright image of a single face. This is because
the system is designed to recognize specific facial features that are only
visible in a front- facing image.
Facial images with and without glasses: While the system is designed to
recognize faces with and without glasses, it is recommended that students
provide both facial images with and without glasses to increase the
accuracy of recognition.
Same device for training and testing: The training and testing images
should be captured using the same device to avoid any quality differences
that may affect the accuracy of recognition.
Student registration: In order to be recognized by the system, students must
register and provide their facial images for training. This can be done
through a user-friendly interface that facilitates the enrolment process.
By satisfying these conditions, the proposed approach can be optimized to
achieve high accuracy in recognizing students and recording attendance.
16
3.3 Face Detection
Viola-Jones object detection framework will be used to detect the face from the
video camera recording frame. The Viola-Jones algorithm works by using a
cascade of simple Haar-like features to classify sub-windows of an image as
either "face" or "non-face". Viola-Jones algorithm has limitations, and one of
them is that the facial image has to be a frontal upright image. This means that
the algorithm is optimized for detecting faces that are oriented towards the
camera in a video frame. If a face is not oriented towards the camera, or is
partially obscured, the algorithm may not be able to detect it accurately. Despite
its limitations, the Viola-Jones algorithm is still widely used for face detection
in real-world applications due to its speed and accuracy in detecting faces that
are oriented towards the camera. By using this framework in a student attendance
system, the system can quickly and accurately detect and recognize the faces of
registered students and record their attendance.
3.4 Pre-Processing
Pre-processing steps are essential for improving the quality of the images before
proceeding to feature extraction. Here are the details of the pre-processing steps
you mentioned:
● Scaling of image: Scaling of the image involves resizing the image to a
particular size, which is usually smaller or larger than the original size. This
step is important because it reduces the computational load during the feature
extraction process, which makes it faster and more efficient.
● Median filtering: Median filtering is a popular pre-processing technique used
to remove noise from images. This technique involves replacing each pixel
in the image with the median value of its neighboring pixels. This helps to
remove salt-
17
and-pepper noise and other types of random noise in the image.
● Conversion of color images to grayscale images: This step involves
converting a color image to a grayscale image. Grayscale images have only
one channel (i.e., black and white), which makes it easier to perform certain
image processing tasks.
● Adaptive histogram equalization: Histogram equalization is a technique used
18
3.5 Feature Extraction
19
uses linear algebra to identify the principal components of the image. This
method is effective at capturing the overall shape and structure of the face,
which can be used to distinguish between different individuals. By combining
local and global feature extraction methods like enhanced LBP and PCA, we
can capture both the texture and geometric information present in facial images,
which can improve the accuracy of face recognition. However, it's important to
note that the performance of these methods can depend on the specific
characteristics of the images being analyzed, such as lighting conditions, pose,
and expression. Therefore, it's important to carefully select and optimize the
feature extraction methods based on the specific requirements of the
application.
20
3.5.2 Working Principle of Proposed LBP
● 𝜃 indicates the angle of the sampling point with respect to the center pixel
● P indicates number of sampling points on the edge of the circle
taken to compare with the center pixel.
(3.3)
𝑋𝑝 = 𝑋𝑐 + 𝑅𝑐𝑜𝑠(𝜃/𝑃)
𝑌𝑝 = 𝑌𝑐 + 𝑅𝑠𝑖𝑛(𝜃/𝑃)
21
3.5.3 Working Principle of PCA
22
Step 2: Obtain the mean/average face vector
Step 3:
23
Step 4: Calculate the covariance matrix
Step 5: Calculate the eigenvectors and eigenvalues from the covariance matrix.
24
3.6 Feature Classification
In face recognition systems, after feature extraction, the next step is to classify
the images by comparing them to a set of known images (the training set) to
determine the closest match. This is typically done using a distance metric,
which measures the dissimilarity between two images. In the case of LBP
feature extraction, the chi-square statistic is commonly used as a dissimilarity
measure to determine the shortest distance between the training image and the
testing image. The chi-square statistic is a statistical measure that quantifies the
difference between two probability distributions. By using this measure, we can
determine how similar two LBP histograms are and use this information to
classify the images. Similarly, in the case of PCA feature extraction, the
Euclidean distance is commonly used to compute the shortest distance between
the trained and test images. The Euclidean distance is a geometric measure that
quantifies the distance between two points in a high-dimensional space. By
using this measure, we can determine how similar two feature vectors are and
use this information to classify the images. However, as you correctly pointed
out, the nearest result might not always be true. This is because different images
may have similar feature vectors or LBP histograms, and it can be difficult to
distinguish between them based on these features alone. Therefore, combining
the results of multiple feature extraction methods, such as enhanced LBP and
PCA, can improve the accuracy of the system. One common approach to
combining multiple feature extraction methods is to use a weighted average or
a fusion algorithm to combine the results.
25
3.7 Location Generation
The Android Location API is a set of classes and interfaces provided by the
Android SDK that allows developers to access location data from various
sources, such as GPS, Wi-Fi, and cellular networks. This API provides a simple
and consistent way to request location updates, retrieve location information,
and track user movements.
The Android Location API is based on the concept of location providers, which
are sources of location data. The three main types of location providers are:
● GPS Provider: This provider uses GPS to determine the location of the
network data to determine the location of the device. This method is faster
and more reliable than GPS in many cases, especially indoors, but may not
be as accurate as GPS.
● Fused Location Provider: This provider combines data from multiple
sources, including GPS, Wi-Fi, and cellular networks, to provide the most
accurate and reliable location data possible. It automatically selects the best
available source based on the current location and other factors.
To use the Android Location API, developers can create an instance of the
LocationManager class, which is responsible for managing location updates
and
retrieving location information. They can then request location updates by
specifying the desired provider and minimum time and distance intervals
between updates. The Location API also provides a range of features, such as
geocoding (converting addresses to latitude/longitude coordinates), reverse
geocoding (converting latitude/longitude coordinates to addresses), and
location tracking.
26
These features can be used to create location-based apps, such as mapping and
navigation apps, social networking apps, and more.
27
projections, which can affect the accuracy and precision of location data.
To connect Android Studio and Google Colab with a Flask API, you will need
to expose the Flask API on a publicly accessible web server. Basic steps to do
so:
● Deploy your Flask API to a cloud service, such as Heroku, Google Cloud
28
Figure 3.13 Complete Flow chart
29
30
CHAPTER 4
REQUIREMENT SPECIFICATION
Processor - Intel
core i5 RAM - 8 GB
Mouse
31
numbers, and lists. Classes and multiple inheritance are available in Python for
object- oriented programming. The language's exception raising and catching
capabilities make error management simpler.
The following Python packages are used in this project:
1. Numpy
2. Pandas
3. Sklearn
4. Matplotlib
5. Seaborn
4.3.1.1 Numby
One of the most common Python packages is called Numpy. Numerical Python
is the short form of it. Working with large arrays and matrices are primarily its
uses. Complex numerical operations can be calculated with ease as well.
Numpy can be used for code optimization because it occupies a very small
amount of memory and specifies the data types of the content that is present
inside.
4.3.1.2 Pandas
Working with "relational" or "labelled" data is made simple and intuitive with
the help of the Python module Pandas, which offers quick, adaptable, and
expressive data structures. It seeks to serve as the essential, high-level building
block for using Python for actual, useful data analysis.
4.3.1.3 Sklearn
32
The efficient and robust able Python machine learning library Sklearn(skit-
learn) offers statistical modelling and provides variety of effective tools. This
involves variety of machine learning techniques classification, regression,
clustering, dimensionality reduction.
4.3.1.4 Matpoltlib
4.3.1.5 Seaborn
4.3.2 Java
33
4.3.3 Google Colab
Google created Google Colab to give anyone who requires access to GPUs and
TPUs for building a machine learning or deep learning model free access to
them. A more advanced version of Jupyter Notebook is Google Colab. Using a
web browser or an Integrated Development Environment, Jupyter Notebook is
a program that enables editing and running of Notebook documents (IDE).
Notebooks will be used for working rather than files.
Flask is a micro web framework written in Python that allows developers to build
web applications quickly and easily. Flask is known for its flexibility, and ease of
use, making it a popular choice for developing web applications, including APIs.
Flask APIs can be deployed to a variety of hosting platforms, including cloud
34
providers like AWS or Google Cloud, and can be used to build a wide range of
applications, including mobile apps, web applications, and Internet of Things
(IoT) devices.
35
CHAPTER 5
5.1 Result
From the above proposed system in Chapter 3, User gets to login, if user is
Teacher he gets to switch ON his Location option and generate longitude and
latitude of the classroom. and students will login and their location will be
generated in terms of longitude and latitude. Our database of class room shape
area and shape length will be collected. With these integrated data, we will be
visualizing student location in GeoDataFrame. If the student moves outside the
GeoDataFrame for about 5 min, Professor/Admin will get notification from the
app he is using. To ensure this, the location generation will be held every 3 sec
and data will be refreshed. Once, student is within GeoDataFrame he will asked
to provide access to camera. After providing access, to perform face recognition
automatically he "register" button allows for the enrollment or registration of
students, which involves capturing their facial images and storing them in the
system's database. The "update" button is used to retrain the system with the latest
images that have been registered. This is important to ensure that the system is
always up- to-date and able to accurately recognize students.
The "browse" button is used to select facial images from the database for testing
purposes. This allows the user to verify the accuracy of the system's recognition
capabilities. Finally, the "recognize" button is used to initiate the face recognition
process on a selected image. The system will compare the features of the selected
image with those in the database and attempt to identify the student in the image.
36
Figure 5.1 Login page Figure 5.2 Access Location
37
Figure 5.5 Classroom selection
38
39
5.2 Discussion
40
41
REFERENCES
1. Arun Katara, Mr. Sudesh V. Kolhe, Mr. Amar P. Zilpe, Mr. Nikhil D. Bhele,
Mr. Chetan J. Bele. (2017). “Attendance System Using Face Recognition and
Class Monitoring System”, International Journal on Recent and Innovation
Trends in Computing
42
10. Sidney Fussell. (2018). NEWS Facebook's New Face Recognition
Features:
What We Do (and Don't) Know. [online] Available at:
https://gizmodo.com/facebooks-new-face-recognition-features-what-we-
do- an- 1823359911 [Accessed 25 Mar. 2018].
11. Solon, O. (2017). Facial recognition database used by FBI is out of control,
House committee hears. [online] the Guardian. Available
at: https://www.theguardian.com/technology/2017/mar/27/us-facial-
recognition- database-fbi-drivers-licenses-passports [Accessed 25 Mar.
2018].
43
CONTRIBUTION OF WORK
Result Information
Similarity 23 %
90