Automated Attendance System Using Image Processing
Automated Attendance System Using Image Processing
Automated Attendance System Using Image Processing
Abstract:
Facial image has set out to be an important biometric feature, which easily is
acquirable and doesn’t require any special or physical interaction between
the subject and the device. As it is observed, image recognition is very
complex and challenging one affecting variety of parameters such as
intensity, orientation, expression and size. Individual recognition is of most
importance in today’s world due to varied reasons. Real-time applications of
this algorithms faces some limitations to resolve loss of important
information. Detection and recognition of faces in videos using image
processing is discussed in. Various steps for detection and recognition are
demonstrated and details regarding what algorithms are used to implement
this techniques are described.
Literature Survey:
Reference 1:
Title: “An Analysis of the Viola-Jones Face Detection Algorithm, Image
Processing”
Reference 2:
Reference 3:
Reference 4:
Reference 5:
Existing System:
Disadvantages:
Objective:
The aim is to develop the automated system for detection and recognition of
faces using their images from videos and recording the attendance of the
students by identifying him/her from their variant facial features. This helps
to maintain and handle the attendance system automatically without any
human intervention. This new system can ease the hectic attendance
maintenance and handling the attendance will be more precise and efficient.
The proposed system contributes to human face detection with the help of
Viola Jones algorithm and face recognition with Fisher Face algorithm.
Scope:
The goal of the project is detecting the students face and automatically
taking attendance without human interaction. By using Viola Jones algorithm
and detecting the faces by Fisher Face algorithm(FFA) that are stored in the
database when we take the images for training. We train the algorithm by
giving the dataset that contains student images from different angles for
accuracy and detection. After performing multiple trials and rigorous training
of the image set, it is been observed that face recognition has been possible
with near to accurate results.
In these experiments, frames are captured from the videos at the regular
interval of 2 seconds. These frames are used to detect the numbers of faces
present in the system. Using the registered students data, detected faces
from the frames are recognized by matching the features with the database.
Motivation:
Now a days, the field of image processing has wide range applications in
biometric recognition, behavioral analysis, teleconferencing and video
surveillance. This project typically puts forward idea of using image
processing techniques such as detection and recognition of faces to design
the system that can automatically handle the attendance of the students.
Proposed System:
Advantages:
Libraries Used:
Tkinter: (Tkinter is the standard GUI library for Python. Python when
combined with Tkinter provides a fast and easy way to create GUI
applications. Tkinter provides a powerful object-oriented interface to the Tk
GUI toolkit.)
PIL: (PIL is a free library for the Python programming language that adds
support for opening, manipulating, and saving many different image file
formats.)
OS: (OS module provides allows you to interface with the underlying
operating system that Python is running on – be that Windows, Mac or
Linux.)
Datetime: (The datetime module supplies classes for manipulating dates and
times.)
Time: (The Python time module provides many ways of representing time in
code, such as objects, numbers, and strings. It also provides functionality
other than representing time, like waiting during code execution and
measuring the efficiency of your code.)
Pandas: (It provides ready to use high-performance data structures and data
analysis tools. Pandas module runs on top of NumPy and it is popularly used
for data science and data analytics.)
Specifications:
HARDWARE REQUIREMENTS:
SOFTWARE REQUIREMENTS:
Various steps for detection and recognition are demonstrated and details
regarding what algorithms are used to implement this techniques are
described.
Work Flow of the system: Students will first register themselves in the
system with proper details, and facial images captured from different angles
and positions. On successful completion of registration process, store
students data in the database. Video Acquisition is done by capturing the
video of the class being conducted in a classroom. Acquired video is used to
detect and recognize faces of different students and differentiate them from
background using image processing techniques i.e. Viola – Jones Algorithm
for face detection, Cropping of faces and Binary Face Algorithm for face
recognition. Student’s identity verification is done by comparing facial image
of the students with the faces stored in the database. If the faces of students
are matched, then their attendance is recorded and updated in the system.
Also, it takes care to see that once attendance is recorded for a particular
student no more update to the attendance of that student will be recorded
(i.e. 1 student = 1 attendance).
Viola Jones was the one to formulate the first ever real-time face detection
algorithm which helped to detect faces from the images. In this module, a
complete algorithmic description is implemented which includes feature
computation using integral images, selection of features with the help of
adaboost training and cascading for efficient allocation of computational
resources. This algorithm provides fast and accurate detection. To compute
face detection, Viola – Jones algorithm is used. Viola Jones algorithm is
divided in four phases:
In Haar feature selection, compute scalar product between the image and
Haar templates. Then, calculate the difference between the number of black
pixels and number of white pixels to obtain numerous features. All the
images are normalized using mean and variance to recoup the effect of
different lighting conditions. Images having variance value lower than one
with little information of interest are excluded. Five Haar patterns that are
used to compute various features from the facial images. These haar
patterns marked with black or white pixels are moved over an image to
compute all the features. These features helps to detect faces from an
images with required computation.
3. Adaboost Training
Development:
We proposed as an alternative to the user-based neighborhood approach.
We first consider the dimensions of the input and output of the neural
network. In order to maximize the amount of training data we can feed to the
network, we consider a training example to be a user profile (i.e. a row from
the user-item matrix R) with one rating withheld. The loss of the network on
that training example must be computed with respect to the single withheld
rating. The consequence of this is that each individual rating in the training
set corresponds to a training example, rather than each user. As we are
interested in what is essentially a regression, we choose to use root mean
squared error (RMSE) with respect to known ratings as our loss function.
Compared to the mean absolute error, root mean squared error more heavily
penalizes predictions which are further off. We reason that this is good in the
context of recommender system because predicting a high rating for an item
the user did not enjoy significantly impacts the quality of the
recommendations. On the other hand, smaller errors in prediction likely
result in recommendations that are still useful—perhaps the regression is not
exactly correct, but at least the highest predicted rating are likely to be
relevant to the user
Collection:
The most crucial step when starting with ML is to have data of good quality
and accuracy. Data can be collected from any authenticated source
like data.gov.in, Kaggle or UCI dataset repository.For example, while
preparing for a competitive exam, students study from the best study
material that they can access so that they learn the best to obtain the best
results. In the same way, high-quality and accurate data will make the
learning process of the model easier and better and at the time of testing,
the model would yield state of the art results.
A huge amount of capital, time and resources are consumed in collecting
data. Organizations or researchers have to decide what kind of data they
need to execute their tasks or research.
Example: Working on the Facial Expression Recognizer, needs a large
number of images having a variety of human expressions. Good data
ensures that the results of the model are valid and can be trusted upon.
Preparation:
The collected data can be in a raw form which can’t be directly fed to the
machine. So, this is a process of collecting datasets from different sources,
analyzing these datasets and then constructing a new dataset for further
processing and exploration. This preparation can be performed either
manually or from the automatic approach. Data can also be prepared in
numeric forms also which would fasten the model’s learning.
Example: An image can be converted to a matrix of N X N dimensions, the
value of each cell will indicate image pixel.
Input:
Now the prepared data can be in the form that may not be machine-
readable, so to convert this data to readable form, some conversion
algorithms are needed. For this task to be executed, high computation and
accuracy is needed. Example: Data can be collected through the sources like
MNIST Digit data(images), twitter comments, audio files, video clips.
Processing:
This is the stage where algorithms and ML techniques are required to
perform the instructions provided over a large volume of data with accuracy
and optimal computation.
Output:
In this stage, results are procured by the machine in a meaningful manner
which can be inferred easily by the user. Output can be in the form of
reports, graphs, videos, etc
Storage:
This is the final step in which the obtained output and the data model data
and all the useful information are saved for the future use.
1. Rescale Data
3. Standardize Data
Standardization is a useful technique to transform attributes with a
Gaussian distribution and differing means and standard deviations
to a standard Gaussian distribution with a mean of 0 and a standard
deviation of 1.
We can standardize data using scikit-learn with the StandardScaler
class.
Data Cleansing
Introduction:
Data cleaning is one of the important parts of machine learning. It plays a
significant part in building a model. Data Cleaning is one of those things that
everyone does but no one really talks about. It surely isn’t the fanciest part
of machine learning and at the same time, there aren’t any hidden tricks or
secrets to uncover. However, proper data cleaning can make or break your
project. Professional data scientists usually spend a very large portion of
their time on this step.
Because of the belief that, “Better data beats fancier algorithms”.
If we have a well-cleaned dataset, we can get desired results even with a
very simple algorithm, which can prove very beneficial at times.
Obviously, different types of data will require different types of cleaning.
However, this systematic approach can always serve as a good starting
point.
• Openrefine
• Trifacta Wrangler
• TIBCO Clarity
• Cloudingo
• IBM Infosphere Quality Stage
Conclusion
So, we have discussed four different steps in data cleaning to make the data
more reliable and to produce good results. After properly completing the
Data Cleaning steps, we’ll have a robust dataset that avoids many of the
most common pitfalls. This step should not be rushed as it proves very
beneficial in the further process.
The Machine Learning process involves building a Predictive model that can
be used to find a solution for a Problem Statement. To understand the
Machine Learning process let’s assume that you have been given a problem
that needs to be solved by using Machine Learning.
The below steps are followed in a Machine Learning process:
Once you know the types of data that is required, you must understand how
you can derive this data. Data collection can be done manually or by web
scraping. However, if you’re a beginner and you’re just looking to learn
Machine Learning you don’t have to worry about getting the data. There are
1000s of data resources on the web, you can just download the data set and
get going.
Coming back to the problem at hand, the data needed for weather
forecasting includes measures such as humidity level, temperature,
pressure, locality, whether or not you live in a hill station, etc. Such data
must be collected and stored for analysis.
The data you collected is almost never in the right format. You will encounter
a lot of inconsistencies in the data set such as missing values, redundant
variables, duplicate values, etc. Removing such inconsistencies is very
essential because they might lead to wrongful computations and predictions.
Therefore, at this stage, you scan the data set for any inconsistencies and
you fix them then and there.
Grab your detective glasses because this stage is all about diving deep into
data and finding all the hidden data mysteries. EDA or Exploratory Data
Analysis is the brainstorming stage of Machine Learning. Data Exploration
involves understanding the patterns and trends in the data. At this stage, all
the useful insights are drawn and correlations between the variables are
understood.
For example, in the case of predicting rainfall, we know that there is a strong
possibility of rain if the temperature has fallen low. Such correlations must
be understood and mapped at this stage.
Choosing the right algorithm depends on the type of problem you’re trying to
solve, the data set and the level of complexity of the problem. In the
upcoming sections, we will discuss the different types of problems that can
be solved by using Machine Learning.
After building a model by using the training data set, it is finally time to put
the model to a test. The testing data set is used to check the efficiency of the
model and how accurately it can predict the outcome. Once the accuracy is
calculated, any further improvements in the model can be implemented at
this stage. Methods like parameter tuning and cross-validation can be used
to improve the performance of the model.
Step 7: Predictions
In our case, for predicting the occurrence of rainfall, the output will be a
categorical variable.
Analysis
Requirements:
The minimum requirements of the project are listed below:
Examine the tools and methodologies required to gain an overview of
the system requirements for the proposed database.
Examine suitable database management systems that can be used to
implement the proposed database.
Evaluate appropriate website authoring and web graphic creation tools
that can be used to develop web based forms for the proposed
database
Requirement Analysis:
Taking into account the comparative analysis stated in the previous section
we could start specifying the requirements that our website should achieve.
As a basis, an article on all the different requirements for software
development was taken into account during this process. We divide the
requirements in 2 types: functional and nonfunctional requirements.
Functional requirements
Functional requirement should include function performed by a specific
screen outline work-flows performed by the system and other business or
compliance requirement the system must meet.
Functional requirements specify which output file should be produced from
the given file they describe the relationship between the input and output of
the system, for each functional requirement a detailed description of all data
inputs and their source and the range of valid inputs must be specified.
The functional specification describes what the system must do, how the
system does it is described in the design specification.
If a user requirement specification was written, all requirements outlined in
the user requirements specifications should be addressed in the functional
requirements.
Nonfunctional requirement
Describe user-visible aspects of the system that are not directly related with
the functional behavior of the system. Non-Functional requirements include
quantitative constraints, such as response time (i.e. how fast the system
reacts to user commands.) or accuracy (.e. how precise are the systems
numerical answers.).
Portability
Reliability
Usability
Time Constraints
Error messages
Actions which cannot be undone should ask for confirmation
Responsive design should be implemented
Space Constraints
Performance
Standards
Ethics
Interoperability
Security
Privacy
Scalabilit
UI Requirements
1. Administrative user interface
The ‘administrative user interface’ concentrates on the consistent
information that is practically, part of the organizational activities and which
needs proper authentication for the data collection. These interfaces help the
administrators with all the transactional states like Data insertion, Data
deletion and Date updating along with the extensive data search capabilities.
The ‘operational or generic user interface’ helps the end users of the system
in transactions through the existing data and required services. The
operational user interface also helps the ordinary users in managing their
own information in a customized manner as per the included Flexibilities.
INPUT DESIGN
The input design is the link between the information system and the user. It
comprises the developing specification and procedures for data preparation
and those steps are necessary to put transaction data in to a usable form for
processing can be achieved by inspecting the computer to read data from a
written or printed document or it can occur by having people keying the data
directly into the system. The design of input focuses on controlling the
amount of input required, controlling the errors, avoiding delay, avoiding
extra steps and keeping the process simple. The input is designed in such a
way so that it provides security and ease of use with retaining the privacy.
Input Design considered the following things:
What data should be given as input?
How the data should be arranged or coded?
The dialog to guide the operating personnel in providing input.
Methods for preparing input validations and steps to follow when
error occur.
OBJECTIVES
OUTPUT DESIGN
A quality output is one, which meets the requirements of the end user and
presents the information clearly. In any system results of processing are
communicated to the users and to other system through outputs. In output
design it is determined how the information is to be displaced for immediate
need and also the hard copy output. It is the most important and direct
source information to the user. Efficient and intelligent output design
improves the system’s relationship to help user decision-making.
1. Designing computer output should proceed in an organized, well thought
out manner; the right output must be developed while ensuring that each
output element is designed so that people will find the system can use easily
and effectively. When analysis design computer output, they should Identify
the specific output that is needed to meet the requirements.
2. Select methods for presenting information.
3. Create document, report, or other formats that contain information
produced by the system.
The output form of an information system should accomplish one or more of
the following objectives.
Convey information about past activities, current status or projections
of the
Future.
Signal important events, opportunities, problems, or warnings.
Trigger an action.
Confirm an action.
SYSTEM STUDY
FEASIBILITY STUDY
The feasibility of the project is analyzed in this phase and
business proposal is put forth with a very general plan for the project and
some cost estimates. During system analysis the feasibility study of the
proposed system is to be carried out. This is to ensure that the proposed
system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential.
ECONOMICAL FEASIBILITY
TECHNICAL FEASIBILITY
SOCIAL FEASIBILITY
ECONOMICAL FEASIBILITY
This study is carried out to check the economic impact that the system will
have on the organization. The amount of fund that the company can pour
into the research and development of the system is limited. The
expenditures must be justified. Thus the developed system as well within the
budget and this was achieved because most of the technologies used are
freely available. Only the customized products had to be purchased.
TECHNICAL FEASIBILITY
This study is carried out to check the technical feasibility, that is, the
technical requirements of the system. Any system developed must not have
a high demand on the available technical resources. This will lead to high
demands on the available technical resources. This will lead to high demands
being placed on the client. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing
this system.
SOCIAL FEASIBILITY
What is SRS?
Software Requirements Specification (SRS) is the starting
point of the software developing activity. As system grew more complex it
became evident that the goal of the entire system cannot be easily
comprehended. Hence the need for the requirement phase arose. The
software project is initiated by the client needs. The SRS is the means of
translating the ideas of the minds of clients (the input) into a formal
document (the output of the requirement phase).
The SRS phase consists of two basic activities:
Problem/Requirement Analysis:
The process is order and more nebulous of the two, deals
with understand the problem, the goal and constraints.
Requirement Specification:
Here, the focus is on specifying what has been found giving
analysis such as representation, Specification languages and tools, and
checking the specifications are addressed during this activity.
The requirement phase terminates with the production of the
validate SRS document. Producing the SRS document is the basic of this
phase.
Role of SRS:
The purpose of the SRS is to reduce the communication gap
between the clients and the developers. SRS is the medium though which
the client and user needs are accurately specified.
It forms the basis of software development. A good SRS
should satisfy all the parties involved in the system.
Purpose:
The purpose of this document is to describe all external
requirements for the E-learning System. It also describes the interfaces for
the system.
Scope:
This document is the only one that describes the
requirements of the system. It is meant for the use by the developers, and
will also by the basis for validating the final deliver system. Any changes
made to the requirements in the future will have to go through a formal
change approval process. The developer is responsible for asking for
clarifications, where necessary, and will not make any alternations without
the permission of the client.
Overview:
The SRS begins the translation process that converts the
software Requirements into the language the developers will use. The SRS
draws on the Use Cases from the user Requirement Document and analyses
the situations from a number of perspectives to discover and eliminate
inconsistencies, ambiguities and omissions before development progresses
significantly under mistaken assumptions.
The Layout:
The business-tier:
The data-tier:
This tier contains the persist able data that is required by the
business tier to operate on. Data plays a very important role in the
functioning of any organization. Thus, persisting of such data is very
important. The data tier performs the job of persisting the data.
Software Development Life Cycle:
In this phase the designs are translated into code. Computer programs are
written using a conventional programming language or an application
generator. Programming tools like Compilers, Interpreters, and Debuggers
are used to generate the code. Different high level programming languages
like PYTHON 3.6, Anaconda Cloud are used for coding. With respect to the
type of application, the right programming language is chosen.
Testing
In this phase the system is tested. Normally programs are written as a series
of individual modules, this subject to separate and detailed test. The system
is then tested as a whole. The separate modules are brought together and
tested as a complete system. The system is tested to ensure that interfaces
between modules work (integration testing), the system works on the
intended platform and with the expected volume of data (volume testing)
and that the system does what the user requires (acceptance/beta testing).
Maintenance
SDLC METHDOLOGIES
This document play a vital role in the development of life cycle (SDLC) as
it describes the complete requirement of the system. It means for use by
developers and will be the basic during testing phase. Any changes made to
the requirements in the future will have to go through formal change
approval process.
SPIRAL MODEL was defined by Barry Boehm in his 1988 article, “A spiral
Model of Software Development and Enhancement. This model was not the
first model to discuss iterative development, but it was the first model to
explain why the iteration models.
As originally envisioned, the iterations were typically 6 months to 2 years
long. Each phase starts with a design goal and ends with a client reviewing
the progress thus far. Analysis and engineering efforts are applied at each
phase of the project, with an eye toward the end goal of the project.
The following diagram shows how a spiral model acts like:
At the customer option, the entire project can be aborted if the risk is
deemed too great. Risk factors might involve development cost
overruns, operating-cost miscalculation, or any other factor that could,
in the customer’s judgment, result in a less-than-satisfactory final
product.
The existing prototype is evaluated in the same manner as was the
previous prototype, and if necessary, another prototype is developed
from it according to the fourfold procedure outlined above.
The preceding steps are iterated until the customer is satisfied that the
refined prototype represents the final product desired.
The final system is constructed, based on the refined prototype.
The final system is thoroughly evaluated and tested. Routine
maintenance is carried on a continuing basis to prevent large scale
failures and to minimize down time.
SYSTEM DESIGN
SOFTWARE DESIGN
In designing the software following principles are followed:
GOALS:
The Primary goals in the design of the UML are as follows:
Provide users a ready-to-use, expressive visual modeling Language so
that they can develop and exchange meaningful models.
Provide extendibility and specialization mechanisms to extend the core
concepts.
Be independent of particular programming languages and development
process.
Provide a formal basis for understanding the modeling language.
Encourage the growth of OO tools market.
Support higher level development concepts such as collaborations,
frameworks, patterns and components.
Integrate best practices
UML Diagrams:
Sequence Diagram:
This has two dimensions which represents time (Vertical) and different
objects (Horizontal)
Sequence diagram for Automated Attendance management
system
Class Diagram:
Activity Diagram:
window.geometry('1280x720')
window.configure(background='snow')
def manually_fill():
global sb
sb = tk.Tk()
sb.iconbitmap('AMS.ico')
sb.title("Enter subject name...")
sb.geometry('580x320')
sb.configure(background='snow')
def err_screen_for_subject():
def ec_delete():
ec.destroy()
global ec
ec = tk.Tk()
ec.geometry('300x100')
ec.iconbitmap('AMS.ico')
ec.title('Warning!!')
ec.configure(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 = time.time()
Date = datetime.datetime.fromtimestamp(ts).strftime('%Y_%m_%d')
timeStamp = datetime.datetime.fromtimestamp(ts).strftime('%H:%M:
%S')
Time = datetime.datetime.fromtimestamp(ts).strftime('%H:%M:%S')
Hour, Minute, Second = timeStamp.split(":")
####Creatting csv of attendance
try:
cursor.execute(sql) ##for create a table
except Exception as ex:
print(ex) #
if subb=='':
err_screen_for_subject()
else:
sb.destroy()
MFW = tk.Tk()
MFW.iconbitmap('AMS.ico')
MFW.title("Manually attendance of "+ str(subb))
MFW.geometry('880x470')
MFW.configure(background='snow')
Testing
Features to be tested
Unit testing involves the design of test cases that validate that the
internal program logic is functioning properly, and that program inputs
produce valid outputs. All decision branches and internal code flow should be
validated. It is the testing of individual software units of the application .it is
done after the completion of an individual unit before integration. This is a
structural testing, that relies on knowledge of its construction and is
invasive. Unit tests perform basic tests at component level and test a
specific business process, application, and/or system configuration. Unit tests
ensure that each unique path of a business process performs accurately to
the documented specifications and contains clearly defined inputs and
expected results.
Integration testing
Functional test
Functional tests provide systematic demonstrations that functions tested
are available as specified by the business and technical requirements,
system documentation, and user manuals.
Functional testing is centered on the following items:
System Test
System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable
results. An example of system testing is the configuration oriented system
integration test. System testing is based on process descriptions and flows,
emphasizing pre-driven process links and integration points.
Test cases:
[3] R. Sarkar, S. Bakshi, P. K. Sa, "A real-time model for multiple human
face tracking from low-resolution surveillance videos", Procedia Technology,
vol. 6, pp. 1004-1010, 2012.
[5] P. Viola and M. Jones, Rapid object detection using a boosted cascade of
simple features, Proceedings of the 2001 IEEE Computer Society Conference
on Computer Vision and Pattern Recognition, vol. 1, 2001, pp.511 518.
[8] Xiaoyang Tan and Bill Triggs, "Enhanced Local Texture Feature Sets for
Face Recognition Under Difficult Lighting Conditions", IEEE Trans, on Image
Processing, Vol. 19, No.6, June 2010.