Saturday, December 28, 2019
Face Recognition And Attendence System ( SRS,SDD )
Face Recognition And Attendence System
Chapter 1
Introduction
Every
age has its scientific discoveries and inventions. But today’s scientific
advancements can impact globally in very short time. Such progress is made in
the field of artificial intelligence or AI [1]. Keeping this in mind we are
going to make an Artificial Intelligence based face recognition system that can
have high impact on different organizations. Uniqueness or independence of an
individual is his face. By considering this fact our system will be super
faster and accurate in marking attendance of individual student.
We
are going to use face detection and recognition in this project. Face detection
is used to locate the position of face region and face recognition is used for
marking the attendance. The database will store faces of students. when the
face of the student matches with one of the face stored in the database then
the attendance is recorded.
1.1 Purpose
The
purpose of this system is to make process of attendance very faster and
accurate. The old method for taking attendance is by calling the name or roll
number of the student to record attendance. It was time consuming and less
accurate process of marking attendance because as we know the data written in
paper can be lost or can be less accurate because students often mark each
other attendance proxy.
Consider
that if a subject has 1-hour duration and have more than 50 students it takes 5
to 10 minutes to mark their attendance. For each teacher this waste of time can
be utilized if we make it faster with automated system. To avoid this waste of
time, a face recognition system can be used to record attendance with faster
and accurate attendance marking.
1.2
Scope
Our project will be used in Universities or
Colleges for taking attendance using facial recognition. The problem we have is
to differentiate characteristic between twins. This case remains a challenge to
biometric systems and face recognition system particularly biometric
identification technology. per Phillips and his co-researcher paper to induce
the simplest results of the algorithms your system used, they must run beneath
sure conditions for taken footage (i.e... age, gender, expressions, studio
surroundings etc.) otherwise, the matter remains in progress [2].
They provide application (method), however
you have to sign a contract with the (NIST) organization and to be a research
worker or developer. For us, to unravel this issue we advise to record twins'
attending manually.
1.3 Definitions,
Acronyms, and Abbreviations.
Table
1 describe the basic Abbreviations, Definitions or Acronyms that we use in this
SRS document.
Table 1. Basic Definitions, Acronyms, Abbreviations |
|
FRAS
|
Face Recognition
Attendance System
|
NIST
|
National Institute of
Standards and Technology
|
UML
|
Unified Modeling
Language
|
IDE
|
Integrated Development
Environment
|
SQL
|
Structured Query
Language
|
1.4 References
[1]. Bejoy Peter’s Public Speech of Artificial
Intelligence.
[3]. Turk, M. and Pentland, A. (1991a).
Eigenfaces for recognition. Journal of Cognitive
Neuroscience, 3(1), 71-86
1.5 Overview
Chapter
1 of describe general factors that affect the university or college attendance
system, such as user characteristics and project constraints. Chapter 2
outlines the detailed, specific functional, System, performance and related
requirements of Face recognition attendance system.
Chapter 3 describe design of the system and it’s architecture from designer
point of view. Chapter 4 describe implementation of project and it’s testing
with test cases and project proto type.
1.6 Product Perspective
FRAS
consist of camera and PC. The PC performs internal functions of the system like
face detection and face recognition modules. System Uses information of all parts
to record the student attendance. There are many applications in market for
checking attendance. These technologies are usually embedded devices that have
a camera and sensor, processing units, storage units and external interfaces.
However,
our product approaches group action taking mechanism in an exceedingly totally
different manner. In alternative devices users typically ought to do one thing
to form themselves to be known by the system, as an example closing up their
faces to device etc. Our system can perform the method effortlessly and
dynamically. Associate in Nursing example of devices that are used unremarkably
is shown within the image below. Our system is not an embedded system. It works
on Windows. The camera is a separate device that is connected to server
computer. Software run in a computer that has an operating system.
Figure 1. Lathem an
Embedded face recognition system [3]
Figure
2. Block Diagram of Face Recognition system
1.6.1 System Interfaces
The camera must
be connected to system and video driver is installed. Camera can send image and
video information to the computer system. Computer can send commands to camera
to turn off or turn on etc. Computer takes info to perform related operations
about 'Attendance Checking' process System will connect to MS SQL database for
storing data.
1.6.2 Interfaces
·
GUI interfaces for desktop.
·
The interface is quite simple and user friendly.
·
Event driven interface
1.6.3 Hardware Interfaces
·
A standalone computer.
·
High quality camera must be positioned in the
class room to obtain the snapshots
·
Secondary memory to store all the images and
database
1.6.4 Software Interfaces
·
Visual Studio and OpenCV library
·
MS SQL
·
For each interface, provide:
1.6.5 Communications Interfaces
The system will
only use standard ports of pc for communication with camera and other parts of
system.
1.6.6 Memory Constraints
The System needs
a minimum of 4GB DDR3 Ram or work properly.
1.6.7 Operations
Teacher organize
the lesson from category for marking attendance. there's no acoustic
interactive operations however there's a period constraint for a few unattended
operations like getting view of class at least one time during lecture. The
system will take backup after one week
1.6.8 Site Adaptation Requirements
Table 2 describe the software and hardware
site Adaptation Requirements for operational site. The site must meet these
requirements to ensure the proper working of system.
Table 1. Site Adaptation Requirements
Hardware Requirements
|
Software requirements
|
A standalone computer
|
Windows 8 or higher
|
High quality camera must be
positioned in the class room to obtain the snapshots
|
Video driver installed
|
Secondary memory to store
all the images and
Database
|
7 Product
Functions
1.7.1 Face Detection Module
The job of this
module is taking photos from the connected camera and after processing coming
images, the system will try to find faces from the images. After finding faces,
the system will try to send the related images to server hard disk and database
system. This info will be used by the ‘face recognition’ module of the system.
Also face detection module will identify the place of each face in the
classrooms for making a healthier conclusion about next image coming from the
camera.
1.7.2 Face Recognition Module
Face recognition
module is used for recognize students in the classrooms then process the
Attendance operation. When images from the face detection module is transferred
to database module and they are ready to be used, face recognition module will
use these image and facial information to try to find a match with student
images from the database. If a match is found between image info and database
record, then this student is checked as present in the classroom. The Figure 3
shows the features of system as described above.
1.7.3 Database and File Management Module
Database module
will be used for storing text and image information coming from user interface
and cameras. This will save the database info like student numbers, names,
student’s facial information, student’s attendance information, errors, course
information.
Figure 3. Main features of face recognition system [5]
This module also
will manage the image files of the students in the classrooms. This module is
used as a transition between face detection module and face recognition module.
This module is also used by client for retrieving information of students,
attendance and courses.
1.7.4
External and
Client Based Functions of System
These functions
are the functions that are used by admin of the system and takes information
from the system.
1.7.8
Student
Matching Function
In this function
will match student face with the related face image of students. This function
is a verification function that verifies the student and the actual data taken
from the cameras. Also the teacher can enter the names and numbers of students
for better reporting.
1.8 User
Characteristics
There
are mainly two type of users such as lecturer and admin. The admin will be a
technical person who can fix any problem related to the system or software and
he can also take data from system. The lecturer will know the basic operational
procedure to run the system. Lecturer don’t need to have technical details. But
lecturer must know how to run system and check attendance. The interface and
design will be user friendly and can be easily understand by the users.
1.9 Constraints
·
The information about the students cannot be
used for other purposes and cannot be distributed.
·
The system must have 4 GB of Ram and minimum
have intel Core i3 Processor.
·
The number and quality of cameras used for
checking attendance system limit
·
The number of students can be detected in the
classroom. XON and XOFF will be used in data transmission.If the system
components requirements like camera are provided and the environmental attributes
are enough or good, our system can work as desired
·
There will be an operator to start our system.
·
The garbage must be collected as much as
possible. And also there must be enough dataset photos of the students.
1.10 Assumptions
and Dependencies
1.11 Assumptions
The detector module should crop every human
face from the input image and not to crop other areas. So it was assumed that
the detector will be very accurate in cropping just and all the human faces
from the uploaded image and save it for further recognition.
The recognition module has to be very
accurate in recognizing that is comparing the detected image with the images
fetched from the database. So it was assumed that the recognition module will
correctly recognize all the faces from the uploaded image so that a correct
attendance sheet is produced.
1.12 Dependecies
Our System use OPENCV and some built in
libraries. Our System is also uses webcam preferably with high specification
for clearly detecting and recognizing the faces. It also considers various
factors such as varying light conditions, accessories on face and changing
environments.
1.11 Apportioning of Requirements
Auto
correction module for the attendance will be implemented in future.
Chapter
2
Software Requirements Specification
2.1 Specific Requirements
·
This module will have a GUI interface used to
train system by taking 5 or more pictures of each student.
·
It will show a imagebox and a button to start
camera
·
The Main menu will take student name, Year, Term
and subject as input for only registering one time
·
The main menu have a present button to mark the
attendance of detected face in camera.
·
The main menu will also have delete,update and
close buttons to alter the information.
2.1.4 Update Records
·
This menu will be used to update student record
including name,year,subject and attendance status
·
It will also show a picture box and an update
button.
2.1.5 Display Record
·
This module will be used to display the
information of student including their attendance status.
·
It will also have a search bar to search student
in list.
2.2 External Interfaces
2.2.1 Login and registration
·
Registration takes username(string or text)
password(string or text) and recovery pin(string or text) as input and after
registration this provide output as take user to login page.
·
Login takes username(string or text) and
password(string or text) as input and
takes user into the application.
2.2.2 Face Detection
·
This module takes image from camera and detect
faces students store detected face in local drive in .BMP format.
·
It also store name of students in text file in
the same order as it’s storing images of student.
2.2.2 Face Recognition
·
This module will take an image of detected faces
captured from camera and then it will compare the faces of that image with the
images stored in training set on local disk.
2.3 Functions
2.3.0 Main Functions
of Application
·
The system shall be able to Take image from camera.
·
The system shall be able to Store image in (Bitmap bmp) on local disk.
·
The system shall be able to detect and recognize
the students.
Functional Requirements
·
The system must distinguish between authorized
and unauthorized persons
·
System can detect students faces.
·
System can recognize students faces.
·
Attendance will be automatically marked if face
matches with particular face of student in database.
·
Lecturer
will be able to manage student records which includes attendance update,
selecting lecture and duration of each lecturer or course.
·
System
must be attached to webcam and face recognition should be smooth.
·
The
information must be entered and managed properly.
·
Lecturer can mark the attendance manually if
system does not recognize some student.
·
The lecturer will also be able to mark absent of
students manually.
·
The system will store records to database after
taking attendance.
2.4 Performance Requirements
2.4.1 Static numerical
requirements for desktop application
·
User can terminate application any moment.
·
Only one user can use this application
simultaneously its offline application.
·
It is recommended to have a Graphic card of 4GB
GTX 660 or more for higher performance
·
The System CPU frequency must be 3.0 or above.
·
A high quality HD camera is recommended for better
accuracy and performance.
2.5 Logical Database Requirements
2.5.1 Entity Relationship Diagram
Figure 6 describe ER
Diagram it shows entities, their attributes and relationship among those
entities. An entity is any object in the system that we want to model and store
information about it. Entities are represented by rectangles, the attributes
are represented by oval and diamond shows relationship between those entities.
Our system has three
entities, Admin, Professor and student. Admin and professor entity consist of
two attributes username and password. Student Entity consist of two attribute
roll no and name. The relationship between those entities are described as.
·
The relationship between professor and student
is many to many.
·
The relationship between admin and professor is
one to many.
First
Normal Form
A
relation is in first normal form if and only if the domain of each attribute contains
atomic values.
The current database tables are already in first normal form.
Second
Normal Form
In second normal form we remove partial dependency and make
fully functional dependency.
The partial dependency is when some attributes of relation does
not depend upon primary key.
Our tables are already in second normal form.
Third
Normal Form
In 3rd
normal form we remove transitive dependency. A transitive dependency is when a
non key attribute depends upon another non key attributes. Our all tables are
already in third normal form.
2.6 Design Constraints
The system must have a HD Camera connect
to system.
2.6.1
Standards Compliance
·
The system should allow the user to rollback the
incorrect attendance.
·
The system must prevent access of unauthorized
users.
2.7 Software System Attributes
2.7.1 Reliability
·
The system will be
able to keep database safe even if the system stop working.
·
The system will
avoid crashes.
2.7.2 Availability
The
application will be available 24/7, the usage will depend upon institution
schedule.
2.7.3 Security
·
The system will be secure from unauthorized
access.
·
The authorized teachers will have their username
and password to login.
2.7.4 Maintainability
The maintainance
of the system will be done time to time after every 3 months.
2.7.5 Portability
·
The application will only work on windows
·
The application is portable and can be used in
other windows pc.
ID
|
Characteristic
|
H/M/L
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
1
|
Correctness
|
|||||||||||||
2
|
Efficiency
|
|||||||||||||
3
|
Flexibility
|
|||||||||||||
4
|
Integrity/Security
|
|||||||||||||
5
|
Interoperability
|
|||||||||||||
6
|
Maintainability
|
|||||||||||||
7
|
Portability
|
|||||||||||||
8
|
Reliability
|
|||||||||||||
9
|
Reusability
|
|||||||||||||
10
|
Testability
|
|||||||||||||
11
|
Usability
|
|||||||||||||
12
|
Availability
|
2.8 Organizing the Specific Requirements
2.8.1 System Mode
·
The interface depends upon camera if there is no
camera device attached to system then the face detection and recognition module
will not work.
·
The system also need proper configuration of
database path.
2.8.2 User Class
·
The teacher can only login and mark attendance
·
The Admin can view,modify or update database and
train application.
·
The students are not allowed to use the
application
2.8.3 Objects
·
Teacher
·
Admin
2.8.4 Feature
·
The system uses an external camera to capture
images that will further processed in face detection and recognition module.
2.8.5 Stimulus
2.8.6 Response
·
The face detection function will detect the
faces of multiple students at a time
·
The Face recognition function will also
recognize the faces of multiple students at a time and then mark their
attendance.
3.1
Use Cases
Use case represents the interaction
between user and system, it only shows what
system will do. Include means some
function must be performing and extend means
show new form if previous operation Is
successfully completed.
Table 3. Description of FRAS 1
Use Case Name:
|
FRAS 1
|
Actors:
|
Admin
|
Description:
|
This
use case describes how Admin log into the system.
|
Triggering events:
|
Admin enter his username and password.
|
Steps Performed (Main Path):
|
1-System requires users to enter username/password.
2-Users enter username/password.
3-System validate entered username/password.
4-The use case ends successfully.
|
Preconditions:
|
1. System installed on pc.
2. Admin must be authorized.
|
Post-conditions:
|
Log in is successfully.
|
Alternate:
|
If the Admin don’t fill information
correctly, the log in fails.
|
Table.
4 Description of FRAS 1
Use Case Name:
|
FRAS 2
|
Actors:
|
Professor
|
Description:
|
This
use case describes how Professor log into the system.
|
Triggering events:
|
Professor enter his username and password.
|
Steps Performed (Main Path):
|
1-System requires users to
enter username/password.
2-Users enter
username/password.
3-System validate entered
username/password.
4-The use case ends
successfully.
|
Preconditions:
|
1. System installed on pc.
2. Professor must be authorized.
|
Post-conditions:
|
Log in is successfully.
|
Alternate:
|
If the Professor don’t fill information
correctly, the log in fails.
|
2.9 Additional Comments
Whenever a new
SRS is contemplated, more than one of the organizational techniques given in
3.7 may be appropriate. In such cases,
organize the specific requirements for multiple hierarchies tailored to the
specific needs of the system under specification.
Three are many
notations, methods, and automated support tools available to aid in the
documentation of requirements. For the
most part, their usefulness is a function of organization. For example, when organizing by mode, finite
state machines or state charts may prove helpful; when organizing by object,
object-oriented analysis may prove helpful; when organizing by feature,
stimulus-response sequences may prove helpful; when organizing by functional
hierarchy, data flow diagrams and data dictionaries may prove helpful.
In any of the
outlines below, those sections called “Functional Requirement i” may be
described in native language, in pseudocode, in a system definition language,
or in four subsections titled: Introduction, Inputs, Processing, Outputs.
Chapter 3
System Design and Architecture
3.1 Architectural Design
The system has a camera that will take the images of the classroom from
live video and then it will send the picture of class to face detection module
to detect faces of students and then after detecting the face the face
detection module will crop the faces and send them to face recognition module.
At this point the face recognition module will recognize the face by
matching each face with training set of images stored in computer. Here all the
faces are detected from the input image and algorithm compares them one by one
with the face database (Testing Set). If the face of students is recognized,
then attendance will be marked and store in MY SQL database.
The professor will come in the class and start the system and then he
will login with Username and password. After this professor will click on the
capture button to take image of students and then he will click on the generate
attendance button to view attendance
3.1.1 System Architect
|
3.3 Design
Rationale
We are
making face recognition attendance system to make attendance process more
secure and faster with facial recognition However, the critical issue we are
facing is to recognize twin’s faces so we trade off this issue and our system
will not differentiate between twin’s faces.
3.4 Data
Description
We will store the
attendance of students in MS SQL database. It database will contain 2 tables
one for attendance of student and second is for storing login credentials.
Alphabetically list the system entities or major data along with their
types and descriptions. If you provided a functional description in Section
3.2, list all the functions and
function parameters. If you provided an OO description, list the objects and
its attributes, methods and method parameters.
3.6 Component Design
COMPONENT DIAGRAM
The figure 5 describe the major components of face
recognition attendance system. Those
components must work together and
coordinates each other for proper working of system.
Chapter 4
Implementation and Testing
4.1 Code Modules
Start Camera
public void button1_Click(object sender, EventArgs e)
{
//Straing the cemera and will
capture frame by frame
grabber = new Capture();
grabber.QueryFrame();
Application.Idle += new EventHandler(FrameGrabber);
button1.Enabled = false; //cemra start button
}
Capture Image and Detect Faces
public void button2_Click(object sender, System.EventArgs e)
{
try
{
ContTrain =
ContTrain + 1;
gray =
grabber.QueryGrayFrame().Resize(320, 240, Emgu.CV.CvEnum.INTER.CV_INTER_CUBIC);
MCvAvgComp[][]
facesDetected = gray.DetectHaarCascade(Face, 1.2,10,
Emgu.CV.CvEnum.HAAR_DETECTION_TYPE.DO_CANNY_PRUNING,
new Size(20, 20));
foreach(MCvAvgComp f in facesDetected[0])
TrainedFace =
currentFrame.Copy(f.rect).Convert<Gray, byte>();
break;
}
//Trained image is
been save to "Trainedface" variable
TrainedFace = result.Resize(100, 100,
Emgu.CV.CvEnum.INTER.CV_INTER_CUBIC);
trainingImages.Add(TrainedFace);
//adding text box
train name to label
labels.Add(textBox1.Text);
imageBox1.Image = TrainedFace;
File.WriteAllText(Application.StartupPath + "/TrainedFaces/TrainedLabels.txt",
trainingImages.ToArray().Length.ToString()
+ "%");
for (int i = 1; i <
trainingImages.ToArray().Length + 1; i++)
{
trainingImages.ToArray()[i - 1].Save(Application.StartupPath + "/TrainedFaces/face" +
i + ".bmp");
File.AppendAllText(Application.StartupPath + "/TrainedFaces/TrainedLabels.txt", labels.ToArray()[i - 1] + "%");
}
MessageBox.Show(textBox1.Text + "´s face
detected and added :)", "Training OK",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
catch
{
MessageBox.Show("Enable the
face detection first", "Training Fail", MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}
}
Mark Attendance
private void btnPrsent_Click(object sender, EventArgs e)
{
if (txtYear.Text == "")
{
MessageBox.Show("Please enter Year", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
txtYear.Focus();
return;
}
if (txtTerm.Text == "")
{
MessageBox.Show("Please enter Term", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
txtTerm.Focus();
return;
}
if (txtSubject.Text == "")
{
MessageBox.Show("Please enter Sub name.", "", MessageBoxButtons.OK,
MessageBoxIcon.Warning);
txtSubject.Focus();
return;
}
//Main place to save data to the database
cc.con = new SqlConnection(cs.DBConn);
cc.con.Open();
string cb = "insert into
Student(C_ID,StudentID,Name,Year,Term,Subject,PresentAbsent,Photo)
VALUES (@d1,@d2,@d3,@d4,@d5,@d6,@d7,@d8)";
cc.cmd = new SqlCommand(cb);
cc.cmd.Connection = cc.con;
cc.cmd.Parameters.AddWithValue("@d1", txtID.Text);
cc.cmd.Parameters.AddWithValue("@d2", txtStudentID.Text);
cc.cmd.Parameters.AddWithValue("@d3", name);
cc.cmd.Parameters.AddWithValue("@d4", txtYear.Text);
cc.cmd.Parameters.AddWithValue("@d5", txtTerm.Text);
cc.cmd.Parameters.AddWithValue("@d6", txtSubject.Text);
cc.cmd.Parameters.AddWithValue("@d7", atten);
MemoryStream ms = new MemoryStream();
Bitmap bmpImage = new Bitmap(Picture.Image);
bmpImage.Save(ms,
System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] data = ms.GetBuffer();
SqlParameter p = new SqlParameter("@d8", SqlDbType.Image);
p.Value = data;
cc.cmd.Parameters.Add(p);
cc.cmd.ExecuteReader();
cc.con.Close();
st1 = lblUser.Text;
st2 = "added the new Student'" + name + "' having Student id '" + txtStudentID.Text + "'";
cf.LogFunc(st1,
System.DateTime.Now, st2);
btnSave.Enabled = false;
MessageBox.Show("Successfully saved", "Record", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
4.2 Database Connectivity
public class ConnectionString
{
public string DBConn = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=F:\Face-
Detection-Based-Attendance\Attendance.mdf;Integrated
Security=True";
}
4.3 Overview of User Interface
1.
The teacher must login to use the system.
2.
After successful login teacher will fill basic
information like year,term and subject.
3.
Then teacher will click on start button to start the
camera.
4.
When camera is start then system will automatically
detect face of student.
5.
When all the faces of students are detected then
teacher will click on present button to mark attendance.
6.
After
successfully marking the attendance the teacher can view attendance by click
get data button.
7.
The teacher can also delete,update or add new student
by click the buttons on form
4.4 Screen Images
4.4.1 Login
4.4.2 Register
4.4.3 Main Menu
4.4.4 Display Attendance
4.4.5 Update Record
4.5
Screen Objects and Actions
·
The system have
login form with text boxes and a login button the user will click on login
button and it will display the main menu if the login information is correct.
·
The main menu consist of different objects such
as image box to show camera
·
The Insert button will be used to insert record
·
Delete button will delete record
·
The Get data button will display attendance of
students
·
The train button will be capture the image of
student and store their detected faces in local disk
4.6 Test Cases
4.6.1 Test Case of Login
Form
Screen Name
|
Login Screen
|
Test Case ID
|
TC:01
|
Engineer
|
Sannia Shoaib
|
Application Name
|
Face Recognition Attendance System
|
Testing Cycle
|
01
|
Purpose
|
For checking that all controls or
properly display
|
Scenario
|
All controls are visible and
button are shown
|
Environment
|
Visual studio
|
Pre-Requisite
|
No
|
Strategy
|
Click On Exe File
|
Expected Result
|
Main Screen Will Display
|
Observations
|
Screen width may be ask to you in
case of running by exe file
|
Result
|
NO bug on Main Screen
|
Re-Test
|
As Above
|
4.6.2 Test Case of Main Menu
Screen Name
|
Main Menu
|
Test Case ID
|
TC:02
|
Engineer
|
Burhan Rasool
|
Application Name
|
Face Recognition Attendance
System
|
Testing Cycle
|
01
|
Purpose
|
For checking the facial
recognition and attendance module
|
Scenario
|
All controls are visible and
button are shown
|
Environment
|
Visual studio
|
Pre-Requisite
|
No
|
Strategy
|
Click On Exe File
|
Expected Result
|
Facial Recognition works and
attendance marked
|
Observations
|
Screen width may be ask to you in
case of running by exe file
|
Result
|
NO bug on Main Screen
|
Re-Test
|
As Above
|
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment