Project Report 7th Semester
Project Report 7th Semester
LAXMAN SONI
VIKAS KUMAR
KANWARPAL SINGH
Session 2022-2023
1
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
…………………………………………
2
………………………………………………
Head
Department of Computer Sc. & Engg,
Rajathan Institute of Engineering and
Technology Jaipur–302026.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
RAJASTHAN INSTITUTE OF ENGINEERING AND TECHNOLOGY
CERTIFICATE OF APPROVAL
(Signature of Examiners)
3
ACKNOWLEDGEMENT
We would like to express our deepest appreciation to all those who provided us the
possibility to complete this project report .A special gratitude we give to our final
year project mentor, Mr.Shivam Malik, whose contribution in stimulating
suggestions and encouragement, helped us to coordinate our project especially in
writing this report.
Many thanks goes to the head of the project, MR. Shivam Malik whose have
invested his full effort in guiding the team in achieving the goal. We have to
appreciate the guidance given by other supervisor as well as the panels especially
in our project presentation that has improved our presentation skills thanks to
their comment and advices.
___
. —————————————
.
—————————————
—————————————
. —————————————
Table of Contents
Page No.
1. Introduction …………………………………………………….
2. Review of Literature ……………………………………………
3. Objective of the Project…………………………………………
4. System Design……………………………………………………
5. Methodology for implementation (Formulation/Algorithm)……
6. Sample inputs and outputs
7. Conclusion……………………………………………………….
References
1. INTRODUCTION
In today's networked world, the need to maintain the security of information or physical
property is becoming both increasingly important and increasingly difficult. From time to
time we hear about the crimes of credit card fraud, computer breakin's by hackers, or
security breaches in a company or government building.
In most of these crimes, the criminals were taking advantage of a fundamental flaw in the
conventional access control systems: the systems do not grant access by "who we are",
but by "what we have", such as ID cards, keys, passwords, PIN numbers, or mother's
maiden name.
None of these means are really define us. Recently, technology became available to allow
verification of "true" individual identity. This technology is based in a field called
"biometrics".
Biometric access control are automated methods of verifying or recognizing the identity
of a living person on the basis of some physiological characteristics, such as fingerprints
or facial features, or some aspects of the person's behavior, like his/her handwriting style
or keystroke patterns. Since biometric systems identify a person by biological
characteristics, they are difficult to forge. Face recognition is one of the few biometric
methods that possess the merits of both high accuracy and low intrusiveness. It has the
accuracy of a physiological approach without being intrusive. For this reason, since the
early 70's (Kelly, 1970), face recognition has drawn the attention of researchers in fields
from security, psychology, and image processing, to computer vision.
2. Review of Literature
Face recognition is one of the few biometric methods that possess the merits of both high
accuracy and low intrusiveness. It has the accuracy of a physiological approach without
being intrusive. Over past 30 years, many researchers have proposed different face
recognition techniques, motivated by the increased number of real world applications
requiring the recognition of human faces. There are several problems that make automatic
face recognition a very difficult task. However, the face image of a person inputs to the
database that is usually acquired under different conditions. The important of automatic face
recognition is much be cope with numerous variations of images of the same face due to
changes in the following parameters such as
1. Pose
2. Illumination
3. Expression
4. Motion
5. Facial hair
6. Glasses
7. Background
of image.
Face recognition technology is well advance that can applied for many commercial
applications such as personal identification, security system, image- film processing,
psychology, computer interaction, entertainment system, smart card, law enforcement,
surveillance and so on. Face recognition can be done in both a still image and video
sequence which has its origin in still-image face recognition. Different approaches of face
recognition for still images can be categorized into three main groups such as
1. Holistic approach
2. Feature-based approach
3. Hybrid approach product
1. Holistic approach :- In holistic approach or global feature, the whole face region is
taken into account as input data into face detection system. Examples of holistic
methods are eigenfaces (most widely used method for face recognition), probabilistic
eigenfaces, fisherfaces, support vector machines, nearest feature lines (NFL) and
independent-component analysis approaches.They are all based on principal
component-analysis
(PCA) techniques that can be used to simplify a dataset into lower dimension while
retaining the characteristics of dataset.
Wavelets, especially Gabor wavelets, play a building block role for facial representation
in these graph matching methods. A typical local feature representation consists of
wavelet coefficients for different scales and rotations based on fixed wavelet bases. These
locally estimated wavelet coefficients are robust to illumination change, translation,
distortion, rotation, and scaling. The grid is appropriately positioned over the image and is
stored with each grid point’s locally determined jet in figure 2(a), and serves to represent
the pattern classes. Recognition of a new image takes place by transforming the image
into the grid of jets, and matching all stored model graphs to the image. Conformation of
the DLA is done by establishing and dynamically modifying links between vertices in the
model domain.
3. Hybrid approach :- The idea of this method comes from how human vision system
perceives both holistic and local feature. The key factors that influence the
performance of hybrid approach include how to determine which features should be
combined and how to combine, so as to preserve their advantages and avert their
disadvantages at the same time.
These problems have close relationship with the multiple classifier system (MCS)
and ensemble learning in the field of machine learning. Unfortunately, even in these
fields, these problems remain unsolved. In spite of this, numerous efforts made in
these fields indeed provide us some insights into solving these problems, and these
lessons can be used as guidelines in designing a hybrid face recognition system.
hybrid approach that use both holistic and local information for recognition may be
an effective way to reduce the complexity of classifiers and improve their
generalization capability.
A throughout survey has revealed that various methods and combination of these methods
can be applied in development of a new face recognition system. Among the many possible
approaches, we have decided to use a combination of knowledge-based methods for face
detection part and neural network approach for face recognition part. The main reason in
this selection is their smooth applicability and reliability issues. Our face recognition
system approach is given in Figure
Therefore, white balance of the acquired image should be corrected before segmenting it
[18]. Results of segmentation on original image and white balance corrected image is given
in Figure 4 and 5.
After “and operation” is applied on segmented images, some morphological operations are
applied on final skin image to search face candidate. Noisy like small regions elimination,
closing operations are performed. Then, face candidates are choosen with two
conditions which are ratio of bounding box of candidate and covering some gaps inside
the candidate region. Ratio of bounding box should lie between 0.3 and 1.5
Based on these conditions, face candidates are extracted from input image with modified
bounding box from original bounding box. The height of bounding box modified as 1.28
times bigger than width of bounding box because chest and neck parts will be eliminated if
candidate includes them This modification value have been determined experimentally.
These face candidates will be sent to facial feature extraction part to validate the
candidates. Final verification of candidate and face image extraction, facial feature
extraction process is applied. Facial feature is one of the most significant features of face.
Facial features are eyebrows, eyes, mouth, nose, nose tip, cheek, etc. The property is used
to extract the eyes and mouth which, two eyes and mouth generate isosceles triangle, and
distance between eye to eye and mid point of eyes distance to mouth is equal [2]. Laplacian
of Gaussian (LoG) filter and some other filtering operations are perfomed to extract facial
feature of face candidate.
5. Methodology for implementation (Formulation/Algorithm)
Note that many algorithms, mostly current complex algorithms, may fall into more than
one of these categories. The most relevant face recognition algorithms will be discussed
later under this classification.
Face recognition systems are part of facial image processing applications and their
significance as a research area are increasing recently. Implementations of system are crime
prevention, video surveillance, person verification, and similar security activities. The face
recognition system implementation will be part of humanoid robot project at Atılım
University.
The goal is reached by face detection and recognition methods. Knowledge-Based face
detection methods are used to find, locate and extract faces in acquired images. Implemented
methods are skin color and facial features. Neural network is used for face recognition. RGB
color space is used to specify skin color values, and segmentation decreases searching time
of face images. Facial components on face candidates are appeared with implementation of
LoG filter. LoG filter shows good performance on extracting facial compoments under
different illumination conditions.
FFNN is performed to classifiy to solve pattern recongition problem since face recognition
is a kind of pattern recognition. Classification result is accurate. Classification is also
flexible and correct when extracted face image is small oriented, closed eye, and small
smiled.
Proposed algorithm is capable of detect multiple faces, and performance of system has
acceptable good results.
Appendix
Source Code
import numpy as np
import cv2,os from
PIL import Image
import pickle
import sqlite3
recognizer = cv2.createLBPHFaceRecognizer()
recognizer.load("recognizer\\trainingData.yml")
cascadePath = 'haarcascade_frontalface_default.xml'
faceCascade = cv2.CascadeClassifier(cascadePath) path =
'dataSet'
def getProfile(id):
conn =sqlite3.connect("FaceBase.db")
cmd = "SELECT * FROM People WHERE ID="+str(id)
cursor =
conn.execute(cmd)
profile=None for row in
cursor: profile=row
conn.close() return profile
cv2.imshow('im',img2)
if(cv2.waitKey(1) == ord('q')):
break
cam.release()
cv2.destroyAllWindows()
import numpy as np
import sqlite3
import cv2
detector=
cv2.CascadeClassifi
er('haarcascade_fro
ntalface_default.xml
') cap =
cv2.VideoCapture(0)
cursor=conn.execute(cmd)
isRecordExist = 0 for row
in cursor:
isRecordExist = 1
if(isRecordExist == 1):
cmd="UPDATE people SET Name="+str(Name)+" WHERE ID="+str(Id)
else:
cmd="INSERT INTO people(ID,Name)
Values("+str(Id)+","+str(Name)+")" conn.execute(cmd) conn.commit()
conn.close()
import numpy as np
import cv2
detector= cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
cap = cv2.VideoCapture(0)
while(True):
ret, img = cap.read()
gray = cv2.cvtColor(img,
cv2.COLOR_BGR2GRAY) faces =
detector.detectMultiScale(gray, 1.3, 5) for (x,y,w,h)
in faces:
cv2.rectangle(img,(x,y),(x+w,y+h),(10,0,130),2)
img2 = cv2.flip(img, 1) cv2.imshow("Original",
img2) if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
6.4 Code for Training our algorithm
import os import
cv2 import numpy
as np
from PIL import Image
recognizer = cv2.createLBPHFaceRecognizer()
path = 'dataSet'
def getImagesWithID(path):
imagePaths = [os.path.join(path,f) for f in
os.listdir(path)] faces = [] IDs = [] for imagePath in
imagePaths:
faceImg = Image.open(imagePath).convert('L')
faceNp = np.array(faceImg,'uint8')
ID = int(os.path.split(imagePath)[-
1].split('.')[1]) faces.append(faceNp)
IDs.append(ID)
cv2.imshow("training",faceNp)
cv2.waitKey(10) return np.array(IDs),
faces Ids, faces = getImagesWithID(path)
recognizer.train(faces,np.array(Ids))
recognizer.save('recognizer/trainingData.yml'
) cv2.destroyAllWindows()
REFERENCES
1. L. Zhi-fang, Y. Zhi-sheng, A.K.Jain and W. Yun-qiong, 2003, “Face Detection And Facial
Feature Extraction In Color Image”, Proc. The Fifth International Conference on
Computational Intelligence and Multimedia Applications (ICCIMA’03), pp.126-130,
Xi’an, China. 2. C. Lin, 2005, “Face Detection By Color And Multilayer Feedforward
Neural Network”, Proc.
2005 IEEE International Conference on Information Acquisition, pp.518-523, Hong Kong
and
Macau, China.
3. S. Kherchaoui and A. Houacine, 2010, “Face Detection Based On A Model Of The Skin
Color With Constraints And Template Matching”, Proc. 2010 International Conference on
Machine and Web Intelligence, pp. 469 - 472, Algiers, Algeria.