Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

Security System for Person Identification Using Face

Recognition for ISP

Submitted By SAAD NAZEER

Registration. No BSIT-021R16-01

Session 2016-2020

Supervised By Zohair Haider Naqvi

Department of Computer Science


Author’s Declaration

All thanks are to almighty ALLAH the most beneficial, merciful and gracious who gave me the
courage to complete the task assigned to me. Thanks ALLAH! I couldn’t have this
achievement if His kindness didn’t support me. Many people whom I want to pay my thanks at
the event, all my honorable teachers, my parent and all the friends. I say my special thanks to
my respected Rector Mr. Saqib Nazeer and my respected H.O.D Mr. Malik Bashir and my
respected supervisor Mr. Zohair Haider Naqvi. Finally, I would like to express my gratitude to
my loving family, especially to my parents for providing me full support during the project and
for all sort of moral and social support in life. Their prayers have enabled me to reach at this
stage.

SAAD NAZEER

BSIT-021R16-01
Final Year Project Undertaking Form

(Institute of Southern Punjab)

It is declared that I have developed a software (Security System for Person Identification
Using Face Recognition for ISP) containing modules that I managed and written this report
under the guidance of my project supervisor on the basis of my personal effort. The report
and the system that we submitted for the completion of Final Year Project are investigation
and effort of my own.

Signature of Student

_________________

Name: -----------------

Date: Month Date, Year


Student Name Saad Nazeer
Registration # BSIT-021R16-01
Contact # 0304-7899950
E-main Address Saadnazir90@yahoo.com
Program BSIT
Session 2016-2020
Domain Artificial Intelligence
Language Python
Project Title Security System for Person Identification
Using Face Recognition for ISP

Signature of Supervisor:

___________________
Name: Ma’am/Sir Date:
COPYRIGHTS©

All copyrights of software application and report strictly reserved By ISP Multan.

Publisher

Institute of Southern Punjab Multan.

Developing and Composing

Saad Nazeer,
BSIT-021R16-01,
ISP MULTAN
Proofreading
Sir Zohair
DEDICATION

This Project (Security System for Person Identification Using Face Recognition for ISP) I’m
dedicating to My Loving Parents, Friends and Respected Teachers, who prayed for my
success and all my supporting ones whom I love and respect from the core of my heart.

(March 2020)
Acknowledgment

I am highly indebted to Institute of Southern Punjab for their guidance and I will especially
thankful to my supervisor Sir Zohair Naqvi whose expertise was priceless in providing
necessary information regarding the project & also for their support in completing the project
without his support it was not easy for me. I will especially appreciate and thankful to my
HOD Sir Mubashir Malik whose motivation excited me to complete all the tasks. Further I will
thankful to my parents for their wise counsel, they are always there for me. This is result of
their prayers that I am stand here.

________________________
Saad Nazeer (BSIT-021R16-01)
Abstract

The face is one of the easiest ways to distinguish the individual identity of each other. Face
recognition is a personal identification system that uses personal characteristics of a person to
identify the person's identity. The product is needed to recognize the individuals with the
objectives of face detection and recognition and give details of that individual. I applied the
face recognition by utilizing the resources which is image processing and python libraries. In
outcome we can pick out the individuals which are known or unknown to organization. The
product I implemented is reliable and effective. The product can authenticate the processed
images fast by comparing to other systems. It will train the product with capturing the images
on real time, will process the images and give outcome by identify the image.

Security System Using Face Recognition


Certificate
It is certifying that Saad Nazeer BSIT-021R16-01 Session has worked on and completed his
software project “Security System for Person Identification Using Face Recognition for ISP”
at department of Information Technology. Institute of southern Punjab Multan (ISP) in partial
fulfilment of the requirement for the degree of BSIT in computer science under my guidance
and supervision. In our opinion, it is satisfactory and up to the mark and therefore fulfil the
requirement of BSIT (Information Technology) degree.

Internal Examiner
Department of Computer Science

--------------------
(Signature)
External Examiner

--------------------
(Signature)
Project Coordinator
Institute of Southern Punjab

--------------------
(Signature)
HOD
Institute of Southern Punjab

--------------------

Security System Using Face Recognition


Project Brief

Project Title Security System for Person Identification Using Face


Recognition for ISP.
Objective The purpose of this project is to defining the security system
that is known as biometric verification based on face
recognition.
Submitted by Saad Nazeer

Submitted to Mr/Mrs

Source Language Python

Database SQL

Operating System Windows 10

Tools Used Python, Python’s idle, Face Recognition Api, numpy,

imutls, dlib, pyqt5, tkinter, opencv, pickle, pyodbc and sql server

Security System Using Face Recognition


Table of Contents

1 Chapter # 1: Introduction ................................................................................................... 1


1.1 Introduction ............................................................................................................................ 1
1.2 Introduction of Security System using Face Recognition .......................................................... 1
1.3 Problem Statement .................................................................................................................. 2
1.4 Purpose................................................................................................................................... 2
1.5 Objectives of System ............................................................................................................... 2
1.6 Product Scope ......................................................................................................................... 2
1.7 Software Tools........................................................................................................................ 3
1.8 Software Requirements............................................................................................................ 3
1.9 Hardware Requirements .......................................................................................................... 3
1.10 Gantt chart .............................................................................................................................. 4

2 Chapter # 2: Literature and Analysis ................................................................................. 5


2.1 Introduction ............................................................................................................................ 5
2.2 Existing System ...................................................................................................................... 5
2.3 Proposed System compared with existing System based on Features ......................................... 5
2.4 Face Detection ........................................................................................................................ 6
2.4.1 Methods for Face Detection................................................................................................. 6
2.5 Face Recognition..................................................................................................................... 9
2.5.1 Methods for Face Recognition ............................................................................................. 9
2.6 Functional Requirement ......................................................................................................... 10
2.6.1 Admin............................................................................................................................... 10
2.6.2 Login ................................................................................................................................ 10
2.6.3 Change Password .............................................................................................................. 10
2.6.4 Get Dataset ....................................................................................................................... 10
2.6.5 Train the Dataset .............................................................................................................. 11
2.6.6 Recognize ......................................................................................................................... 11
2.6.7 Check Dataset ................................................................................................................... 11
2.6.8 Logout .............................................................................................................................. 11
2.7 Non-Functional Requirements ............................................................................................... 11
2.7.1 Performance Requirements ................................................................................................ 11
2.7.2 Security Requirement ........................................................................................................ 11
2.7.3 Usability ........................................................................................................................... 11

Security System Using Face Recognition


2.7.4 Availability ....................................................................................................................... 11
2.7.5 Maintainability ................................................................................................................. 11
2.7.6 Flexible............................................................................................................................. 11

3 Chapter # 3: Project Design .............................................................................................. 13


3.1 Introduction .......................................................................................................................... 13
3.2 Methodology ......................................................................................................................... 13
3.2.1 Why Agile Model .............................................................................................................. 13
3.3 Agile Model .......................................................................................................................... 14
3.4 Software Development Life Cycle.......................................................................................... 14
3.4.1 Planning ........................................................................................................................... 14
3.4.2 Design .............................................................................................................................. 15
3.4.3 Development ..................................................................................................................... 15
3.4.4 Testing ............................................................................................................................. 15
3.4.5 Release ............................................................................................................................. 15
3.4.6 Feed Back ......................................................................................................................... 15
3.5 Proposed Framework............................................................................................................. 16
3.6 Design Description ................................................................................................................ 16
3.6.1 Product Functions ............................................................................................................. 16
3.7 Data Flow Diagram............................................................................................................... 16
3.7.1 External Entity.................................................................................................................. 17
3.7.2 Data Flow......................................................................................................................... 17
3.7.3 Process ............................................................................................................................. 17
3.7.4 Store................................................................................................................................. 17
3.7.5 Zero Level DFD................................................................................................................ 18
3.7.6 Level 1 DFD ..................................................................................................................... 18
3.8 Entity Relationship Diagram For Storing Individual Information. ........................................... 19
3.8.1 ERD (entity relationship diagram) ..................................................................................... 19
3.8.2 Entity................................................................................................................................ 19
3.8.3 Relationship ...................................................................................................................... 19
3.8.4 Cardinality........................................................................................................................ 19
3.8.5 Degree .............................................................................................................................. 19
3.8.6 Attributes.......................................................................................................................... 19
3.8.7 ERD (conceptual Design) .................................................................................................. 19
3.8.8 ERD (logical Design) ........................................................................................................ 20
3.9 Schema Diagram ................................................................................................................... 20

Security System Using Face Recognition


3.10 Database ............................................................................................................................... 20
3.10.1 Advantages ....................................................................................................................... 20
3.10.2 Types of normalization...................................................................................................... 21
3.11 Sequence Diagram ................................................................................................................ 22
3.12 Use Case Diagram ................................................................................................................ 23
3.12.1 Use case # 1...................................................................................................................... 24
3.12.2 Use case # 2...................................................................................................................... 24
3.12.3 Use Case # 3 ..................................................................................................................... 25
3.12.4 Use Case # 4 ..................................................................................................................... 25

4 Chapter # 4: Implementation and Evaluation .................................................................. 26


4.1 Introduction .......................................................................................................................... 26
4.2 User Interface ....................................................................................................................... 26
4.2.1 Login Interface.................................................................................................................. 26
4.2.2 Main System Interface ...................................................................................................... 27
4.2.3 Register Face .................................................................................................................... 28
4.2.4 Dataset ............................................................................................................................. 31
4.2.5 Update Information ........................................................................................................... 32
4.2.6 Face Recognizer ................................................................................................................ 33
4.2.7 Example of Recognize Faces ............................................................................................. 34
4.3 Evaluation............................................................................................................................. 35
4.3.1 White Box Testing ............................................................................................................ 35
4.3.2 Black Box Testing ............................................................................................................ 39
4.3.3 Unit Testing ...................................................................................................................... 39
4.3.4 Integration Testing ............................................................................................................ 39
4.3.5 System Testing ................................................................................................................. 40
4.3.6 Regression Testing ............................................................................................................ 40

5 Chapter #5: Conclusion ..................................................................................................... 41


5.1 Introduction .......................................................................................................................... 41
5.2 Conclusion ............................................................................................................................ 41

6 References .......................................................................................................................... 42

Security System Using Face Recognition


List of Figures
Figure 1 (HOG dark pixel compare) ...................................................................................... 7
Figure 2 (HOG gradient map) ................................................................................................ 7
Figure 3 (Agile Model) ........................................................................................................ 14
Figure 4 (Process Flow Diagram) ........................................................................................ 16
Figure 5 (0 Level DFD) ....................................................................................................... 18
Figure 6 (Level 1 DFD) ....................................................................................................... 18
Figure 7(ERD Conceptual Design) ...................................................................................... 19
Figure 8 (ERD Logical Design) ........................................................................................... 20
Figure 9 (Schema Diagram) ................................................................................................. 20
Figure 10 (Sequence Diagram) ............................................................................................ 22
Figure 11 (Use Case Diagram) ............................................................................................. 23
Figure 12 (login).................................................................................................................. 26
Figure 13 (Main interface) ................................................................................................... 27
Figure 14 (Register Face) .................................................................................................... 28
Figure 15 (example of registration) ...................................................................................... 29
Figure 16 (Record Inserted Successfully) ............................................................................. 29
Figure 17 (Record Inserted in Database) .............................................................................. 30
Figure 18(Registering Face) ................................................................................................. 30
Figure 19 (Dataset).............................................................................................................. 31
Figure 20 (Update Information) ........................................................................................... 32
Figure 21 (Face Recognizer) ................................................................................................ 33
Figure 22 (Example of Recognized faces) ............................................................................ 34

Security System Using Face Recognition


List of Tables
Table 1 (Gantt chart) ............................................................................................................. 4
Table 2 (Comparison of HOG and HAAR for Face Detection) ............................................... 8
Table 3 (Comparison of face recognition method) ................................................................ 10
Table 4 (comparison table of existing and proposed system) ................................................ 12
Table 5 (Use Case Login) .................................................................................................... 24
Table 6(Use case capturing module) .................................................................................... 24
Table 7 (Use case training module) ...................................................................................... 25
Table 8(Use case recognizing module) ................................................................................. 25
Table 9 (Test Case 1) .......................................................................................................... 35
Table 10 (Test Case 2) ........................................................................................................ 36
Table 11 (Test Case 3) ........................................................................................................ 36
Table 12 (Test Case 4) ........................................................................................................ 37
Table 13 (Test Case 5) ........................................................................................................ 37
Table 14 (Test Case 6) ........................................................................................................ 38
Table 15 (Test Case 7) ........................................................................................................ 38
Table 16 (Black box Test Case 1) ........................................................................................ 39

Security System Using Face Recognition


Chapter 1 Introduction

1 Chapter # 1: Introduction

1.1 Introduction

Any project starts with the brief introduction. Chapter # 1 keeps brief introduction of Security
System for Person Identification Using Face Recognition for ISP as well as purpose of the
system, objectives of the system, product scope and software tools that are used to develop this
system.

1.2 Introduction of Security System using Face Recognition

Biometrics are study of science and technology measuring and examining biology. Biometrics are
referred by technologies that measure and examine the human body features such as DNA, Finger
prints and facial pattern for authentication. Face detection is a method which checks whether tha
face is present in the given image or not. If present then it return the image location and content
of every image. Face detection is the general case of face localization in which the locations and
sizes of a known number of faces (usually one) are interpreted. [1]
A facial recognition device is a device that takes an image or a video of a human face and
compares it to other image faces in a database. The structure, shape and proportions of the faces
are compared during the face recognition steps. In addition, distance between the eyes, nose,
mouth and jaw, upper outlines of the eye sockets, the sides of the mouth, location of the nose and
eyes, and the area surrounding the check bones are also compared. [2]
Automatic face recognition has been a challenging task for the research community. It has been
extensively adopted by the applications including biometrics, surveillance, security, identification,
and authentication. Face recognition usually exploit high-dimensional information which makes it
computationally intensive. In addition, wrong detected features can make the recognition process
even slower. [6]
The system is developed for Institute of Southern Punjab Multan. In this system the camera will
be placed at entrance area of university with the purpose of monitoring the individuals and will
detect the faces and compare with the dataset, provide outcome in the form of details which will
be inserted in database that are as follow:
 Face ID
 Registration # (Roll number of individual)

Security System Using Face Recognition 1


Chapter 1 Introduction

 Name (The name of individual)


 Type (The type varies whether the person is Student, Teacher and another Staff member
or visitor.)
 Department (Department of the individual)
If it detects any unknown individual then he or she will be considered as unknown to
organization.

1.3 Problem Statement

Monitoring cameras which are placed in entrance area are only for monitoring objective and not
doing any identification of individuals so, there is also risk of unknown person can enter in
organization. The existing system has some drawbacks as it does not contains much information
of Individual, and results are not satisfactory because it does not recognize the individual
accurately. The major disadvantages required special attention.

1.4 Purpose

The purpose of this project is to defining the security system that is known as biometric
verification based on face recognition. This security system’s goal will to authenticate the
individual on the basis of detecting and identify his or her face and also will tell whether he is
student, staff or visitor, his name, his registration # and also department of that individual. If the
individual will not recognized then he will be considered as unknown to the organization.

1.5 Objectives of System

The targets of this product are as follows:


 It detects real time faces.
 It match and recognizes the faces by using Face Recognition Api.
 It provide output of individual whether he is staff, student and visitor and also department
of that individual.

1.6 Product Scope

Gives facility of automatically identification of individuals. Uses real time face recognition so that
security problems and much time of security guards will be reduced. The product is limited to
only ISP entrance area.

Security System Using Face Recognition 2


Chapter 1 Introduction

1.7 Software Tools

The tools which are selected to implement the product are as follows:
 Python’s Idle
 Python
 OpenCv library
 Face recognition api
 Dlib library
 Imutils
 Pickle library
 Tkinter library
 PyQT5 library
 SQL server
 Pyodbc library

1.8 Software Requirements

The software requirements of the system that are used to run this system are as follows:
1. Windows 7, 8 10 Operating System
2. Drivers of Camera
3. Drivers of GPU
4. Display Drivers
5. USB Drivers

1.9 Hardware Requirements

The hardware requirements are mentioned below:


1. USB port 2.0 or better
2. Camera: 8MP or better
3. High GPU recommended
4. CPU: Core I5 or better

Security System Using Face Recognition 3


Chapter 1 Introduction

1.10 Gantt chart

Table 1 (Gantt chart)

Weeks 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th 12th 13th 14th 15th 16th
Work

Planning

Design

Coding

Testing

Delivery

Security System Using Face Recognition 4


Chapter 2 Literature and Analysis

2 Chapter # 2: Literature and Analysis

2.1 Introduction

This phase has the analysis of the system and literature review. In this chapter I explained the
existing system and compare with my proposed system based on features. I also mention my
proposed system through functional and non-functional requirements and did the comparison of
my system with the existing system.

2.2 Existing System

The Entrance Security System through Face Recognition was implemented last year by Hussain
Ahmed in Institute of Southern Punjab Multan. The system take two entries, Face Id entry and
Student or Teacher or Visitor entry. The system make folders of Student, Teacher and Visitor.
Then during testing it gives output whether the person is student, teacher or visitor. The
problems in existing system of security system using face recognition there is no database to store
the information of user, also when adding user it does not require the information of user such as
name, registration number and department. The system cannot update the information of user if
required. The login page contains only login button if admin wants to change the password then
he/she cannot do it. The admin cannot check the dataset in the system through system. And the
method of face detection gives lot of false predictions because Haar Cascade is used in the system
and in recognition process there is Local Binary Pattern Histogram is used which is less accurate
and also requires lots of images for training.

2.3 Proposed System compared with existing System based on Features

My proposed system of security system (Security System for Person Identification Using Face
Recognition for ISP) keeps the information that is stored in the database when adding the user.
This system provides the update information of users. The system takes the information like
name, registration #, type and department. In this system the login page contains login function
logout function and admin can update the password. In this system it requires only one image to
train and gives perfect match with high accuracy because in this system face recognition module
is used which has 99.38 % accuracy of perfect matching.

Security System Using Face Recognition 5


Chapter 2 Literature and Analysis

2.4 Face Detection

Face detection is a method to find whether or not there are any faces in a given image (usually in
gray scale) and, if present, return the image location and content of each face. This is the first
step of any fully automatic system that analyzes the information contained in faces (e.g. identity,
gender, expression, age, race and pose). Face detection is a type of object class detection in
which the locations and sizes of all objects in an image that belong to a given class are found.
Face detection is the general case of face localization in which the locations and sizes of a known
number of faces (usually one) are interpreted. [1]

2.4.1 Methods for Face Detection

The method that is used for face detection in the existing system used Haar Cascade Classifier
which is used in object detection, and the method of face detection gives lot of false predictions.
A Haar Cascade is basically a classifier which is used to detect particular objects from the source.
The haarcascade_frontalface_default.xml is a haar cascade designed by OpenCV to detect the
frontal face. A Haar Cascade works by training the cascade on thousands of negative images with
the positive image superimposed on it. The haar cascade is capable of detecting features from the
source.
The other method to detect the face more accurately is Dlib, Dlib for face detection uses a
combination of HOG (Histogram of Oriented Gradient) & Support Vector Machine (SVM)
which is trained on positive and negative images (meaning there are images that have faces and
ones that don’t).This type of object detector is fairly general and capable of detecting many types
of semi-rigid objects in addition to human faces. The first step is to convert the input image to
gray scale. It only looks at the changes between light and dark areas in an image. It doesn’t need
color information. It takes a pixel and compares how dark this pixel is compared to the next
pixels around it and find out in which direction the biggest changes happened. [5]

Security System Using Face Recognition 6


Chapter 2 Literature and Analysis

Figure 1 (HOG dark pixel compare)

In above the left pixel is lighter and the right pixel is darker. The direction for biggest change is
left to right.

Figure 2 (HOG gradient map)

If we repeat this process for every single pixel for an image then the image will turn into a map of
transition from light to dark areas. After placing every pixel the full gradient map is the simplified
version of the actual image. To detect a face all we need an overall structure of an image and
that’s what Hog does. [5]

Security System Using Face Recognition 7


Chapter 2 Literature and Analysis

Table 2 (Comparison of HOG and HAAR for Face Detection)

Face Detection Methods Pros Cons


Haar Cascade Classifier 1. Works almost real-time 1. The major drawback of
on CPU. this method is that it
2. Simple Architecture. gives a lot of false
3. Detects faces at predictions.
different scales. 2. Doesn’t work on non-
frontal images.
3. Doesn’t work under
occlusion. [10]
Histogram Oriented 1. Fastest method on 1. The major drawback is
Gradients CPU. that it does not detect
2. Works very well for small faces as it is
frontal and slightly trained for minimum
non-frontal faces. face size of 80×80.
3. Works under small 2. Does not work very
occlusion. well under substantial
occlusion.
3. Does not work for side
face and extreme non-
frontal faces, like
looking down or up.
[10]

Security System Using Face Recognition 8


Chapter 2 Literature and Analysis

2.5 Face Recognition

The real-time face recognition system gets the testing images from the camera firstly, and then
determines the face’s information or the face ID. This process consists of two key steps: face
detection and face recognition. Only those images which really contain a face should be
recognized. Therefore, the system we proposed includes face detection and face recognition. We
get the interested face region by face detection and identify the face ID by face recognition. [3]

2.5.1 Methods for Face Recognition

2.5.1.1 Local Binary Pattern

In the existing system, Local Binary Pattern Histogram (LBPH) is used. The basic idea of Local
Binary Patterns is to summarize the local structure in an image by comparing each pixel with its
neighborhood. Take a pixel as center and threshold its neighbors against. The main idea is to
divide the LBP image into local regions and extract a histogram from each. These histograms are
called Local Binary Patterns Histograms.
1. Present new image to the recognizer.
2. The recognizer creates a histogram for that new image.
3. The new histogram is compared with the histogram it already has.
4. Finally, it detects the best match and returns the student name associated with that best
match. [4]

2.5.1.2 Face Recognition API

The second method of face recognition is face recognition module which is created by Adam
Geitgey. Face recognition module is based on Resnet34 network architecture, which is the
Convolutional Neural Network’s architecture under Dlib library (created by Davis King) which is
part of face recognition module. It’s a C++ library and contains machine learning algorithms and
tools and can solve a real-world problem like face recognition. The network of face recognition
quantifies the faces, constructing 128d embedding (quantification) of each face. The network
itself was trained by Davis King on a dataset of ~3 million images. On the Labeled Faces in the
Wild (LFW) dataset the network compares to other state-of-the-art methods, reaching 99.38%
accuracy. [8] https://www.pyimagesearch.com/2018/06/18/face-recognition-with-opencv-python-
and-deep-learning/

Security System Using Face Recognition 9


Chapter 2 Literature and Analysis

2.5.1.2.1 Recognition by Dlib

It compares two images and perfectly predict if both images are the same person with 99.38 %
accuracy that is pretty good as compared to LBPH. [5]

2.5.1.2.2 RESNET Architecture

The network architecture of face recognition module (RESNET) has 29 conv layers. It is a
version of RESNET34 from the Deep Residual Learning for Image Recognition by He, Zhang,
Ren. The model has an accuracy of 99.38% on the standard Labeled Faces in the Wild
benchmark. This is comparable to other state-of-the-art models and means that, given two face
images, it correctly predicts if the images are of the same person 99.38% of the time. [9]
Table 3 (Comparison of face recognition method)

Method for No. of Images for Training Time Testing Accuracy


Recognition Training
LBPH 50 images Fast 90.93% [7]
Face Recognition 1 image only Slow 99.38% [5]
Model

2.6 Functional Requirement

The function requirements describe the functions of the system, where a function is described as a
specification of behavior between outputs and inputs. The functional requirements of the system
are as follows:

2.6.1 Admin

With the requirements of the system, admin can perform the actions that are defined below:

2.6.2 Login

The system requires login before entering to the application to use.

2.6.3 Change Password

The admin can also update password if want to do.

2.6.4 Get Dataset

User’s image is taken from the camera that detects the face of the user, takes face Id, user’s
information like name, registration number, type and department of the user that he/she belongs

Security System Using Face Recognition 10


Chapter 2 Literature and Analysis

to and store information of user into the database and the dataset of user will be placed on the
assigned path/ directory.

2.6.5 Train the Dataset

When assigning the path, then it will train the dataset by using Face Recognition Module.

2.6.6 Recognize

After training of dataset the recognizer will recognize the face and return the information of that
face from the database.

2.6.7 Check Dataset

The admin can also able to see the dataset that he collected.

2.6.8 Logout

The logout function will take the admin to the login page.

2.7 Non-Functional Requirements

2.7.1 Performance Requirements

The performance of the system is good, saves time and requires high level of specification of the
machine to perform best. It cannot handle the low specification of machine. It requires high level
of GPU and CPU to perform real time face recognition.

2.7.2 Security Requirement


The system is secure and only accessible to the admin.

2.7.3 Usability
The usability of the system contains simplicity and it is very easily understandable.

2.7.4 Availability
The functions of the system are accessible and available to the admin.

2.7.5 Maintainability
The system can be easy to maintain if needed in future
2.7.6 Flexible
The system allows flexibility to update of modify if required in future.

Security System Using Face Recognition 11


Chapter 2 Literature and Analysis

Table 4 (comparison table of existing and proposed system)

Content Existing System Proposed System

Database No Yes

User’s Information No (not complete info) Yes

Update Information No Yes

Login function Yes Yes

Logout No Yes

Change Password No Yes

System Security Yes Yes

System Accuracy Less High

Security System Using Face Recognition 12


Chapter 3 Project Design

3 Chapter # 3: Project Design

3.1 Introduction

The most important phase of any project is the designing of the logical data and database which
involve the designing of different diagrams. This chapter keeps the methodology which involves
in development of the system, contains Data Flow Diagram, USE case diagram and Entity
Relationship Diagram.

3.2 Methodology

Software development methodology is a framework that is used to structure, plan, and control
the process of developing an information system. This kind of development methodologies are
only concerned with the software development process, so it does not involve any technical
aspect of, but only concern with proper planning for the software development. Many
methodologies are used for software development some of them are fellows:
 Waterfall Model
 Spiral Model
 V- Model
 Iterative Model
 Agile Model

3.2.1 Why Agile Model

When concerning with Advance projects like AI based projects many changes can be done
because of research or according to requirement, so to see this, I am using agile methodology in
my system because agile methodology is a practice which promotes continue interaction between
development and customer after every iteration of development. In the Agile method, the entire
project is divided into small incremental builds therefore customer easily see the product and
realize whether he is fulfilled or not that is why this is one of the benefits of this model.

Security System Using Face Recognition 13


Chapter 3 Project Design

3.3 Agile Model

Agile software development comprises various approaches to software development under which
requirements and solutions evolve through the collaborative effort of self-organizing and cross-
functional teams and their customer(s)/end user(s). It advocates adaptive planning, evolutionary
development, early delivery, and continual improvement, and it encourages rapid and flexible
response to change.

Figure 3 (Agile Model)

3.4 Software Development Life Cycle

3.4.1 Planning

I held meeting with my supervisor of this project and gather the requirements. According to the
supervisor the existing system needed to changes some extent. All the requirements needed for
develop the system are gathered and analyze in this phase. I gather the requirement and write on
the paper, noted the requirements that the supervisor needed for this project.

Security System Using Face Recognition 14


Chapter 3 Project Design

3.4.2 Design

System design assists defining hardware and system needs which help in defining over all the
system architecture. In this system I designed different diagrams like use case, sequence and data
flow diagrams.

3.4.3 Development

Inputs from system design, stem is first developing in small program called units, in next phase
these units are integrated. Each unit is developed and tested for its functionality, are referred as
unit testing. In implementation, code is written to implement the design phase. The tool that is
used is Python’s idle.

3.4.4 Testing

Testing process cleans the system from errors. Software’s units are tested and debugged. The
system is achieved its goals and ready to use.

3.4.5 Release

The system is released according to deadline given from the supervisor. Also meet its aim.

3.4.6 Feed Back

The system is performing well and solved the problems that was received in the existing system of
security system using face recognition.

Security System Using Face Recognition 15


Chapter 3 Project Design

3.5 Proposed Framework

Figure 4 (Process Flow Diagram)

3.6 Design Description

Design Description include Data Flow Diagram, Entity Relationship diagram, Sequence Diagram
and Use case diagram.

3.6.1 Product Functions

1. Login
2. Capture Faces
3. Processing\ Training
4. Recognize the images.

3.7 Data Flow Diagram

A data flow diagram shows the way information flows through a process or system. It includes
data inputs and outputs, data stores, and the various sub processes the data moves through.
DFDs are built using standardized symbols and notation to describe various entities and their
relationships. Data flow diagrams visually represent systems and processes that would be hard to
describe in a chunk of text. You can use these diagrams to map out an existing system and make

Security System Using Face Recognition 16


Chapter 3 Project Design

it better or to plan out a new system for implementation. Visualizing each element makes it easy
to identify inefficiencies and produce the best possible system. Components of DFD are as
follows:
1. External Entity
2. Data Flow
3. Process
4. Store

3.7.1 External Entity

The external entity is one who communicates the system.

Individual

3.7.2 Data Flow

Shows the movement of the information.

Flow of data

3.7.3 Process

The process is the part of the system transform input to output.


Process

3.7.4 Store

Act as storage area for two processes that occurs at different times.
Store

Security System Using Face Recognition 17


Chapter 3 Project Design

3.7.5 Zero Level DFD

Entrance Area

Figure 5 (0 Level DFD)

3.7.6 Level 1 DFD

Figure 6 (Level 1 DFD)

Security System Using Face Recognition 18


Chapter 3 Project Design

3.8 Entity Relationship Diagram For Storing Individual Information.

3.8.1 ERD (entity relationship diagram)


It is a diagram which tells the relationship between different entities.
3.8.2 Entity
Anything that receives and generates the data generally from any system.

3.8.3 Relationship

Relationship that links between different entities. Every relationship has name, also has cardinality
(optional, mandatory) and degree (binary, ternary).
3.8.4 Cardinality
The maximum number of possible relationship occurs for an entity that participate in the
relationship.
3.8.5 Degree
The number of entity types that are participating in the relationship.
3.8.6 Attributes
Within each entity, there can be more than one attribute. Attributes provide detailed information
about the concept. In a relational database, attributes are represented by the fields where the
information inside a record is held.

3.8.7 ERD (conceptual Design)

Figure 7(ERD Conceptual Design)

Business Rule
The admin must input the information of one or more individual. All the individual’s information
must be input by one admin.
Type of relationship: one to many.
Type of cardinality: one mandatory to many mandatory.
Type of Degree: Binary.

Security System Using Face Recognition 19


Chapter 3 Project Design

3.8.8 ERD (logical Design)

Figure 8 (ERD Logical Design)

3.9 Schema Diagram

Figure 9 (Schema Diagram)

3.10 Database

A database is an application that manages data and allows fast storage and retrieval of that data.
A database is a collection of data which is organized in such a way that each piece of data is
available to those who need it and with minimum duplication of data. There are different types of
database but the most popular is a relational database that stores data in tables where each row in
the tables holds the same sort of information.

3.10.1 Advantages

1. Minimal data redundancy

Security System Using Face Recognition 20


Chapter 3 Project Design

2. Consistency of data
3. Data integrity
4. Sharing of data
5. Ease of application development
6. Uniform security, privacy and integrity controls
7. Reduced program maintenance
8. Improved data security

3.10.2 Types of normalization

3.10.2.1 First normal form


As per first normal form, no two rows of data must contain repeating group of information, each
set of columns have a unique value such that multiple columns cannot be used to fetch the same
row. Each table should be organized into rows, and each row should have a primary key that
distinguishes it as unique. The primary key used for a single column, but sometimes more than
one column can be combined to create a single primary key.

3.10.2.2 Second normal form

As per second normal form there must not be any partial dependency of any column on primary
key. It means that for a table that has concatenated primary key, each column in the table that is
not part of the primary key must depend on the entire concatenated key for its existence. If any
column depends only on one part of the concatenated then the table fails second normal form. All
the rules include first normal form and second normal form. No non-key field depends upon
another. All non-key fields depend only the primary key.

3.10.2.3 Third normal form

The rules include first normal form and second normal form. No non-key field depends upon
another

Security System Using Face Recognition 21


Chapter 3 Project Design

3.11 Sequence Diagram

Security System Using Face Recognition

Figure 10 (Sequence Diagram)

Security System Using Face Recognition 22


Chapter 3 Project Design

3.12 Use Case Diagram

Figure 11 (Use Case Diagram)

Security System Using Face Recognition 23


Chapter 3 Project Design

3.12.1 Use case # 1

Table 5 (Use Case Login)

Use Case Name Login

Description This use case will allow admin to


login in to the system.
Actor Administrator
Primary Flow 1. Admin can login into the
system.
2. Admin can update the
password of the system.
Post Condition When the admin successfully
logged into the system he/she will
get complete access to the system.
Exception Invalid information will not
authenticate the admin.

3.12.2 Use case # 2

Table 6(Use case capturing module)

Use Case Name Capturing Module


Description This use case will detect face from
camera and admin will capture the
image.
Actor System

Primary Flow This function will detect face and


store the image into the dataset
path. Also get information of
individual such as name, registration
etc. and store into the database.
Post Condition When this module will run it will

Security System Using Face Recognition 24


Chapter 3 Project Design

capture image and store into


dataset.
Exception If string is inserted in the Face Id
column then it will get error.
Because its data type is integer.

3.12.3 Use Case # 3

Table 7 (Use case training module)

Use Case Name Training Module


Description This use case will train the faces
that are captured through camera
and write on the dataset.
Actor System

Primary Flow This function will extract features


from the images and write these
encodings into file.
Post Condition It will extract the features of images

3.12.4 Use Case # 4

Table 8(Use case recognizing module)

Use Case Name Recognizer Module


Description This use case will recognize the face
when it occurs on the camera.
Actor System
Primary Flow This function will take path of the
encodings file and recognize the
features of image when the image
will occur on the camera.
Post Condition It will recognize the face and
retrieve information of that face.

Security System Using Face Recognition 25


Chapter 4 Implementation and Evaluation

4 Chapter # 4: Implementation and Evaluation

4.1 Introduction

After requirement and design is completed then implementation and evaluation phase starts, in
this phase the coding is started according to requirements and design that us discussed above, and
evaluation of the system, testing system against the requirements.

4.2 User Interface

4.2.1 Login Interface

Figure 12 (login)

Security System Using Face Recognition 26


Chapter 4 Implementation and Evaluation

When entering into the main system admin must enter password and then take access of the
system.

4.2.2 Main System Interface

Figure 13 (Main interface)

Security System Using Face Recognition 27


Chapter 4 Implementation and Evaluation

This main interface consist of 6 buttons which are as follows:


 Register Face
 Update Information
 Dataset
 Face Trainer
 Face Recognizer
 Logout

4.2.3 Register Face

Figure 14 (Register Face)

The register face interface takes information of individual and will insert to the database.

Security System Using Face Recognition 28


Chapter 4 Implementation and Evaluation

Figure 15 (example of registration)

This is the example registering the information.

Figure 16 (Record Inserted Successfully)

After taken the information it will inserted it in database.

Security System Using Face Recognition 29


Chapter 4 Implementation and Evaluation

Figure 17 (Record Inserted in Database)

Now the record that is inserted in register face interface is successfully inserted in database.

Figure 18(Registering Face)

After registering the information it will register the face and put face into the dataset.

Security System Using Face Recognition 30


Chapter 4 Implementation and Evaluation

4.2.4 Dataset

Figure 19 (Dataset)

The faces that was captured above now placed into the dataset.

Security System Using Face Recognition 31


Chapter 4 Implementation and Evaluation

4.2.5 Update Information

Figure 20 (Update Information)

Update Information interface will take information and then update the information in database.

Security System Using Face Recognition 32


Chapter 4 Implementation and Evaluation

4.2.6 Face Recognizer

Figure 21 (Face Recognizer)

The face recognizer will recognize the face and show the information of that individual.

Security System Using Face Recognition 33


Chapter 4 Implementation and Evaluation

4.2.7 Example of Recognize Faces

Figure 22 (Example of Recognized faces)

This is an example of recognized faces.

Security System Using Face Recognition 34


Chapter 4 Implementation and Evaluation

4.3 Evaluation

When the coding of the system is done, then it starts for evaluation of the system to make sure
that the functions are built are working correctly. The system is entirely tested, software testing is
an activity to check that the system whether it is performing according to needs and actual results
matches the expected results also ensures the system is freed from defect. Software testing is also
helps to check that whether there is errors or any lacking needs against the actual requirements.
So the developer detects the errors and corrects those errors until the system works correctly, so
he/she use testing of different types which are written below:
 White Box Testing
 Black Box Testing
 Unit Testing
 Integration Testing
 System Testing
 Regression Testing

4.3.1 White Box Testing

In white box testing we understand the internal functionalities of the system, with white-box
testing, we have at least some idea of what is going on inside the software.
Test Cases
Table 9 (Test Case 1)

Test case 1: Login Priority(H,L): High


Test Objective: Authentication Access
Test Description: Admin will enter the required field and press the login button.
Requirement Verified: Yes
Action Expected Result
Admin will login to access the system. Message Box Show, “Login
Successfully.”
Pass: Yes Condition: Pass Fail: No
Issues: Nil
Status: Successfully Executed

Security System Using Face Recognition 35


Chapter 4 Implementation and Evaluation

Table 10 (Test Case 2)

Test case 2: Update Password Priority(H,L): High


Test Objective: To change the password.
Test Description: Admin will enter the old password to required field and then enter
new password.
Requirement Verified: Yes
Action Expected Result
Admin will update the password on Message Box Show, “Password Change
interface. succeed.”
Pass: Yes Condition: Pass Fail: No
Issues: Nil
Status: Successfully Executed

Table 11 (Test Case 3)

Test case 3: Face Register Priority(H,L): High


Test Objective: To register the information and face.
Test Description: Admin will press Face register button to register face and
information.
Requirement Verified: Yes
Action Expected Result
Admin will register the faces of Message Box Show, “Record
individuals on interface. Individual will successfully inserted.”
come in front of camera. So camera can
detect his/her face and capture the face
and store into dataset.
Pass: Yes Condition: Pass Fail: No
Issues: Nil
Status: Successfully Executed

Security System Using Face Recognition 36


Chapter 4 Implementation and Evaluation

Table 12 (Test Case 4)

Test case 4: Update Information Priority(H,L): High


Test Objective: To update information if required.
Test Description: Admin will press the update information button to update
information of individual.
Requirement Verified: Yes
Action Expected Result
Admin will update information on the Message Box Show, “Updated
interface. Individual will provide Successfully.”
information that he/she wants to update.
Pass: Yes Condition: Pass Fail: No
Issues: Nil
Status: Successfully Executed

Table 13 (Test Case 5)

Test case 5: Dataset Priority(H,L): Low


Test Objective: To check dataset
Test Description: Admin will press the dataset button to check dataset.
Requirement Verified: Yes
Action Expected Result
Admin will check dataset on interface. Open folder of dataset.
Pass: Yes Condition: Pass Fail: No
Issues: Nil
Status: Successfully Executed

Security System Using Face Recognition 37


Chapter 4 Implementation and Evaluation

Table 14 (Test Case 6)

Test case 6: Face Trainer Priority(H,L): High


Test Objective: To train the faces
Test Description: Admin will press face trainer button to train the faces.
Requirement Verified: Yes
Action Expected Result
Admin will train the faces on interface. Message in console, “Face Trained
All the faces that are captured will be Successfully”
trained.
Pass: Yes Condition: Pass Fail: No
Issues: Nil
Status: Successfully Executed

Table 15 (Test Case 7)

Test case 7: Face Recognizer Priority(H,L): High


Test Objective: To Recognize faces
Test Description: Admin will press face recognizer to recognize the faces.
Requirement Verified: Yes
Action Expected Result
Admin will train the faces on interface. Show individual’s information on screen.
Individual will come in front of the
camera and the camera will recognize
that individual.
Pass: Yes Condition: Pass Fail: No
Issues: Nil
Status: Successfully Executed

Security System Using Face Recognition 38


Chapter 4 Implementation and Evaluation

4.3.2 Black Box Testing

Black Box Testing is a software testing method in which testers evaluate the functionality of the
software under test without looking at the internal code structure.
Test Case
Table 16 (Black box Test Case 1)

Test case 7: Face Recognizer Priority(H,L): High


Test Objective: To Recognize faces
Test Description: The system will recognize the faces of individuals by matching
with dataset.
Requirement Verified: Yes
Test Environment: The camera must be working for real time face detection so that
the individual can be recognized.
Action Expected Result
Individual will come in front of the Show individual’s information like
camera and the camera will recognize student, teacher, visitor and other staff
that individual. person, name, registration # and
department on screen.
Pass: Yes Condition: Pass Fail: No
Issues: Nil
Status: Successfully Executed

4.3.3 Unit Testing

The testing of an individual program or module is called unit testing. The objective is to identify
and eliminate execution errors that could cause the program to terminate. During unit testing,
programmers must test each part independently. Each module/function of this system is checked
to remove errors.

4.3.4 Integration Testing

Testing one or more program is known as integration testing. In integration testing two or more
modules are dependent on each other. In this system, all the modules that depend on each other
are working finely.

Security System Using Face Recognition 39


Chapter 4 Implementation and Evaluation

4.3.5 System Testing

After completing integration testing, system testing is performed which involves the entire
system. A system test includes all typical processing situations and is intended to assure users,
developers, and managers that the program meets all specifications and that all necessary features
have been included. Whole system is tested after integration testing. Complete system is working
properly and gives results that satisfy requirements.

4.3.6 Regression Testing

Whenever programmer wants to change the features, regression testing is performed to ensure
that any modification cannot destroy the current functionalities. Regression testing is nothing but
a full or partially selection of already executed test-cases which are re-executed to ensure existing
functionality works fine. The system might not affected if do any changes.

Security System Using Face Recognition 40


Chapter 5 Conclusion

5 Chapter #5: Conclusion

5.1 Introduction

In this phase conclusion is briefly summarize the project and its goals.

5.2 Conclusion

Face Recognition Systems are going to have widespread application in the smart environment.
Security System for Person Identification Using Face Recognition for ISP was meant for
identification of the individuals which identify individuals based on personal characteristics with
the aim of face detection and recognition. The system gives the information when recognize the
face like he/she is a student, teacher, visitor or other staff member also gives the detail of
department to whom he/she belongs to and if the face is not recognized then it will be considered
as unknown to organization. The system is time saving and effective.

Security System Using Face Recognition 41


6 References

[1] S.Padmapriya & Esther Annlin KalaJames, "Real Time Smart Car Lock Security System
Using Face," jan 2012.
[2] Face RecogMichel Owayjan, Amer Dergham, Gerges Haber, Nidal Fakih, Ahmad Hamoush,
Elie Abdo, "Face Recognition Security System," dec,2013.
[3] Ren Meng, Zhang Shengbing, Lei Yi, Zhang Meng, "CUDA-based Real-time Face
Recognition System," 2014.
[4] SudhaNarang, Kriti Jain, MeghaSaxena, AashnaArora, "Comparison of Face Recognition
Algorithms Using Opencv for Attendance System," February 2018.
[5] Momtahina, Rakibul Hossain, Md. Mushfiqur Rahman,Onul Ashrafi Tania, "Image Capturing
and Automatic Face Recognition," January 2019.
[6] Danish Ali Chowdhry, Aqeel Hussain, Muhammad Zaka Ur Rehman, Farhan Ahmad, Arslan
Ahmad, Mahmood Pervaiz, "Smart Security System for Sensitive Area," 2013.
[7] H. Haris, "Automated attendance System through Face Recognition".

[8] https://www.pyimagesearch.com/2018/06/18/face-recognition-with-opencv-python-and-deep-
learning/
[9] http://blog.dlib.net/2017/02/high-quality-face-recognition-with-deep.html
[10] https://www.learnopencv.com/face-detection-opencv-dlib-and-deep-learning-c-python/

Security System Using Face Recognition 42

You might also like