Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Attendance System based on Face Recognition

A PROJECT REPORT

submitted by

AKSHAT SRIVASTAVA 2006205


ARPAN KAPOOR 2006388
AKCHAT CHANDRA 2006204
SARVAJEET DUA 2006403

to
KIIT Deemed to be University

in partial fulfilment of the requirements for the award of the Degree


of
Bachelor of Technology
in
Information Technology

UNDER THE GUIDANCE OF


Madhabananda Das
KALINGA INSTITUTE OF INDUSTRIAL TECHNOLOGY
BHUBANESWAE, ODISHA - 751024

April 2023
Attendance System based on Face Recognition

A PROJECT REPORT

submitted by

AKSHAT SRIVASTAVA 2006205


ARPAN KAPOOR 2006388
AKCHAT CHANDRA 2006204
SARVAJEET DUA 2006403

to
KIIT Deemed to be University

in partial fulfilment of the requirements for the award of the Degree


of
Bachelor of Technology
in
Information Technology

UNDER THE GUIDANCE OF


Madhabananda Das

SCHOOL OF COMPUTER ENGINEERING


CONTENTS

ACKNOWLEDGEMENT i

ABSTRACT ii

Chapter 1 : Introduction 1

Chapter 2 : Basic Concepts 3


2.1 OpenCV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 TkInter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Flask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Pandas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.5 NumPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.6 Pillow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.7 Haar Cascade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Chapter 3 : Problem Statement 6


3.1 Project Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Project Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 System Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.1 Design Constraints . . . . . . . . . . . . . . . . . . . . . . . 8
3.3.2 System Architecture . . . . . . . . . . . . . . . . . . . . . . 8

Chapter 4 : Implementation 10
4.1 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2 Testing Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.3 Screenshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.4 Quality Assurance . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Chapter 5 : Standards Adopted 13


5.1 Design Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 Coding Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3 Testing Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Chapter 6 : Conclusion and Future Scope 15


6.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.2 Future Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
ACKNOWLEDGEMENT

i
ABSTRACT

The Attendance System based on Face Recognition technology presented in this


report offers a modern solution for organizations to track attendance. The system
employs OpenCV, a widely-used open-source computer vision library, to recognize
faces from images and videos captured through a camera. Haarcascade Frontal-
Face is used as the face detection algorithm, which is fast and efficient for real-time
applications.

To provide a smooth user experience, TkInter, a Python binding to the Tk GUI


toolkit, is used for client-side rendering. The user can easily navigate through the
graphical user interface and perform various tasks such as adding and deleting
students or employees, viewing attendance reports, and exporting data to CSV
files. For robust data management, the system employs Flask, a Python web
framework, for server-side rendering. The API-based architecture allows the client
to communicate with the server securely, and provides the flexibility to access
the attendance data from different devices and locations. Additionally, Insomnia
API is utilized for testing the API endpoints and ensuring proper functionality.
The system uses Pandas, a powerful data manipulation library, for efficient data
handling and Pillow for image processing. NumPy and MatPlotLib are used for
data visualization, allowing the user to generate attendance reports in various
formats.

Overall, the Attendance System based on Face Recognition technology presented


in this report offers a reliable and efficient solution for tracking attendance. The
system utilizes modern technologies such as OpenCV, TkInter, & Flask to provide
accurate and real-time attendance data management. The project demonstrates
proficiency in facial recognition technology making it a valuable contribution to
the field of attendance tracking systems.

Keywords: Face Recognition System, Attendance System, OpenCV, TkInter,


Client-side rendering, Server-side rendering, Raspberry Implementation, Haarcas-
cade FrontalFace, Pandas, Pillow, NumPy, MatPlotLib, Insomnia API, Flask.

ii
CHAPTER 1

INTRODUCTION

Attendance registration is an essential task in any educational institution, and


the traditional method of calling students’ names or roll numbers is both time-
consuming and requires significant energy. Automated attendance systems have
been developed to solve this problem, with biometric technology and RFID sys-
tems being among the most popular. However, these systems are not without
their flaws, such as requiring students to stand in line to attend, which can take
a considerable amount of time.

This project proposes a solution in the form of an automated attendance grading


system that uses face recognition technology. This system is non-intrusive and
does not interfere with normal teaching methods. It can also be implemented
during exam sessions or other educational activities where attendance is crucial.
The system eliminates the need for traditional student identification methods,
such as calling students by name and checking their IDs, which can disrupt the
learning process and put students under pressure during exams.

Face recognition technology has become prevalent in daily life, with airports, the
FBI, and social networking websites like Facebook using it for criminal inves-
tigations, missing children cases, and photo tagging, respectively. In addition,
companies like Intel and Apple have implemented face recognition for account
access and unlocking mobile phones.

The development of face recognition technology dates back to the 1960s, with
Woody Bledsoe, Helen Chan Wolf, and Charles Bisson introducing a system that
required administrators to locate eyes, ears, nose, and mouth in images. The
distance and ratios between the located features and common reference points are
then calculated and compared. The use of other features, such as hair color and
lip thickness, was later introduced by Goldstein, Harmon, and Lesk in 1970. Kirby

1
and Sirovich then suggested principle component analysis (PCA) in 1988 to solve
the face recognition problem.

This project aims to develop an attendance system based on face recognition


technology that utilizes modern tools and techniques such as OpenCV, TkIn-
ter, client-side rendering, API, server-side rendering, Raspberry Implementation,
Haarcascade FrontalFace, Pandas, Pillow, NumPy, MatPlotLib, Insomnia API,
and Flask. By leveraging these technologies, we aim to develop a robust and scal-
able attendance system that can handle the demands of a real-world educational
environment.

2
CHAPTER 2

BASIC CONCEPTS

In this section, we will introduce the basic concepts related to the tools and tech-
niques used in this project. These concepts are essential for understanding the
implementation and functioning of the application. Each subsection provides a
description of a specific technology.

2.1 OpenCV
OpenCV (Open Source Computer Vision) is a popular open source library used
for real-time computer vision and image processing. It offers many useful features
including image and video capture, image filtering and manipulation, feature de-
tection, object detection and more. OpenCV Contrib is a collection of additional
modules and algorithms that are not included in the main OpenCV library. These
modules are contributed by the OpenCV community and provide additional func-
tionality for tasks such as stereo vision, 3D reconstruction, text recognition and
more.

2.2 TkInter
The tkinter package is a thin object-oriented layer on top of Tcl/Tk. To use
tkinter, you don’t need to write Tcl code, but you will need to consult the Tk
documentation and occasional Tcl documentation. tkinter is a set of wrappers
that implement Tk widgets as Python classes. The main advantages of tkinter
are that it is fast, and it usually comes with Python. Although its standard
documentation is poor, good content is available, including: references, tutorials,
books and others.

3
2.3 Flask
Flask is a popular web framework for Python, used for building web applications
and APIs. It is a lightweight and flexible framework, with minimalistic design and
easy-to-use APIs. Flask follows the Model-View-Controller (MVC) architectural
pattern, but does not enforce any particular database, template engine, or other
components. Flask is known for its simplicity and ease of use, making it a popular
choice for small to medium-sized projects. It has a modular structure, which
means you can add extensions and libraries to enhance its functionality. Flask
supports various plugins and extensions, which can be used for tasks like handling
user authentication, database management, and caching. Flask is also highly
customizable, allowing developers to tailor their web applications to specific needs.
Its minimalist approach allows developers to focus on writing clean, efficient code,
without getting bogged down by unnecessary features.

2.4 Pandas
Pandas is an open-source library primarily designed to work easily and intuitively
with relational or labeled data. It provides various data structures and operations
for manipulating numerical data and time series. This library is built on top of
the NumPy library. Pandas is fast and has high performance and productivity for
users.

2.5 NumPy
NumPy provides a convenient and efficient way to handle large amounts of data.
NumPy is also very comfortable with matrix multiplication and data reshaping.
NumPy is fast which makes it reasonable to work with large sets of data. NumPy
performs array-oriented computing. It efficiently implements multidimensional
arrays.It performs scientific calculations.It is capable of Fourier transforming and
reshaping data stored in multidimensional arrays.

2.6 Pillow
PIL is a display library for the Python programming language. A script is a
piece of code that is used to automate system-oriented tasks. When you write
code that performs a practical task without the need for compilation, it can be
called scripting. PIL has very powerful image processing capabilities and can

4
process many image types (BMP, DIB, EPS, GIF, ICO, IM, JPEG, JPG, JPEG
2000, MSP, PCX, PNG, PPM, SGI, TGA, TIFF, WebP , XBM , to name a few
formats) and image modes such as RGB, RGBA, BW and monochrome.

2.7 Haar Cascade


Haar Cascade is a feature-based object detection algorithm for detecting objects
from images. A cascade function is trained on many positive and negative images
to detect. The algorithm does not require extensive computation and can run in
real-time. We can train our own cascade function for custom objects like animals,
cars, bikes etc. Necklace Cascade cannot be used for face recognition as it only
recognizes matching shapes and sizes. Haar Cascade uses the cascade function and
cascading window. It tries to calculate the features for each window and classifies
positive and negative. Positive images – These images contain images that we
want our classifier to recognize. Negative images - images of everything else, not
including the object we want to find.

By understanding these basic concepts, readers will gain a solid foundation for
comprehending the implementation and functionality of the application. These
concepts play a crucial role in the successful development of the project and enable
users to appreciate the technical aspects behind its design and functionality.

Understanding these basic concepts is essential for readers to grasp the technical
foundation of the project. They provide insights into the utilization of the chosen
technologies and highlight their importance in addressing the challenges faced by
existing solutions in the market.

In the subsequent sections of this report, we will delve into the implementation de-
tails of the application, including the architecture, database design, user interface,
and functionality. By examining these aspects, readers will gain a comprehensive
understanding of the project’s development process and its contribution to the
field of online property rentals.

5
CHAPTER 3

PROBLEM STATEMENT

The traditional method of taking student attendance in educational institutions


is time-consuming and prone to errors. The conventional method involves the
instructor calling out the names of the students or passing around an attendance
sheet for manual signing, which can be a distraction to both the instructor and
the students. In addition, the attendance sheet can be lost, misplaced or subject
to fraudulent activities, leading to inaccurate attendance records.

To address these challenges, a face recognition-based automated student atten-


dance system is proposed. The system aims to eliminate the need for manual
attendance taking by utilizing facial recognition technology to identify and mark
the attendance of each student in real-time. However, the implementation of a
face recognition attendance system faces several challenges such as difficulties in
facial identification, slow and time-consuming training processes, and the effects
of lighting, pose, and expression on image recognition accuracy.

Therefore, the main objective of this project is to develop a real-time operating


student attendance system that can accurately recognize students’ faces, even
under different lighting conditions and head poses, and mark their attendance
within defined time constraints. The proposed system aims to provide a fast
and efficient way of marking attendance while improving the overall teaching and
learning experience by minimizing disruptions and distractions caused by manual
attendance taking. High accuracy and fast computation time will be the evaluation
criteria for the performance of the system.

The following subsections present the Software Requirements Specification (SRS)


according to the IEEE format, outlining the project planning, analysis, and system
design.

6
3.1 Project Planning
The planning phase of the project involves defining the steps to be followed for
successful execution of the development process. The following list of requirements
and features outline the key aspects to be developed in the application:

1. Student Registration and Capturing Faces: School’s administration


should be able to register new students and capture their face data for the
model training.

2. Training Model based on Students’ Faces: School’s administration


should be able to quickly train and update their model based on new regis-
tration.

3. Recognise Student based on Model: The attendance system should be


able to capture and mark attendance for at least 10 students at once to avoid
rush at the entrance of the classroom. It should be quick in updating the
attendance database, and should be responsive when attendance is being
marked more than once.

4. Attendance Management: The database handling the incoming data


should be robust and should have the authentication for the incoming data
where attendance should be marked once at a time, also accuracy for the
recognition should be more than 75% for marking the attendance as ”Present”,
otherwise reject the incoming data, and ask for marking the attendance
again.

5. HCI for the attendance system: Administration should be able to inter-


act with the application via a medium. Using client-side framework, TkInter,
for the interaction on the local system present at the school premises. Also,
implementing API using Flask framework to implement server-side applica-
tion to enable for its wide usage and making the tech available on a wide
network.

3.2 Project Analysis


After collecting the requirements and conceptualizing the problem statement, a
thorough analysis needs to be performed to identify any ambiguities, or inconsis-
tencies. This analysis phase ensures a clear understanding of the project scope
and requirements, minimizing potential risks during the development process.

7
3.3 System Design

3.3.1 Design Constraints


The design constraints for the application involves the utilization of specific tech-
nologies and frameworks to ensure compatibility and optimal performance. The
following constraints are considered:

1. OpenCV: The application should be built on top of OpenCV, leveraging


its real-time computer vision and image processing.

2. Flask: Flask should be used for building web applications and APIs. Flask
can be used for tasks like handling user authentication, database manage-
ment, and caching.

3. TkInter: The application’s frontend is built on top of TkInter which is a


thin object-oriented layer on top of Tcl/Tk, using it we have to implement
the backend to work with the Tk interface application.

4. Haar Cascade: This algorithm is should be used for our main function to
be fast in recognising faces, and give high accuracy.

5. CSV: Using CSV module of python to manage local database for now, where
data authentication should be implemented to ensure correct data stream.

6. Insomnia: This should be used to test the server-side APIs developed using
Flask. Doing an end-to-end test can ensure robust and flexible application.

7. Raspberry Module: Hardware should be set-up to integrate with our


technology to make the product accessible.

3.3.2 System Architecture


The system architecture for the application involves the integration of various com-
ponents and technologies. The architecture should follow a modular and scalable
approach, allowing for easy maintenance and future enhancements. Key compo-
nents of the system architecture include:

1. TkInter: TkInter is a thin object-oriented layer on top of Tcl/Tk, using it


we have to implement the backend to function with the Tk interface appli-
cation.

8
2. OpenCV: Facilitates models training, and running effectively in real-time.

3. Raspberry + Aurdino: Aurdino set-up + Raspberry as the OS to imple-


ment micro hardwares to run the tech effectively and efficiently.

The proper planning, analysis, and system design ensure a structured approach
to the development process, laying a strong foundation for the successful imple-
mentation of the application. By defining the project requirements and features,
the planning phase provides a clear roadmap for the development team, ensuring
that all necessary functionalities are addressed.

The analysis phase is crucial for identifying any potential issues or inconsistencies
in the requirements. By thoroughly analyzing the problem statement, the develop-
ment team can address ambiguities, refine the scope, and ensure a comprehensive
understanding of the project. This analysis minimizes risks and ensures that the
final application meets the desired objectives.

The system architecture for the attendance system based on face recognition
should be modular and scalable, allowing for easy maintenance and future enhance-
ments. Key components of the system architecture include TkInter, OpenCV, and
the Raspberry + Arduino hardware setup for efficient and effective implementa-
tion of the technology. The combination of proper planning, detailed analysis, and
well-defined system design sets the stage for a successful implementation of the
attendance system based on face recognition.

The combination of proper planning, detailed analysis, and well-defined system


design sets the stage for a successful implementation of the application. The subse-
quent sections of this report will delve into the implementation details, showcasing
how the project’s objectives and requirements are translated into a fully functional
and user-friendly application.

9
CHAPTER 4

IMPLEMENTATION

This section presents the implementation details of the full stack application de-
veloped during the project. It includes the methodology or proposal followed, the
testing or verification plan, screenshots showcasing the output, and any relevant
quality assurance measures taken.

4.1 Methodology
For the development of this project, a structured approach was adopted, which
involved the following steps:

1. Requirement Gathering: During the initial phase of the project, the


development team collected and analyzed the requirements for the full stack
application. This phase involved identifying the necessary features, designing
the user interface, and defining the structure of the database.

2. System Design: After gathering and analyzing the requirements for the
full stack application, a system design was developed. This included creating
an architectural design, database schema design, and UI/UX wireframing.
The design phase emphasized ensuring modularity, scalability, and a user-
friendly experience.

3. Implementation: The main technology utilized in the implementation ap-


proach is the OpenCV computer vision library, which is an open-source
infrastructure designed to provide a straightforward and easy-to-use frame-
work for developing advanced vision applications. With over 500 functions
spanning numerous vision areas, OpenCV plays a crucial role in the devel-
opment of the face recognition system. To recognize a user’s face, they are

10
required to stand in front of the camera at a minimum distance of 50cm, and
their image is captured as an input. The captured image is then processed
to extract the frontal face, which is converted to grayscale and stored. The
Principal Component Analysis (PCA) algorithm is used to perform compu-
tations on the images, and the resulting eigenvalues are saved in an XML
file. When a user requests face recognition, the system extracts the frontal
face from the captured video frame via the camera. The eigenvalue is recal-
culated for the test face, and the system matches it with the stored data for
the closest match. This approach enables the system to identify users with
high accuracy and efficiency.

4. Testing: During the implementation phase, testing was conducted to en-


sure the correctness and robustness of the application, despite the lack of
a dedicated QA team. While unit testing and integration testing were not
explicitly performed, manual testing was carried out to evaluate the appli-
cation’s functionality.

4.2 Testing Plan


To ensure the project’s success, a comprehensive testing plan was executed, which
included manual testing to verify the project’s outcome. The testing plan was
composed of the following aspects:

1. Functionality Testing: The application’s features and functionalities


were evaluated to ensure that they functioned as intended. This process in-
cluded manually executing test cases that covered a variety of user scenarios
and workflows.

2. User Interface Testing: The user interface was evaluated for responsive-
ness and visual consistency across various devices and screen sizes.

3. Usability Testing: The application’s usability and user experience were


assessed by obtaining feedback from users and incorporating their sugges-
tions for improvement.

4. Error Handling Testing: The application’s error handling capabilities


were evaluated by deliberately inducing various error scenarios and confirm-
ing that the users received the appropriate error messages or fallbacks.

5. Performance Testing: The application’s performance was assessed by


testing its ability to handle high user loads and stress testing. This ensured

11
that the application could manage a significant number of concurrent users
without experiencing performance degradation.

During the implementation phase, there was no dedicated team for unit testing
and integration testing. However, manual testing was conducted to identify and
address any issues or bugs that arose during the process.

4.3 Screenshots
To provide a visual representation of the implemented application, we have in-
cluded the following screenshots of its output and user interface:

4.4 Quality Assurance


Even though there was no dedicated QA team involved in the project, quality as-
surance measures were implemented during the implementation phase. To main-
tain code consistency and enforce coding standards, ESLint was integrated into
the codebase. By utilizing ESLint with proper rules and plugins, the codebase was
analyzed for potential errors or stylistic problems, as well as checked for readability
and maintainability.

During the implementation phase, a structured approach was taken, including


manual testing for functionality and user experience, visual representation through
screenshots, and the use of ESLint to maintain code quality and consistency. These
actions resulted in a successful development of the full stack application, which
was functional and user-friendly.

12
CHAPTER 5

STANDARDS ADOPTED

In this section, we will discuss the standards that were adopted during the devel-
opment of the application, which includes design, coding, and testing standards.

5.1 Design Standards


Design standards are critical for creating maintainable and robust applications
in the field of software engineering. The project adhered to the following recom-
mended practices:

• Use of UML Diagrams: Unified Modeling Language (UML) diagrams


were used to visually represent the system architecture, data models, and
relationships between different components.

• Consistent User Interface Design: The user interface design followed


industry best practices and aimed to provide a seamless and intuitive user
experience.

• Database Design Standards: To ensure the integrity and efficiency


of the database, standard practices were followed in designing the database
schema. The design aimed to achieve data normalization and optimal query-
ing performance. The database entities and their relationships were metic-
ulously defined based on the application requirements.

5.2 Coding Standards


It is crucial to adhere to coding standards to produce code that is clean, easy to
read, and maintainable. During the development of the full stack application, the

13
following coding standards and best practices were observed:

1. ESLint Integration: A popular static code analysis tool called ESLint


was integrated into the development workflow. ESLint helped ensure coding
standards were enforced, potential errors were detected, and code consis-
tency was maintained. Custom ESLint rules were created in alignment with
industry best practices.

2. Naming Conventions: Appropriate naming conventions were used to


ensure code clarity and readability. Descriptive and meaningful names were
employed for variables, functions, and components, adhering to standard
naming conventions like camel case or Pascal case.

3. Code Organization: The codebase was structured in a modular and


organized manner. Functions and classes were kept concise and focused on
a single task, promoting reusability and maintainability. Indentation and
formatting were applied consistently to enhance code readability.

5.3 Testing Standards


Although this project did not follow specific testing standards like ISO/IEC/IEEE
29119, it is important to acknowledge the significance of established testing and
quality assurance practices in software development. These practices are critical
in ensuring the quality, reliability, and maintainability of software systems.

This project implemented various measures to maintain code quality and consis-
tency, such as integrating ESLint to enforce coding standards and identify poten-
tial issues. While no explicit testing was conducted, the project aimed to adhere to
design standards and recognize the importance of testing in software development.
By incorporating these practices, the project aimed to deliver a high-quality and
reliable application.

14
CHAPTER 6

CONCLUSION AND FUTURE SCOPE

6.1 Conclusion
In conclusion, the implementation of a face recognition attendance system pro-
vides a more efficient and automated way of recording attendance in educational
institutions. The reference project discussed in the text highlights the importance
of attendance records and the challenges associated with traditional attendance
processes. The project proposes an automatic attendance system that uses face
detection and recognition to label student attendance without disrupting the nor-
mal teaching process.

The work done on the system involved implementing a GUI and an API to provide
a simple and efficient way to interact with the system, improving the existing
codebase to optimize its performance and enhance its quality. The implementation
of a GUI using Tkinter and an API using Flask demonstrates how to create a user-
friendly interface and integrate the system with an organization’s system.

Overall, the implementation of a face recognition attendance system has the po-
tential to improve attendance records, save time and energy, and enhance the
learning experience for both teachers and students.

6.2 Future Scope


While the project has met the defined objectives, there are several areas that can
be further enhanced and expanded in the future:

1. Improve security: Implementing high-end 2FA + encryption on the data


stream and improving the security passes and barriers for a safe database

15
and defend DDoS, IP attacks.

2. Use Neural Network for high accuracy: The benefits of using neural
networks include improved accuracy, especially in complex and ambiguous
scenarios, as well as the ability to learn and adapt to new data. Neural
networks can also reduce the need for manual feature engineering, as they
can automatically learn useful features from data.

3. Build end-to-end SaaS: Building an end-to-end SaaS platform for ad-


ministrations to register themselves and use our technology on their end to
take attendance of employees/ or students.

The chapter discusses the conclusion and future scope of the implementation of
a face recognition attendance system. The project aims to improve attendance
records, save time and energy, and enhance the learning experience for both teach-
ers and students. The project involves implementing a GUI and an API to pro-
vide a simple and efficient way to interact with the system, improving the existing
codebase to optimize its performance and enhance its quality. The future scope
includes improving security, using neural networks for higher accuracy, and build-
ing an end-to-end SaaS platform for administrations to register themselves and
use the technology for attendance management.

16

You might also like