FRAS Final Report CSE 299
FRAS Final Report CSE 299
FRAS Final Report CSE 299
ATTENDANCE SYSTEM
A System For Everyone
Page 1 of 54
Face Recognition Attendance System
Table of Contents
Abstract ................................................................................................................................................... 4
Introduction .......................................................................................................................................... 5
1.1.Introduction ............................................................................................................................ 6
1.2.Background ................................................................................................................................. 6
1.3.Problem Statement ................................................................................................................ 8
1.4.Aims and Objectives ........................................................................................................... 9
1.5.Flow Chart ............................................................................................................................... 10
1.6.Scope of the project ....................................................................................................... 11
Literature Review ............................................................................................................................ 12
2.1.Student Attendance System ........................................................................................... 13
2.2.Digital Image Processing ............................................................................................. 13
2.3.Image Representation in a Digital Computer .................................................. 14
2.4.Steps in Digital Image Processing ........................................................................ 14
2.5.Definition of Terms and History ............................................................................. 15
Model Implementation & analysis .......................................................................................... 23
3.1.Introduction .......................................................................................................................... 24
3.2.Model Implementation ....................................................................................................... 25
3.3.Design Requirements ......................................................................................................... 26
3.3.1.Software Implementation ....................................................................................... 26
3.3.2.Hardware Implementation ....................................................................................... 27
Specification: The Raspberry Pi 3 Model B+ is the final revision in
the Raspberry Pi 3 range. ..................................................................................................... 28
3.4.Experimental Results ....................................................................................................... 31
Code Implementation ....................................................................................................................... 35
4.1.Code Implementation ......................................................................................................... 36
4.1.1.main.py ............................................................................................................................. 36
4.1.2.Dataset.py ...................................................................................................................... 39
4.1.3.AutoMail.py .................................................................................................................... 40
4.2.Summary ........................................................................................................................................... 43
Working Plan ........................................................................................................................................ 44
Page 2 of 54
Face Recognition Attendance System
5.1.Introduction .......................................................................................................................... 45
5.2.Work Breakdown Structure ............................................................................................. 45
5.3.Gantt Chart............................................................................................................................. 47
5.4.Financial Plan ..................................................................................................................... 47
5.5.Feasibility Study .............................................................................................................. 47
5.6.Summary ...................................................................................................................................... 50
Future Work .......................................................................................................................................... 51
6.1.Introduction .......................................................................................................................... 52
6.2.Future Scope of Work ....................................................................................................... 52
6.3.Summary ...................................................................................................................................... 52
Result ...................................................................................................................................................... 53
7.1.Introduction .......................................................................................................................... 54
7.2.Summary ...................................................................................................................................... 54
Page 3 of 54
Face Recognition Attendance System
Abstract
Page 4 of 54
Face Recognition Attendance System
Chapter 1
Introduction
Page 5 of 54
Face Recognition Attendance System
1.1.Introduction
1.2.Background
Page 6 of 54
Face Recognition Attendance System
Page 7 of 54
Face Recognition Attendance System
1.3.Problem Statement
Page 8 of 54
Face Recognition Attendance System
Page 9 of 54
Face Recognition Attendance System
1.5.Flow Chart
Page 10 of 54
Face Recognition Attendance System
Page 11 of 54
Face Recognition Attendance System
Chapter 2
Literature Review
Page 12 of 54
Face Recognition Attendance System
1
Arun Katara et al., 2017
2
Anil K Jain, Lin Hong, Sharath Pankanti, and Ruud Bolle, Biometric Identification. IEEE, 2004
Page 13 of 54
Face Recognition Attendance System
3
N. Tom, Face Detection, Near Infinity - Podcasts, 2007
4
T. Kanade, Computer recognition of human faces. Basel [etc.]: Birkhäuser, 1977
Page 14 of 54
Face Recognition Attendance System
Face Detection
Face detection is the process of identifying and locating all
the present faces in a single image or video regardless of their
position, scale, orientation, age and expression. Furthermore,
the detection should be irrespective of extraneous illumination
conditions and the image and video content[5].
Face Recognition
Face Recognition is a visual pattern recognition problem, where
the face, represented as a three dimensional object that is
subject to varying illumination, pose and other factors, needs
to be identified based on acquired images[6].
Face Recognition is therefore simply the task of identifying an
already detected face as a known or unknown face and in more
advanced cases telling exactly whose face it is[7].
5
A. L. Rekha and H. K. Chethan, “Automated Attendance System using face Recognition through Video
Surveillance,” Int. J. Technol. Res. Eng., vol. 1, no. 11, pp. 1327–1330, 2014.
6
I. Kim, J. H. Shim, and J. Yang, “Face detection,” Face Detect. Proj. EE368 Stanf. Univ., vol. 28, 2003.
7
E. Shervin, “OpenCV Computer Vision,” 03-Oct-2010
Page 15 of 54
Face Recognition Attendance System
Face Detection
Advantages Disadvantages
Method
1. Long Training Time.
1. High detection
Viola Jones 2.Limited Head Pose.
Speed.
Algorithm 3.Not able to detect dark
2. High Accuracy.
faces.
1.Simple 1.Only used for binary and
Local Binary computation. grey images. 2.Overall
Pattern 2.High tolerance performance is inaccurate
Histogram against the compared to Viola-Jones
monotonic Algorithm.
8
T. Matthew and A. Pentland, Eigenfaces for Recognition, vol. 3, Volume 3, Number 1 vols. Vision and Modelling
Group, The Media Laboratory, MIT: Journal of Cognitive Neuroscience, 1991
9
Y.-Q. Wang, “An Analysis of the Viola-Jones Face Detection Algorithm,” Image Process. Line, vol. 4, pp. 128–148,
Jun. 2014
Page 16 of 54
Face Recognition Attendance System
Face Detection
Advantages Disadvantages
Method
illumination
changes.
10
Varsha Gupta and Dipesh Sharma, 2014
Page 17 of 54
Face Recognition Attendance System
11
Srushti Girhe et al., 2015
Page 18 of 54
Face Recognition Attendance System
Page 19 of 54
Face Recognition Attendance System
Page 20 of 54
Face Recognition Attendance System
Page 21 of 54
Face Recognition Attendance System
Page 22 of 54
Face Recognition Attendance System
Chapter 3
Model Implementation
& analysis
Page 23 of 54
Face Recognition Attendance System
3.1.Introduction
Page 24 of 54
Face Recognition Attendance System
3.2.Model Implementation
Page 25 of 54
Face Recognition Attendance System
3.3.Design Requirements
We used some tools to build the HFR system. Without the help of
these tools it would not be possible to make it done. Here we
will discuss about the most important one.
3.3.1.Software Implementation
1. OpenCV: We used OpenCV 3 dependency for python 3. OpenCV is
library where there are lots of image processing functions
are available. This is very useful library for image
processing. Even one can get expected outcome without writing
a single code. The library is cross-platform and free for
use under the open-source BSD license. Example of some
supported functions are given bellow:
• Derivation: Gradient / laplacian computing, contours
delimitation
• Hough transforms: lines, segments, circles, and
geometrical shapes detection
• Histograms: computing, equalization, and object
localization with back projection algorithm
• Segmentation: thresholding, distance transform, foreground
/ background detection, watershed segmentation
• Filtering: linear and nonlinear filters, morphological
operations
• Cascade detectors: detection of face, eye, car plates
• Interest points: detection and matching
• Video processing: optical flow, background subtraction,
camshaft (object tracking)
• Photography: panoramas realization, high definition
imaging (HDR), image inpainting
Page 26 of 54
Face Recognition Attendance System
3.3.2.Hardware Implementation
1.Raspberry Pi 3:
Page 27 of 54
Face Recognition Attendance System
Page 28 of 54
Face Recognition Attendance System
2.Webcam:
ELP HD 8Megapixel USB CMOS board camera module adopt Sensor Sony
(1/3.2”) IMX179 is nice to use in Linux equipment, or those
equipment which come with windows, linux, Android system etc.
Fig: Webcam
Specification:
• UVC usb camera, Support windows, linux, Mac with UVC, also
for android system.
Page 29 of 54
Face Recognition Attendance System
3.Power Source:
4.Project Machine:
Page 30 of 54
Face Recognition Attendance System
3.4.Experimental Results
Face Detection:
Begin:
End
Page 31 of 54
Face Recognition Attendance System
Face Recognition:
Begin:
End
Page 32 of 54
Face Recognition Attendance System
Page 33 of 54
Face Recognition Attendance System
Page 34 of 54
Face Recognition Attendance System
Chapter 4
Code Implementation
Page 35 of 54
Face Recognition Attendance System
4.1.Code Implementation
All our code is written in Python language. First here is our
project directory structure and files.
1. HFRAS
2. |__ Dataset
3. |__ main.py
4. |__ dataset.py
5. |__ database.log
6. |__ data_set.csv
7. |__ data_log.ods
4.1.1.main.py
All the work will be done here, Detect the face ,recognize the
faces and take attendance.
1. import cv2
2. import numpy as np
3. import os
4. from picamera.array import PiRGBArray
5. from picamera import PiCamera
6. import time
7. import sys
8. import logging as log
9. import datetime as dt
10. from time import sleep
11.
12. cx = 160
13. cy = 120
14.
15. # names related to ids: example
Page 36 of 54
Face Recognition Attendance System
Page 37 of 54
Face Recognition Attendance System
Page 38 of 54
Face Recognition Attendance System
4.1.2.Dataset.py
Dataset Implementation code are given below which is also in
python code.
1. import cv2
2. from picamera.array import PiRGBArray
3. from picamera import PiCamera
4. import time
5. import os
6. import numpy
7. import io
8. #Create a memory stream so photos doesn't need to be saved
in a file
9. stream = io.BytesIO()
10. cam = cv2.VideoCapture(0)
11. detector=cv2.CascadeClassifier('haarcascade_frontalface_de
fault.xml')
12.
13. #Convert the picture into a numpy array
14. buff = numpy.fromstring(stream.getvalue(),
dtype=numpy.uint8)
15.
16. Id=raw_input('enter your id')
17. sampleNum=0
18. while(True):
19. ret, img = cam.read() #cam output
20. cv2.imshow('frame',img) #screen output
21. gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
#convert black and white
22. faces = detector.detectMultiScale(gray, 1.3, 5)
#detect face
23. for (x,y,w,h) in faces:
24. cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
#framing
25. cv2.imwrite("Dataset/"+Id +'_'+ str(sampleNum) +
".jpg", gray[y:y+h,x:x+w]) #saving data in id
26. #incrementing sample number
27. sampleNum=sampleNum+1
28. #saving the captured face in the dataset folder
29.
30. cv2.imshow('frame',img)
31. #wait for 100 miliseconds
32. if cv2.waitKey(100) & 0xFF == ord('q'):
33. break
Page 39 of 54
Face Recognition Attendance System
Extra Feature :
4.1.3.AutoMail.py
In this project we add an extra feature called auto mail. It can
automatically sent the attendance file to specific mail. Auto
mail code given below:
1. import yagmail
2. receiver = "[email protected]" # receiver email address
3.
4. body = "Attendence File" # email body
5.
6. filename = "Attendance\data_log.csv" # attach the file
7. # mail information
8.
9. yag = yagmail.SMTP("[email protected]", "mypassword")
10.
11. # sent the mail
12.
13. yag.send(
14.
15. to=receiver,
16.
17. subject="Attendance Report", # email subject
18.
19. contents=body, # email body
20.
21. attachments=filename, # file attached
22.
Page 40 of 54
Face Recognition Attendance System
23. )
Sample Images:
Page 41 of 54
Face Recognition Attendance System
Page 42 of 54
Face Recognition Attendance System
4.2.Summary
In this long yet useful chapter we managed to cover the entire
structure of how the system has been developed and how it
functions to give the best outcome.
Page 43 of 54
Face Recognition Attendance System
Chapter 5
Working Plan
Page 44 of 54
Face Recognition Attendance System
5.1.Introduction
Page 45 of 54
Face Recognition Attendance System
Page 46 of 54
Face Recognition Attendance System
5.3.Gantt Chart
5.4.Financial Plan
5.5.Feasibility Study
Page 47 of 54
Face Recognition Attendance System
Technical feasibility
A study of available resource that may affect the ability to
achieve an acceptable system. This evaluation determines whether
the technology needed for the proposed system is available or not.
• Can the work for the project be done with current equipment
existing software technology & available personal?
• Can the system be upgraded if developed?
Page 48 of 54
Face Recognition Attendance System
Economic feasibility
Economic justification is generally the “Bottom Line”
consideration for most systems. Economic justification includes a
broad range of concerns that includes cost benefit analysis. In
this we weight the cost and the benefits associated with the
candidate system and if it suits the basic purpose of the
organization i.e. profit making, the project is making to the
analysis and design phase.
Operational Feasibility
It is mainly related to human organizations and political aspects.
The points to be considered are:
• What changes will be brought with the system?
• What organization structures are disturbed?
• What new skills will be required?
Page 49 of 54
Face Recognition Attendance System
Schedule feasibility
Time evaluation is the most important consideration in the
development of project. The time schedule required for the
developed of this project is very important since more development
time effect machine time, cost and cause delay in the development
of other systems.
5.6.Summary
To conclude, we discussed the scheduling processes of developing
this system. Additionally we have also identified how feasible
the system is through the lens of evaluating using various
feasibility studies
Page 50 of 54
Face Recognition Attendance System
Chapter 6
Future Work
Page 51 of 54
Face Recognition Attendance System
6.1.Introduction
6.3.Summary
Page 52 of 54
Face Recognition Attendance System
Chapter 7
Result
Page 53 of 54
Face Recognition Attendance System
7.1.Introduction
This chapter of the report contains the results that we achieved
throughout the course of using this system.
Results Achieved
7.2.Summary
This chapter has covered the different types of results that we
have managed to obtain throughout the course of using this
system.
Page 54 of 54