Report
Report
Report
Abstract
The objective of this project is to identify the gender of a person by looking at his/her photograph. 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.
Wehave not taken genders other than M ale and Female into account. A preliminary algorithm is run to make sure that an
imageis that of a human beforeclassification begins.
I. Intr oduct ion matical equations governing these methods will not be
discussed in this report.
Previous research has shown that our brain has special-
ized nerve cells responding to specific local features
of a scene, such as lines, edges, angles or movement.
Our visual cortex combines these scattered pieces of
information into useful patterns. Automatic face recog- II. Dat a Set and Pr ocessin g
nition aims to extract these meaningful pieces of infor-
mation and put them together into a useful representa-
tion in order to perform a classifi cation/ identifi cation The data we have is a set of high resolution colour im-
task on them. ages of 396 female faces and 389 male faces obtained
While we attempt to identify gender from facial from the MUCT database. All images are frontal views
features, we are often curious about what features of of the face. The database provides diversity of lighting,
the face are most important in determining gender. age and ethnicity.
Are localized features such as eyes, nose and ears more The images also have variations in :
important or overall features such as head shape, hair
line and face contour more important? subject’s head rotation and tilt
There are a plethora of successful and robut face subject’s facial expression
recognition algorithms on the web. Instead of using subject’s face/ Hair accessories
the inbuilt tools that they provide, we start building position of the face in the image
various algorithms from scratch to gain a rich learning However, this challenging database was chosen to
experience. make room for imrpovements in the algorithm.
In this project, the following methods were used
for classifi cation : This data has been used in four different ways
Eigenface Method on a single algorithm so that we can study how sen-
K-means sitive it is to the data quality. We run a python
script to center all the images in our database - by
GDA that performs supervised learning on re-
duced space of PCA centering the images the faces are aligned at the
axis of symmetry of the face. Hehce, we have a
SVM that performs supervised learning on re-
set of centered and uncentered images. We also
duces space of PCA
use coloured (RGB) and B/ W versions of the given
Fisherfaces Method
images. Colour images have been compressed to
SVM that performs supervised learning on fea-
140x140 pixels and B/ W to 64x48 pixels. We now
tures provided by the Histogram of Oriented
have four different datasets: Dataset1(centered, RGB),
Gradients (HOG) method
Dataset2(centered,B/ W), Dataset3(uncentered,RGB)
We look at how these methods perform on our
and Dataset4(uncentered, B/ W).
data, discuss the relative advantages and disadvan-
tages of these methods and investigate the limitations The dataset has been split into training set and test
on accuracy posed by the dataset itself. The mathe- set as summarized in the following table:
1
Table 1: Dataset of faces female subjects who have short hair, hair tied back or
in a scarf were almost always labeled male. Having
Gender Training Set Test Set insufficient examples for them to train on might have
resulted in this outcome. Another key observation is
Male 200 169
that, the male faces are better centered and hence male
Female 200 189
faces have a more reliable eigenspace.
2
Table 6: PCA and GDA method on Dataset 2
IV. K-mean s
A k-fold cross validation was done to determine the
We apply K-means directly on the pixel data that we number of PCAs required, and we found the optimal
get from images to obtain 10 clusters for female faces value to be 100. In order to visualize how GDA works
and 10 for male faces. We would like to call these the with this data, we take 3 Principal Components and
10 most representative female and male faces. We then obtain the following plot:
run the K Nearest Neighbours algorithm to classify our
test images. K was chosen to be 5 after analysing the
performance of the algorithm (using cross validation)
for all possible values of K.
This is done on Dataset 3 and Dataset 4. We get the
following results:
3
Table 11: FishfaceMethod on Dataset 3
4
The outline of a male face face is more rugged and provides an input to a supervised learn-
compared to a female face ing algorithm. These algorithms are more
Turns out that these differences are key in classi- robust to geometric variations in dataset.
fying a person to be male or female.
X. Fut ur e Wor k
IX. Discussi on