Black Book
Black Book
Black Book
Vaishali Parsewar
Yes No
Date: Date:
Date:
1
“FACE RECOGNITION ATTENDANCE SYSTEM”
A Project Report
Submitted in partial fulfilment of the
Requirements for the award of the Degree of
BY
Asmit Mandhotra
Seat No ( )
CERTIFICATE
Internal Guide
Coordinator
External Examiner
Date:
College Seal
3
ACKNOWLEDGEMENTS
I am also grateful to my classmates for their camaraderie and assistance during the
course of this project. Their insights and feedback have been instrumental in shaping
the development process.
Lastly, I would like to express my gratitude to all the individuals who directly or
indirectly contributed to the completion of this project. Their encouragement and
support have been instrumental in this journey of learning and discovery.
4
ABSTRACT
Face detection is a critical technology within computer vision that identifies human
faces in digital images and video streams. It serves as a foundational step for various
applications, including facial recognition, emotion detection, and biometric
identification. The objective of this system is to present an automated system for human
face recognition for an organization or institute to mark the attendance of their students
or employees. This paper introduces face detection method using the Voila and Jones
algorithm and recognition using correlation technique. The system will record the
attendance of the students in class room environment. The above system is fully
automated and easily deployable. User gets an authentication to upload the image
containing file and also to view the attendance.
5
DECLARATION
Asmit Mandhotra
(Signature of the Student)
6
INDEX
1.Premilinary Investigation
Project Overview
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.1.2 Advantages Over Current System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.1.3 Proposed System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3 Activity Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.4 Gantt Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2 Literature Review
2.1 Automated Attendance System Using Face Recognition Through Video
Surveillance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
2.1.1 Weaknesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.1.2 How to Overcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.2 Study of Implementing Automated Attendance System Using Face Recognition . ..
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.2.1 Weaknesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2.2 How to Overcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.3 Algorithm for Efficient Attendance Management: Face Recognition . . . . 21
2.3.1 Weaknesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3.2 How to Overcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3 Requirement Analysis
3.1 Platform Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.1.1 Supportive Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7
3.2 Software Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24
3.3 Hardware Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
4 Project Design
4.1 Design Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
4.2 Software Architectural Designs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
4.2.1 Component Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
4.2.2 Deployment Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
4.3 Database Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
4.3.1 E-R Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30
5 Implementation Details
5.1 Assumptions and Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
5.1.1 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1.2 Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2 Implementation Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.3 Competitive Advantages of Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33
5.4 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
5.5 Class Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
6 Coding
8
8. Conclusion and Future Scope
8.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
8.2 Future Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49
Reference
9
Chapter 1
Introduction
1.1 Introduction
In many Institution and Organization the attendance is a very important factor to maintain the
record of lectures, salary and work hours etc. Most of the institutes and organizations follow
the manual method using old paper and file method and some of them have shifted to
biometric technique. The current method that colleges use is that the professor passes a sheet
or make roll calls and mark the attendance of the students and this sheet further goes to the
admin department with updates the final excel sheet. This process is quite hectic and time
consuming. Also, for professors or employees at institutes or organizations the biometric
system serves one at a time. So, why not shift to an automated attendance system which works
on face recognition technique? Be it a class room or entry gates it will mark the attendance of
the students, professors, employees, etc. This system uses Viola and Jones algorithm for
detecting and recognizing the faces. The main elements of this technology are as follows:
a) Face Detection
b) Face Recognition
a) Face Detection:
Face detection is a computer technology being used in a variety of applications that identifies
human faces in digital images. Face detection also refers to the psychological process by
which humans locate and attend to faces in a visual scene. Face detection can be regarded as
a specific case of object-class detection. In object-class detection, the task is to find the
locations and sizes of all objects in an image that belong to a given class. Examples include
upper torsos, pedestrians, and cars. Face-detection algorithms focus on the detection of frontal
human faces. It is analogous to image detection in which the image of a person is matched bit
by bit. Image matches with the image stores in database.
Any facial feature changes in the database will invalidate the matching process. A reliable
face-detection approach based on the genetic algorithm and the eigen-face technique: Firstly,
the possible human eye regions are detected by testing all the valley regions in the gray-level
image. Then the genetic algorithm is used to generate all the possible face regions which
include the eyebrows, the iris, the nostril and the mouth corners. Each possible face candidates
is normalized to reduce lightning effect caused due to uneven illumination and the shirring
effect due to head movement. The fitness value of each candidate is measured based on its
projection on the eigen-faces. After a number of iterations, all the face candidates with a high
fitness value are selected for further verification. At this stage, the face symmetry is measured
and the existence of the different facial features is verified for each face 1 candidate.
b) Face Recognition:
10
A facial recognition system is a computer application capable of identifying or verifying a
person from a digital image or a video frame from a video source. One of the ways to do this
is by comparing selected facial features from the image and a facial database. It is typically
used in security systems
and can be compared to other biometrics such as fingerprint or eye iris recognition systems.
Some facial recognition algorithms identify facial features by extracting landmarks, or
features, from an image of the subject’s face. For example, an algorithm may analyze the
relative position, size, and/or shape of the eyes, nose, cheekbones, and jaw. These features are
then used to search for other images with matching features. Other algorithms normalize a
gallery of face images and then compress the face data, only saving the data in the image that
is useful for face recognition. A probe image is then compared with the face data. One of the
earliest successful systems is based on template matching techniques applied to a set of salient
facial features, providing a sort of compressed face representation. Recognition algorithms
can be divided into two main approaches, geometric, which looks at distinguishing features,
or photometric, which is a statistical approach that distills an image into values and compares
the values with templates to eliminate variances. Popular recognition algorithms include
Principal Component Analysis using eigenfaces, Linear Discriminate Analysis, Elastic Bunch
Graph Matching using the Fisher face algorithm, the Hidden Markov model, the Multilinear
9 Subspace Learning using tensor representation, and the neuronal motivated dynamic link
matching
1.1.1 Motivation
The main motivation for us to go for this project was the slow and inefficient traditional
manual attendance system. This made us to think why not make it automated fast and mush
efficient. Also, such face detection techniques are in use by department like crime
investigation where they use cctv footages and detect the faces from the crime scene and
compare those with criminal database to recognize them. Also Facebook, it uses an algorithm
called deep face whose accuracy to recognize is 97.25% which is as close as what humans
have that is 97.53%.
12
Yashwantrao Chavan College Of Art-Commerce & Science
PLOT NO.23, SECTOR-15, KOPARKHAIRNE, NAVI MUMBAI-400709
ACTIVITY CHART
Student Name :-
Project Name :- Face recognition based attendance system
System
3. Design 18-07-2024 21-07-2024 6
Project/Black
Book 10-08-2024 15-08-2024 4
6. Submission
13
1.4 GANTT CHART
preliminary Investigation
System Design
System Coding
Project/Black Book
Submission
14
Chapter 2
LITERATURE REVIEW
Arun Katara et al. (2017) mentioned disadvantages of RFID (Radio Frequency Identification)
card system, fingerprint system and iris recognition system. RFID card system is implemented
due to its simplicity. However, the user tends to help their friends to check in as long as they
have their friend’s ID card. The fingerprint system is indeed effective but not efficient because
it takes time for the verification process so the user has to line up and perform the verification
one by one. However, for face recognition, the human face is always exposed and contain less
information compared to iris. Iris recognition system which contains more detail might invade
the privacy of the user. Voice recognition is available, but it is less accurate compared to other
methods. Hence, face recognition system is suggested to be implemented in the student
attendance system.
Difference between face detection and face recognition are often misunderstood. Face
detection is to determine only the face segment or face region from image, whereas face
recognition is to identify the owner of the facial image. S.Aanjanadevi et al. (2017) and Wei-
Lun Chao (2007) presented a few factors which cause face detection and face recognition to
encounter difficulties. These factors consist of background, illumination, pose, expression,
occlusion, rotation, scaling and translation. The definition of each factor is tabulated in Table
2.1
15
Table 2.1 Factors Causing Face Detection Difficulties
Background Variation of background and environment
around people in the image which affect the
efficiency of face recognition.
2.2.0.1 Abstract
The objective of this system is to present an automated system for human face recognition in
a real time background for an organization to mark the attendance of their employees or
student. So automated attendance using real time face recognition is a real-world solution
which comes with day-to-day activities of handling employees or student. The task is very
difficult as the real time background subtraction in an image is still a challenge. In the past
two decades, face detection and recognition has proven to be very interesting research field
of image processing. The work carried out describes an automated attendance system using
video surveillance. The proposed algorithm is automatic and efficient in intelligent
surveillance applications. Video surveillance is used to detect the object movement thereby
16
the captured image undergoes face detection and recognition process and searches the student
database and enters the attendance if it is valid in the list [1].
This paper uses Viola and Jones algorithm for face detection and correlations formulas for
face recognition. Viola and Jones algorithm is used for face detection. Where it is used in both
creating database and face recognition process. Where in case creating database, it takes input
image through a web camera continuously. Captured image undergoes face detection.
Detected face will be cropped and stored in database. Where in case of face recognition if
there is any movement video surveillance will be used to detect the moving object. The
captured image undergoes face detection and further processed later by face recognition. 8
Cross-Correlation and Normalized-Correlation are used to extract the Coordinates of peak
with the RIO and target images. The peak of the cross-correlation matrix occurs where the
sub images are best correlated. Find the total offset between the images. The total offset or
translation between images depends on the location of the peak in the cross-correlation matrix,
and on the size and position of the sub images. Check if the face is extracted from the target
Image. Figure out where face exactly matches inside of target image.
17
2.1.1 Weaknesses
• In Viola and Jones, the result depends on the data and weak classifiers. The quality of the
final detection depends highly on the consistence of the training set. Both the size of the sets
and the interclass variability are important factors to take in account.
• The System overview does not provide the clear idea about components of the overall
process.
• The analysis shows very bad results when in case of multiple persons with different
sequence.
18
2.3 Study of Implementing Automated Attendance System Using Face Recognition
2.3.0.1 Abstract
This paper is uses PCA (Principal Component Analysis) technique for face recognition and
image compression. The implementation of this project is done using OpenCV libraries for
face detection and further processes. PCA method has been widely used in applications such
as face recognition and image compression. PCA is a common technique for finding patterns
in data, and expressing the data as eigenvector to highlight the similarities and differences
between different data. Then the system implementation is divided in three major part Face
Detection and Extract, Learn and Train Face Images, Recognize and Identification.
Implementation is done using OpenCV libraries which is open source and cross platform.
19
2.2.1 Weaknesses
This paper uses PCA which have two major disadvantages.
• The covariance matrix is difficult to be evaluated in an accurate manner
• Even the simplest invariance could not be captured by the PCA unless the training data
explicitly provides this information This paper is not giving the clear idea about face detection
and recognition algorithm. Author explains the code of OpenCV instead of explaining the
techniques and methods.
20
2.4 Algorithm for Efficient Attendance Management: Face Recognition
2.4.0.1 Abstract
Students’ attendance in the classroom is very important task and if taken manually wastes a
lot of time. There are many automatic methods available for this purpose i.e. biometric
attendance. All these methods also waste time because students have to make a queue to touch
their thumb on the scanning device. This work describes the efficient algorithm that
automatically marks the attendance without human intervention. This attendance is recorded
by using a camera attached in front of classroom that is continuously capturing images of
students, detect the faces in images and compare the detected faces with the database and
mark the attendance. The paper reviews the related work in the field of attendance system
then describes the system architecture, software algorithm and results [3]
This paper uses Viola and Jones algorithm for face detection and correlations formulas for
face recognition. Viola and Jones algorithm is used for face detection. Where it is used in both
creating database and face recognition process. Where in case creating database, it takes input
image through a web camera continuously. Captured image undergoes face detection.
Detected face will be cropped and stored in database. Where in case of face recognition if
there is any movement video surveillance will be used to detect the moving object. The
captured image undergoes face detection and further processed later by face recognition.
21
2.3.1 Weaknesses
• It uses hardware like camera and button which is makes it costly as these are to be
installed in every classroom.
• Histograms fails if there are grey values that are physically apart from each other.
22
Chapter 3
Requirement Analysis
To be used efficiently, all computer software needs certain hardware components or other
software resources to be present on a computer. These prerequisites are known as (computer)
system requirements and are often used as a guideline as opposed to an absolute rule. Most
software defines two sets of system requirements: minimum and recommended.
3.1 Platform Requirement
Software requirements deal with defining software resource requirements and prerequisites
that need to be installed on a computer to provide optimal functioning of an application. These
requirements or prerequisites are generally not included in the software installation package
and need to be installed separately before the software is installed.
Web Browser
• Google Chrome
• Mozilla Firefox
• Internet Explorer/Edge
• Opera
23
3.2 Software Requirement
24
3.3 Hardware Requirement
The most common set of requirements defined by any operating system or software
application is the physical computer resources, also known as hardware, A hardware
requirements list is often accompanied by a hardware compatibility list (HCL), especially in
case of operating systems. An HCL lists tested, compatible, and sometimes incompatible
hardware devices for a particular operating system or application.
25
Chapter 4
Project Design
Design is the first step in the development phase for any techniques and principles for the
purpose of defining a device, a process or system in sufficient detail to permit its physical
realization. Once the software requirements have been analyzed and specified the software
design involves three technical activities design, coding, implementation and testing that are
required to build and verify the software. The design activities are of main importance in this
phase, because in this activity, decisions ultimately affecting the success of the software
implementation and its ease of maintenance are made. These decisions have the final bearing
upon reliability and maintainability of the system. Design is the only way to accurately
translate the customer requirements into finished software or a system. Design is the place
where quality is fostered in development. Software design is a process through which
requirements are translated into a representation of software. Software design is conducted in
two steps. Preliminary design is concerned with the transformation of requirements into data.
Our system follows the three-tier architecture. First tier consists of GUI, Recognition tier and
the Database.
1. GUI: The GUI (Graphical User Interface) in our project deals with the interface for the
user where the user enters the name of the product, he/she wants to search. The GUI
provides a platform for the user to communicate with the database.
2. At initial level the system is trained by providing 5-10 images of an individual. The
images are given in grey scale for mind further its histogram is made to enhance the
recognition accuracy.
Detection:
Whenever any image is uploaded all the face in it are cropped and stored for further
comparison.
26
Face Recognition:
Here the detected cropped face sare compared with the trained images from the data base
using correlation. If any of the cropped image is recognized then that id would be marked
present in the attendance data sheet.
3. Database:
We have a centralized database with all the details of student and staff. the database is
constructed using MySQL. Every cropped or detected image compares itself with the
trained images in this database i.e retrieval is done and also the attendance sheet is
generated using this database i.e. updating is done.
27
28
29
30
Chapter 5
Implementation Details
5.1.1 Assumptions
5.1.2 Dependencies
• Ee have used packages of nodejs like npm which is the strongest package manager
available. The start or run time environment is provided by nodejs. It also shows the actual
background working like confidence level, recognition accuracy, etc.
31
This work is being carried out in five stages:
Step 1: Generating Data for Training Initially the system is trained that is the cropped
images are saved to the database and they undergo detection and recognition. Further
this data will be used to compare the detected images in all the uploaded files and mark
the attendance.
32
Step 2: Capturing In this the capturing of the video or image will be done using a device
and the captured file is uploaded to the server using web app.
Step 3: Face Detection The file uploaded to the server undergoes face detection using
Viola and Jones algorithm. The frames received are checked for the faces and those are
cropped for further recognition.
Step 4: Face Recognition The detected images undergo correlation with the trained
images of the databases. By this the detected images are now recognized.
Step5: Attendance Marking After the recognition process the students recognized are
searched in the database and their attendance is marked.
33
• Integrated Biometric facial systems are also easy to program into any organization
computer system. Usually, they will work with existing software that they have in
place.
• Facial biometrics technology to day has a high success rate, especially with the
emergence of 3D face recognition technologies. It is extremely difficult to fool the
system.
34
35
Chapter 6
Coding
1. Setup
Pip install OpenCV
pip install face recognition
pip install numpy
pip install tkinter
2. Face Detection
import cv2
import face recognition
import numpy as np
import os
from datetime import datetime
import mysql.connector
from mysql.connector import Error
36
def create_db_connection():
try:
connection = mysql.connector.connect(
host=DB_HOST,
database=DB_NAME,
user=DB_USER,
password=DB_PASS
)
if connection.is_connected():
return connection
except Error as e:
print(f"Error while connecting to MySQL: {e}")
return None
37
# Load known faces
known_face_encodings = []
known_face_names = []
# Initialize webcam
video_capture = cv2.VideoCapture(0)
38
cursor.execute("SELECT * FROM attendance WHERE name=%s AND
date=%s", (name, date_string))
result = cursor.fetchone()
if result is None:
# Insert new attendance record
cursor.execute("INSERT INTO attendance (name, date, time) VALUES (%s,
%s, %s)",
(name, date_string, time_string))
connection.commit()
print(f"Attendance marked for {name}")
return "Marked"
else:
print(f"Attendance already marked for {name} today")
return "Already Marked"
except Error as e:
print(f"Error marking attendance: {e}")
return "Error"
# Main execution
connection = create_db_connection()
if connection:
create_table(connection)
while True:
# Capture frame-by-frame
ret, frame = video_capture.read()
# Find all face locations and face encodings in the current frame
39
face_locations = face_recognition.face_locations(frame)
face_encodings = face_recognition.face_encodings(frame, face_locations)
# Use the known face with the smallest distance to the new face
face_distances = face_recognition.face_distance(known_face_encodings,
face_encoding)
best_match_index = np.argmin(face_distances)
if matches[best_match_index]:
name = known_face_names[best_match_index]
attendance_status = mark_attendance(name, connection)
40
# Display the resulting frame
cv2.imshow('Video', frame)
3. Attendance_Portral
import tkinter as tk
from tkinter import ttk
import mysql.connector
from mysql.connector import Error
class AttendanceViewer(tk.Tk):
41
def __init__(self):
super().__init__()
self.title("Attendance Viewer")
self.geometry("800x600")
def refresh_data(self):
# Clear existing data
for i in self.tree.get_children():
42
self.tree.delete(i)
except Error as e:
print(f"Error fetching data: {e}")
finally:
if connection.is_connected():
cursor.close()
connection.close()
def create_db_connection(self):
try:
connection = mysql.connector.connect(
host=DB_HOST,
database=DB_NAME,
user=DB_USER,
password=DB_PASS
)
43
if connection.is_connected():
return connection
except Error as e:
print(f"Error while connecting to MySQL: {e}")
return None
if __name__ == "__main__":
app = AttendanceViewer()
app.mainloop()
44
OUTPUT
((SCREENSHOTS)
45
46
47
Chapter 7
48
Chapter 8
8.1 Conclusion
In order to maintain the attendance this system has been proposed. It replaces the
manual system with an automated system which is fast, efficient, cost and time saving
as replaces the stationary material and the paper work. Hence this system is expected
to give desired results and in future could be implemented for logout. Also, the
efficiency could be improved by integrating other techniques with it in near future.
49
References
[1] Rekha A, Dr. Chethan H, Automated Attendance System Using Face Recognition
Through Video Surveillance, International Journal for Technological Research in
Engineering, Volume 1, Issue 11, July-2014.
[2] Nirmalya Kar, Mrinal Kanti Debbarma, Ashim Saha, and Dwijen Rudra Pal, Study
of Implementing Automated Attendance System Using Face Recognition Technique,
International Journal of Computer and Communication Engineering, Vol. 1, No. 2, July
2012.
[3] Naveed Khan Baloch, M. Haroon Yousaf, Waqar Ahmad and M. Iram Baig,
Algorithm for Efficient Attendance Management: Face Recognition Based Approach,
International Journal of Computer Science Issues, Vol. 9, Issue 4, No 1, July 2012.
50
51