Available via license: CC BY 3.0
Content may be subject to copyright.
IOP Conference Series: Materials Science and Engineering
PAPER • OPEN ACCESS
Probabilistic neural network and invariant moments for men face shape
classification
To cite this article: Romi Fadillah Rahmat et al 2018 IOP Conf. Ser.: Mater. Sci. Eng. 420 012095
View the article online for updates and enhancements.
This content was downloaded from IP address 139.81.183.231 on 01/10/2018 at 18:41
1
Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd
1234567890‘’“”
2nd Nommensen International Conference on Technology and Engineering IOP Publishing
IOP Conf. Series: Materials Science and Engineering 420 (2018) 012095 doi:10.1088/1757-899X/420/1/012095
Probabilistic neural network and invariant moments for men face shape
classification
Romi Fadillah Rahmat, Muhammad Dian Syahputra, Ulfi Andayani*, Tifani
Zata Lini
Department of Information Technology, Faculty of Computer Science and
Information Technology, Universitas Sumatera Utara, Medan, Indonesia
*Email: ulfi.andayani@usu.ac.id
Abstract.Face shape classification is useful for grooming personalities, such as
the selection of haircut, the selection of facial makeup, the selection of glasses
frames or even the selection of appropriate shirts. The face shape in men is
divided into six forms, namely: oval, round, diamond, rectangle, triangle and
square. Facial shape determination has been introduced by many beauty experts,
but for society, in general, is still a little difficult to classify it because the form of
each face is almost the same and manual measurement requires a long process.
That's why it needs a method to classify face shape quickly and precisely. A
proposed method in this research is Probability Neural Network and Invariant
Moments. Men face images are used as input for image processing. The stages
before classification are image pre-processing (Gray scaling, Scaling, and Gabor
Filter). Then feature extraction using Invariant Moments. The final step is
classification using Probability Neural Network. After testing is done to 90 data
training and 30 data testing, it was concluded that the proposed method has the
capability to classify men face shape with accuracy 80%.
1. Introduction
The classification of facial shape is especially useful for grooming personalities, such as the
selection of haircut shape, the selection of facial makeup, the selection of sunglasses or even
the selection of appropriate shapes [5][6]. The process of determining facial shape can be
done in several stages such as taking pictures with the camera, outlining the face, counting the
length and width of the face, cheekbones, jaw, and forehead then done determination type
face shape. The face shape in men is divided into six forms, namely: oval, round, diamond,
rectangle, triangle and square [4]. Facial shape identification has been introduced by many
experts beauty, but for the community, in general, is still a little difficult to classify it because
the shape of each face is almost the same and the measurement manually requires a long
process and must be done carefully to get accurate results.
Research on the classification of facial shape has been done in previous studies. Classifies
face shape in women to get haircut recommendations using AAM (Active Appearance Model)
algorithm and facial segmentation based on the color region [1]. From the research, the
researchers get the highest accuracy with the classifier SVM-RBF of 72% in the test set and
70,67% in the training set. The issue surfaced in the research is the existence of the
misclassification between round and square facial shapes, while oval is the most difficult
facial shape to identify.
Other research conducted on face recognition using invariant moment and backpropagation
2
1234567890‘’“”
2nd Nommensen International Conference on Technology and Engineering IOP Publishing
IOP Conf. Series: Materials Science and Engineering 420 (2018) 012095 doi:10.1088/1757-899X/420/1/012095
neural network. The researcher does engineering the image object by changing the size and
lighting of the same image. The research used 50 facial data and processed them through the
processes of rotation, scaling, and translation which resulted in 400 facial images. The
conclusion of this research is Invariant Moment, and Backpropagation Neural Network can
produce high enough accuracy, with an accuracy of the introduction of 50 face images by
98.22% [2].
Further research is a study conducted by Qiakai, et al. In this study, the researchers
conducted a comparison of classification for face recognition by comparing three classifiers
namely PNN, LVQ, and BPNN and using Discrete Cosine Transform and Wavelet
Decomposition as its feature extraction. Of the three classifiers, PNN ranks the highest-
accurate classifier with an accuracy of 93% [3].
In our study, the author will do the classification using Probabilistic Neural Network
(PNN) and Invariant Moments as its feature extraction to determine the effectiveness and
accuracy of the method in the classification of faces in men. Generally, PNN is widely uses as
neural classifier with good accuracy [7]. Several other researches has been conducted
regarding face recognition such as, mobile based face recognition using fisher face method [8]
and face recognition using eigen face in cloud environment [9] and the use of other classifier
such as SVM and Random Forest for face recognition [10].
With the selection of this method is expected to authors can classify the face shape in men
with more accurate and in a shorter time.
The limitations set for the research, among which are:
1. The input system is a clear facial image with the hair does not cover the forehead,
with no glasses and hats, mustache and beard are not so dense, and manual editing
had been performed on the face image.
2. The app only detects six types of men facial shapes, namely oval, round, diamond,
oblong, triangular and square.
3. System output is in the form of facial shape label.
4. The inputted images were using the front face perspective.
5. File extension applied in this research are jpeg (.jpg) and png (.png)
2. Methodology
2.1. Face Shape Determination Rules
Every human face has its characteristics. Furthermore, according to the beauty experts, human
face has been classified following the size of the jaw, the length, and width of the face,
forehead and size of the cheekbones.It will be easier to determine the suitable hair style,
eyebrows, make-up even selection of glasses that fit with the face if the facial shape has been
identified.The process of measuring the facial shape consists of several stages, such as taking
pictures with the camera, outlining the face, calculating the length and width of the face,
cheekbones, jaw, and forehead, then determining the type of face based on the results of the
previous calculation.The face can be classified into six shapes: round, square, oblong, heart,
oval, and diamond [4]. Each shape can be identified by the following rules:
• Oval: The forehead is wider than the chin. The face length is one and a half times
more than the width of the face.
• Round: The length and width of the face are almost the same, and the cheekbones
are the most prominent part.
• Oblong: Almost the same as the oval shape, but longer and not so wide. The shape
of the chin is also more pointed.
3
1234567890‘’“”
2nd Nommensen International Conference on Technology and Engineering IOP Publishing
IOP Conf. Series: Materials Science and Engineering 420 (2018) 012095 doi:10.1088/1757-899X/420/1/012095
• Square: All face sizes are almost the same width (forehead, cheekbones, and jaw),
while the jaw angle is sharper.
• Triangular: The jaw is the widest part and slowly narrows to the forehead.
• Diamond: the cheekbone is the most dominant part bigger than the forehead and
jaw.
Figure 1.Types of human face based on shape
2.2. Dataset
The data used for the research consisted of 90 facial images of male obtained from the search
site of http://www.google.com and direct retrieval using a mobile camera consisting of 120
images of male faces. 90 pictures were used for training consisting of 15 images for each
facial type and 30 images used for the test consisting of 5 images for eachtype.
2.3. General Architecture
The method proposed to classify the face shape of men is composed of several stages. These
stages start from the image acquisition and data grouping of the male facial images of oval,
round, oblong, rectangle, square and triangle shapes that will be used for training data and
testing data. The process continues to preprocessing step of gray-scaling to convert the image
into a grayscale image. The next step is CLAHE that aims to add more contrast to the image
[12], then followed by facial segmentation by converting the image into a binary image to
bring up the facial feature using Gabor filter. Extraction feature will be performed after facial
segmentation to obtain seven moment values using invariant moments. Following the feature
extraction, the system will proceed to classification process using probabilistic neural network
to get the nearest classification value to the existing data in the database. After these steps
were executed, the system will generate the classification output of male facial shapes. The
general architecture of this research is shown in Figure 2.
2.4. Invariant Moments
Two-dimensional (p+q)th order moment are defined as follows:
(1)
p,q
= 0, 1, 2, ...
If the image function f(x,y) is a piecewise continuous bounded function, the moments of
all orders exist and the moment sequence {mpq} is uniquely determined by f(x,y), and
correspondingly, f(x,y) is also uniquely determined by the moment sequence {mpq}.One
should note that the moments in (1) may be not invariant when f(x,y) changes by translating,
rotating or scaling. The invariant features can be achieved using central moments, which are
defined as follows:
4
1234567890‘’“”
2nd Nommensen International Conference on Technology and Engineering IOP Publishing
IOP Conf. Series: Materials Science and Engineering 420 (2018) 012095 doi:10.1088/1757-899X/420/1/012095
(2)
where
The pixel point ( x , y ) is the centroid of the image f(x,y). The centroid moments μpq
computed using the centroid of the image f(x,y) is equivalent to the mpq whose center has
been shifted to the centroid of the image. Therefore, the central moments are invariant to
image translations. Scale invariance can be obtained by normalization. The normalized central
moments are defined as follows:
;
(3)
Based on normalized central moments, the seven moment invariants are as follows:
(4)
(5)
(7)
(8)
(9)
(10)
The seven moment invariants are useful properties of being unchanged under image
scaling, translation, and rotation.
Figure 2.General Architecture
5
1234567890‘’“”
2nd Nommensen International Conference on Technology and Engineering IOP Publishing
IOP Conf. Series: Materials Science and Engineering 420 (2018) 012095 doi:10.1088/1757-899X/420/1/012095
2.5. Probabilistic Neural Network
Probabilistic neural network is a kind of feed-forward neural networks evolved from the
radial basis function networks. Its theoretical basis is the Bayesian minimum risk criteria. In
pattern classification, its advantage is to substitute nonlinear learning algorithm with a linear
learning algorithm. Meanwhile, it maintains the characteristics of high precision compared
with a nonlinear algorithm. PNN includes the input layer, pattern layer, summation layer and
output layer. The input layer receives the value of the training sample.
2.6. Feature Extraction
We obtained a discriminative feature set by extracting the valid dataset with Invariant
Moments algorithm. This method selected seven unique features value that invariant to
rotation, translation, and scalation. This system doesn't have face landmarking feature, so this
research using a picture that has been cropped with 3rd part software. The image will be
processed by Gabor filter to remove skin and unnecessary part of a face and make line art
picture. Those line art will be extracted with invariant moments and generate seven unique
features value.
(a) (b) (c)
Figure 3. Output images processed by different pre-processing; (a) Original picture; (b)
CLAHE; (c) Gabor kernel
3. Result and Discussion
In this section we described our testing and result. The data entered into the system is a
male face image taken from the search site http://www.google.com and manual retrieval. The
data is selected and divided into six classes: diamond, oblong, oval, round, square and
triangular. Each category has 15 training data and 5 test data, so the total training data is 90
images and 30 image test data.Classification testing in PNN uses different smoothing
parameter values (σ) to determine which values have the highest accuracy. The value of σ
used is 0.1, 0.3, 0.5, 0.7 and 0.9. Testing with σ different from the 5 test data for each face
class can be seen in Figure 4.
6
1234567890‘’“”
2nd Nommensen International Conference on Technology and Engineering IOP Publishing
IOP Conf. Series: Materials Science and Engineering 420 (2018) 012095 doi:10.1088/1757-899X/420/1/012095
Figure 4. Smoothing Parameter Experiment
Based on Figure 4, we can see that σ = 0.1 has the lowest accuracy values. While if we
start from σ = 0.7 the bar has risen up consistently until it reaches σ = 0.9. To make it clear,
the confusion matrices for the test sets are shown in Table 1. These matrices reveal that
square-shaped faces were often predicted as round-shaped. Square-shaped faces tended to be
most difficult to classify correctly as the classifier was the least accurate when applied to this
face shape. Diamond-shape and Round-shape tended to be most easy to classify correctly.
Overall, the PNN algorithm achieved 80% accuracies for predicting the test sets. 80% is
below our expectation this is mainly because of the un-optimal image processing process that
has been conducted.
Table 1. The Confusion Matrix On Test Data
4. Conclusion
Probabilistic neural network and invariant moments method is able to classify face shape in
men with high accuracy with 80% accuracy and 20% error rate. Noise, background, and
image resolution are very influential on the results of classification because the IM method
will calculate the entire area of the image, including the remnants of pixels after the filter. The
skin detection will be implemented in the next research [11].
Smoothing parameter values used in the calculation of PNN greatly affect the level of
accuracy due to the smaller value of σ then the accuracy will be lower. The value of σ ≥ 7 is
the best value to get fairly high accuracy. The square face has the lowest accuracy than other
facial types and often misclassification because square face shape is almost similar to round
0
1
2
3
4
5
6
σ = 0,1 σ = 0,3 σ = 0,5 σ = 0,7 σ = 0,9
Result of Correctly Identified (of 5
picyutes)
PNN Smoothing parameter
Test of PNN Smooting Parameter
Diamond
Oblong
Oval
Round
Square
Triangular
True
Label
Predicted Label
Diamond
Oblong
Oval
Round
Square
Triangular
Accuracy(%)
Diamond
5
0
0
0
0
0
100.00
Oblong
0
4
0
1
0
0
80.00
Oval
0
1
3
0
0
1
60.00
Round
0
0
0
5
0
0
100.00
Square
0
0
0
2
2
1
40.00
Triangular
0
0
0
0
0
5
100.00
7
1234567890‘’“”
2nd Nommensen International Conference on Technology and Engineering IOP Publishing
IOP Conf. Series: Materials Science and Engineering 420 (2018) 012095 doi:10.1088/1757-899X/420/1/012095
face.
References
[1] O’Connor, C 2016 What Shape Am I Retrieved from http://www.fashionbeans.com/2016/
how-to-choose-right-haircut-for-face-shape/
[2] Men’s Hair Style Today 2016 What Haircut Should I Get? Retrieved from
http://www.menshairstylestoday.com/what-haircut-should-i-get/
[3] Smith, Robyna. 2016. Eyebrow Shaping and Colouring To Suit Face Shapes. Sydney: R
Smith-Keys.
[4] Sunhem, W. &Pasupa, K. 2016. An Approach to Face Shape Classification for Hairstyle
Recommendation. 8th International conference on Advanced Computational Intelligence,
pages 390–394.
[5] Sholahuddin. 2012. Metode Moment Invariant danBackproragation Neural Network pada
pengenalan wajah. Lokakarya Komputasi dalam Sains dan Teknologi Nuklir, 10 Oktober
2012 (283-295).
[6] Qiakai, NI, et al. 2012. Research of Face Image Recognition Based on Probabilistic
Neural Networks. Control and Decision Conference (CCDC), 2012 24th Chinese.
[7] Syahputra M F, Nurrahmadayeni, Aulia I, Rahmat R F 2017 Hypertensive retinopathy
identification from retinal fundus image using probabilistic neural network International
Conference on Advanced Informatics, Concepts, Theory, and Application, ICAICTA
2017, 8090989
[8] Arisandi D, Syahputra M F, Putri I L, Purnamawati S, Rahmat R F, and Sari P P 2018 A
real time mobile-based face recognition with fisherfacemethods Journal of Physics:
Conference Series, 978(1),012038
[9] Syahputra M F, Siregar S T M, Rahmat R F 2018 Human face recognition using eigenface
in cloud computing environmentIOP Conference Series: Materials Science and
Engineering, 308(1),012013
[10] Li L, So J, Shin H, and Han Y 2013 Performance of Random Forest and SVM in Face
Recognition Journal of Research in Engineering and Technology (IJRET) 2(4)
[11] Rahmat R F, Chairunnisa T, Gunawan D and Sitompul O S 2016 Skin color
segmentation using multi-color space threshold International Conference on Computer
and Information Sciences, ICCOINS 2016 – Proceedings pp. 391-396
[12] Nababan E B, Iqbal M and Rahmat R F 2016 Breast Cancer Identification on Digital
Mammogram Using Evolving Connectionist SystemsInternational Conference on
Informatics and Computing (ICIC)pp. 132–136.