0% found this document useful (0 votes)
33 views21 pages

Project Report 7th Semester

Uploaded by

RIET COLLEGE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views21 pages

Project Report 7th Semester

Uploaded by

RIET COLLEGE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

STUDENT ATTENDANCE SYSTEM

BASED ON THE FACE RECOGNITION


OF WEBCAM’S IMAGE OF THE
CLASSROOM.
By

LAXMAN SONI
VIKAS KUMAR
KANWARPAL SINGH

UNDER THE GUIDANCE OF


SHIVAM MALIK

PROJECT REPORT SUBMITTED IN PARTIAL FULFILLMENT OF


THE REQUIREMENTS FOR THE DEGREE OF

BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE AND


ENGINEERING

RAJASTHAN INSTITUTE OF ENGINEERING AND TECHNOLOGY

Session 2022-2023

1
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

RAJASTHAN INSTITUTE OF ENGINEERING AND TECHNOLOGY


[Affiliated to Rajasthan Technical University , Kota]

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


RAJASTHAN INSTITUTE OF ENGINEERING AND TECHNOLOGY, JAIPUR

TO WHOM IT MAY CONCERN

I hereby recommend that the Project entitled Student Attendance


System based on the Face Recognition of Webcam’s Image of the
Classroom prepared under my supervision by

1. Vikash Kumar (20ERECS077 OF 2020-2024,CSE)


2. Laxman Soni (20EREAD008 OF 2020-2024,AI&DS)
3. Kanwarpal Singh (20EREAD005 OF 2020-2024,AI&DS)

of B.Tech (7th Semester), may be accepted in partial fulfillment for the


degree of Bachelor of Technology in Computer Science & Engineering under
Rajasthan Technical University , Kota (RTU).
.

…………………………………………

Department of Computer Science and Engineering


Rajasthan Institute of Engineering and Technology

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

The foregoing Project is hereby accepted as a credible study of an engineering


subject carried out and presented in a manner satisfactory to warrant its acceptance as
a prerequisite to the degree for which it has been submitted. It is understood that by
this approval the undersigned do not necessarily endorse or approve any statement
made, opinion expressed or conclusion drawn therein, but approve the project only for
the purpose for which it is submitted.

FINAL EXAMINATION FOR


EVALUATION OF PROJECT 1. —————————————
2. ———————————

(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……………………………………………………….

Appendix-: Program Source code with adequate comments.

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.

2. Feature-based approach:- In feature-based approaches or local feature that is the


features on face such as nose, and then eyes are segmented and then used as input
data for structural classifier. Pure geometry, dynamic link architecture, and hidden
Markov model methods belong to this category. One of the most successful of these
systems is the Elastic Bunch Graph Matching (EBGM) system [40],[41], which is
based on DLA.

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.

3. Objective of the Project

8. To implement Student attendance system based on the face recognition of webcam’s


image in the classroom.
4. System Design

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

4.1. Input Part


Input part is prerequisite for face recognition system. Image acquisition operation is
performed in this part. Live captured images are converted to digital data for performing
image-processing computations. These captured images are sent to face detection
algorithm.

4.2. Face Detection Part


Face detection performs locating and extracting face image operations for face recognition
system. Face detection part algorithm is given in Figure given below. Our experiments
reveal that skin segmentation, as a first step for face detection, reduces computational time
for searching whole image. While segmentation is applied, only segmented region is
searched weather the segment includes any face or not.
For this reason, skin segmentation is applied as a first step of detection part. RGB color
space is used to describe skin like color [4]. White balance of images differs due to change
in lighting conditions of the environment while acquiring image. This situation creates non-
skin objects that belong to skin objects.

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)

A similar separation of pattern recognition algorithms into four groups is proposed by


Jain and colleges. We can grop face recognition methods into three main groups. The
following approaches are proposed: ˆ

Template matching:- Patterns are represented by samples, models, pixels, curves,


textures. The recognition function is usually a correlation or distance measure. ˆ

Statistical approach:- Patterns are represented as features. The recognition function is a


discriminant function. ˆ
Neural networks. The representation may vary. There is a network function in some
point.

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.

6. Sample inputs and outputs

Sample images taken by our Detector Program


Sample Output
7.
7. CONCLUSION

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

6.1 Code for face detection

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

cam = cv2.VideoCapture(0) font =


cv2.cv.InitFont(cv2.cv.CV_FONT_HERSHEY_SIMPLEX, 1, 1, 0, 1, 1) #create a font
while True:
ret, img = cam.read()
img2 = cv2.flip(img, 1)
gray = cv2.cvtColor(img2,cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(gray,
scaleFactor=1.2,minNeighbors=5,minSize=(100,
100),flags=cv2.CASCADE_SCALE_IMAGE)
for(x,y,w,h) in faces:
id, conf = recognizer.predict(gray[y:y+h,x:x+w])
cv2.rectangle(img2,(x,y), (x+w,y+h), (255,0,0),2)
profile=getProfile(id)
if(profile!=None):
cv2.cv.PutText(cv2.cv.fromarray(img2),"ID "+str(profile[0]),(x,y+h+30),font,200)
cv2.cv.PutText(cv2.cv.fromarray(img2),"Name "+str(profile[1]),(x,y+h+60),font,200)
# Draw the Text
cv2.cv.PutText(cv2.cv.fromarray(img2),"Age "+str(profile[2]),(x,y+h+90),font,255)
cv2.cv.PutText(cv2.cv.fromarray(img2),"Gender
"+str(profile[3]),(x,y+h+120),font,255)
else:
cv2.cv.PutText(cv2.cv.fromarray(img2),"ID Unknown",(x,y+h+30),font,200)
cv2.cv.PutText(cv2.cv.fromarray(img2),"Name Unknown",(x,y+h+60),font,200)
cv2.cv.PutText(cv2.cv.fromarray(img2),"Age Unknown",(x,y+h+90),font,200)
cv2.cv.PutText(cv2.cv.fromarray(img2),"Gender Unknown",(x,y+h+120),font,200)

cv2.imshow('im',img2)
if(cv2.waitKey(1) == ord('q')):
break
cam.release()
cv2.destroyAllWindows()

6.2 Code for dataSet creator

import numpy as np
import sqlite3
import cv2
detector=
cv2.CascadeClassifi
er('haarcascade_fro
ntalface_default.xml
') cap =
cv2.VideoCapture(0)

def insertOrUpdate(Id,Name): conn =


sqlite3.connect("FaceBase.db") cmd = "SELECT *
FROM people WHERE ID="+str(Id)

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()

Id=raw_input('Enter user id') name


= raw_input('Enter user name')
insertOrUpdate(Id,name)
sampleNumber=0 while(True):
ret, img = cap.read()
img2 = cv2.flip(img, 1)
gray = cv2.cvtColor(img2,
cv2.COLOR_BGR2GRAY) faces =
detector.detectMultiScale(gray, 1.3, 5) for (x,y,w,h) in
faces:
cv2.rectangle(img2,(x,y),(x+w,y+h),(10,0,130),2)
sampleNumber=sampleNumber+1
cv2.imwrite("dataSet/User."+Id+"."+str(sampleNumber)+".jpg",gray[y:y+h,x:x+w])
cv2.imshow('frame',img2)

if cv2.waitKey(300) & 0xFF ==


ord('q'): break elif sampleNumber
> 20:
break
cap.release()
cv2.destroyAllWindows()

6.3 Code for FACE DETECTION

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.

4. Design of a Face Recognition System (PDF Download Available). Available from:


https://www.researchgate.net/publication/262875649_Design_of_a_Face_Recognition_Syste
m.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy