0% found this document useful (0 votes)
56 views44 pages

Smart Attendance System Report Final Document For Print

Smart attendance system using ml

Uploaded by

barlasricharan
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)
56 views44 pages

Smart Attendance System Report Final Document For Print

Smart attendance system using ml

Uploaded by

barlasricharan
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/ 44

Project Report

on

SMART ATTENDANCE SYSTEM USING


ML TECHNIQUES

Submitted in the partial fulfilment of the requirements for


the award of the degree of

BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING
By

A. SAI CHARAN 21315A0401


B. SRI CHARAN 21315A0402
V. VARAPRASAD 21315A0403

UNDER THE GUIDANCE OF


Dr. Asha Devi
Professor, Dept. of ECE

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


SREENIDHI INSTITUTE OF SCIENCE AND TECHNOLOGY
(Autonomous)
Yamnampet (V), Ghatkesar (M), Hyderabad – 501 301.
April 2024

1
SREENIDHI INSTITUTE OF SCIENCE AND TECHNOLOGY
(Affiliated to Jawaharlal Nehru Technological University, Hyderabad)
Yamnampet (V), Ghatkesar (M), Hyderabad – 501 301

Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the project report entitled “SMART


ATTENDANCE SYSTEM USING ML TECHNIQUES” is being submitted by

A. SAI CHARAN 21315A0401


B. SRI CHARAN 21315A0402
V. VARAPRASAD 21315A0403
in partial fulfilment of the requirements for the award of Bachelor of
Technology degree in Electronics and Communication Engineering to
Sreenidhi Institute of Science and Technology affiliated to Jawaharlal
Nehru Technological University, Hyderabad (Telangana). This record is a
bona fide work carried out by them under our guidance and supervision.
The results embodied in the report have not been submitted to any other
University or Institution for the award of any Degree or Diploma.

Dr. Asha Devi


Professor, Dept. of ECE

Head of the Department


Dr. S.P.V. SUBBA RAO
Professor, Department of ECE

Signature of the External Examiner

2
DECLARATION

We hereby declare that the work described in this thesis titled “SMART
ATTENDANCE SYSTEM USING ML TECHNIQUES” which is being submitted by us
in partial fulfilment for the award of Bachelor of Technology in the Department of
Electronics and Communication Engineering, Sreenidhi Institute of Science and
Technology is the result of investigations carried out by us under the guidance of Dr.
Asha Devi, Professor, Dept. of ECE, Sreenidhi Institute of Science and
Technology, Hyderabad.

No part of the thesis is copied from books/ journals/ internet and whenever the
portion is taken, the same has been duly referred. The report is based on the project
work done entirely by us and not copied from any other source. The work is original
and has not been submitted for any Degree/Diploma of this or any other University.

Place: Hyderabad
Date:
A. SAI CHARAN 21315A0401
B. SRI CHARAN 21315A0402
V. VARAPRASAD 21315A0403

3
ACKNOWLEDGEMENTS

We wish to express our deep sense of gratitude to our Internal guide and project
coordinator Dr. Asha Devi, Professor ECE Department who has taken great care in
the Project Work undertaken, by devoting their valuable time in advising and guiding
us at each phase, leading to successful completion of our Project Work. It has been
an educative and enlightening experience working with her.
We are greatly indebted to Prof. Dr. S.P.V Subba Rao, Head of the department
of Electronics and Communication for providing valuable guidance at every stage of
this Project Work.
We are thankful to our principal Dr. T. C. H. Siva Reddy for providing valuable
guidance and support at every stage of this Project Work.
We are profoundly grateful to our director Dr. C. V. Tomy and college
authorities for helping us in completing our Project Work. We would also like to
thank all our other faculty members and staff who supported us completing the
project work.

4
Contents

Abstract 8

CHAPTER1 : INTRODUCTION
1.1 Motivation 9
1.2 Background 9-10
1.3 Problem Statement 10-11
1.4 Aims and objectives 11-12
CHAPTER 2 : LITERATURE SURVEY 13 – 16
CHAPTER 3 : FUNDAMENTALS
3.1 Machine Learning 18
3.2 Deep Learning 19
3.3 Machine Learning vs Deep Learning 20
3.4 Open CV 22
3.5 HOG 23
3.6 Convolution Neural Network 24
3.7 Support Vector Machine 27
CHAPTER 4 : IMPLEMENTATION PROCESS 29 - 32
CHAPTER 5 : RESULTS
5.1 Output Images 33-35

5
CHAPTER 6: CONCLUSION & FUTURE SCOPE
6.1 Conclusion 37
6.2 Future Scope 38
REFERENCES 39-41
APPENDIX :
1.1 face_detection.py CODE 42
1.2 smart_attendance_system_program 43-44

6
LIST OF FIGURES

Figure 3.1 Machine learning vs Deep learning 22

Figure 3.2 Histogram of oriented gradients 25

Figure 3.3 Convolutional neural network 27

Figure 3.4 CNN data extraction 28

Figure 3.5 Support Vector Machine 29

Figure 4.1 Operation stages 31

Figure 4.2 Operation flow chart 33

Figure 5.1 Image recognition 35

Figure 5.2 Attendance marking 35

7
ABSTRACT

The paper outlines the development of a facial recognition system coupled with
a smart attendance feature using OpenCV and Python. Its core objective is to
streamline attendance processes in educational institutions or workplaces by
harnessing computer vision capabilities. Through real-time face detection and
recognition, manual attendance marking becomes obsolete, enhancing efficiency and
accuracy. Employing machine learning algorithms, the system is trained to precisely
identify individuals, ensuring dependable attendance tracking. A user-friendly
interface facilitates administrators in efficiently managing attendance records.
Notably, the project aims to overcome the shortcomings of traditional
attendance methods, offering a more precise and convenient alternative. OpenCV,
renowned for its prowess in computer vision tasks, is pivotal in handling challenges
like varying lighting conditions, facial expressions, and occlusions. Python's
integration enables seamless development and customization, ensuring adaptability
to specific needs. In conclusion, this endeavour seeks to deliver a practical and
trustworthy solution for automating attendance management, fostering enhanced
efficiency and productivity in both educational and organizational contexts.
Keywords: Face recognition, Smart Attendance system, Python, OpenCV,
Machine Learning.

8
CHAPTER 1
INTRODUCTION

9
1.1 MOTIVATION:

The SMART Attendance System utilizing machine learning techniques is


designed to revolutionize attendance tracking across diverse contexts such as
classrooms, workplaces, and events. Through the implementation of advanced
recognition algorithms, the system aims to significantly enhance accuracy by
precisely identifying individuals, thereby minimizing errors and mitigating the
risk of attendance manipulation.

Moreover, by automating the attendance-taking process, the system


greatly improves efficiency, saving valuable time for both instructors and
attendees, consequently fostering increased productivity and allowing for a
greater focus on more meaningful tasks. Furthermore, the system's
adaptability ensures reliable performance across various environments,
accommodating differences in lighting conditions, camera angles, and group
sizes. Scalability is also a key aspect, with the system designed to effortlessly
handle varying numbers of attendees, from small classrooms to large
conferences, without compromising accuracy or performance.

Overall, the SMART Attendance System represents a sophisticated


solution tailored to meet the evolving needs of attendance tracking, leveraging
machine learning technologies to deliver unparalleled accuracy, efficiency, and
adaptability.

1.2 BACKGROUND:

Facial recognition plays a pivotal role in our daily interactions, aiding us


in identifying familiar individuals like family, friends, or acquaintances.
However, the intricate process of recognizing faces involves several underlying
steps that are often overlooked. Human cognition enables us to receive visual
information and interpret it during the recognition process. This information is
received through the eyes and processed by the retina, where light, comprising
electromagnetic waves, projects images onto our visual perception. According

10
to Robinson-Riegler and Robinson-Riegler (2008), the human visual system
then engages in analyzing the shape, size, contour, and texture of objects,
including faces, to extract relevant information. This analyzed data is
subsequently compared to stored representations of faces in our memory to
facilitate recognition.

Despite the remarkable capabilities of the human brain in facial


recognition, building automated systems with equivalent proficiency poses a
significant challenge. The sheer volume and diversity of faces encountered in
settings such as universities render it impractical for individuals to remember
each face accurately.

To overcome these limitations, facial recognition systems leverage the


computational power of computers, which possess extensive memory capacity
and processing speed. Essentially, facial recognition is a biometric method that
involves identifying individuals by comparing real-time images with stored
facial data in a database, thereby providing a reliable means of authentication
and identification.

1.3 PROBLEM STATEMENT:

The existing methods of taking attendance, such as manual roll calls or


barcode scanners, are characterized by inefficiencies, error-prone processes,
and the absence of real-time monitoring functionalities. These traditional
approaches often consume significant amounts of time, leading to disruptions
in the learning or working environment. Additionally, the reliance on manual
input increases the likelihood of errors, whether through human oversight or
intentional manipulation.

Moreover, the lack of real-time monitoring means that attendance data


may not be readily available for immediate action or decision-making. To
overcome these shortcomings, the project aims to develop an automated
attendance system capable of accurately identifying individuals and seamlessly

11
recording their attendance status. The proposed system aims to optimize the
attendance-taking process through the integration of cutting-edge technologies
like machine learning algorithms and biometric recognition methods. Its goal is
to reduce errors, enhance efficiency, and offer immediate insights into
attendance trends in real-time.

This innovative approach not only improves efficiency but also enhances
the overall effectiveness of attendance management in various contexts,
including educational institutions, workplaces, and event venues. The
integration of machine learning algorithms allows for the automated
identification of individuals, reducing the need for manual intervention and
increasing the accuracy of attendance records. Additionally, the real-time
monitoring capabilities of the system enable prompt action in response to
attendance data, facilitating better decision-making and resource allocation.
Overall, the project aims to revolutionize traditional attendance-taking
methods, offering a more efficient, accurate, and adaptable solution for
attendance management.

1.4 Aims and Objectives:

The aim of this project is to create a face recognition attendance system,


with specific anticipated accomplishments to meet this goal:

Initially, the system will focus on identifying facial segments within video
frames accurately. This involves developing advanced algorithms capable of
discerning and isolating human faces, regardless of varying backgrounds and
perspectives, ensuring reliable face detection capabilities.

Subsequently, the system will proceed to extract pertinent features from


each recognized face. These features encompass diverse facial attributes such
as landmarks, textures, and shapes, crucial for effective differentiation between
individuals. Feature extraction serves as a pivotal step, providing the system
with essential data for accurate facial recognition.

12
Following feature extraction, the system will engage in feature
classification to facilitate facial identification. Through the utilization of
machine learning or deep learning models, specific facial characteristics will be
associated with known individuals, enabling precise matching of detected faces
with their respective identities. This classification process significantly
enhances the system's capability to recognize faces with consistency and
efficiency.

Upon successful recognition of a face, the system will proceed to


document the attendance of the identified individual. This process involves
updating a database or maintaining attendance records digitally, offering a
seamless and accurate method for attendance tracking.

By achieving these outlined milestones, the face recognition attendance


system endeavors to redefine conventional attendance-taking methods, offering
a contemporary, efficient, and dependable solution for attendance management
across various settings.

13
CHAPTER 2

LITERATURE REVIEW

14
[2] Harsh D Joshi; Aditya Kakhandaki; Kimaya Pawar; Seema U Deoghare,
"Automated Attendance Tracking and Wage Management System Using IRIS
Detection".

The Automated Attendance System proposed here leverages facial recognition


algorithms to streamline the process of attendance marking by automatically
identifying students upon their arrival in the classroom. The system incorporates
advanced techniques for both face detection and recognition. For face detection, it
employs the Viola-Jones Algorithm, a widely used method that utilizes cascade
classifiers to efficiently detect human faces within images or video streams. This
algorithm's effectiveness lies in its ability to rapidly scan images for facial features,
making it suitable for real-time applications like attendance tracking.
Feature selection, a crucial step in the facial recognition process, is achieved
using the Principal Component Analysis (PCA) algorithm. PCA helps in reducing the
dimensionality of the feature space while preserving as much variance as possible,
thereby enhancing the efficiency and accuracy of subsequent classification tasks.
For face classification, the system employs Support Vector Machines (SVM), a
powerful supervised learning algorithm commonly used for pattern recognition tasks.
SVMs are particularly effective in distinguishing between different classes in high-
dimensional spaces, making them well-suited for the task of recognizing individual
faces based on their extracted features.
Compared to traditional attendance methods, this automated system not only
saves time but also offers enhanced capabilities for student monitoring. By leveraging
the speed and accuracy of facial recognition technology, the system enables seamless
and efficient attendance tracking, contributing to improved classroom management
and administrative efficiency.

[3] Rathinamala S; Karthikeyan A; Abishek R; C. K. Kannan, Automatic

Attendance Monitoring System Using LBPH and HAAR Algorithm, 2023 9th
International Conference on Advanced Computing and Communication Systems
(ICACCS).

15
The paper introduces an automated attendance management system that relies
on face detection and recognition algorithms to identify students as they enter the
classroom and record their attendance through recognition. Specifically, the Local
Binary Pattern Histogram (LBPH) algorithm is employed in this system, chosen for its
demonstrated superior performance compared to other algorithms. LBPH is known
for its robustness and effectiveness in capturing facial features, making it well-suited
for accurate face recognition tasks in real-world environments. By leveraging LBPH,
the system aims to achieve reliable and efficient attendance tracking, enhancing
classroom management and administrative processes.

[4] Ali Sharifara; Mohd Shafry Mohd Rahim; Yasaman Anisi, "A general review
of human face detection including a study of neural networks and Haar feature-
based cascade classifier in face detection".

The author presents a comprehensive exploration of various face detection


techniques designed to effectively identify faces across different poses and patterns.
These techniques encompass a range of approaches, including the detection of
specific facial features such as the nose, eyes, hair, and ears, with some methods
even taking into account skin tone variations. The primary objective of face detection
is to accurately pinpoint the presence and location of faces within images, a
fundamental task in the field of computer vision. Through a detailed examination, the
paper delves into different methodologies, such as the Ada-Boost Algorithm, Viola-
Jones Face Detection Algorithm, SMQT Features and SNOW Classifier Method, and
Local Binary Pattern (LBP). Each technique is meticulously scrutinized for its
respective advantages and disadvantages, highlighting the nuances and
considerations associated with their implementation.
Furthermore, the paper underscores the importance of selecting the most
suitable face detection technique based on specific requirements and constraints.
Each method offers unique strengths and weaknesses, which must be carefully
weighed in the context of the intended application. For instance, while some
16
algorithms may excel in detecting faces under varying lighting conditions or facial
expressions, others may struggle with occlusions or complex backgrounds. By
thoroughly examining the characteristics and performance of each technique, the
paper provides valuable insights into the intricacies of face detection and offers
guidance for researchers and practitioners seeking to implement robust and reliable
solutions in real-world scenarios.

[5] Wang Qiang; Zhang Zhijing; Ye Xin; Jin Xin; Zhou Zhi, "Directional Sub-
pixel Edge Detection Based on Limited Window Local Entropy", 2011 Fourth
International Conference on Intelligent Computation Technology and Automation.

Within the proposed system, students are prompted to stand in front of the
camera, initiating iris detection and face recognition processes that streamline
attendance marking. To facilitate iris detection, the system leverages a combination
of algorithms including Gray Scale Conversion, Six Segment Rectangular Filter, and
Skin Pixel Detection. These algorithms work cohesively to accurately identify and
capture iris patterns, contributing to the system's overall effectiveness in attendance
management. By integrating iris detection alongside face recognition, the system
addresses concerns related to proxy attendance, ensuring the reliability and integrity
of attendance records.
While the implementation of iris detection and face recognition enhances the
system's robustness, it may introduce a potential drawback in terms of time
efficiency. As individuals are required to wait for the preceding members to complete
the iris detection and face recognition process, there may be delays in attendance
marking, leading to potential time wastage. Despite this challenge, the system's
ability to mitigate proxy attendance risks and ensure accurate student attendance
management remains paramount. Efforts to optimize the iris detection and face
recognition processes to minimize wait times while maintaining reliability are crucial
for enhancing the overall efficiency and usability of the proposed attendance system.

17
CHAPTER 3
FUNDANMENTALS

18
3.1 MACHINE LEARNING:

Machine learning is a branch of artificial intelligence (AI) that empowers


computers to learn from data and improve their performance over time without
being explicitly programmed. It revolves around the development of algorithms
that enable computers to automatically learn and make predictions or
decisions based on input data. The process involves feeding large amounts of
data into an algorithm, allowing it to recognize patterns, make predictions, or
identify trends without being explicitly programmed for each task.

At the heart of machine learning lies the concept of models, which are
mathematical representations of patterns or relationships within data. These
models are trained using a variety of algorithms that adjust their parameters to
minimize errors or discrepancies between predicted outcomes and actual data.
Various machine learning algorithms exist, categorized into types such as
supervised learning, unsupervised learning, and reinforcement learning. Each
type is tailored for specific tasks and data structures, offering a diverse range
of applications and capabilities.

Supervised learning consists of training a model with a labeled dataset,


where each input is linked to a predetermined output.. Through this process,
the model learns to recognize patterns within the labeled data and generalize
them to make predictions on new, unseen data. Unsupervised learning,
however, works with unlabeled data, where the algorithm aims to uncover
inherent structures or patterns without explicit guidance. On the other hand,
reinforcement learning focuses on training an agent to make sequential
decisions in an environment, learning optimal strategies through trial and error
and receiving feedback in the form of rewards or penalties for its actions.

Machine learning finds applications in various domains, including


finance, healthcare, marketing, and autonomous vehicles, among others.
However, it also raises ethical and societal concerns related to data privacy,

19
bias, and job displacement, highlighting the importance of responsible and
ethical implementation.

3.2 DEEP LEARNING:

Deep learning is a subset of machine learning that employs artificial neural


networks with multiple layers to model and extract patterns from complex data.
These neural networks, which draw inspiration from the architecture and
functionality of the human brain, are comprised of interconnected nodes arranged in
layers. Each layer processes the input data and passes it on to the next layer, with
the final layer generating the output. The depth of these networks, characterized by
the number of layers, distinguishes deep learning from traditional machine learning
techniques.

One of the key advantages of deep learning is its ability to automatically learn
hierarchical representations of data at different levels of abstraction. This
hierarchical representation enables deep neural networks to effectively capture
intricate patterns and features within the data, making them well-suited for tasks
such as image recognition, speech recognition, natural language processing, and
more.

There are several types of deep learning architectures tailored to different tasks
and data modalities. Convolutional Neural Networks (CNNs) are widely used for tasks
involving image recognition and computer vision. CNNs leverage convolutional layers
to extract spatial hierarchies of features from input images, enabling them to
recognize patterns such as edges, textures, and shapes.

Recurrent Neural Networks (RNNs) are specialized for sequential data


processing tasks, such as time series prediction, speech recognition, and language
modeling. Unlike feedforward neural networks, RNNs have connections that form
directed cycles, allowing them to maintain internal memory and process sequences of
inputs. This makes them particularly effective for tasks requiring context or temporal
dependencies.

20
Another type of deep learning architecture is the Generative Adversarial
Network (GAN), which consists of two neural networks— a generator and a
discriminator— pitted against each other in a game-theoretic framework. GANs are
used for generating realistic synthetic data, image-to-image translation, and data
augmentation. The generator network learns to generate data samples that are
indistinguishable from real data, while the discriminator network learns to
differentiate between real and synthetic data, thereby pushing the generator to
improve its output.

Furthermore, there are architectures like Deep Reinforcement Learning (DRL),


which combines deep neural networks with reinforcement learning algorithms to
enable machines to learn optimal decision-making policies through interaction with
an environment. Overall, deep learning continues to drive significant advancements
in AI, revolutionizing various industries and opening doors to new possibilities in
artificial intelligence and machine learning.

3.3 MACHINE LEARNING VS DEEP LEARNING:

Machine learning and deep learning are two prominent subfields within the
broader domain of artificial intelligence, each with distinct characteristics and
applications. While both involve training algorithms to learn from data, they differ in
their approach, complexity, and the types of problems they address.

Machine learning encompasses an extensive array of methodologies facilitating


computers to glean insights from data and render predictions or decisions devoid of
explicit programming. It includes supervised learning, unsupervised learning, and
reinforcement learning, among others. Supervised learning involves training models
on labeled datasets, where each input is paired with a corresponding output, while
unsupervised learning deals with unlabeled data to discover hidden patterns or
structures. Reinforcement learning focuses on training agents to interact with an
environment and learn optimal strategies through trial and error.

21
On the other hand, deep learning is a subset of machine learning that
leverages artificial neural networks with multiple layers to model and extract complex
patterns from data. Deep learning architectures, inspired by the structure and
function of the human brain, consist of interconnected nodes organized into layers.
These networks can automatically learn hierarchical representations of data at
different levels of abstraction, making them well-suited for tasks involving image
recognition, speech recognition, natural language processing, and more.

Figure No 3.1 Machine learning VS deep learning

One of the key distinctions between machine learning and deep learning lies in
the depth and complexity of the models used. While traditional machine learning
algorithms often rely on handcrafted features and shallow models, deep learning
models learn multiple levels of representation from the data itself, eliminating the
need for manual feature engineering in many cases. This allows deep learning models
to capture intricate patterns and features within the data, leading to state-of-the-art
performance in various domains.

22
Furthermore, deep learning often requires large amounts of labeled data and
computational resources for training, making it more computationally intensive
compared to some traditional machine learning techniques. However, the scalability
and flexibility of deep learning have fueled significant advancements in AI, enabling
breakthroughs in areas such as computer vision, natural language processing, and
autonomous systems. Despite their differences, both machine learning and deep
learning play crucial roles in advancing artificial intelligence and driving innovation
across industries.

3.4 OPEN CV:

OpenCV, an abbreviation for Open Source Computer Vision Library, stands as


a prevalent open-source tool for computer vision and image processing endeavors. It
furnishes an extensive array of functions and algorithms, empowering developers to
execute an assortment of tasks, encompassing image and video manipulation, object
detection and tracking, facial recognition, and beyond. Initially created by Intel and
presently upheld by a collaborative community, OpenCV ensures cross-platform
compatibility, facilitating its utilization across various operating systems, including
Windows, Linux, macOS, and mobile platforms like Android and iOS.

One of the key strengths of OpenCV lies in its extensive collection of pre-built
functions and algorithms, which significantly streamline the development process for
computer vision applications. These functions cover a wide range of tasks, from basic
image processing operations such as filtering, edge detection, and morphological
operations to advanced techniques like feature detection, camera calibration, and
machine learning-based object detection.

Its efficient implementation of algorithms, optimized for parallel processing


using multicore CPUs and GPUs, ensures fast and responsive performance even with
large datasets. Furthermore, OpenCV's modular architecture and support for
hardware acceleration technologies like CUDA (Compute Unified Device Architecture)
enable developers to leverage the full potential of modern computing hardware for
accelerated image processing and computer vision tasks.

23
3.5 HISTOGRAM OF ORIENTED GRADIENTS (HOG):

Facial recognition systems utilize diverse methods to precisely identify and


differentiate faces within images or video streams. At the outset, these systems
deploy face detection algorithms, such as the Histogram of Oriented Gradients (HOG),
which assess gradients and patterns in monochrome images to detect faces.

The Histogram of Oriented Gradients (HOG) algorithm is a popular technique


used in computer vision for object detection and recognition tasks. It operates by
analyzing the distribution of gradient orientations in localized regions of an image.
The fundamental concept behind HOG is to capture the shape and texture
information of objects within an image by quantifying the distribution of gradient
directions.
To understand the workings of the HOG algorithm, the image is first divided
into small, overlapping regions known as cells. Within each cell, gradient information
is computed by calculating the magnitude and orientation of gradients using
techniques like the Sobel operator. The gradients provide information about the
intensity variations and edges within the image.
After computing gradients for each cell, neighboring cells are grouped together
into blocks. These blocks are used to aggregate gradient information from adjacent
cells, allowing the algorithm to capture spatial relationships between features. By
normalizing the gradient values within each block, the HOG algorithm becomes
robust to changes in illumination and contrast, enhancing its performance in varying
conditions.

24
Figure No 3.2 Histogram of oriented gradients

Finally, the histogram of gradient orientations is computed for each block,


capturing the distribution of gradient directions. These histograms serve as feature
descriptors that represent the local texture and shape information within the image.
The HOG features can then be fed into a machine learning algorithm, such as a
support vector machine (SVM), for object detection and recognition tasks. Overall, the
HOG algorithm provides a powerful and effective method for extracting discriminative
features from images, making it widely used in various computer vision applications.

3.6 CONVOLUTIONAL NEURAL NETWORK(CNN):

Following the alignment of faces, deep learning methods, notably Deep


Convolutional Neural Networks (CNNs), are utilized for facial encoding. These CNNs
innovate image analysis and processing by emulating the human visual system's
proficiency in identifying visual patterns.

Convolutional Neural Networks (CNNs) are a class of deep neural networks


widely used in machine learning and computer vision tasks, particularly for tasks
like image recognition and classification. The core idea behind CNNs is to leverage the
local connectivity and hierarchical structure of visual data to automatically learn
features directly from raw input images.

25
At the heart of CNNs are convolutional layers, which perform the convolution
operation on input data using learnable filters or kernels. These filters slide across
the input image, computing dot products between the filter weights and the pixel
values in the receptive field. This operation results in feature maps that capture
spatial hierarchies of features, such as edges, textures, and patterns, across different
regions of the image.
CNNs also incorporate pooling layers, such as max pooling or average pooling,
which down sample the feature maps by summarizing the information within local
neighbourhoods. Pooling helps reduce the spatial dimensionality of the feature maps
while retaining important features, making the network more robust to variations in
the input data and reducing computational complexity.

Additionally, CNNs often include activation functions, such as the rectified


linear unit (ReLU), applied element-wise to introduce non-linearity into the network.

Figure No 3.3 Convolutional neural network

Furthermore, CNN architectures typically consist of multiple convolutional


layers followed by fully connected layers, which perform classification or regression
tasks based on the extracted features. In a Convolutional Neural Network (CNN), the
embedding typically consists of a series of convolutional layers followed by pooling

26
layers, which are responsible for extracting features from the input data. These layers
employ learnable filters or kernels to convolve over the input image, computing dot
products and generating feature maps that capture spatial hierarchies of features.
With a depth of 128 measurements, the embedding encodes increasingly abstract
and discriminative representations of the input data as it progresses through the
convolutional layers. The pooling layers then down sample the feature maps,
summarizing the information within local neighbourhoods and reducing spatial
dimensionality. Through this process, the CNN learns to extract meaningful features
from the input data, enabling it to perform tasks such as image classification, object
detection, and semantic segmentation effectively.

Figure No 3.4 CNN data extraction

Overall, CNNs leverage the principles of local connectivity, parameter sharing,


and hierarchical feature learning to automatically extract meaningful features from
raw input data. Their ability to learn hierarchical representations directly from data
has led to significant advancements in image recognition, object detection, and other
visual perception tasks.
3.7 SUPPORT VECTOR MACHINE(SVM):
In the final stage of the facial recognition pipeline, classification algorithms like
linear Support Vector Machines (SVMs) are utilized to associate names with detected
faces.

27
Support vectors, pivotal in SVMs, represent data points positioned closest to
the decision boundary, thus delineating the optimal hyperplane and establishing the
margin. By prioritizing margin maximization, SVMs achieve heightened generalization
efficacy and resilience to noise. Employing kernel functions, SVMs can address non-
linearly separable data by projecting input data into higher-dimensional spaces
conducive to separation. Throughout the training process, SVMs fine-tune a convex
objective function to strike a balance between maximizing margin and minimizing
classification errors. Subsequently, when presented with new data points, SVMs
classify them based on their proximity to the decision boundary, thereby determining
their assigned class label.

Figure No 3.5 Support vector machine

By comparing embeddings of test images with those of known individuals


stored in a database, the classification algorithm determines the closest match,
thereby assigning names to detected faces. This classification process completes the
facial recognition process, enabling rapid and accurate identification of individuals
within images or video streams.

28
CHAPTER 4
IMPLEMENTATION PROCESS

29
The initial step in building a facial recognition system using OpenCV involves
capturing an image from a camera as input. OpenCV provides functionalities to
interface with cameras and capture frames in real-time. This step typically involves
accessing the camera feed, either from a connected webcam or an external camera
device, and capturing a frame containing the face of the person whose attendance is
to be recorded. Careful consideration must be given to factors such as lighting
conditions, camera angles, and image resolution to ensure optimal results.

Figure No 4.1 Operation stages

Following the image capture stage, the next crucial step is face detection using
OpenCV's pre-trained face detection models or custom-trained classifiers. OpenCV
offers various face detection algorithms. These algorithms analyze the captured image
to identify regions containing human faces. Upon detection, bounding boxes are
drawn around the detected faces, providing visual cues for further processing.
Once the face is successfully detected, the next step involves extracting the
facial region from the captured image. OpenCV provides utilities to crop and extract
regions of interest (ROI) from images based on the coordinates of the detected

30
bounding boxes. By isolating the facial region, unnecessary background information
is eliminated, allowing for more accurate facial feature extraction and recognition.
Preprocessing techniques such as resizing, normalization, and grayscale conversion
may also be applied to the extracted facial images to enhance their quality and
simplify subsequent processing.
After extracting and preprocessing the facial images, they are saved to a
storage location for future reference and comparison. OpenCV offers functionalities to
save images in various formats, such as JPEG or PNG, ensuring compatibility with
other image processing tools and applications. These saved images serve as reference
data for training recognition models or for comparison with new input images during
the recognition phase. Proper organization and labeling of the saved images are
essential for efficient retrieval and management of the dataset.
In the final step, the saved facial images are loaded and used for matching
against new input images. OpenCV provides tools for loading images from storage
and performing tasks such as feature extraction, similarity computation, and
matching. Techniques like facial embedding extraction using deep learning models or
feature extraction using traditional methods like Histogram of Oriented Gradients
(HOG) may be employed to represent facial images as numerical vectors. These
vectors are then compared with the vectors of input facial images using similarity
metrics such as cosine similarity or Euclidean distance to determine matches. The
recognition results are subsequently used for attendance tracking, identity
verification, or other applications requiring facial recognition capabilities. Through
these steps, a comprehensive facial recognition system is developed using OpenCV,
capable of capturing, detecting, extracting, saving, and matching facial images for
diverse use cases.

31
Figure No 4.2 Operation flow chart

32
CHAPTER 5

RESULTS

33
5.1 OUTPUT IMAGES:

Figure No 5.1 Image recognition

Figure No 5.2 Attendance marking

In Figure 4, the implementation of the smart attendance system


within the seminar hall of our college, SNIST, is depicted. Initially, the
system underwent a training phase wherein images of final year students
were loaded and utilized to train the system. This training process involved
the system learning and internalizing the facial features of the enrolled
students, enabling it to recognize them accurately during subsequent
34
attendance sessions. The smart attendance system was strategically
positioned within the seminar hall, equipped with a webcam to capture real-
time images of attendees as they entered the premises. Upon image capture,
the system employed its facial recognition capabilities to identify the final
year students, as illustrated in Figure 4.

Subsequently, as portrayed in Figure 5, after successfully recognizing


the final year students, the smart attendance system proceeded to mark
their attendance. Once the students were identified, their attendance status
was automatically recorded by the system, eliminating the need for manual
attendance tracking methods. This automated process streamlined the
attendance management process, reducing administrative burden and
ensuring efficient monitoring of student attendance. By leveraging the
capabilities of the smart attendance system, SNIST was able to implement a
robust and reliable attendance tracking mechanism, enhancing overall
efficiency and accuracy in attendance management within the seminar hall.

35
CHAPTER 6

CONCLUSIONS & FUTURE SCOPE

36
6.1 CONCLUSION:

Managing attendance in lecture halls, particularly in classrooms with


substantial student populations, presents a formidable challenge that is
both laborious and time-intensive. The introduction of Automatic Facial
Recognition (AFR) technology has brought about a significant paradigm shift
in attendance management practices, offering a solution that not only
simplifies the process but also enhances data security measures. By
leveraging facial recognition controls, educational institutions can
streamline daily operations and reduce their reliance on traditional paper-
based and manual attendance tracking methods. With AFR, the student's
facial biometrics and other facial characteristics serve as unique identifiers,
enabling the system to capture, store, and apply various algorithms for
recognition purposes within our attendance system. Through this approach,
the computerized system efficiently identifies the students by matching their
facial features against stored data, thereby facilitating the automatic
marking of attendance.

A diverse array of algorithms and techniques are employed to bolster


the accuracy and efficiency of facial recognition within the attendance
system. These algorithms leverage sophisticated computational methods to
analyze and compare facial features, ensuring robust recognition
capabilities even amidst varying environmental conditions and facial
expressions. By continuously refining and optimizing these algorithms,
educational institutions can enhance the reliability and effectiveness of their
attendance management systems, ultimately contributing to improved
administrative efficiency and student engagement. Through the integration
of facial recognition technology, educational institutions can embrace a
modernized approach to attendance tracking that not only streamlines
operations but also upholds stringent data security standards, fostering a
more efficient and technologically advanced learning environment.

37
6.2 FUTURE SCOPE:

To enhance the accuracy of face detection within the model and


achieve optimal performance, it is imperative to implement iterative
improvements and refinements. This can involve fine-tuning the parameters
of the facial recognition algorithms, adjusting thresholds for feature
extraction, and optimizing the model architecture. Additionally, augmenting
the training dataset with a diverse range of facial images captured under
various lighting conditions, angles, and facial expressions can help improve
the model's robustness and generalization capabilities. Moreover, integrating
techniques such as data augmentation, regularization, and ensemble
learning can further bolster the model's accuracy by reducing overfitting and
enhancing its ability to generalize to unseen data.

Despite the inherent challenges associated with manual attendance


tracking, retrieving data from Excel sheets has proven to be a remarkably
efficient and reliable method. Excel sheets offer a structured and organized
format for storing attendance data, facilitating easy retrieval and analysis.
By leveraging Excel's functionalities, educational institutions can efficiently
manage attendance records, track student participation, and generate
comprehensive reports. However, to streamline the process further and
mitigate the laborious nature of manual data entry, exploring automation
solutions or integrating Excel with other software applications can offer
additional efficiency gains.

A strategic approach to organizing attendance schedules involves


creating separate Excel files for each day, rather than storing all attendance
data in a single file. This segmented approach enhances organizational
clarity and simplifies data management, as it allows for easier navigation
and retrieval of specific attendance records. By compartmentalizing
attendance data into daily files, educational institutions can maintain a
structured and systematic record-keeping system, minimizing the risk of
data errors or inconsistencies.

38
REFERENCES

[1] Victor Oluwatobiloba Adeniji; Mfundo Shakes Scott; Nomnga


Phumzile,"Development of an Online Biometric-enabled Class Attendance
Register System",ISBN:978-1-9058-2455-7
[2] Harsh D Joshi; Aditya Kakhandaki; Kimaya Pawar; Seema U
Deoghare,"Automated Attendance Tracking and Wage Management
System Using IRIS Detection",ISBN:979-8-3503-0426-8
[3]. Rathinamala S; Karthikeyan A; Abishek R; C. K. Kannan, Automatic
Attendance Monitoring System Using LBPH and HAAR Algorithm, 2023
9th International Conference on Advanced Computing and
Communication Systems (ICACCS), DOI:
10.1109/ICACCS57279.2023.10112924, ISBN:979-8-3503-9737-6
ISBN:979-8-3503-9735-2.
[4]. Ali Sharifara; Mohd Shafry Mohd Rahim; Yasaman Anisi, "A general
review of human face detection including a study of neural networks and
Haar feature-based cascade classifier in face detection", 2014 International
Symposium on Biometrics and Security Technologies (ISBAST), DOI:
10.1109/ISBAST.2014.7013097, ISBN:978-1-4799-6444-4
[5]. Wang Qiang; Zhang Zhijing; Ye Xin; Jin Xin; Zhou Zhi, "Directional
Sub-pixel Edge Detection Based on Limited Window Local Entropy", 2011
Fourth International Conference on Intelligent Computation Technology and
Automation,DOI: 10.1109/ICICTA.2011.416, ISBN:978-1-61284-289-9
[6] . A. Devi Dharmavaram, S. Babu M and S. Vunnisa Sayyad, "Design
and Analysis of Encoding Decoding Methods used for 5G Communications,"
2022 IEEE Delhi Section Conference (DELCON), 2022, pp. 1-7, doi:
10.1109/DELCON54057.2022.9753541. (Electronic ISBN:978-1-6654-
5883-2 Print on Demand(PoD) ISBN:978-1-6654-5884-9).
[7]. Dharmavaram Asha Devi, Niharika Reddy Kathula, Gopinath Kalluri,
and Leela Sai Bondalapati, " Design and Implementation of Image
Processing Application with Zynq SoC", International Journal of Computing
and Digital Systems, Vol.14, Issue.01, 2023.
[8]. M.Suresh Babu, Dharmavaram Asha Devi, A.Pranayanatha Reddy,

39
“Forecasting Election Results using Machine Learning Techniques”,
Communication and Management Journal, pp-88-96, vol.8,issue.10, Oct-
2023.
[9]. Dharmavaram Asha Devi, Satyavati Jaga, “Analysis of Scheduled
Routing Algorithms on 5Port Router for Network on Chip Application”,
International Journal of Scientific & Technology Research, ISSN 2277-8616,
VOLUME 8, ISSUE 09, pp-2148-2153, September 2019.
[10]. M. Veldurthi and A. D. Dharmavaram, "Automatic Vehicle
Identification and Recognition using CNN Implemented on PYNQ
Board," 2022 6th International Conference on Electronics, Communication and
Aerospace Technology, Coimbatore, India, 2022, pp. 1302-1306, doi:
10.1109/ICECA55336.2022.10009054
[11]. Babu, M.S., Raj, K.B., Devi, D.A. (2021). Data Security and Sensitive
Data Protection using Privacy by Design Technique. In: Haldorai, A., Ramu,
A., Mohanram, S., Chen, MY. (eds) 2nd EAI International Conference on Big
Data Innovation for Sustainable Cognitive Computing. EAI/Springer
Innovations in Communication and Computing. Springer,
Cham. https://doi.org/10.1007/978-3-030-47560-4_14
[12]. Jinane Mounsef, Lina Karam, "Augmented Sparse Representation
Classifier for Blurred Face Recognition", 2018 25th IEEE International
Conference on Image Processing (ICIP), pp.778-782, 2018.
[13]. Hongjun Wang, Jiani Hu, Weihong Deng, "Compressing Fisher Vector
for Robust Face Recognition", IEEE Access, vol.5, pp.23157-23165, 2017
[14]. Jeong-Jik Seo, Hyung-Il Kim, Yong Man Ro, "Pose-Robust and
Discriminative Feature Representation by Multi-task Deep Learning for
Multi-view Face Recognition", 2015 IEEE International Symposium on
Multimedia (ISM), pp.166-171, 2015
[15]. Rosebrock, A. (2019). Deep Learning for Computer Vision with
Python. PyImageSearch.
[16]. Wonjun Hwang, Junmo Kim, "Mark1ov Network-Based Unified
Classifier for Face Recognition", IEEE Transactions on Image Processing,
vol.24, no.11, pp.4263-4275, 2015

40
[17]. Togneri, R., & Bennamoun, M. (2001). Face recognition using line
edge maps. IEEE Transactions on Pattern Analysis and Machine
Intelligence, 23(6), 691-697.
[18]. Bradski, G., & Kaehler, A. (2008). Learning OpenCV: Computer Vision
with the OpenCV Library
[19]. Belhumeur, P. N., Hespanha, J. P., & Kriegman, D. J. (1997).
Eigenfaces vs. Fisherfaces: Recognition using class specific linear
projection. IEEE Transactions on Pattern Analysis and Machine
Intelligence, 19(7), 711-720.
[20]. Thambiratnam, D. P., & Ramana, K. V. (2018). A review on face
recognition algorithms. International Journal of Pure and Applied
Mathematics, 118(19), 3589-3600.
[21] https://medium.com/@ageitgey/machine-learning-is-fun-part-4-
modern-face-recognition-with-deep-learning-c3cffc121d78.

41
APPENDIX :
1.1 face_detection.py CODE :
# importing librarys
import cv2
import numpy as npy
import face_recognition as face_rec
# function
def resize(img, size) :
width = int(img.shape[1]*size)
height = int(img.shape[0] * size)
dimension = (width, height)
return cv2.resize(img, dimension, interpolation= cv2.INTER_AREA)

# img declaration
smplimg = face_rec.load_image_file('sample_images\smplimg.jpg')
smplimg = cv2.cvtColor(smplimg, cv2.COLOR_BGR2RGB)
smplimg = resize(smplimg, 0.50)
smplimg_test = face_rec.load_image_file('sample_images\elonmusk.jpg')
smplimg_test = resize(smplimg_test, 0.50)
smplimg_test = cv2.cvtColor(smplimg_test, cv2.COLOR_BGR2RGB)

# finding face location

faceLocation_smplimg = face_rec.face_locations(smplimg)[0]
encode_smplimg = face_rec.face_encodings(smplimg)[0]
cv2.rectangle(smplimg, (faceLocation_smplimg[3], faceLocation_smplimg[0]),
(faceLocation_smplimg[1], faceLocation_smplimg[2]), (255, 0, 255), 3)

faceLocation_smplimgtest = face_rec.face_locations(smplimg_test)[0]
encode_smplimgtest = face_rec.face_encodings(smplimg_test)[0]
cv2.rectangle(smplimg_test, (faceLocation_smplimg[3],
faceLocation_smplimg[0]), (faceLocation_smplimg[1], faceLocation_smplimg[2]),
(255, 0, 255), 3)

results = face_rec.compare_faces([encode_smplimg], encode_smplimgtest)


print(results)
cv2.putText(smplimg_test, f'{results}', (50,50), cv2.FONT_HERSHEY_COMPLEX,
1,(0,0,255), 2 )

cv2.imshow('main_img', smplimg)
cv2.imshow('test_img', smplimg_test)
cv2.waitKey(0)
cv2.destroyAllWindows()

42
1.2 smart_Attendance_system_program.py CODE :

import cv2
import numpy as np
import face_recognition as face_rec
import os
import pyttsx3 as textSpeach
from datetime import datetime

engine = textSpeach.init()

def resize(img, size) :


width = int(img.shape[1]*size)
height = int(img.shape[0] * size)
dimension = (width, height)
return cv2.resize(img, dimension, interpolation= cv2.INTER_AREA)

path = 'student_images'
studentImg = []
studentName = []
myList = os.listdir(path)
for cl in myList :
curimg = cv2.imread(f'{path}/{cl}')
studentImg.append(curimg)
studentName.append(os.path.splitext(cl)[0])

def findEncoding(images) :
imgEncodings = []
for img in images :
img = resize(img, 0.50)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
encodeimg = face_rec.face_encodings(img)[0]
imgEncodings.append(encodeimg)
return imgEncodings
def MarkAttendance(name):
with open('Attendance.csv', 'r+') as f:
myDatalist = f.readlines()
nameList = []
for line in myDatalist :
entry = line.split(',')
nameList.append(entry[0])

if name not in nameList:


now = datetime.now()
timestr = now.strftime('%H:%M')
f.writelines(f'\n{name}, {timestr}')
statment = str('welcome to class' + name)

43
engine.say(statment)
engine.runAndWait()

EncodeList = findEncoding(studentImg)

vid = cv2.VideoCapture(1)
while True :
success, frame = vid.read()
Smaller_frames = cv2.resize(frame, (0,0), None, 0.25, 0.25)

facesInFrame = face_rec.face_locations(Smaller_frames)
encodeFacesInFrame = face_rec.face_encodings(Smaller_frames, facesInFrame)

for encodeFace, faceloc in zip(encodeFacesInFrame, facesInFrame) :


matches = face_rec.compare_faces(EncodeList, encodeFace)
facedis = face_rec.face_distance(EncodeList, encodeFace)
print(facedis)
matchIndex = np.argmin(facedis)

if matches[matchIndex] :
name = studentName[matchIndex].upper()
y1, x2, y2, x1 = faceloc
y1, x2, y2, x1 = y1*4, x2*4, y2*4, x1*4
cv2.rectangle(frame, (x1, y1), (x2, y2), (0, 255, 0), 3)
cv2.rectangle(frame, (x1, y2-25), (x2, y2), (0, 255, 0),
cv2.FILLED)
cv2.putText(frame, name, (x1+6, y2-6), cv2.FONT_HERSHEY_COMPLEX,
1, (255, 255, 255), 2)
MarkAttendance(name)

cv2.imshow('video',frame)
cv2.waitKey(1)

44

You might also like