Академический Документы
Профессиональный Документы
Культура Документы
Suez University
Abstract ………………………………………………………………………………..3
INTRODUCTION ........................................................................................................... 6
Development ............................................................................................................. 24
3.2 Coding:.............................................................................................................. 31
Design ……………………………………………………………….………………..49
5.1 Conclusion:....................................................................................................... 69
1|Page
5.2 Future work: .................................................................................................... 70
Appendixes……………………………………………………………………………72
Acknowledgement ................................................................................................. 3
References…………… ............................................................................................. 75
2|Page
Acknowledgement
3|Page
Team Members
4|Page
Abstract
5|Page
CHAPTER 1
INTRODUCTION
6|Pa ge
CHAPTER 1: Introduction
1.1 Introduction
The main objective of this project is to develop face recognition based,
automated student attendance system.
In order to achieve better performance, the test images and training
images of the proposed approach are limited to frontal and upright
facial images that consists of a single face only. The test images and
training images must be captured by using the same device to ensure
no quality difference. In addition, the students have to register in the
database to be recognized.
The enrolment can be done on the spot through the user-friendly
interface.
7|P age
CHAPTER 1: Introduction
• To record the attendance of the identified student.
8|Page
CHAPTER 1: Introduction
In order to overcome human limitations, computers with almost
limitless memory, high processing speed and power are used in face
recognition systems. The human face is a unique representation of
individual identity. “Thus, face recognition is defined as a biometric
method in which identification of an individual is performed by
comparing real-time capture image with stored images in the
database of that person” (Margaret Rouse, 2012) Nowadays, face
recognition system is prevalent due to its simplicity and awesome
performance. For instance, airport protection systems and FBI use
face recognition for criminal investigations by tracking suspects,
missing children and drug activities (Robert Silk, 2017). Apart from
that, Facebook which is a popular social networking website
implement face recognition to allow the users to tag their friends in
the photo for entertainment purposes (Sidney Fussell, 2018).
Furthermore, Intel Company allows the users to use face recognition
to get access to their online account (Reichert, C., 2017). Apple allows
the users to unlock their mobile phone, iPhone X by using face
recognition (deAgonia, M., 2017).
The work on face recognition began in 1960. Woody Bledsoe, Helen
Chan Wolf and Charles Bisson had introduced a system which required
the administrator to locate eyes, ears, nose and mouth from images.
The distance and ratios between the located features and the
common reference points are then calculated and compared. The
studies are further enhanced by Goldstein, Harmon, and Lesk in 1970
by using other features such as hair color and lip thickness to
automate the recognition. In 1988, Kirby and Sirovich first suggested
principle component analysis (PCA) to solve face recognition problem.
Many studies on face
9|Pa ge
CHAPTER 1: Introduction
recognition were then conducted continuously until today (Ashley
DuVal, 2012)
10 | P a g e
CHAPTER 1: Introduction
The paper proposed by Zhao, W et al. (2003) has listed the
difficulties of facial identification. One of the difficulties of
facial identification is the identification between known and
unknown images. In addition, paper proposed by Pooja G.R et
al. (2010) found out that the training process for face
recognition student attendance system is slow and time-
consuming. In addition, the paper proposed by Priyanka Wagh
et al. (2015) mentioned that different lighting and head poses
are often the problems that could degrade the performance
of face recognition-based student attendance system. Hence,
there is a need to develop a real time operating student
attendance system which means the identification process
must be done within defined time constraints to prevent
omission. The extracted features from facial images which
represent the identity of the students have to be consistent
towards a change in background, illumination, pose and
expression. High accuracy and fast computation time will be
the evaluation points of the performance.
11 | P a g e
CHAPTER 1: Introduction
12 | P a g e
CHAPTER 2
System Analysis
13 | P a g e
CHAPTER 2: System Analysis
14 | P a g e
CHAPTER 2: System Analysis
15 | P a g e
CHAPTER 2: System Analysis
16 | P a g e
CHAPTER 2: System Analysis
17 | P a g e
CHAPTER 2: System Analysis
Activity Diagram:
Activity diagrams are graphical representations of
workflows of stepwise activities and actions with support
for choice, iteration and concurrency. In the Unified
Modelling Language, activity diagrams are intended to
model both computational and organizational processes.
18 | P a g e
CHAPTER 2: System Analysis
19 | P a g e
CHAPTER 2: System Analysis
State Diagram:
A state diagram is a type of diagram used to describe the
behavior of systems. They require that the system
described is composed of a finite number of states;
sometimes, this is indeed the case, while at other times
this is a reasonable abstraction.
20 | P a g e
CHAPTER 2: System Analysis
Figure 8 ERD
21 | P a g e
CHAPTER 2: System Analysis
2.4 Requirements
Requirement is very important part of developing any system.
There are two types of requirement on software
development. One is functional requirement, and another is
non-functional requirement.
Functional requirements are kind of requirements which is
focus on those activity which can easily perform by the system.
Non-functional requirements are something that can make
system efficient.
22 | P a g e
CHAPTER 2: System Analysis
2.1.1 Security
The computer that runs the program will have its own
security. Only the System Admin will log in to the system
and view the users. Only a faculty professor or teaching
assistant will login to the system with his/her username
and password. The person whose face recognized will
access to view the system functions.
2.1.2 Maintainability
As a tool to obtain the ease of maintainability UML
Diagrams were used in the development process as
guides.
2.1.3 Portability
To ensure portability, the application is developed in
python framework and implemented as web application.
23 | P a g e
CHAPTER 3
Development
24 | P a g e
CHAPTER 3: Development
25 | P a g e
CHAPTER 3: Development
26 | P a g e
CHAPTER 3: Development
image has to fulfill several criteria or has to pass through the
several Haar features.
27 | P a g e
CHAPTER 3: Development
Let A, B, C D be the values of the integral image at the corners of a
rectangle. The sum of original image values within the rectangle
can be computed:
𝑆𝑢𝑚 = 𝐴 − 𝐵 − 𝐶 + D
Only three additions are required for any size of rectangle. This
face detection approach minimizes computation time while
achieving high detection accuracy. It is now used in many
systems.
28 | P a g e
CHAPTER 3: Development
3.1.5 Numpy:
NumPy is the fundamental package for scientific computing
with Python. It contains among other things:
• A powerful N-dimensional array object
• Sophisticated (broadcasting) functions
• Tools for integrating C/C++ and Fortran code
Besides its obvious scientific uses, NumPy can also be used as an
efficient multi-dimensional container of generic data. Arbitrary
datatypes can be defined. This allows NumPy to seamlessly and
speedily integrate with a wide variety of databases.
29 | P a g e
CHAPTER 3: Development
art, to mines inspection, stitching maps on the web or
through advanced robotics.
30 | P a g e
CHAPTER 3: Development
3.2 Coding
3.2.1 Face Recognition Model:
Capture frames from web cam and store them in cap variable
cap = cv2.VideoCapture(0)
31 | P a g e
CHAPTER 3: Development
# frame start clone end clone color stroke
cv2.rectangle(frame, (x, y), (x + w, y + w), (0, 0, 255), 2)
roi_gray = gray[y:y + h, x:x + w]
roi_color = frame[y:y + h, x:x + w]
eyes = eye_cascade.detectMultiScale(roi_gray)
id_, conf = reconizer.predict(roi_gray)
32 | P a g e
CHAPTER 3: Development
import os
import cv2
import numpy as np
from PIL import Image
import pickle
BASE_DIR=os.path.dirname(os.path.abspath(__file__))
image_dir=os.path.join(BASE_DIR , "hema")
face_cascade=cv2.CascadeClassifier('/usr/share/opencv/haarcascades/haarcasc
ade_frontalface_alt.xml')
reconizer=cv2.face.createLBPHFaceRecognizer()
y_label=[]
x_train=[]
current_id=0
label_ids={}
for root , dirs ,files in os.walk(image_dir):
for file in files:
if file.endswith('png') or file.endswith('jpg'):
path=os.path.join(root,file)
#root
label=os.path.basename(os.path.dirname(path)).replace(' ','-').lower()
pil_image=Image.open(path).convert('L') #convert to gray scall
size=(600,600)
final_image=pil_image.resize(size,Image.ANTIALIAS)
image_item = 'hem.png'
image_array=np.array(final_image,'uint8')
#print(image_array)
if label not in label_ids:
label_ids[label]=current_id
current_id+=1
id_=label_ids[label]
33 | P a g e
CHAPTER 3: Development
#print(label_ids)
faces = face_cascade.detectMultiScale(image_array, scaleFactor=1.5,
minNeighbors=5, minSize=(8, 8))
for (x,y,w,h) in faces:
roi=image_array[y:y+h,x:x+w]
cv2.imwrite(image_item, roi)
x_train.append(roi)
y_label.append(id_)
#print(label,path)
#x_label.append(label)
#y_train.append(path)
with open('labels.pickle','wb') as f:
pickle.dump(label_ids,f)
reconizer.train(x_train,np.array(y_label))
reconizer.save('trainner.yml')
print('recognizer is trained ')
34 | P a g e
CHAPTER 3: Development
for row in result:
d.append(row)
mydb.commit()
return render_template('admindashboard.html',data=d)
return render_template('admindashboard.html',data=d)
35 | P a g e
CHAPTER 3: Development
result = mycursor.fetchall()
#msg=Message('{0},{1}'.format(doctor,passwd),sender='ibrahimeelqad@gma
il.com' , recipients=['{0}'.format(email)])
36 | P a g e
CHAPTER 3: Development
#mail.send(Message('{0},{1}'.format(doctor,passwd),sender='ibrahimeelqad
@gmail.com' , recipients=['{0}'.format(email)]))
mycursor.execute('insert into doctors (doctor_id , doctor_name ,
doctor_gmail , passwd) values("{0}","{1}","{2}","{3}");'.format(id, doctor,
email, passwd))
mydb.commit()
return render_template('add_d.html',m=m)
i=up_doc[0]
doc_id=i[0]
name=i[1]
email=i[2]
passwd=i[3]
37 | P a g e
CHAPTER 3: Development
result = mycursor.fetchall()
mydb.commit()
for row in result:
up_doc.append(row)
38 | P a g e
CHAPTER 3: Development
print(up_doc)
i=up_doc[0]
cour_code=i[0]
cour_name=i[1]
hour=i[2]
teach=i[3]
return render_template('updatecourse.html',
code=cour_code,name=cour_name , hour =hour ,teach=teach)
39 | P a g e
CHAPTER 3: Development
mycursor.execute('select stu_id , stu_name ,
stu_email ,father_email,departments_department_id , level_lev_id from
students where stu_id ="{0}";'.format(id))
result = mycursor.fetchall()
mydb.commit()
for row in result:
up_doc.append(row)
print(up_doc)
i=up_doc[0]
id=i[0]
name=i[1]
stu_gmail=i[2]
fath_gmail=i[3]
depart=i[4]
level=i[5]
40 | P a g e
CHAPTER 3: Development
mycursor.execute('update students set stu_name ="{0}" ,
stu_email="{1}" ,father_email="{2}" , departments_department_id ="{3}" ,
level_lev_id ="{4}" WHERE
stu_id="{5}";'.format(name ,stu_gmail ,fath_gmail , depart ,level , id))
mydb.commit()
return stu()
return render_template('addstudent.html',m=m)
@app.route('/cour/add_cour1',methods=["POST" ,"GET"])
41 | P a g e
CHAPTER 3: Development
mycursor.execute('insert into courses (course_code , course_name,
course_hour , doctors_doctor_id)values("{0}" , "{1}" ,
"{2}" ,"{3}" );'.format(code ,name ,hour ,teach))
mydb.commit()
return render_template('addcourse.html', success='success')
42 | P a g e
CHAPTER 3: Development
Delete specific student
@app.route('/stu/del_stu' , methods=['POST'])
def del_stu():
id = request.form.get("id")
print(id)
mycursor.execute('delete from courses_has_students where students_stu_id
="{0}";'.format(id))
mydb.commit()
mycursor.execute('delete from students where stu_id="{0}";'.format(id))
mydb.commit()
return stu()
43 | P a g e
CHAPTER 3: Development
students.stu_id=courses_has_students.students_stu_id and
courses.course_code=courses_has_students.courses_course_code where
courses.course_code="{0}" ;'.format(code))
result = mycursor.fetchall()
result = mycursor.fetchall()
mydb.commit()
print(result)
d = d[0]
d = d[0]
d=d+1
print(d)
44 | P a g e
CHAPTER 3: Development
mycursor.execute('update courses_has_students set
count_att="{0}",att_date ="{1}" where students_stu_id ="{2}" and
courses_course_code ="{3}";'.format(d, date, syudent_id, course_code))
mydb.commit()
face_cascade =
cv2.CascadeClassifier('/usr/share/opencv/haarcascades/haarcascade_frontalfac
e_alt.xml')
eye_cascade =
cv2.CascadeClassifier('/usr/share/opencv/haarcascades/haarcascade_eye_tree_
eyeglasses.xml')
reconizer = cv2.face.createLBPHFaceRecognizer()
reconizer.load('trainner.yml')
labels = {'person name': 1}
with open('labels.pickle', 'rb') as f:
og_labels = pickle.load(f)
labels = {v: k for k, v in og_labels.items()}
sample = []
45 | P a g e
CHAPTER 3: Development
for i in range(len(labels)):
sample.append(labels[i])
names = []
count = 0
while True:
ret, frame = cap.read()
if ret == False:
continue
# print(conf)
# conf for percentage
for (ex, ey, ew, eh) in eyes:
cv2.rectangle(roi_color, (ex, ey), (ex + ew, ey + eh), (0, 255, 0), 2)
46 | P a g e
CHAPTER 3: Development
names.append(labels[id_])
count = 0
else:
print(labels[id_], 'is regestered', conf)
font = cv2.FONT_HERSHEY_SIMPLEX
name = labels[id_]
color = (0, 255, 255)
stroke = 2
per = str(int(100 - conf)+20)
info = per + '%' + ' ' + name
cv2.putText(frame, info, (x, y), font, 1, color, stroke,
cv2.LINE_AA)
count = 0
else:
count += 1
font = cv2.FONT_HERSHEY_SIMPLEX
name = labels[id_]
color = (0, 255, 255)
stroke = 2
info = 'un_known'
cv2.putText(frame, info, (x, y), font, 1, color, stroke, cv2.LINE_AA)
if count == 300:
d = str(input('cant recognise who is??'))
stu_name = d + '.png'
cv2.imwrite(stu_name, roi_gray)
count = 0
# print(roi_color)
image_item = 'hema.png'
47 | P a g e
CHAPTER 3: Development
cv2.imwrite(image_item, roi_gray)
# print(frame)
# cv2.circle(frame,((x + x + w) / 2, (y + y + h) / 2), w / 2, (0, 255, 0),
2)
cv2.imshow('frame', frame)
if cv2.waitKey(20) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
print(names,code)
for i in names:
print(i)
take_att(str(code), str(i))
return "<h1>GREATE , You Finished The Process</h1>"
48 | P a g e
CHAPTER 4
Design
49 | P a g e
CHAPTER 4: Design
Application Screening
Home page conta
4.1.1 Home page
• Home page contains 5 icons like:
1) admin login
2) doctor login
3) contact us
4) about us
5) home
50 | P a g e
CHAPTER 4: Design
• Contact us:
Register your name, your email and leave any comments
about the site .
51 | P a g e
CHAPTER 4: Design
And this basic information about the site
52 | P a g e
CHAPTER 4: Design
4.1.2 admin login:
• Firstly, to login using given credentials to control the
dashboard.
53 | P a g e
CHAPTER 4: Design
• Dashboard contains database of:
1) Relate student with doctor
2) Attendance
3) Courses
4) Students
5) Doctors
54 | P a g e
CHAPTER 4: Design
1) Relate student with course
This means that the student is registered in a new course.
55 | P a g e
CHAPTER 4: Design
2) Attendance
Graph total attendance over the semester
56 | P a g e
CHAPTER 4: Design
3) Courses
A table that contains information about the course and can
be modified from update button or delete course. Add new
course from add course button.
57 | P a g e
CHAPTER 4: Design
Add and Edit current courses by admin:
58 | P a g e
CHAPTER 4: Design
4) Student
A table that contains information about the students and can
be modified from update button or delete student. Add
student from add new button.
59 | P a g e
CHAPTER 4: Design
60 | P a g e
CHAPTER 4: Design
5) Doctors
It is table that contains information about the doctors and
can be modified from update button.
61 | P a g e
CHAPTER 4: Design
62 | P a g e
CHAPTER 4: Design
4.1.3 Doctor login:
• Teacher page:
It will appear after doctor login.
63 | P a g e
CHAPTER 4: Design
• Take attendance:
1) Enter course code from course attendance form.
64 | P a g e
CHAPTER 4: Design
2) Camera capture student photo and
appear this message after right recognition.
65 | P a g e
CHAPTER 4: Design
• View report:
Enter course code to show attendance table of this course. The
report is a table that contains the student name, the course code,
the number of attendees and the last attendance date for each
student.
66 | P a g e
CHAPTER 4: Design
67 | P a g e
CHAPTER 5
68 | P a g e
CHAPTER 5: conclusion and Future work
5.1 Conclusion
Face images are the inputs for the attendance using face
recognition system. We came to realize that there are
extensive variety of methods for face recognition but some
of them are tedious and non-productive. That is why we put
on the search to choose a method that can identify faces
concisely and in a solid way. We are automating the
attendance system to decrease the errors occur due to the
manual taking attendance. We made our product as web
application so that it can be accessed in any place and using
any version of device and more accessibility in the usage.
Using artificial intelligence concept, the attendance
monitoring system is very secure, accurate and easy to
monitor students’ attendance. The system is designed to be
cost effective by being software dependent and not require
any additional hardware rather than a smartphone or a
laptop that is connected to a stable internet.
69 | P a g e
CHAPTER 5: conclusion and Future work
70 | P a g e
CHAPTER 5: conclusion and Future work
5.1.4 Mobile phone version:
Same application with its same features can be
implemented as a mobile application and publish the APK
for it since it’s more common to the user to have his most
used services as apps.
71 | P a g e
Appendixes
72 | P a g e
Appendix B: Screens and Figueres
73 | P a g e
FIGURE 24 TEACHER’S ACTIONS 63
FIGURE 25 ATTENDANCE TAKING SCREEN 64
FIGURE 26 COURSE ATTENDANCE OVERALL REPORT 66
FIGURE 27 COURSE REPORT TABLE VIEW 67
74 | P a g e
References
References
1. Varadharajan, E., Dharani, R., Jeevitha, S., Kavinmathi, B., & Hemalatha, S. (2016).
Automatic attendance management system using face detection. 2016 Online
International Conference on Green Engineering and Technologies (IC-GET).
doi:10.1109/get.2016.7916753
2. Automatic Student Attendance System using Face Recognition. (2020). International
Journal of Engineering and Advanced Technology Regular Issue, 9(3), 93-99.
doi:10.35940/ijeat.b4207.029320
3. Sutabri, T., Pamungkur, P., Kurniawan, A., & Saragih, R. E. (2019). Automatic Attendance
System for University Student Using Face Recognition Based on Deep Learning.
International Journal of Machine Learning and Computing, 9(5), 668-674.
doi:10.18178/ijmlc.2019.9.5.856
4. C. P., MR, BHAT, S., MR, S., MS, & S, S. K., MS. (n.d.). AUTOMATIC STUDENT ATTENDANCE
SYSTEM USING FACE RECOGNITION [Scholarly project].
5. Zhou, L. (2008). Image processing. Bellingham, WA: SPIE.
6. Birchfield, S. (2018). Image processing and analysis. Boston, MA: Cengage Learning.
7. (PDF) Student Attendance Management System. (n.d.). Retrieved July 07, 2020, from
https://www.researchgate.net/publication/323511629_Student_Attendance_Manageme
nt_System
8. Student Attendance Management System And Software. (n.d.). Retrieved July 07, 2020,
from http://www.technospacio.com/student-attendance.html
9. Howse, J., Joshi, P., & Beyeler, M. (2016). OpenCV: Computer vision projects with Python:
Get savvy with OpenCV and actualize cool computer vision applications: A course in three
modules. Birmingham, UK: Packt.
75 | P a g e