Team No. 12 Major Project Report
Team No. 12 Major Project Report
Team No. 12 Major Project Report
Belagavi - 590018
A Project Report on
IDENTIFICATION OF GENDER USING FACIAL
IMAGES
Submitted by
CERTIFICATE
Certified that the project work entitled “IDENTIFICATION OF GENDER USING
FACIAL IMAGES” is a bona fide work carried out by
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
1 INTRODUCTION 1
1.4 Objective 2
2 LITERATURE SURVEY 3
5 SYSTEM DESIGN 11
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
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.
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.
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:
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.
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.
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.
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
face or not. Using Fuzzy rule formation, it is easy to detect based on facial features but
sometimes result may be unpredictable.
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.
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
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
Disadvantage is Key parameters need to be set correctly to achieve the best classification
results for any given problem.
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.
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.
CHAPTER 3
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
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.
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.
CHAPTER 4
• 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.
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.
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.
Gender Identification
using Facial Images
Camera
SVM
Calculate
Training
Fitness
Gender
Identification
SVM
Classification
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.
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.
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.
Input
Image
Face
Extraction
Pre
processing
Feature
Extraction
User
Gender
discrimination
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.
Level 1DFD
Image
SVM
Training
Dataset Dataset
Face Pre
Extraction processing
Value Value
Feature Gender
Extraction discrimination
Calculate
Threshold
Fitness
Male, female
Result
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
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
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.
SVM training
Smoothing filter
Extraction
Face extraction
Pre-processing
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.
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:
• 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.
6.1 ALGORITHMS
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
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
1. Begin
3. Predict gender
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
We take the max out of all the output to get the predicted age group
10. End
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
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.
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
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.
[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.