Professional Documents
Culture Documents
MLRWD SV1
MLRWD SV1
After taking into account all this assumption our drawings will have to be similar to this one:
Now, since the only parameter we can classify the faces by is the mouth, we can actually split
our classification into 3 classes: happy, neutral or sad.
The precomputed values are created by using a training set of already classified images and
extracting an average distance beyond which the face is either happy or sad. Any smaller ab-
solute distance obtained will result in a neutral face. The drawing below should be suggestive:
The next step is identifying the centers of the eyes. Considering that the eyes are above the
mouth, we can traverse the matrix in some different ways to find the following points that we
are interested in:
(i) from top to bottom: find the highest point of one eye
(ii) from left to right: find the most left side point of one eye
(iii) from right to left: find the most right side point of one eye
(iv) from bottom to top: first we go through the lines containing the pixels of the mouth and
then we find the lowest point of one of the eyes
Now, comparing the distances between all this points and choosing the smallest 2, we can pair
them s.t. each pair describes one eye. Afterwards, we use these points to get the centers of
the eyes, determine the angle between that line and a horizontal one, and rotate our image so
that the mouth will be placed in a sensible position.
The only bit left is to use the mouth in order to classify the sentiment. We will exploit the fact
that a drawing of a happy/sad mouth is usually similar to a quadratic function and therefore
use a best fit algorithm in order to find a function of the form ax2 + bx + c. Finally, we can
simply consider that for a<0 the face is sad and for a>0 the face is happy. However, for a
neutral face there is a high probability that a!=0 when we use our fitting algorithm. Therefore,
when we apply this algorithm on the training set images, we determine the average value of
the distance shown in the second picture. We use this value as limits for a neutral face.