Team No. 12 Major Project Report

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

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Belagavi - 590018

A Project Report on
IDENTIFICATION OF GENDER USING FACIAL
IMAGES
Submitted by

LAKSHITHA KULAL 4SN16CS718


NAMITHA KUMARI 4SN16CS723
SHREEPRIYA R 4SN16CS739
SUSHMITHA ACHARYA 4SN16CS749

In partial fulfillment of the requirements for the degree of


BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE & ENGINEERING

Under the Guidance of


Mr. ARAVIND NAIK
Assistant Professor

Department of Computer Science & Engineering

SRINIVAS INSTITUTE OF TECHNOLOGY


(NAAC ACCREDITED)
MANGALURU - 574143, KARNATAKA
2019 - 2020
SRINIVAS INSTITUTE OF TECHNOLOGY
(NAAC ACCREDITED)
MANGALURU - 574143, KARNATAKA.

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

CERTIFICATE
Certified that the project work entitled “IDENTIFICATION OF GENDER USING
FACIAL IMAGES” is a bona fide work carried out by

LAKSHITHA KULAL 4SN16CS718


NAMITHA KUMARI 4SN16CS723
SHREEPRIYA R 4SN16CS739
SUSHMITHA ACHARYA 4SN16CS749

in partial fulfillment for the award of BACHELOR OF ENGINEERING in


COMPUTER SCIENCE & ENGINEERING of the VISVESVARAYA
TECHNOLOGICAL UNIVERSITY, BELAGAVI during the year 2019 - 2020. It is
certified that all corrections/suggestions indicated for Internal Assessment have been
incorporated in the report deposited in the departmental library. The project report has
been approved as it satisfies the academic requirements in respect of Project work
prescribed for the Bachelor of Engineering Degree.

Mr. Aravind Naik Dr. Shivakumar G. S. Dr. Shrinivasa Mayya D.


Project Guide Head of the Department Principal

Name of the Examiners Signature with Date

1.

2.
ABSTRACT

The objective of this project is to identify the gender of a person by providing the facial
image as input to the computer. This is a case of supervised learning where the algorithm is
first trained on a set of female and male faces, and then used to classify new data.

Gender classification using facial images has been of interest for quite some time.
Humans are very good at determining gender from facial images. Even if the face is cropped
to remove all gender cues, we can identify gender with very high accuracy. More recently
automated gender classification from facial images has gained much interest in the computer
vision and machine learning community. This is because of its extreme importance in Human
Computer Interaction, demographic research, and security and surveillance applications. It
can also augment other important areas like face recognition, age and ethnicity
determination. Several approaches have been taken to classify facial images based on gender.
This report addresses few of these approaches using dimensionality reduction techniques.
One of the challenges of automatic gender classification is to account for the effects of pose,
illumination and background clutter. Practical systems have to be robust enough to take these
issues into consideration. Most of the work in gender classification assumes that the frontal
views of faces, which are pre-aligned and free of distracting background clutters, are
available.
ACKNOWLEDGEMENT
The success and final outcome of this project required a lot of guidance and assistance from
many people and we are extremely fortunate to have got their support all along the
completion of our project.
We take this opportunity to express our profound gratitude and deep regards to our
Project Guide Mr. Aravind Naik, Assistant Professor, Department of Computer Science and
Engineering, for his exemplary guidance, monitoring and constant encouragement
throughout the course of this project.
We are highly grateful and would like to express our wholehearted thankfulness to
our Project Coordinator, Mr. Manjesh R., Assistant Professor, Department of Computer
Science and Engineering, who has been our source of inspiration. He has communicated
various ideas for improving the project and has been especially enthusiastic in giving his
opinions and critical reviews in a constructive manner.
We express a deep sense of gratitude to Dr. Shivakumar G. S., Head of the
Department, Computer Science and Engineering, for his cordial support, valuable
information and guidance, which helped us in completing this project through various stages.
We also express our heartfelt gratitude to our Principal Dr. Shrinivasa Mayya D. for
his kind co-operation and encouragement which helped us in the completion of this project.
We also thank our Management who helped us directly and indirectly for the
successful completion of our project.
We are thankful to and fortunate enough to get constant encouragement, support and
guidance from all the Teaching and Non-teaching staff of Department of Computer Science
and Engineering who helped us in successfully completing our project.
Lastly, we would like to thank our Parents for their moral support and our Friends
with whom we shared our day-to-day experiences and received lots of suggestions that
improved our quality of work.

Lakshitha Kulal
Namitha Kumari
Shreepriya R
Sushmitha Acharya
TABLE OF CONTENTS

CHAPTER No. TITLE PAGE No.

1 INTRODUCTION 1

1.1 Problem Statement 1

1.2 Existing System 1

1.3 Proposed System 2

1.4 Objective 2

2 LITERATURE SURVEY 3

3 SOFTWARE REQUIREMENT ANALYSIS 6

3.1 Feasibility Study 6

3.1.1 Technical Feasibility 6

3.1.2 Operational Feasibility 7

3.1.3 Economic Feasibility 7

4 SYSTEM REQUIREMENT SPECIFICATION 8

4.1 Functional Overview 8

4.2 Operating Environment 8

4.2.1 Software Requirements 8

4.2.2 Hardware Requirements 8

4.3 Functional Requirements 9

4.4 Non-functional Requirements 10

4.5 Performance Requirements 10


4.6 Security Requirements 10

5 SYSTEM DESIGN 11

5.1 High Level Design 11


5.2 Detailed Design 12

5.2.1 Use Case Diagram of Gender Identification 13

5.2.2 Data Flow Diagram of Gender Identification 14

5.2.3 Sequence Diagram of Gender Identification 16

6 SYSTEM IMPLEMENTATION 18

6.1 Algorithms 20
6.1.1 Login Module 20
6.1.2 Logout Module 20
6.1.3 Age and Gender Prediction 21
6.1.4 Image Verification 21
7 TESTING 22

7.1 Introduction 22
7.2 Testing Objectives 23
7.3 Testing Criteria 23
9 USER MANUAL 27

9.1 Camera 27
CONCLUSION AND FUTURE WORK 28
REFERENCES
LIST OF FIGURES

FIGURE No. TITLE PAGE No.


5.1 High level design for Gender Identification 12
5.2 Use case diagram for Gender Identification 13
5.3 Level 1 Data flow diagram of Gender Identification 14
5.4 Level 2 Data flow diagram of Gender Identification 15
5.5 Sequence Diagram of Gender Identification 16
LIST OF TABLES

TABLE No. TITLE PAGE No.


7.1 Testing for valid user name 23
7.2 Testing for valid password 23
7.3 Testing for valid Email address 24
7.4 Testing for data insertion 24
7.5 Testing for deletion 25
7.6 Testing for phone number 25
7.7 Hardware testing 25
7.8 Other cases 26
Identification of Gender using Facial Images Introduction

CHAPTER 1

INTRODUCTION
Identification of gender using facial images is becoming an active research area spanning
several disciplines such as image processing, pattern recognition, computer vision, neural
networks, cognitive science.it is the dedicated process, not merely an application of the
general object recognition process.

The goal of gender detection is to determine whether or not there are any faces in
the image and if the image is present then it return extent of each face. While this appears
as the trivial task for human beings, it is an extremely tough task for computers, and has
been one of the top studied research topics in the past few decades.

1.1 Problem Statement


Over the past decades identification of gender based on images of faces have transcended
from esoteric to popular areas of research in computer vision and one of the better and
successful application of image analysis.

The problem is that computer vision task which consists in detecting one or several
human faces in an image. It is one of the first and most important steps of face analysis.
Face detection is not straight forward because it has lots of variations of image appearance,
such as pose variation (front, non-front), occlusion, image orientation, illuminating
condition and facial expression.

1.2 Existing System


Gender recognition is based on the geometric features of a face is probably the most
intuitive approach to face recognition. One of the first automated face recognition systems
was described in marker points (position of eyes, ears, nose) where used to build feature
vector (distance between the points, angle, between them). Recently various methods for a
local feature extraction emerged. To avoid the high-dimensionality of the input data only
local regions of an image are described, the extracted features are more robust against
partial occlusion, illumination and small sample size.

Department of CSE, SIT, Mangaluru Page 1


Identification of Gender using Facial Images Introduction

1.3 Proposed System


Support Vector Machine is used as a classifier to classify the genders based on the facial
images. By using OpenCV we load the images into the system.

When image quality is taken into consideration, there is a plethora of factors that
influence the system’s accuracy. It is extremely important to apply various image pre-
processing techniques to standardize the images that is supplied to a gender recognition
system.

1.4 Objective

There are few objectives to design gender detection system. The objective of identification
of gender using facial images are:

• To design real time face detection system.


• To utilize the face detection system based on OpenCV classifier.
• To detect gender based on the image produced.

Department of CSE, SIT, Mangaluru Page 2


Identification of Gender using Facial Images Literature Survey

CHAPTER 2

LITERATURE SURVEY
In this literature study a comparative study was done considering 8 different papers/journals
which has different approach towards Identification of Gender methods. The brief description
of each paper is as follows.

[1] GENDER CLASSIFICATION USING FUSION OF LOCAL AND GLOBAL


FACIALFEATURES:

Feature Extraction Techniques uses two methods to extract the features, Global Feature
Extraction and Local feature extraction. Global feature extraction uses eigen face approach for
reconstruction of face images by using principal component analysis (PCA) and the two-
dimensional discrete cosine transform (2D-DCT) approach. Local Feature Extraction uses
Local Binary Pattern (LBP) descriptor and computes by using the LBP operator. It was initially
used as a texture descriptor giving very promising results in many applications. Fusion of the
Features is the process which Combines the global and local feature vectors to form the overall
feature vector for the whole image. The Advantage is PCA are low noise sensitivity.
Disadvantage is DCT is expensive to manufacture.

[2] GENDER CLASSIFICATION FROM FACIAL IMAGES:

K-Nearest Neighbor techniques used for detecting gender by K-NN algorithm. Every time the
input feature data is compared to the data present in training data, and the result is made
according to that. Convolutional Neural Networks (CNN) uses two methods to recognize the
faces, appearance-based which uses about 72 facial points as key features and geometry based
using specific regions of the face as local features. The advantage is K-NN improved the
accuracy up to 92.5% and texture normalization is done to improve the results. Disadvantages
are K-NN is effective if the training data is large, Algorithm has high Computation cost.

[3] GENDER RECOGNIZATION & AGE PREDICTION:

Fuzzy rule formation is the method were identification can be done using beard, bindi, hair, ear
ring, eyebrows. In this paper, trial and error method is used to locate skin color and non-skin
color pixels. But many of the times, system fails to detect whether an image contains human

Department of CSE, SIT, Mangaluru Page 3


Identification of Gender using Facial Images Literature Survey

face or not. Using Fuzzy rule formation, it is easy to detect based on facial features but
sometimes result may be unpredictable.

[4] FACE RECOGNITION AND GENDER CLASSIFICATION USING FEATURE OF


LIPS:

This method depends on feature derivation and analysis to gain the required knowledge about
face. Facial features may be skin color, face shape, mouth. Principal Component Analysis
(PCA) method is used to reduce the large dimensionality of the data space to the smaller
intrinsic dimensionality of feature space which are needed to describe the data economically.
Minimum distance classifier method is used to test the image and to compare with the image
of training set individually. The YCbCr ((Y) luminance Component, (Cr, Cb) chrominance
components) color space is used to detect the skin region on the given input face image. The
given input RGB image is converted into the YCbCr color space. Color is a powerful clue of
human faces. The Advantage is Lips has stable structure that is preserved well even at the old
age. The size of the lip is large compared with there is, retina.

[5] FACE DETECTION SYSTEM BASED ON RETINAL CONNECTED NEURAL


NETWORK(RCNN):

Face detection system based on a Retinal Connected Neural Network (RCNN) that examine
small windows of an image to decide whether each window contains a face or not. It first
applies a set of neural network-based filters to an image and uses an arbitrator to combine the
outputs then the filters, examine each location in the image at several scales, looking for
locations that might contain a face then the arbitrator merges the detections from individual
filters and eliminates overlapping detections. The Advantage is this method produces good
detection rates (77.9% and 90.3%) and disadvantage is only detecting up right faces looking at
the camera

[6] GENDER CLASSIFICATION BY USING SUPPORT VECTOR MACHINE:

In this algorithm data is classified in two groups using Support Vectors. Data is grouped
according to the properties of data. This result is better than other Algorithm because this
method groups the data according to the property and not according to the data available in
sample sets. Support Vectors can maximum differentiate the properties between two groups.
The Advantage is in Support Vector Machine the samples are well trained and the

Department of CSE, SIT, Mangaluru Page 4


Identification of Gender using Facial Images Literature Survey

Disadvantage is Key parameters need to be set correctly to achieve the best classification
results for any given problem.

[7] VIOLA-JONES OBJECT DETECTION FRAMEWORK AND LOCALIZATION


BASED ON SKIN:

This system consists of an offline training phase and an online testing phase. In the training
stage the algorithms are applied for detection and classification of standard facial image
database. The images are first pre-processed, passed on to the feature extraction stage, and the
extracted features are used to train the classifier. For the testing phase skin detection is applied
as a pre-processing procedure on the incoming video frames in order to locate the possible
facial regions. The trained classifier then works on the extracted texture features to perform
gender classification. Detection of Human Faces in the input video stream Pre-Processing steps
to account for variation in lighting, illumination, shading, background etc. The Disadvantage
is code is very slow and takes up to 25.68s for the detection of a single face from the scene
therefore Time consuming.

[8] FACIAL RECOGNIZATION BY USING OPENCV:

OpenCV (open source computer vision) is a library of programming functions mainly designed
for real-time computer vision firstly developed by intel. There are many functions available
inside OpenCV but it is difficult to understand the wide variety of functions and also the
function used for a particular problem. By using OpenCV it is easy capture the color image and
to identify the each pixel of image. The advantages are OpenCV is available at free of coast, it
is portable as OpenCV can run on any device that can run c and the Disadvantage is OpenCV
does not provide the same ease of use when compared to MATLAB.

Department of CSE, SIT, Mangaluru Page 4


Identification of Gender using Facial Images Software Requirement Analysis

CHAPTER 3

SOFTWARE REQUIREMENT ANALYSIS

A system requirements specification (SRS) – a requirements specification for a software


system is a complete description of the behaviour of a system to be developed. It includes
a set of use cases that describes all the interactions the users will have with the software.
In addition to use cases, the SRS also contains non-functional requirements. Non-
functional requirements are requirements which impose constraints on the design or
implementation (such as performance engineering requirements, quality standards or
design constraints).
Software requirement is a sub-field of software engineering that deals with the
elicitation, analysis, specification and validation of requirements for software. The
software requirement specification document enlists all necessary requirements for
project development. To derive the requirements, we need to have clear and thorough
understanding of the products to be developed.

3.1 Feasibility Study

The main objective of the feasibility study is to treat the technical, operational and
economic feasibility of developing the application. Feasibility is the determination of
whether or not project is worth doing. The process followed in making this determination
is called feasibility study. All systems are feasible, given unlimited resources and infinite
time. The feasibility study to be conducted for this project involves:

• Technical Feasibility
• Operational Feasibility
• Economic Feasibility

3.1.1 Technical Feasibility


It is the measure of the specific technical solution and the availability of the technical
resources and expertise. It is one of the first studies that must be conducted after a project
has been identified. A technical study of feasibility is an assessment of the logistical
aspects of business operation. This is considered with specifying equipment and software
that will successfully satisfy the user requirement. The technical needs of the system may

Department of CSE, SIT, Mangaluru Page 6


Identification of Gender using Facial Images Software Requirement Analysis

vary considerably but should include the facility to produce outputs in a given time,
response time under certain conditions and the ability to process a certain amount of
transaction at a certain speed.

3.1.2 Operational Feasibility


Operational feasibility is mainly concerned with issues like whether the system will be
used if it is developed and implemented, whether there will be resistance from the users
which will affect the possible application benefits. It is the ability to utilize, support and
perform the necessary tasks of a system or program. It includes everyone who creates,
operates or uses the system. It is the measure of how well a proposed system solves the
problem and takes advantages of the opportunities identified during the scope definition
and problem analysis phases. This system helps in many ways. It reduces the burden of
maintaining bulk of records of all the fruit details. Maintenance of the project is also easy
and understandable and no major training and new skills are required.

3.1.3 Economic Feasibility


Economic feasibility is the most frequently used method for evaluating the effectiveness
of the new system. Economic feasibility is the measure of the cost effectiveness of an
information system solution. Without a doubt, this measure is most often and important
one of the three. Information systems are often viewed as capital investments for the
business, and, as such, should be subjected to the same type of investment analyses as
other capital investments.

Economic analysis is used for evaluating the effectiveness of the proposed system.
In economic feasibility, the most important is cost-benefit analysis. This project is not
economical as it mainly depends on the software components which are not freely
available.

Department of CSE, SIT, Mangaluru Page 7


Identification of Gender using Facial Images System Requirement Specification

CHAPTER 4

SYSTEM REQUIREMENT SPECIFICATION


The main purpose of System Requirement Specification is to translate the ideas in the
minds of a client into a formal document. Through System Requirement Specification the
client clearly describes what it expects from the proposed system and the developer
clearly understands what capabilities are required to build the system. The purpose of this
document is to serve as a guide to developers and testers who are responsible for the
development of the system.
The input given is in the form of a face image and the image features are analyzed
based on the algorithm. An unknown image is then inputted to predict the gender of the
same. An output will be generated which will contain the gender prediction of the
unknown face image.

4.1 Functional Overview


• A classifier is used called as A Support Vector Machine
• Feature extraction and feature calculation takes place.
• The gender is revealed.

4.2 Operating Environment


Operating environment involves minimum software and hardware requirements required
by the system.

4.2.1 Software Requirements


• Windows 10
• Anaconda python 2.7
• OpenCV

4.2.2 Hardware Requirements


• Processor - Dual core
• Hard Disk – 50GB
• Memory – 1GB RAM

Department of CSE, SIT, Mangaluru Page 8


Identification of Gender using Facial Images System Requirement Specification

4.3 Functional Requirements


Functional Requirements defines the function of a system or its component. A function is
described as a set of inputs, the behavior and outputs. Functional requirements specify
particular results of a system. Functional requirements drive the application architecture
of a system. Following are the functional requirements used in the project.

• Load Camera
Open Computer Vision (OpenCV) is an open source BSD licensed image processing
bundle that contains functions for all type of image processing functionality from
basic image decoding, enhancement, color space conversion, object detection, object
tracking and so on.
• Input Image

Here in the input image we can give access to the web camera or we can also give
access to the part of the video so that the stored video can be played anytime.

• Preprocessor
A preprocessor is a program that processes its input data to produce output that is
used as input to another program. The output is said to be a preprocessed form of the
input data, which is often used by some subsequent programs like compilers.
• Feature Extraction
Feature extraction involves reducing the number of resources required to describe a
large set of data. When performing analysis of complex data one of the major
problem’s stems from the number of variables involved. Analysis with a large number
of variables generally requires a large amount of memory and computation power
• Fitness Calculation
In computer world, genetic material is replaced by strings of bits and natural selection
replaced by fitness function.
• Gender identification
Gender identity is defined as a personal conception of oneself as male or female (or
rarely, both or neither). This concept is intimately related to the concept of gender
role, which is defined as the outward manifestations of personality that reflect the
gender identity.

Department of CSE, SIT, Mangaluru Page 9


Identification of Gender using Facial Images System Requirement Specification

4.4 Non-Functional Requirements


Safety Requirements
The entire document should follow the font specification. If there are any important
lines of the document which do not follow the specification, then there is chance that
it is misinterpreted by the application which may lead to meaningless sentence or loss
of important data.

Software Quality Attributes

The SRS describes the applications attributes and properties.

• Availability: System should be present when it is required with not many


delays.
• Security: With the encrypted password the users are allowed to login into
system giving safety against malicious users.
• Maintainability: Further assistant is given in future in case the system
undergoes any problem.
• Portability: System is portable as needed.
• Reusability: Parts of system can be reused whenever needed.

4.5 Performance Requirements


• Capacity: System with 1 GB hard disk is more than enough to hold data from
database. A set of bulk SMSs can be sent at a time using SMS gateway.
• Latency: Execution in the system is done without much latency. Sending of
message depends on the GSM network, congestion and traffic.
• Response Time: Execution in the system is done without much latency. Provides
a timely availing of information of the events through messages. Provides a high
degree of customer satisfaction by guiding the participants. Provides a timely
response when overlapping of an event takes place.

4.6 Security Requirements


The admin should login with his password for the authentication purpose. Admin also has
to see to that his password is not known to anyone, failure of which may lead to misuse of
data.

Department of CSE, SIT, Mangaluru Page 10


Identification of Gender using Facial Images System Design

CHAPTER 5

SYSTEM DESIGN
System design is the way of describing the architecture, interfaces, and others for a
system to fulfil the particular need.
System design concentrates on determining which module is needed for the
system, the specifications of the given modules that are in the system. System design is
also called top-level design where we consider system as a group of components with
specifically defined behaviour that communicates with each.
The purpose of the design phase is to plan a solution of the problem specified by
the requirement document. The design of a system is perhaps the most critical factor
affecting the quality of the software, and has a major impact on the later phases,
particularly testing and maintenance. The output of this phase is the design document.
The design activity is often divided into two separate phases. They are system design and
detailed design.

It is one basic approach where issues are solved based on a selection.


Following points are needed while designing the system:
• Rectify data to be extracted.
• List out the user requirements.
• Identity every data for input and output.
• System specification.
• Future benefits of the project in long term.

5.1 High Level Design

High-level design which is sometimes also called system design, aims to identify the
modules that should be in the system, the specifications of these modules, and how they
interact with each other to produce the desired results. At the end of system design all the
major data structures, file formats, output formats, as well as the major modules in the
system and their specifications are decided.

Department of CSE, SIT, Mangaluru Page 11


Identification of Gender using Facial Images System Design

Gender Identification
using Facial Images

Camera

Extract Image Face Pre- Feature


Extraction processing Extraction

SVM
Calculate
Training
Fitness
Gender
Identification

SVM
Classification

Fig 5.1: High level design for Gender Identification

The above high-level design shows that the camera is used in order to extract the
images, once the images are extracted, the SVM algorithm is used and the SVM
classification is done. The face extraction details are absorbed. Pre-processing of the data
is done, the fitness is calculated, all the features are extracted and the gender is revealed
as the output.

5.2 Detailed Design

During detailed design the internal logic of each of the modules specified in system
design is decided. During this phase further details of the data structures and algorithmic
design of each of the modules is specified. The logic of module is usually specified in a
high-level design description language, which is independent of target language in which
the software will eventually be implemented.

Department of CSE, SIT, Mangaluru Page 12


Identification of Gender using Facial Images System Design

5.2.1 Use Case Diagram

A use case diagram at its simplest is a representation of a user's interaction with the
system and depicting the specifications of a use case. A use case diagram can portray the
different types of users of a system and the various ways that they interact with the
system.

• Use cases:
It explains an order of action that gives meaningful values to actors and it
is drew as a horizontally ellipses.
• Actors:
An actor’s is person or externally object which performs the job of
communications within the systems.
• System boundary boxed:
A rectangular box is drawn among the Use case which specifies the
objectives of system.
• Association:
The association is the link that is drew among actors and a Use case. It
specifies which actors speak with system to complete the various tasks.

Identification of Gender using Facial Images

Input
Image

Face
Extraction

Pre
processing

Feature
Extraction
User

Gender
discrimination

Fig 5.2: Use case diagram for Gender Identification

Department of CSE, SIT, Mangaluru Page 13


Identification of Gender using Facial Images System Design

The above use case diagram displays the working of the face recognition the
camera is used to capture the images. After the input of the images, face extraction takes
place, and then pre-processing of the images with the help of feature extraction and
gender discrimination is the output.

5.2.2 Data Flow Diagram

Level 1DFD

Camera Video Capture


Image

Image

SVM
Training

Dataset Dataset

Face Pre
Extraction processing

Value Value

Feature Gender
Extraction discrimination

Calculate
Threshold
Fitness
Male, female

Result

Fig 5.3: Level 1 Data flow diagram of Gender Identification

A Data Flow Diagram (DFD) is a graph showing flow of data values from their sources in
objects through processes that transform them to destination in other objects. A DFD also
known as “bubble chart” has the purpose of clarifying the system requirements and
identifying major transformations that will become programs in system design. So, it is

Department of CSE, SIT, Mangaluru Page 14


Identification of Gender using Facial Images System Design

the starting point of the design phase that functionally decomposes the requirements
specifications down to the lowest level of detail. The bubbles represent data
Transformations and the lines represent data flows in the system. A DFD is often used as
a preliminary step to create an overview of the system without going into great detail,
which can later be elaborated.

The level one DFD shows that the camera is placed and the video is recorded, the
video will capture the image, through the SVM training based on the dataset face
extraction and pre-processing is done, and based on the value feature extraction takes
place, on the basis of threshold value fitness is calculated, the gender discrimination is
done, either male or female the results are displayed.

Level 2 DFD

Image

Camera SVM
training

Dataset Bits

Image
Skin colour
binarization
segmentation

rgb
Bits

Smoothing
filter

Smoothing value

Extraction

Fig 5.4: Level 2 Data flow of Gender Identification


The level 2 DFD shows that the camera which captures images the SVM training is used
to know the skin color segmentation and through bits image binarization process takes
place, smoothing filter is done through bits smoothing value is used for extraction.

Department of CSE, SIT, Mangaluru Page 15


Identification of Gender using Facial Images System Design

5.2.3 Sequence Diagram

Sequence diagram shows the participants in an interaction and sequence of messages flown
among them. They also show the interactions of a system with its actors to perform all parts
of use case. Each use case requires one or more sequence diagrams to describe its behaviour.

A sequence diagram is a Unified Modelling Language (UML) is a kind of interaction


diagram that shows how processes operate with one another and in which order. It is a
construct of message sequence chart. A sequence diagram shows object interactions arranged
in time sequence. It depicts the objects and classes involved in the scenario and sequence of
messages exchanged between the objects needed to carry out the functionality of the scenario.
Sequence diagrams typically are associated with use case realizations in the logical view of
the system under development. A sequence diagram shows, as parallel vertical lines, different
processes or objects that live simultaneously, and as horizontal arrows, the messages
exchanged between them in the order in which they occur. This allows the specification of
simple run time scenarios in a graphical manner.

Customer System Database

On video Input Image

SVM training

Skin colour segmentation

Smoothing filter

Extraction

Face extraction

Pre-processing

Result (Male, female) Calculate Fitness

Fig 5.5: Sequence Diagram of Gender Identification

Department of CSE, SIT, Mangaluru Page 16


Identification of Gender using Facial Images System Design

The above sequence diagram depicts that the customer on video, the system will input
the image, which will be saved in database. The SVM training is passed, skin colour
segmentation takes process, smoothing filter is utilized and extraction is done, face extraction
and pre-processing are done through the help of database and then fitness is calculated the
results are shown as either male or female.

The sequence of activities to be carried out in order to implement the proposed


system. User logs in to the system with user name and password, the system compares
this with the username and password stored in the database. If the user is authentic then
he is redirected to the main page. The captured image is stored and the text extraction is
done by converting it to grey scale.

Department of CSE, SIT, Mangaluru Page 17


Identification of Gender using Facial Images System Implementation

CHAPTER 6

SYSTEM IMPLEMENTATION
System Implementation is the stage where the theoretical design is converted into a
working system, the new system may be totally new, replacing an existing manual, or
automated system or it may be a major modification to an existing system. The system is
implemented using Python.
Python is an interpreted, high-level, general-purpose programming language.
Created by Guido van Rossum and first released in 1991, Python's design philosophy
emphasizes code readability with its notable use of significant whitespace. Its language
constructs and object-oriented approach aim to help programmers write clear, logical code for
small and large-scale projects. Python is dynamically typed and garbage-collected. It supports
multiple programming paradigms, including structured (particularly, procedural,)object-
oriented, and functional programming. Python is often described as a "batteries included"
language due to its comprehensive standard library.

Python was conceived in the late 1980s as a successor to the ABC language. Python 2.0,
released in 2000, introduced features like list comprehensions and a garbage collection
system capable of collecting reference cycles. Python 3.0, released in 2008, was a major
revision of the language that is not completely backward-compatible, and much Python 2
code does not run unmodified on Python 3. Python is a multi-paradigm programming
language. Object-oriented programming and structured program Python uses dynamic
typing and a combination of reference counting and a cycle-detecting garbage collector
for memory management. It also features dynamic name resolution (late binding), which
binds method and variable names during program execution are fully supported, and many of
its features support functional programming and aspect-oriented programming (including
by meta programming and metal objects (magic methods)). Many other paradigms are
supported via extensions, including design by contract and logic programming. The
language's core philosophy is summarized in the document “The Zen of Python (PEP 20)”,
which includes aphorisms such as:

• Beautiful is better than ugly.

• Explicit is better than implicit.

Department of CSE, SIT, Mangaluru Page 18


Identification of Gender using Facial Images System Implementation

• Simple is better than complex.

• Complex is better than complicated.

• Readability counts.

Rather than having all of its functionality built into its core, Python was designed to be
highly extensible. This compact modularity has made it particularly popular as a means of
adding programmable interfaces to existing applications. Van Rossum's vision of a small core
language with a large standard library and easily extensible interpreter stemmed from his
frustrations with ABC, which espoused the opposite approach.

Python strives for a simpler, less-cluttered syntax and grammar while giving developers a
choice in their coding methodology. In contrast to Perl's "there is more than one way to do it"
motto, Python embraces a "there should be one and preferably only one obvious way to do it"
design philosophy. Alex Maratelli, a Fellow at the Python Software Foundation and Python
book author, writes that "To describe something as 'clever' is not considered a compliment in
the Python culture."

Python's developers strive to avoid premature optimization, and reject patches to non-
critical parts of the C, Python reference implementation that would offer marginal increases
in speed at the cost of clarity. When speed is important, a Python programmer can move
time-critical functions to extension modules written in languages such as C, or use PyPy,
a just-in-time compiler. Python is also available, which translates a Python script into C and
makes direct C-level API calls into the Python interpreter.

An important goal of Python's developers is keeping it fun to use. This is reflected in the
language's name a tribute to the British comedy group Monty Python and in occasionally
playful approaches to tutorials and reference materials, such as examples that refer to spam
and eggs (from a famous Monty Python sketch) instead of the standard foo and bar.

A common neologism in the Python community is pythonic, which can have a wide range
of meanings related to program style. To say that code is pythonic is to say that it uses Python
idioms well, that it is natural or shows fluency in the language, that it conforms with Python's
minimalist philosophy and emphasis on readability. In contrast, code that is difficult to
understand or reads like a rough transcription from another programming language is
called un pythonic. Users and admirers of Python, especially those considered knowledgeable
or experienced, are often referred to as Pythonistas.

Department of CSE, SIT, Mangaluru Page 19


Identification of Gender using Facial Images System Implementation

6.1 ALGORITHMS

6.1.1 LOGIN MODULE

This module allows user to login to system with respective username and password. If the
values are matched then the user will be redirected to homepage.

1. Begin
2. Input username, password.
If username exists, then
Check whether password matches
If password matches, then
Successful Login
Else
Display error message
End if
End if
3. End

6.1.2 LOGOUT MODULE

In logout module if the emailed already logged in then update logout otherwise display error
message.

1. Begin

2. Input Email id
Check if Email id already logged in
Update Logout
Else
Display error message
End If
3. End

Department of CSE, SIT, Mangaluru Page 20


Identification of Gender using Facial Images System Implementation

6.1.3 AGE AND GENDER PREDICTION

1. Begin

2. The face detection is done using the function getFacebox

3. Predict gender

4. Load the gender network into memory

5. Pass the detected face through the network

The above procedure gives the probabilities or confidence of the two classes

6. Take the max of the two outputs and use it as the final gender prediction

7. Predict age

8. Load the age network

9. Use the forward pass to get the output

We take the max out of all the output to get the predicted age group

10. End

6.1.4 IMAGE VERIFICATION

1. Begin
2. A training dataset is maintained which consists of images of a person involved in criminal
activities.
3. Upload the image that is to be identified
The hash value of uploaded image is calculated.
Compare the hash value of the uploaded image with all the images present in the
training dataset.
Check if the hash value of the uploaded image matches with any of the training
images.
If the match is found then return the desired output
4. End

Department of CSE, SIT, Mangaluru Page 21


Identification of Gender using Facial Images Testing

CHAPTER 7

TESTING

7.1 Introduction:
Software testing is the process used to help identify the correctness, completeness, security
and quality of developed computer software. This includes the process of executing the
program or application with the intent of finding errors. Quality is not an absolute; it is value
to some person. With that in mind testing can never completely establish the correctness of
arbitrary computer software; testing furnishes a criticism or comparison that compares the
state and behavior of the product against a specification.

The testing phase consists of evaluating the software that has been developed in order to
conform that it produces the output required in a safe and efficient manner. In this phase
inherent errors that occur, have to be handled and the user should be informed so that he/she
can follow the guidelines and instructions and get around the error and obtain the output.

During testing, the program to be tested is executed with a set of test cases and the
output of the program for the test cases is evaluated to determine if the program is performing
as expected. Due to its approach, dynamic testing can only ascertain the presence of errors in
the program the exact nature of the errors is not usually decided by testing.

Testing forms the first step in determining the errors in a program. Clearly the success
of testing in revealing errors in programs depends critically on the test cases. Because code is
the only product that can be executed and whose actual behavior can be observed, testing is
the phase where the errors remaining from all the previous phases must be detected.

The program to be tested is executed with a set of test cases and the output of the
program for the test cases are evaluated to determine if the programming is performing as
expected. Testing forms the first step in determining errors in a program. The success of
testing in reveling errors in programs depends critically on the test cases.

Department of CSE, SIT, Mangaluru Page 22


Identification of Gender using Facial Images Testing

7.2 Testing Objective

The objectives of testing are:


• Testing is a process of executing a program with the intent of finding errors.
• A successful test case is one that discovers an as of yet and discovered error. System
testing is a stage of implementation which is aimed at ensuring that the system works
accurately and efficiently as per the user need, before the live operation commences
as stated before, testing is vital to the success of a system testing makes a logical
assumption that if all parts of system are correct the goal will successfully be
achieved. A series of tests are performed before the system is ready for the user
acceptance test.

7.3 Testing Criteria


Table 7.1: Testing for valid user name

Test case Input Test description Output

1 User name starts with User name cannot start with Must Enter
number number Characters

2 User name is left blank User name cannot be left blank Must Enter
username

Table 7.2: Testing for valid password

Test case Input Test description Output

1 Password is left Password cannot be Must Enter password


blank blank
2 Invalid password Valid password must Password mismatch
entered be entered

Department of CSE, SIT, Mangaluru Page 23


Identification of Gender using Facial Images Testing

Table 7.3: Testing for valid Email address

Test case Input Test description Output


1 Email address is not in Correct Email address Should Invalid
format have Correct format Expression

2 Email address with space Email address cannot Invalid


have space Expression
3 Email is left blank Email cannot be blank Must enter
Email ID

Table 7.4: Testing for data insertion

Test case Input Test description Output

1 Mandatory fields left Mandatory fields Must enter data


empty cannot be left
empty
2 Duplicate entry Duplicate entry Appropriate error message
not allowed
3 Input without above Valid input Record inserted Successfully
faults

Department of CSE, SIT, Mangaluru Page 24


Identification of Gender using Facial Images Testing

Table 7.5: Testing for deletion

Test case Input Test description Output

1 Deletion attempted Entries, if not selected, cannot be Select any field


when no entries deleted.
selected
2 Valid deletion Valid deletion Record deleted
without above Successfully
faults

Table 7.6: Testing for phone number

Test case Input Test description Output

1 Phone number Phone number Enter only


entered with alphabets Cannot have numbers
alphabets
2 Phone number entered is Phone number with Invalid phone number
more than 10 digits more than 10 digits
cannot be entered

Table 7.7: Hardware testing

Test case Input Test description Output

1 Receiving data If desired data not Ignore


received
2 Hardware If hardware not Error message
connection connected to system hardware not found

Department of CSE, SIT, Mangaluru Page 25


Identification of Gender using Facial Images Testing

Table 7.8: Other cases


Test case Input Test description Output

1 Click on logout Application Will Application closes and redirects to


close login page
2 Click on clear Entering details Record is not submitted to the
database and Text boxes cleared
3 Click on save Entering details Record is submitted to the
database
4 Click on save Not entering the Appropriate error message is
details displayed
5 Click on date Selecting date Date is displayed
control
6 Click on Drop Selecting data Data is displayed
down list

Department of CSE, SIT, Mangaluru Page 26


Identification of Gender using Facial Images User Manual

CHAPTER 9

USER MANUAL

9.1 CAMERA

Camera is used in order to extract the images, once the images are extracted, the SVM
algorithm is used and the SVM classification is done. Face recognition is used to capture the
images. After the input of the images, face extraction takes place, and then pre-processing of
the images with the help of feature extraction and gender discrimination is the output.

The video is also recorded, the video will capture the image, through the SVM
training based on the dataset face extraction and preprocessing is done, and based on the
value feature extraction takes place, on the basis of threshold value fitness is calculated, the
gender discrimination is done, either male or female the results are displayed. The camera
which captures images the SVM training is used to know the skin color segmentation and
through bits image binarization process takes place, smoothing filter is done through bits
smoothing value is used for extraction.

Department of CSE, SIT, Mangaluru Page 27


Identification of Gender using Facial Images Conclusion

CONCLUSION AND FUTURESCOPE


Gender recognition from face images is one of the fundamental research areas in computer
vision. Automated gender recognition is important in many application areas such as human
computer inter-action, biometric, surveillance, demographic statistics etc. Human face
contains important visual information for gender perception. It is challenging for a machine
to identify this visual information which separate male faces from female faces. Researches
are going on so that a machine can achieve human level accuracy. The project can be used to
overcome the frauds. Hence, we are motivated to work on this where it helps. Hence this
project can be much used in voter identification. It can also be used for surveillance at banks
and residential areas. In future this framework can also be used in several vision based
classification such as object and scene classification in reducing the burden of humans. Hence
this project helps in identifying easily and also currently it is inaccurate at identifying people
of colour especially black women. Hence this can be improved in future.

Department of CSE, SIT, Mangaluru Page 28


REFERENCES

[1] Ojala, T., Pietkainen, M., Harwood, D.: A Comparitative Study of Texture Measures with
Classification Based on Feature Distributions. Pattern Recognition 29(1), 51-59 (1996).

[2] Ojala, T., Pietkainen, M., Maenpaa, T.: Multiresolution Gray-Scale and Rotation Invariant
Texture Classification with Local Binary Patterns. IEEE Trans. Pattern Analysis and Machine
Intelligence 24(7), 971-987(2002).

[3] Deepak Deshmukh “Gender Recognition from Model’s Face using SVM Algorithm”
presented at International Journal of Enginnering Research & Technology (IJERT) vol.10
Number 1, Apr 2014.

[4] F. H. C. Tivive and A. Bouzerdoum. A Gender recognition system using shunting Inhibitory
convolutional neural networks. Proceedings at International Joint Conference on Neural
Networks (IJCNN ‘06’), pages 5336-5341, 2006.

[5] Lemley, Sami Abdul-Wahid, Dipayan Banik, Razvan Andonie “Comparison of Recent
Machine Learning Techniques for Gender Recognition from Facial Images” presented at
MAICS 2016.

[6] Y. H. Chan and S. A. R. Abu – Baker, “Face Detection System Based on Feature – Based
Chrominance Colour Information”, Proceedings of the International Conference on Computer
Graphics, Imaging and Visualization, 2000.

[7] Baback Moghaddam and Ming-Hsuan Yang “Gender Classification with Support Vector
Machines” proceedings of the 4th IEEE International Conference on Face and Gesture
Recognition, March 2000.

[8] G. Guo, S.Z. Li, K. Chan, Face Recognition by Support Vector Machines. Proc. of the IEEE
International Conference on Automatic Face and Gesture Recognition, 2000.

You might also like