Kaustubh Blackbook
Kaustubh Blackbook
Project report
On
Diploma in
(Computer Technology)
By
[Link] KATHOLE
[Link] PATIL
1
DEPARTMENT OF COMPUTER TECHNOLOGY
BHARATI VIDYAPEETH’S INSTITUTE OF TECHNOLOGY,
Sector-7, C.B.D. Belpada,
Navi Mumbai-400614
Academic Year 2024 – 2025
CERTIFICATE
Mohan Mali
The mentor from the guidance of the Faculty
Name:……………………………………………..
Telephone: ………………………………………….
2
Acknowledgement
Name of Student
TYCM (Computer Technology) - III Year
Kaustubh Kathole
Darshan Patil
3
Facial Recognition Attendance System
ABSTRACT
4
Computer Engineering
Facial Recognition Attendance System
INDEX
1 Introduction
1. Introduction
2. Problem Introduction
3. Modules In The Project
2 Requirements Specification
1. Introduction
2. Hardware Requirements
3. Software Requirements
3 Analysis
1. Existing System
2. Proposed System
3. Feasibility Study
4. Software Specification
4 Design
1. System Design
2. Introduction To Uml
3. Uml Diagrams Of Our Project
5 System Implementation
1. Introduction
2. Sample Code
6 Sample Screenshots
7 1. Conclusion
2. Bibliography
5
Computer Engineering
Facial Recognition Attendance System
CHAPTER 1
INTRODUCTION
6
Computer Engineering
Facial Recognition Attendance System
1.1 INTRODUCTION:
The impetus behind the development of FRAS stems from the recognition of the
limitations inherent in traditional attendance tracking systems. These limitations
include the potential for human error, time-consuming administrative tasks, and
the lack of robust security measures to prevent unauthorized access or
tampering with attendance records. FRAS seeks to address these shortcomings
by automating the attendance management process, enhancing accuracy,
efficiency, and security while minimizing administrative overhead.
7
Computer Engineering
Facial Recognition Attendance System
In the subsequent sections of this project, we will delve into the technical
specifications, key features, implementation strategies, and potential benefits
of FRAS. By exploring the intricacies of its design and functionality, we aim to
demonstrate how FRAS represents a paradigm shift in attendance
management, poised to drive efficiency, transparency, and accountability in
organizations of all sizes and sectors.
8
Computer Engineering
Facial Recognition Attendance System
1.3 OBJECTIVE:
9
Computer Engineering
Facial Recognition Attendance System
The system can be used in various settings such as schools, offices, and
events to automate attendance management processes.
10
Computer Engineering
Facial Recognition Attendance System
CHAPTER 2
REQUIREMENT SPECIFICATION
11
Computer Engineering
Facial Recognition Attendance System
2.1 INTRODUCTION:
12
Computer Engineering
Facial Recognition Attendance System
Storage Hardware:
SSD: 128GB SATA SSD for basic storage needs.
HDD: 500GB SATA HDD for additional storage capacity(optional).
Camera Hardware:
Integrated Webcam: Built-in webcam with 720p resolution.
13
Computer Engineering
Facial Recognition Attendance System
Text editor like Visual Studio Code or Sublime Text for writing
and editing code.
. Facial Recognition Software
OpenCV for basic image processing and face detection.
14
Computer Engineering
Facial Recognition Attendance System
programming language for simplicity and ease of
development.
Text editor like Visual Studio Code or Sublime Text for writing
and editing code.
. Facial Recognition Software
OpenCV for basic image processing and face detection.
15
Computer Engineering
Facial Recognition Attendance System
CHAPTER 3
ANALYSIS
16
Computer Engineering
Facial Recognition Attendance System
17
Computer Engineering
Facial Recognition Attendance System
Technical Feasibility:
Hardware Requirements: High-resolution cameras,
processing units, and networking equipment are readily
available in the market. Compatibility with existing
infrastructure and scalability options ensure technical
feasibility.
Economic Feasibility:
Operational Feasibility:
User Acceptance: User training and acceptance testing are
crucial to ensure smooth adoption of the system. A user-
friendly interface and clear communication of benefits
facilitate acceptance among administrators and employees.
19
Computer Engineering
Facial Recognition Attendance System
20
Computer Engineering
Facial Recognition Attendance System
CHAPTER 4
DESIGN
21
Computer Engineering
Facial Recognition Attendance System
Components:
o Camera Module: Each entry point will be equipped with a camera
capable of capturing facial images. Cameras may include features
such as night vision, wide dynamic range, and high-resolution
sensors for optimal image quality.
o Facial Recognition Module: This module will employ deep learning
techniques, such as Convolutional Neural Networks (CNNs), for
face detection, alignment, and recognition. Pre-trained models like
FacialRecognition, OpenFace, FaceNet, or deep learning
frameworks such as TensorFlow or PyTorch can be used.
o Database Module: The database will store biometric profiles of
individuals, including facial images and associated metadata such
as name, ID, and attendance records. A relational database
management system (RDBMS) like PostgreSQL or MySQL is
22
Computer Engineering
Facial Recognition Attendance System
Data Flow:
o When an individual enters the designated area, the camera
captures their facial image and transmits it to the server.
o The facial recognition module processes the incoming images,
detecting and recognizing faces using deep learning algorithms.
o If a match is found with an existing profile in the database, the
attendance record for the identified individual is updated.
o Real-time feedback may be provided to the user interface for
display of recognition results and attendance status.
Security Measures:
o Data Encryption: All communication between client and server, as
well as data storage in the database, will be encrypted using
TLS/SSL protocols to ensure data security and privacy.
o Authentication and Authorization: Access to system functionalities
and data will be controlled through robust authentication
mechanisms (e.g., OAuth, JWT) and role-based access control
(RBAC).
23
Computer Engineering
Facial Recognition Attendance System
Deployment:
o On-Premises Deployment: The system can be deployed on the
organization's local servers or data centers, providing full control
over infrastructure and data privacy.
24
Computer Engineering
Facial Recognition Attendance System
Structural Diagrams:
o Class Diagram: Represents the static structure of a system
by showing classes, attributes, methods, and relationships
between classes.
o Object Diagram: Shows instances of classes and the
relationships between them at a specific point in time.
25
Computer Engineering
Facial Recognition Attendance System
Behavioral Diagrams:
o Use Case Diagram: Represents the functional requirements
of a system by showing actors, use cases, and relationships
between them.
o Activity Diagram: Illustrates the flow of control or workflow in
a system, including activities, decisions, and transitions
between them.
o State Machine Diagram: Represents the dynamic behavior of
a system by showing states, events, transitions, and actions.
Interaction Diagrams:
o Sequence Diagram: Shows the interactions between objects
or components in a system over time, illustrating the
sequence of messages exchanged to accomplish a specific
task or scenario.
o Communication Diagram: Similar to a sequence diagram but
focuses more on the relationships between objects or
components and the messages exchanged between them.
26
Computer Engineering
Facial Recognition Attendance System
27
Computer Engineering
Facial Recognition Attendance System
1. Block Diagrams
28
Computer Engineering
Facial Recognition Attendance System
29
Computer Engineering
Facial Recognition Attendance System
30
Computer Engineering
Facial Recognition Attendance System
In essence, use case diagrams act as visual maps that illuminate the user-
system interactions and functionalities required to fulfill user needs. They
streamline the process of requirements engineering by delineating actors'
roles, system functionalities, and their relationships, facilitating a shared
understanding among stakeholders. With their ability to capture the essence
of user-system interactions and requirements, use case diagrams serve as
indispensable tools in guiding system design decisions and ensuring that
software systems align closely with user expectations and needs.
Furthermore, use case diagrams play a crucial role in ensuring that software
development efforts remain focused on delivering value to users. By providing
a visual representation of user requirements and system functionalities, they
help prioritize development tasks, allocate resources effectively, and identify
potential gaps or inconsistencies early in the development process.
Additionally, use case diagrams serve as a foundation for more detailed
analysis and design activities, such as creating detailed use case
specifications, defining system behavior in sequence diagrams, and designing
31
Computer Engineering
Facial Recognition Attendance System
32
Computer Engineering
Facial Recognition Attendance System
2. Sequence Diagrams
33
Computer Engineering
Facial Recognition Attendance System
34
Computer Engineering
Facial Recognition Attendance System
35
Computer Engineering
Facial Recognition Attendance System
36
Computer Engineering
Facial Recognition Attendance System
37
Computer Engineering
Facial Recognition Attendance System
CHAPTER 5
SYSTEM
IMPLEMENTATION
38
Computer Engineering
Facial Recognition Attendance System
5.1 Introduction:
The below lines of code depict the basic version of an attendance system
that uses facial recognition to mark attendance. This system uses basic
GUI for a simple user experience of the attendance system. Furthermore,
the system can be enhanced and improved to add security measures
which are incorporated by more advance facial recognition python
modules such as DeepFace,FaceNet,FisherFaces,etc. The GUI can also
be enhanced further using PyQt5,Kivy,etc.
import tkinter as tk
from tkinter import *
import cv2
import csv
import os
import numpy as np
from PIL import Image, ImageTk
import pandas as pd
import datetime
import time
[Link]('1280x720')
[Link](background='grey80')
39
Computer Engineering
Facial Recognition Attendance System
def manually_fill():
global sb
sb = [Link]()
# [Link]('[Link]')
[Link]("Enter subject name...")
[Link]('580x320')
[Link](background='grey80')
def err_screen_for_subject():
def ec_delete():
[Link]()
global ec
ec = [Link]()
[Link]('300x100')
# [Link]('[Link]')
[Link]('Warning!!')
[Link](background='snow')
Label(ec, text='Please enter your subject name!!!', fg='red',
bg='white', font=('times', 16, ' bold ')).pack()
Button(ec, text='OK', command=ec_delete, fg="black", bg="lawn
green", width=9, height=1, activebackground="Red",
font=('times', 15, ' bold ')).place(x=90, y=50)
def fill_attendance():
ts = [Link]()
Date = [Link](ts).strftime('%Y_%m_
%d')
40
Computer Engineering
Facial Recognition Attendance System
timeStamp = [Link](ts).strftime('%H:
%M:%S')
Time = [Link](ts).strftime('%H:%M:
%S')
Hour, Minute, Second = [Link](":")
# Creatting csv of attendance
import [Link]
# Connect to the
database try:
global cursor
connection = [Link](
host='localhost', user='root', password='',
db='manually_fill_attendance')
cursor = [Link]()
except Exception as e:
print(e)
try:
[Link](sql) # for create a table
except Exception as ex:
print(ex) #
if subb == '':
err_screen_for_subject()
else:
[Link]()
MFW = [Link]()
# [Link]('[Link]')
[Link]("Manually attendance of " +
str(subb)) [Link]('880x470')
[Link](background='grey80')
def del_errsc2():
[Link]()
def err_screen1():
global errsc2
errsc2 = [Link]()
[Link]('330x100')
# [Link]('[Link]')
42
Computer Engineering
Facial Recognition Attendance System
[Link]('Warning!!')
[Link](background='grey80')
Label(errsc2, text='Please enter Student &
Enrollment!!!', fg='black', bg='white',
font=('times', 16, ' bold ')).pack()
Button(errsc2, text='OK', command=del_errsc2, fg="black",
bg="lawn green", width=9, height=1,
activebackground="Red", font=('times', 15, ' bold
')).place(x=90, y=50)
global ENR_ENTRY
ENR_ENTRY = [Link](MFW, width=20, validate='key',
bg="white", fg="black", font=('times', 23))
ENR_ENTRY['validatecommand'] = (
ENR_ENTRY.register(testVal), '%P', '%d')
43
Computer Engineering
Facial Recognition Attendance System
ENR_ENTRY.place(x=290, y=105)
def remove_enr():
ENR_ENTRY.delete(first=0, last=22)
STUDENT_ENTRY = [Link](
MFW, width=20, bg="white", fg="black", font=('times', 23))
STUDENT_ENTRY.place(x=290, y=205)
def remove_student():
STUDENT_ENTRY.delete(first=0, last=22)
[Link](Insert_data, VALUES)
except Exception as e:
print(e)
ENR_ENTRY.delete(first=0, last=22)
STUDENT_ENTRY.delete(first=0, last=22)
def create_csv():
import csv
[Link]("select * from " + DB_table_name + ";")
csv_name = 'C:/Users/Pragya
singh/PycharmProjects/Attendace_management_system/Attendance/
Manually Attendance/'+DB_table_name+'.csv'
with open(csv_name, "w") as csv_file:
csv_writer = [Link](csv_file)
csv_writer.writerow(
[i[0] for i in [Link]]) # write
headers csv_writer.writerows(cursor)
O = "CSV created Successfully"
[Link](text=O, bg="Green", fg="white",
width=33, font=('times', 19, 'bold'))
[Link](x=180, y=380)
import csv
import tkinter
root = [Link]()
[Link]("Attendance of " + subb)
[Link](background='grey80')
with open(csv_name, newline="") as file:
reader = [Link](file)
r=0
45
Computer Engineering
Facial Recognition Attendance System
46
Computer Engineering
Facial Recognition Attendance System
def attf():
import subprocess
[Link](
r'explorer /select,"C:\Users\Pragya Singh\
PycharmProjects\Attendace_management_system\Attendance\
Manually Attendance\-------Check atttendance "')
[Link]()
47
Computer Engineering
Facial Recognition Attendance System
global SUB_ENTRY
def clear():
[Link](first=0, last=22)
def clear1():
[Link](first=0, last=22)
def del_sc1():
[Link]()
48
Computer Engineering
Facial Recognition Attendance System
def err_screen():
global sc1
sc1 = [Link]()
[Link]('300x100')
# [Link]('[Link]')
[Link]('Warning!!')
[Link](background='grey80')
Label(sc1, text='Enrollment & Name required!!!',
fg='black', bg='white', font=('times', 16)).pack()
Button(sc1, text='OK', command=del_sc1, fg="black", bg="lawn
green", width=9,
height=1, activebackground="Red", font=('times', 15, ' bold
')).place(x=90, y=50)
# Error screen2
def del_sc2():
[Link]()
def err_screen1():
global sc2
sc2 = [Link]()
[Link]('300x100')
# [Link]('[Link]')
[Link]('Warning!!')
[Link](background='grey80')
Label(sc2, text='Please enter your subject name!!!',
fg='black', bg='white', font=('times', 16)).pack()
49
Computer Engineering
Facial Recognition Attendance System
def take_img():
l1 = [Link]()
l2 = [Link]()
if l1 == '':
err_screen()
elif l2 == '':
err_screen()
else:
try:
cam = [Link](0)
detector = [Link](
'haarcascade_frontalface_default.xml')
Enrollment = [Link]()
Name = [Link]()
sampleNum = 0
while (True):
ret, img = [Link]()
gray = [Link](img, cv2.COLOR_BGR2GRAY)
faces = [Link](gray, 1.3, 5)
for (x, y, w, h) in faces:
[Link](img, (x, y), (x + w, y + h), (255, 0, 0), 2)
# incrementing sample number
50
Computer Engineering
Facial Recognition Attendance System
sampleNum = sampleNum + 1
# saving the captured face in the dataset folder
[Link]("TrainingImage/ " + Name + "." + Enrollment +
' + str(sampleNum) + ".jpg",
gray)
print("Images Saved for Enrollment :")
[Link]('Frame', img)
# wait for 100 miliseconds
if [Link](1) & 0xFF == ord('q'):
break
#
# # break if the sample number is morethan
100 elif sampleNum > 70:
break
[Link]()
[Link]()
ts = [Link]()
Date = [Link](ts).strftime('%Y-%m-
%d')
Time = [Link](ts).strftime('%H:%M:
%S')
row = [Enrollment, Name, Date, Time]
with open('StudentDetails\[Link]', 'a+') as
csvFile: writer = [Link](csvFile, delimiter=',')
[Link](row)
[Link]()
res = "Images Saved for Enrollment : " + Enrollment + " Name :
" + Name
[Link](
51
Computer Engineering
Facial Recognition Attendance System
52
Computer Engineering
Facial Recognition Attendance System
harcascadePath = "haarcascade_frontalface_default.xml"
faceCascade = [Link](harcascadePath) df
= pd.read_csv("StudentDetails\[Link]") cam =
[Link](0)
font = cv2.FONT_HERSHEY_SIMPLEX
col_names = ['Enrollment', 'Name', 'Date', 'Time']
attendance =
[Link](columns=col_names) while True:
ret, im = [Link]()
gray = [Link](im, cv2.COLOR_BGR2GRAY)
faces = [Link](gray, 1.2, 5)
for (x, y, w, h) in faces:
global Id
%M:%S')
aa = [Link][df['Enrollment'] == Id]
['Name'].values global tt
53
Computer Engineering
Facial Recognition Attendance System
tt = str(Id) + "-" + aa
En = '15624031' + str(Id)
[Link][len(attendance)] = [
Id, aa, date, timeStamp]
[Link](
im, (x, y), (x + w, y + h), (0, 260, 0), 7)
[Link](im, str(tt), (x + h, y),
font, 1, (255, 255, 0,), 4)
else:
Id = 'Unknown'
tt = str(Id)
[Link](
im, (x, y), (x + w, y + h), (0, 25, 255),
7) [Link](im, str(tt), (x + h, y),
font, 1, (0, 25, 255), 4)
if [Link]() > future:
break
attendance = attendance.drop_duplicates(
['Enrollment'], keep='first')
[Link]('Filling attedance..', im)
key = [Link](30) & 0xff
if key == 27:
break
ts = [Link]()
date = [Link](ts).strftime('%Y-
%m-%d')
timeStamp = [Link](
54
Computer Engineering
Facial Recognition Attendance System
ts).strftime('%H:%M:%S')
Hour, Minute, Second = [Link](":")
fileName = "Attendance/" + Subject + "_" + date + \
"_" + Hour + "-" + Minute + "-" + Second + ".csv"
attendance = attendance.drop_duplicates(
['Enrollment'], keep='first')
print(attendance)
attendance.to_csv(fileName, index=False)
[Link]( ts).strftime('%Y_%m_%d')
DB_Table_name = str(
Subject + "_" + date_for_DB + "_Time_" + Hour + "_" +
Minute + "_" + Second)
import [Link]
# Connect to the
database try:
global cursor
connection = [Link](
host='localhost', user='root', password='',
db='Face_reco_fill')
cursor = [Link]()
except Exception as e:
print(e)
55
Computer Engineering
Facial Recognition Attendance System
[Link]()
[Link]()
import csv
import tkinter
root = [Link]()
[Link]("Attendance of " + Subject)
56
Computer Engineering
Facial Recognition Attendance System
[Link](background='grey80')
cs = 'C:/Users/Pragya
Singh/PycharmProjects/Attendace_management_system/' + fileName
with open(cs, newline="") as file:
reader = [Link](file)
r=0
57
Computer Engineering
Facial Recognition Attendance System
def Attf():
import subprocess
[Link](
r'explorer /select,"C:\Users\Pragya Singh\PycharmProjects\
Attendace_management_system\Attendance\-------Check atttendance
------ "')
def admin_panel():
win = [Link]()
# [Link]('[Link]')
58
Computer Engineering
Facial Recognition Attendance System
[Link]("LogIn")
[Link]('880x420')
[Link](background='grey80')
def log_in():
username = un_entr.get()
password = pw_entr.get()
if username == 'pragya':
if password == 'pragya123':
[Link]()
import csv
import tkinter
root = [Link]()
[Link]("Student Details")
[Link](background='grey80')
cs = 'C:/Users/Pragya
Singh/PycharmProjects/Attendace_management_system/StudentDetai
ls/[Link]'
with open(cs, newline="") as file:
reader = [Link](file)
r=0
59
Computer Engineering
Facial Recognition Attendance System
bg="white", text=row,
relief=[Link])
[Link](row=r, column=c)
c += 1
r += 1
[Link]()
else:
valid = 'Incorrect ID or Password'
[Link](text=valid, bg="red", fg="white",
width=38, font=('times', 19, 'bold'))
[Link](x=120, y=350)
else:
valid = 'Incorrect ID or Password'
[Link](text=valid, bg="red", fg="white",
width=38, font=('times', 19, 'bold'))
[Link](x=120, y=350)
[Link](x=30, y=150)
def c00():
un_entr.delete(first=0, last=22)
def c11():
pw_entr.delete(first=0, last=22)
[Link](x=290, y=250)
[Link]()
[Link](faces, [Link](Id))
try:
[Link]("TrainingImageLabel\[Link]")
except Exception as e:
q = 'Please make "TrainingImageLabel" folder'
[Link](text=q, bg="SpringGreen3",
width=50, font=('times', 18, 'bold'))
[Link](x=350, y=400)
def getImagesAndLabels(path):
imagePaths = [[Link](path, f) for f in [Link](path)]
# create empth face list
faceSamples = []
# create empty ID
list Ids = []
# now looping through all the image paths and loading the Ids and
the images
for imagePath in imagePaths:
# loading the image and converting it to gray scale
pilImage = [Link](imagePath).convert('L')
# Now we are converting the PIL image into numpy
array imageNp = [Link](pilImage, 'uint8')
# getting the Id from the image
Id = int([Link](imagePath)[-1].split(".")[1])
# extract the face from the training image sample
faces = [Link](imageNp)
# If a face is there then append that in the list as well as Id of
it for (x, y, w, h) in faces:
[Link](imageNp[y:y + h, x:x +
w]) [Link](Id)
return faceSamples, Ids
window.grid_rowconfigure(0, weight=1)
63
Computer Engineering
Facial Recognition Attendance System
window.grid_columnconfigure(0, weight=1)
# [Link]('[Link]')
def on_closing():
from tkinter import messagebox
if [Link]("Quit", "Do you want to quit?"):
[Link]()
[Link]("WM_DELETE_WINDOW", on_closing)
[Link](x=80, y=20)
64
Computer Engineering
Facial Recognition Attendance System
return False
return True
65
Computer Engineering
Facial Recognition Attendance System
66
Computer Engineering
Facial Recognition Attendance System
CHAPTER 6
SAMPLE SCREENSHOTS
67
Computer Engineering
Facial Recognition Attendance System
70
Information Technology
Facial Recognition Attendance System
71
Computer Engineering
Facial Recognition Attendance System
CHAPTER 7
CONCLUSION
72
Computer Engineering
Facial Recognition Attendance System
7.1 CONCLUSION:
73
Computer Engineering
Facial Recognition Attendance System
7.2 BIBLIOGRAPHY
IV. Huang, G. B., Mattar, M., Berg, T., & Learned-Miller, E. (2008). Labeled
faces in the wild: A database for studying face recognition in unconstrained
environments. University of Massachusetts, Amherst, Tech. Rep, 07-49.
V. Taigman, Y., Yang, M., Ranzato, M., & Wolf, L. (2014). DeepFace: Closing
the gap to human-level performance in face verification. In Proceedings of
the IEEE conference on computer vision and pattern recognition (pp.
1701-1708).
VI. Turk, M., & Pentland, A. (1991). Eigenfaces for recognition. Journal
of cognitive neuroscience, 3(1), 71-86.
VII. Ghosh, P., & Prakash, N. (2019). Biometric Attendance System Using
Facial Recognition. In Intelligent Systems Design and Applications
(pp. 449-458). Springer, Cham.
VIII. Zhou, D., Krishnan, S., & Kumar, A. (2019). Real-time Automated
Attendance System using Facial Recognition. In 2019 4th International
Conference on Computational Systems and Information Technology
for Sustainable Solutions (CSITSS) (pp. 1-6). IEEE.
IX. National Institute of Standards and Technology (NIST) - Biometric
Testing and Evaluation: [Link]
74
Computer Engineering
Facial Recognition Attendance System
projects/biometric-testing-and-evaluation
X. OpenCV Documentation - Facial Recognition:
[Link]
[Link]
XI. PyImageSearch - Facial Recognition with OpenCV, Python, and deep
learning: [Link]
recognition-with-opencv-python- and-deep-learning/
XII. IEEE Xplore Digital Library: [Link]
XIII. SpringerLink - Biometrics:
[Link]
XIV. ACM Digital Library: [Link]
75
Computer Engineering
Facial Recognition Attendance System
76
Computer Engineering