Face Recognization and Detection System For Attendance.
Face Recognization and Detection System For Attendance.
Session 2018-2019
I have not submitted the matter presented in this Seminar report anywhere for the award
of any other Degree.
Deepanshu Samdani
Roll No.: 15ESKIT029
B.Tech. (Information Technology)
Swami Keshvanand Institute of Engineering & Technology, Jaipur
Counter Signed by
Neha Mathur
Asst. Prof., Department of CS
Department of Computer Science & Engineering
Swami Keshvanand Institute of Technology, Management and Gramothan, Jaipur
i
ACKNOWLEGEMENT
I feel immense pleasure in expressing my regards to the Chairman Mr. Surja Ram Meel,
Director Mr. Jaipal Meel, Registrar Mrs. Rachana Meel, Director (Academics) Prof.
(Dr.) S. L. Surana, Principal & Director (D&W) Prof. (Dr.) S. K. Calla Swami
Keshvanand Institute of Technology, Management & Gramothan, Jaipur for providing me
necessary facilities during the various stages of this work.
I would like to thank Faculties, Department of CSE & IT, Swami Keshvanand Institute of
Technology, Management & Gramothon, and Jaipur for their valuable guidance, keen
interest, constant encouragement, incessant inspiration and continuous help throughout
this work. Especially I acknowledge their support when I was stuck and they were
suggesting me new ideas to solve the problems. Their vast experience and realistic
approach have been of great help to me. Their excellent guidance has been instrumental in
making this work a success
I would also like to express my thanks to my parents for their support and blessings. In
addition, a very special thanks to all my colleagues and friends for their support in the
completion of this work.
Deepanshu Samdani
ii
ABSTRACT
Face Detection and Recognition System is a system which would primarily aim on
performing a successful log in access operation of the concerned user on the basis of
identification and recognition of their unique face provided that the user is an authorized
personal (old user) within the confines of the system. This Face Recognition System is
now a days is also use in education intuitions for marking the presence of the student in
the curriculum. If the arriving user is completely new in the system then this Face
Detection and Recognition System, through a non-complex and a friendly user interface,
will ask for and store the required the credentials of the user in order to convert them
into an authorized user for all the future purposes i.e. future log in access operations.
Further applications of this system could include a face recognition based attendance
system. The system will be implemented in Python and Flask Frame work using Kairos
API.
iii
TABLE OF CONTENTS
CERTIFICATE…………………………………………………………………………….I
ACKNOWLEDGMENT…………………………………………………………...……..II
ABSTRACT……………………………………………………………………………...III
TABLE OF CONTENT………………………………………………………………….IV
LIST OF FIGURES……………………………………………………………………...VI
LIST OF TABLES……………………………………………………………………...VII
LIST OF ABBREVIATIONS……………………………………………………...…VIIII
1. INTRODUCTION……………………………………………………………………………………………………………1
2. LITERATURE SURVEY…………………………………………………………………………………………………..3
3. METHODOLOGY………………………………………………………………………………………………………..5-11
3.1 Kairos API functioning……………………………………………………………..5
3.2 Finding faces in image…...…………………………………………………………5
3.3 Finding faces by color…………………………….………………………………..6
3.4 Finding faces by motion………………………...………………………………….6
3.5 OpenCV Module for capturing images…………………………………………….7
3.6 Python Flask framework…………………………..………………………………………………………….9
4. SYSTEM REQUIREMENT SPECIFICATION……………………………….12-17
4.1 Overall description……………………………………....………………..…….12
iv
Activity Diagram…………………………………...…..……………………………18
Sequence Diagram…….…………..…………………………………...…………….19
Class Diagram…………………………………………………………..…………...20
Object Diagram...........................................................................................................21
6. SCREENSHOTS………………………………………………………………...22-27
7. PROJECT SUMMARY RESULT AND CONCLUSIONS………………………...28
8. FUTURE SCOPE…………………………………………………………………...29
9. REFERENCES……………………………………………………………………...30
v
LIST OF FIGURES
S.No DESCRIPTION PAGE No.
vi
LIST OF TABLES
S.No DESCRIPTION PAGE No.
5. Software Interfaces(Minimum) 15
6. Software Interfaces(Recommended) 15
vii
ABBREVIATIONS USED
1 FDR Face Recognition and Detection
4 IP Image processing
6 OS Operating System
viii
Chapter 01
1. INTRODUCTION
Face recognition systems are part of facial image processing applications and their
significance as a research area is increasing recently. They use biometric information of
humans and are applicable easily instead of fingerprint, iris, signature etc., because these
types of biometrics are not much suitable for non-collaborative people. Face recognition
systems are usually applied and preferred for people and security cameras in metropolitan
life. These systems can be used for crime prevention, video surveillance, person
verification, and similar security activities. Face recognition system is a complex image-
processing problem in real world applications with complex effects of illumination,
occlusion, and imaging condition on the live images. It is a combination of face detection
and recognition techniques in image analyzes.
Detection application is used to find position of the faces in a given image. Recognition
algorithm is used to classify given images with known structured properties, which are
used commonly in most of the computer vision applications. Recognition applications use
standard images, and detection algorithms detect the faces and extract face images which
include eyes, eyebrows, nose, and mouth. That makes the algorithm more complicated
than single detection or recognition algorithm. The first step for face recognition system is
to acquire an image from a camera. Second step is face detection from the acquired
image. As a third step, face recognition that takes the face images from output of
detection part. Final step is person identity as a result of recognition part. Acquiring
images to computer from camera and computational medium (environment) via frame
grabber is the first step in face recognition system applications. The input image, in the
form of digital data, is sent to Kairos API to extracting subject ID across each face in the
image. Briefly, knowledge-based methods are derived from human knowledge for
features that makes a face. After faces are detected, the faces should be recognized to
identify the persons in the face images. In the literature, most of the methods used images
from an available face library, which is made of standard images. After faces are detected,
standard images should be created with some methods. When user next time appears for
mark the attendance that particular image is identified by using the Subject Id which is
1
provided by Kairos at the time of registration.
1.1 Overview:
Face detection and recognition module detects faces from the image captured by the
camera, and the image of the face is cropped and stored. The module recognizes the images
of student’s face, which have been registered manually with their names and ID codes in
the database. Face detection data and face recognition data are recorded into the database
2
Chapter 02
2 LITERATURE SURVEY
The motivation for this research is taken from recent studies which have demonstrated
increased retrieval effectiveness of face detection systems. The methodology is derived
from previous studies which model the impact that ambiguity and its subsequent resolution
have on IR.
Human beings perform face recognition automatically every day and practically with no
effort. Although it sounds like a very simple task for us, it has proven to be a complex task
for a computer, as it has many variables that can impair the accuracy of the methods, for
example: illumination variation, low resolution, and occlusion, amongst other.
In computer science, face recognition is basically the task of recognizing a person based on
its facial image. It has become very popular in the last two decades, mainly because of the
new methods developed and the high quality of the current videos/cameras. Note that face
recognition is different of face detection:
Face Detection: it has the objective of finding the faces (location and size) in an image and
probably extract them to be used by the face recognition algorithm. Face Recognition: with
the facial images already extracted, cropped, resized and usually converted to gray scale,
the face recognition algorithm is responsible for finding characteristics which best describe
the image.
Identification or facial recognition: it basically compares the input facial image with all
facial images stores in the gallery of the Kairos and identifies the particular image of
user with the subject Id which is provided by the Kairos at the time of the registration.
3
OpenCV was started at Intel in 1999 by Gary Bradsky and the first release came out in
2000. Vadim Pisarevsky joined Gary Bradsky to manage Intel’s Russian software
OpenCV team. In 2005, OpenCV was used on Stanley, the vehicle who won 2005
DARPA Grand Challenge. Later its active development continued under the support of
Willow Garage, with Gary Bradsky and Vadim Pisarevsky leading the project. Right
now, OpenCV supports a lot of algorithms related to Computer Vision and Machine
Learning and it is expanding day-by-day.
Currently OpenCV supports a wide variety of programming languages like C++, Python,
and Java etc. and is available on different platforms including Windows, Linux, OS X,
Android, iOS etc. Also, interfaces based on CUDA and OpenCV are also under active
development for high-speed GPU operations.
Python is a general purpose programming language started by Guido van Rossum, which
became very popular in short time mainly because of its simplicity and code readability. It
enables the programmer to express his ideas in fewer lines of code without reducing any
readability.
4
Chapter 03
3 METHODOLOGY
Face detection is a computing technology term that is used when software is used to
determine the existence, location and size of a human face in a particular photo. The
software is clever enough to detect the facial features, while at the same time ignoring
other objects like trees, buildings and bodies.
A person’s face is actually a rich source of information. It is possible to tell, simply from
a human face, whether a person is male or female, approximately how old they are, and
from their expression, how they are feeling.
Human beings can process faces very quickly. It only takes you a split second to
determine the key attributes of anyone you look at. In the case of computers, however, it
is a somewhat more complex process.
In simple terms, a computer attempting face detection will begin by examining either a
still photo or a video image. It then has the task of determining if there are any faces
present in that picture, distinguishing these faces from whatever else is in the background.
It has to do this regardless of illumination, orientation or camera distance.
There are a number of methods which a computer can use to achieve this.
There is a relatively straight-forward method that can be used when you simply have a
frontal face image against a plain background. In this case the software can easily remove
the background, leaving face boundaries. If software uses this approach it tends to have a
number of different classifiers for detecting different types of front-on faces, along with
some for profile faces. It will attempt to detect eyes, a nose, a mouth, and in some cases
even a whole body for pictures that show more than just a face.
5
3.3 Finding Faces by Color
This is a relatively simplistic method that a computer can use to look for faces. It
obviously requires that the photos or video images used be color. The software scans the
picture looking for areas that are of a typical skin color, then looking for face segments. A
problem with this technique is that skin color varies from race to race, and this method
does not work as well for all skin color. Varying lighting conditions changes the exact
hue of a person’s skin in the picture, and that can have a major effect on facial detection,
too.
When you are using video images you can use movement as a guide. Faces are usually
moving in real-time videos, so one option is for the software to capture the moving area.
Of course, other parts of videos also move, so the software needs to look for particular
reference points to indicate that it is actually a face that is moving.
One specific face movement is blinking. If the software can determine a regular blinking
pattern (two eyes blinking together, symmetrically positioned) then this is a good
indication that there is a face. From this regular blinking pattern the computer can
determine the area of the video image that is actually the face, using one of a number of
face models.
There will be a number of face models in the software, containing the appearance, shape
and motion of faces. There are actually a variety of different face shapes, roughly
categorised as oval, rectangle, round, square, heart and triangle.
As well as blinking, there are various other motions that signpost to the computer that the
image may contain a face. These include raised eyebrows, flared nostrils, wrinkled
foreheads and opened mouths.
Once one of these actions is detected, the computer will pass their face models over the
video image and try and determine a facial match.
Once a face is detected, and a particular face model matched with a particular movement,
the model is laid over the face, enabling face tracking to pick up further face movements.
6
3.5 OpenCV Module for capturing the image:
Image processing studies image to image transformation. The input and output of image
processing are both images.
a. Core Functionality
This module covers the basic data structures such as Scalar, Point, Range, etc.,
that are used to build OpenCV applications. In addition to these, it also includes
7
the multidimensional array Mat, which is used to store the images. In the Java
library of OpenCV, this module is included as a package with the name
org.opencv.core.
b. Image Processing
This module covers various image processing operations such as image filtering,
geometrical image transformations, color space conversion, histograms, etc. In the
Java library of OpenCV, this module is included as a package with the name
org.opencv.imgproc.
c. Video
This module covers the video analysis concepts such as motion estimation,
background subtraction, and object tracking. In the Java library of OpenCV, this
module is included as a package with the name org.opencv.videoio.
d. Video I/O
This module explains the video capturing and video codecs using OpenCV library.
In the Java library of OpenCV, this module is included as a package with the
name org.opencv.videoio.
e. calib3d
This module includes algorithms regarding basic multiple-view geometry
algorithms, single and stereo camera calibration, object pose estimation, stereo
correspondence and elements of 3D reconstruction. In the Java library of
OpenCV, this module is included as a package with the name org.opencv.calib3d.
f. features2d
This module includes the concepts of feature detection and description. In the Java
library of OpenCV, this module is included as a package with the name
org.opencv.features2d.
g. Object Detect
This module includes the detection of objects and instances of the predefined
classes such as faces, eyes, mugs, people, cars, etc. In the Java library of OpenCV,
this module is included as a package with the name org.opencv.objdetect.
8
h. Highgui
This is an easy-to-use interface with simple UI capabilities. In the Java library of
OpenCV, the features of this module is included in two different packages
namely, org.opencv.imgcodecs and org.opencv.videoio.
9
Test the Flask Installation:
app = Flask(__name__)
@app.route('/')
def hello_world():
if __name__ == '__main__':
app.run(debug=True)
Figure: 3.1
Description:
host: Hostname to listen on. Defaults to 127.0.0.1 (local host). Set to ‘0.0.0.0’ to
have server available externally.
10
Figure 3.2: Working of Face Recognition System
We propose a method that take the attendance using face recognition based on continuous
observation. Our purpose is to obtain the attendance, positions and images of students’
face, which are useful information in the classroom lecture.
11
Chapter 04
b. Proceeding with SignIn option will lead you to another prompt window which
would be the camera feed recognizing the user’s face.
c. Proceeding with SignUp option will lead you to another prompt window to look
straight into the camera.
d. After the user’s face is successfully captured, system is store the image on the
local system and as well as sent to Kairos gallery.
Screen resolution of at least 500 x 300 pixels is required for proper and complete
viewing of screens. Higher resolutions in wide-screen mode will be better for a better
view.
12
Chapter 04
Python programming language with OpenCV module is required for its working
The following table required Minimum Hardware Interfaces at Client Side as well as for
the Server Side:
HARDWARE SPECIFICATIONS
Keyboard (QWERTY)
13
The following table required recommended Hardware Interfaces at Client Side as well as
for the Server side.
Keyboard (QWERTY)
14
4.6 Software Interfaces:
Any Microsoft Windows 7 and higher (Windows 7 / 8 / 8.1 / 10) or equivalent Linux
based operating system with minimum kernel support 3.X.
Working Webcam.
15
4.7 System Product Features:
Efficiency:
As the application is built on Python using OpenCV and Haar-cascade files, the
system is relatively efficient. The images are converted and stored in a
compressed manner, reducing the cost of size.
Reliability:
The application is reliable in terms of privacy (no other member/employee can
access other member/employee profile), services, accessibility.
Economic:
While considering economic feasibility, it is checked in points like performance,
information and outputs from the system. The cost incurred to develop the system
is freeware & does not incur the cost to the project. Backend database technology
is a freeware. This justifies economic feasibility of the system.
16
Chapter 05
System design presents the schematic view of the complete system along with its major
components and their connectivity.
17
Activity Diagram
18
Sequence Diagram
19
Class Diagram
20
Object Diagram
21
Chapter 06
6 SCREENSHOTS OF PROJECT
22
Image 6.2: Registration page
23
Image 6.3: Take Picture for enrolling
24
Image 6.4: Mark attendance
25
Image 6.5: Database record
26
Image 6.6: Bar-graph of number of student present
27
Chapter 07
Using Kairos API as a cloud for storage the image. Which give the subject Id for
particular image and provide a register name with particular image successfully.
The object of this project is to harness the power of Artificial Intelligence for our practical
and potential use. This report explains to extensively cover this concept and plant a seed
of inquisitiveness in the mind of users.
This system can allow users to quickly and hesitantly gain authorized access in a
particular system without any requirement of heavy and time consuming credentials
which not only makes a system slow but also inefficient.
Our project is currently on track with the exception of a couple of problems that were
encountered. The first is that we have not yet figured out how to increase accuracy of face
recognition. Implementation of this function will require further research of image
processing and face recognition modules.
The second problem is determining the reason why we can only apply frontal face
detection. To troubleshoot this problem we must look over the code more thoroughly. We
are still confident that we will be able to find solutions to these problems, so we expect
not to have to compromise on our initial project goal.
28
Chapter 08
8 FUTURE SCOPE
The possible future scope of this application will be on mobile platform with following
enhancements:
29
Chapter 09
9 REFERENCES
1. https://www.tutorialspoint.com/python/python_modules.htm
2. https://www.tutorialspoint.com/python/python_environment.htm
3. https://pythonprogramming.net/loading-images-python-opencv-tutorial/
4. https://www.kairos.com/docs/getting-started-with-kairos-face-recognition
5. https://www.kairos.com/docs/api/humanface/application/appkey
6. http://flask.pocoo.org/
7. https://www.tutorialspoint.com/flask/flask_redirect_and_errors.htm
8. http://flask.pocoo.org/docs/1.0/design/
9. https://www.w3schools.com/html/html_attributes.asp
10. https://www.w3schools.com/html/html_images.asp
11. https://www.tutorialspoint.com/javascript/javascript_functions.htm
12. https://www.w3schools.com/html/html_tables.asp
13. https://www.w3schools.com/css/css_background.asp
30