Face Recognition Attendence System Vishal Singh

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Face Recognition Based Attendance System

Vishal Singh, Atharv Vanjari, Priti Patil, Tejas Shinde, Harshada Giri

Department of Information Technology

Abstract — Face recognition, fingerprint recognition, and other the Haar Cascade algorithm is used for face detecting,
biometric authentication methods are gradually becoming the attendance-based systems can be used by teachers for their
most promising means for identifying a person's face. We can use convenience.
them in our phones, laptops, offices, and other devices. However,
pupils' attendance is still taken manually, which takes a long time I. LITERATURE REVIEW
and is extremely inefficient. To preserve that valuable time, we
needed an automated operating attendance system that
eliminated all of the drawbacks of collecting attendance on
R. C. Damale and B. V. Pathak [1]paper, computer vision
paper. We're putting together a system that's both efficient and and ML based face recognition system is proposed. They
dependable. have trained a module with a lot of images. For helping in
face recognition SVM, MLP and CNN are used as a
Using OpenCV, we created a face recognition-based attendance classifier. The SVM, MLP and CNN nearly achieve the
system. We can apply our attendance system anywhere, not just testing accuracy of about eighty seven percent, eighty six
for students. For face detection and recognition, the Haar percent and ninety eight percent respectively.
Cascade algorithm is utilized.
Second paper is written by 4 authors. They have [2]
Keywords — OpenCV ,Face Recognition, Face Detection, proposed a system for face recognition using the LBPH
Attendance, LBPH algorithm, Haar Cascade algorithm. First, a database is created by enrolling students.
They are taking several images of students using cameras.
INTRODUCTION Then the images are converted into grayscale by using the
LBP algorithm and after that a histogram is generated. A
The face is the most significant component of the human video stream is given to the system by which the LBPH
body for identifying a person. Face recognition is another algorithm matches the live image taken by camera streams
type of biometric recognition that maintains all of a person's with the images present in database. When a face is detected
facial traits as distinct faces prints in order to uniquely successfully, attendance is marked.
identify them. Biometric face recognition has received a lot
of traction among researchers due to its versatility and S. Dev and T. Patnaik [3] proposed a system which the
usefulness. Also its contact free procedure, that is why it requirements i.e is required for the face recognition.The
outsmarts all other recognitions like fingerprint, iris print addition of Gabor filters considerably increases the system's
and palm print. Face recognition technology is also able to accuracy.. Three algorithms are used for face recognition:
detect a person from far away, without coming in physical KNN, CNN, and support vector machines. KNN algorithm
contact with anyone. (of 99.27%)has proved to have the highest accuracy by using
CNN has low computational complexity and algorithm name
The photo that has been captured will be stored in the SVM is used to prove to be less efficient.
database. After that we can use this project in many ways
like face recognition systems will be used in crime related S. S. Pawaskar and A. M. Chavan [4] proposed a system of
reports. To identify the persons in all scenarios such as using different algorithms like haar cascade and LBPH
change of the illumination, pose, age, and so on, we need a which is mostly used for the object and the image detection
very huge dataset and complicated attributes.In recent years, along with the record of the attendance through this system.
Significant progress has been made in the fields of Biometric
like face recognition systems till yet. There has been M. N. Adji And R. Hartanto [5] proposed an attendance
enormous progress in the field of facial recognition during system by face recognition using the Haar cascade
the last decade. algorithm. Face images are captured using a camera. To
determine the location of the face it is performed by a haar
Many facial recognition algorithms today work well even algorithm for image detection.It basically draws a box
with a limited number of faces in pictures.Although, these around the faces of the person to whom we want to detect
types of methodologies had been test under very limited and his face .Using different types of the algorithms they have
very controll lightined conditioning, very proper faces pose done it . After that they have stored the data in the cloud.
and usually non-blurred images. Face recognition-based
attendance systems will be based on the technology of face
recognition and it will be very useful for teachers as it will
provide a very convenient way of marking attendance of the
students for teachers. Face recognition is done by LBPH and
2

determine the location of the face the face detection process


was performed using the Haar Cascade algorithm. When the
face image had been detected, it would make

or draw a box that covers the whole face as an ROI (Region


of Interest). Image feature extraction was performed using
the LBPH algorithm. Compare the detected faces with all
the faces in the database to find the one closest to the
detected face. We have used CSV file format for storing the
database.It is used to present names and directories of faces
which are in the database.

In a paper of [6] authors have suggested a facial recognition


for the attendance system which is based on principal
component analysis. A single image of each person's face is
captured. Then the image is transferred to a grayscale image
and stored in the database.After entering class, the camera is
placed over the face and will change the face into gray scale
and after that it submits to the next part. We are using the
fisher face method for extracting features.Face recognition is
accomplished by comparing all received variables to
previously recorded values in the database. In the event that
the qualities match, the face is recognised and the name
associated with that face is displayed. Data is recorded into a
facedata.xml file when the face is recognised.

In [7]th paper the authors have developed an attendance


management system using face recognition using Raspberry
Pi.For facial recognition, he employed the LBP algorithm.
The image of your face is taken as you face the camera. The Fig. Block Diagram
area of interest, also known as the ROI, which is the human
face, is detected and trimmed as the initial processing step.
The Haar feature-based Cascade method can be used to do Face Detection:It finds and extracts faces (size and
this. The LBP technique is then used to extract the image's location) in images so that the face recognition
features, and the extracted features are compared to the algorithm can use them. The Haar Cascade approach
trained dataset. A servo motor will open the door for the was used to recognise faces in the image. This is an
recognised student if the student's face is recognised. The object detection technique that can detect faces in
attendance results are saved in a MySQL database, which images and real-time videos.
the web server can access.
Face Recognition: The algorithm of face recognition
In [8]th paper the authors have developed a face recognition is important for discovering features that best describe
based automated attendance system which will have an in-
the image once we have retrieved facial images ,
built 2-tier authentication method.For face detection, a faster
R-CNN algorithm is used. The system is designed to work in cropped, scaled, and usually converted to grayscale.
a classroom with two cameras on opposing ends, such that at The Local Binary Pattern Histogram algorithm is a
least one of the cameras captures every student. Each student human face detection technique. It is well-known for
has a unique ID that is used to identify them in the database. its performance and ability to distinguish a person's
When a student meets the two-tier authentication process's face from both the front and side.
required criteria, their corresponding ID is listed as present.

II. METHODOLOGY/EXPERIMENTAL
A. Materials/Components/Flowchart/Block
Diagram/Theory
3

Function Task done


VideoCapture() For starting the camera

cvtColor() Input image is converted


into a specified format,
e.g., grayscale, hsv, etc.
detectMultiScale() Detects different-sized
items in the provided
image.
cv2.imwrite() To save the images into
the dataset
cv2.face.LPBHFaceRecognize Used to load the
r recognizer.
create()
import cv2 To import the OpenCV
module Fig. Haar cascade feature(a)

It is a machine learning method that entails training a


III. RESULTS AND DISCUSSIONS cascade function with a huge number of pictures.This is a
machine learning source used to train the cascading function
with numbers of photos.
This project is a facial recognition attendance system
To train the classifier, this technique requires a large number
that accepts student ID cards and photos as input.
of both positive (photos with faces) and negative (images
Train your photos using the Haarcascade method and
without faces). It then invites you to extract the features
generate a YML file. To recognize the face, the LBPH
from it. Each feature is a single integer obtained by dividing
algorithm compares the histogram of the trained image
the total number of pixels beneath the white rectangle by the
with the image from the video stream. When our face is
total number of pixels beneath the black rectangle.
recognized, the presence is automatically marked in
the CSV file. The entire
process basically starts with capturing a frame from the
input video stream. The Haar Cascade algorithm forms
a frame around the student's face and begins capturing
the student's image. Photos are converted to grayscale
before being saved to the dataset. The model is then
trained using these images and the LBPH algorithm is
used to generate a yml file. Then the tracking process
begins. The LBPH algorithm is used for face
recognition. After the face matches one of the faces in
the dataset, the presence is recorded, and if they do
not match, it is unknown.

Explanation of all the steps is as follows:

Fig. Haar cascade features(b)


1. Start Camera
The first step is to start the webcam and get the video stream All kernel sizes and positions will be utilized to calculate a
as the input for the system. After starting the video, the main high number of features 160000 different propertie were
task is to detect the human face in it so that the images of the offered by a 24x24. These qualities are critical in the context
face can be taken, stored, and then used for face recognition. of face detection. Some fundamental examples of these
characteristics are:
o Typically, the area surrounding the eyes is darker than
2. Face Detection
the area surrounding the cheeks.
For face detection, the Haar Cascade approach is used. This o The area surrounding the nose is brighter than the area
object detection technique can operate in real-time. surrounding the eyes.
Given these rectangular sections and their accompanying
difference of sums, it is feasible to construct features that
may be used to categorize different regions of a face. The
4

AdaBoost method is then applied on a full dataset of features


to choose which ones correlate to picture facial areas Fig. StudentDetails.csv

3. Create Dataset

The next step performed by the system is to store the images


into the dataset folder so that a histogram can be generated
based on all those images.

Fig. Haar cascade Fig. Created Dataset


We register a student into the system using Student Id and
name and then start face detection process to generate the In the dataset a total of 200 images will be saved because at
dataset. 200 images the system works perfectly as on 200,little time
is required , and we are getting the level of confidence that
is best . If images are increased, then the confidence rate
decreases and also the time taken increases a lot.As a result,
the 200 image is the best option for this system which is
plausible . We may calculate the confidence level of the
photos by multiplying Tp (total positive images) and Tn
(total negative images) by the total number of images.

Number of Time Taken (sec) Confidence


Images Level (%)
100 7.52 70%

200 9.10 75%

300 13.78 67%

Fig. Face detection


500 22.34 66%
After face detection is done a StudentDetails.csv file is
generated which contains the id and name of the student.
5

80 5. Face Recognition
70
The LBPH algorithm is used for face recognition.
60 The Local Binary Pattern (LBP) textured operator
50 identifies pixels in an image by thresholding the
neighborhood of each pixel and using the output as a
40
binary integer. The
30 face image can be described by a simple data vector
20 that uses LBP in combination with the histogram. This
is also known as the LBPH method.
10
0 LBPH has four parameters:
Test 1 Test 2 Test 3 Test 4
Radius: The radius is used to determine the radius
Number of images (*10) Time taken(in s) around the center pixel and create a circular LBP.
Confidence Normally set to 1.

4. Training Model Neighbor: Create CLBP. The higher the cost, the more
points you get. It is basically set to 8.
The next step of this process is to use the photographs we've
acquired to train our model. The model will be trained using (Raster X): Number of cells in the horizontal direction.
the LBPH approach. The histogram formed by training on The more cells in the grid and the finer the grid, the
those 200 photos is stored in the 'yml' file. higher the dimension of the resulting feature vector.
Normally set to 8.

(Grid Y): Number of cells placed vertically The more


cells in the raster and the finer the raster, the higher
the dimension of the final feature. Normally set to 8.

LBPH only considers local properties of required


elements. In face recognition, the LPBH algorithm
simply looks at face, eye, and mouth features. The first
and most important step of the
LBPH method is to develop an intermediate image that
better describes the original image by emphasizing the
essential facial features.

Fig. Extracting pixel values from input image


Then we must determine the center value of the matrix,
which will be used as the threshold value. This value will be
used to define the new values of the eight neighbors.

We construct a new binary value for each of the core value's


neighbors. A value of 1 was assigned to values that were
equal to or greater than the threshold value, and a value of 0
was assigned to values that were less than the threshold
value. A local binary operator is used in each zone. The LBP
operator is specified using a 3x3 window.

Fig. YML File

The center pixel'(xc,yc)' has an intensity of 'ic'. And 'ip'


stands for the surrounding pixel's intensity. A neighbor pixel
6

is set to 1 if its value is greater than or equal to the value of a large number of grids from a single image, each region's
the center pixel; otherwise, it is set to 0; otherwise, we histogram may now be retrieved.
compare a pixel to its 8 closest pixels using the median pixel Because we're working with a grayscale image, each
value as a threshold value. histogram will have approximately 256 places to record the
occurrences of each pixel intensity. To train an algorithm,
the following data is used. Each image from the training
dataset will be represented by its own histogram. As a result,
we'll repeat the processes to generate a histogram that
reflects an input image. For computation, the LBP
histograms from each sub-region are combined into a single
histogram with additional features such as:

Only binary values will now be present in the matrix


(ignoring central pixel value)
where:
The number of separate labels formed by the LBP operator
is represented by the variable n.
m is the number of sub-regions.
and I{} is defined as follows:

After that, the binary value will be translated to a decimal So, all we have to do to identify the picture that precisely
integer and assigned to the centre value of the matrix, which matches the input image is compare the histograms and
is a pixel from the original picture.. return the image with the most similar histogram.

At the completion of this operation, we will obtain a new


picture that better represents the original image's qualities
than the original image.

Fig. Histogram of an Image

We may use a variety of ways to compare the histograms,


such as utilizing the Euclidean distance, chi-square, absolute
value, and so on to calculate the distance between the two
histograms. We'll use the Euclidean distance in the following
example, which is determined using the formula:
Fig. Converting Input image to LPBH image

If we utilize the picture created in the previous step, we can


now use the two parameters Grid X and GridY. To generate
7

The programme merely outputs the id and name of the Fig. Attendance record
student with the closest histogram if the face is found. The
computed distance will also be returned by the algorithm, IV. LIMITATIONS
which may be used as a 'confidence' evaluation. Face recognition-based systems have a key flaw: their
Then, using a threshold and 'confidence,' we can see if the accuracy isn't 100 percent. There is always the possibility of
algorithm correctly recognised the image. We may deduce making a mistake. The system's data processing may take
that the algorithm has properly recognised if the confidence some time, which will become a problem throughout the
is higher than the provided threshold because we are lesson. The system would require a certain amount of
subtracting the result from 100 for better comprehension. If storage depending on the quality of the input data. If the data
the confidence level is too low, the image will be labeled as obtained is of extremely high quality and requires a huge
unknown and stored in the Unknown Images folder. quantity of storage space, this might be highly troublesome,
especially for events with a big estimated audience. If the
image quality isn't good enough, the cameras may be fooled
Person Confidence level (%) into thinking the person being scanned isn't the same as the
one in the photo.
Tejas 75%
V. FUTURE SCOPE
Atharv 77% The future scope of the project might involve taking a large
number of detailed photographs of kids and storing them in
Pritti 72% the cloud. The technology might be created and used in
ATM machines to detect fraud.
Vishal 71% Using facial recognition technology, the approach might
potentially be used to identify voters during elections.
The system can work in conditions such as low light and can
also detect and recognize the face. Here is the table in which VI. CONCLUSION
some features of the system are mentioned:
This system provides a very effective form of attendance
management in the classroom that may fully replace
Features Results previous manual techniques. This method is incredibly safe,
trustworthy, precise, and effective. It is not necessary to
Detection of single face Yes employ specialized hardware to set up the system in the
classroom. It is quite simple to make using a camera and a
Low light face Yes computer. Some of the algorithms that can recognise faces in
recognition the veil must be employed to improve the system's
Detection of Multiple Yes performance. The solution will also save time, minimize
faces administrative workload, and replace traditional stationery
Recognition in mask/veil No with electronic equipment, reducing the number of human
resources required for the task. As a result, a system with
Recognition in Bright Yes predetermined results will be developed, but there will be
Light room for development.

VII. ACKNOWLEDGMENT
6. Attendance Record
As soon as we stop the face recognition process, an We would like to express our gratitude to the college
attendance file will be automatically generated by the system teachers for providing us with the chance to work on a
which will contain the id, name, date, and time at which project about facial recognition. It was a fantastic experience
each and every student was detected. For students whose from which we gained a lot of knowledge. It allowed us to
faces were successfully matched with the current database, test our abilities and piqued our curiosity in the subject of
attendance is recorded in the csv file. facial recognition. Thanks especially to Deepali Joshi mam
for her patience and understanding. She is really
encouraging and supports subjects that we are interested in.
She was a great source of inspiration for us, and we owe her
a debt of gratitude. This group had a great atmosphere, and
we all tried our hardest.
8

VIII. REFERENCES [11] Rajat Kumar Chauhan, Vivekanand Pandey, Lokanath


[1] R. C. Damale and B. V. Pathak, "Face Recognition M, “Smart Attendance System Using CNN”, International
Based Attendance System Using Machine Learning Journal of Pure and Applied Mathematics,2018.
Algorithms," 2018 Second International Conference on
Intelligent Computing and Control Systems (ICICCS), 2018, [12] Mayank Yadav, Anmol Aggarwal, “Motion based
pp. 414-419, doi: 10.1109/ICCONS.2018.8662938. attendance system in real time environment for multimedia
application”, 2018.
[2] A. Arjun Raj, M. Shoheb, K. Arvind and K. S. Chethan,
"Face Recognition Based Smart Attendance System," 2020 [13] Wei Wu, Chuanchang Liu, Zhiyuan Su, “Novel Real-
International Conference on Intelligent Engineering and time Face Recognition from Video Streams”, International
Management (ICIEM), 2020, pp. 354-357, doi: Conference on Computer Systems, Electronics and Control,
10.1109/ICIEM48762.2020.9160184. 2017.

[3] S. Dev and T. Patnaik, "Student Attendance System [14] Changxing Ding, Dacheng Tao, “Trunk-Branch
using Face Recognition," 2020 International Conference on Ensemble Convolutional Neural Networks for Video-Based
Smart Electronics and Communication (ICOSEC), 2020, pp. Face Recognition”, IEEE transactions on pattern analysis
90-96, doi: 10.1109/ICOSEC49089.2020.9215441. and machine intelligence, 2018.

[4] S. S. Pawaskar and A. M. Chavan, "Face Recognition [15] Aziza Ahmedi, Dr Suvarna Nandyal, “An Automatic
based Class Management and Attendance System," 2020 Attendance System Using Image processing”, The
IEEE Bombay Section Signature Conference (IBSSC), 2020, International Journal of Engineering and Science, 2015.
pp. 180-185, doi: 10.1109/IBSSC51096.2020.9332212.
[16]Yohei Kawaguchi, Tetsuo Shoji, “Face Recognition-
[5] R. Hartanto and M. N. Adji, "Face Recognition for based Lecture Attendance System”, “3rd AER”, 2005.
Attendance System Detection," 2018 10th International
Conference on Information Technology and Electrical [17] B. Kavinmathi, S.Hemalatha, “Attendance System for
Engineering (ICITEE), 2018, pp. 376-381, doi: Face Recognition using GSM module”, 4th International
10.1109/ICITEED.2018.8534942. Conference on Signal Processing and Integrated Networks”,
2018.
[6] T. A. Kiran, N. D. K. Reddy, A. I. Ninan, P. Krishnan,
D. J. Aravindhar and A. Geetha, "PCA based Facial [18] Ketan N. Mahajan, Nagaraj V. Dharwadkar,”
Recognition for Attendance System," 2020 International Classroom attendance system using surveillance camera”,
Conference on Smart Electronics and Communication International Conference on Computer Systems, Electronics
(ICOSEC), 2020, pp. 248-252, doi: and Control”,2017.
10.1109/ICOSEC49089.2020.9215326.
[19] Shubhobrata Bhattacharya, Gowtham Sandeep Nainala,
[7] O. A. R. Salim, R. F. Olanrewaju and W. A. Balogun, Prosenjit Das, Aurobinda Routray “Smart Attendance
"Class Attendance Management System Using Face Monitoring System (SAMS): A Face Recognition based
Recognition," 2018 7th International Conference on Attendance System for Classroom Environment”, IEEE 18th
Computer and Communication Engineering (ICCCE), 2018, International Conference on Advanced Learning
pp. 93-98, doi: 10.1109/ICCCE.2018.8539274. Technologies, 2018.

[8] R. Mehta, S. Satam, M. Ansari and S. Samantaray, [20] E.Varadharajan, R.Dharani, S.Jeevitha,., “Automatic
"Real-Time Image Processing: Face Recognition based attendance management system using face detection”, 2017.
Automated Attendance System in-built with “Two-Tier
Authentication” Method," 2020 International Conference on
Data Science and Engineering (ICDSE), 2020, pp. 1-6, doi:
10.1109/ICDSE50459.2020.9310090.

[9] Jacob, I. Jeena. "Capsule network based biometric


recognition system." Journal of Artificial Intelligence
1,2019.

[10] Kirtiraj Kadam, Manasi Jadhav, Shivam Mulay, Tushar


Indalkar, “Attendance Monitoring System Using Image
Processing and Machine Learning”, International Journal of
Advance Engineering and Research Development, 2017.

You might also like