FUZZY SKIN DETECTION
TEY YI CHIN
A project report submitted in partial fulfillment of the
requirements for the award of the degree of
Master of Science (Computer Science)
Faculty of Computer Science and Information System
Universiti Teknologi Malaysia
OCTOBER 2008
iii
To my beloved father and mother,
Tey Kim Seng and Chia Ah Mui
iv
ACKNOWLEDGEMENT
During the preparation of this project, many people have been very kind to
lend a hand to help and giving advices. Their advices and help have been very
valuable and largely contributed for me to conduct this project. Taking the chances
here, I would like to express my appreciation to all of them.
First of all, I wish to send my gratitude to my supervisor, Assoc. Prof. Dr. Ali
Selamat. His invaluable experience and advice has been a light in the dark to me
throughout the project. It was my pleasure to be under his guidance. I am also very
thankful to my co-supervisor, Prof. Dr Mohd Aizaini Maarof for his encouragement
and guidance during the project conduction. His guidance has been a valuable asset
for me. At the same time, I would like to thank Assoc. Prof. Dr Siti Mariyam for
sharing her knowledge with me.
Nonetheless, I would like to send my gratitude to FSKSM postgraduate staffs,
especially Pn. Lijah. They have been very helpful throughout my master study.
Besides that, the supports and helps from my fellow course mates and friends should
not be forgotten. They have been very helpful and sharing their ideas and knowledge
with me. Their encouragement and assistance is my motivation throughout the
project implementation. Due to the limit space, I apologize for not being able to list
them all down here.
Finally, I would like to send my appreciation to my parents for their support
and care throughout my whole life.
v
ABSTRACT
The robustness of web technologies allows huge collection of information to
be available through internet. Among this information, some of them are unhealthy
and undesirable. This kind of harmful information will make bad impact on human
development especially to children and teenagers. Therefore, an explicit image
filtering method based on skin detection is proposed in this project. Skin detection is
a popular image processing technique that has been applied in many areas such as
video-surveillance, cyber-crime prosecution and face detection. It is well known
technique to detect the human appearance within image. However, it faces several
drawbacks when using color as cue to detect skin. First, the similarity between skin
and background color within an image. Second, the skin appearance of human under
different lightning condition also adds the complexity in skin detection. Third,
different camera characteristics also influence the performance of skin detection.
Therefore in this project, fuzzy theory is proposed to improve the skin detection
performance by solving the first problem. By improving the first problem, we can
increase the classification accuracy when discriminate human and animal skin
images which was tested in this project. The complexity of applying fuzzy theory in
skin detection is based on the highly similarity between skin and non-skin pixels as a
clear description of the skin color set is needed for processes. Hence, the rules need
to be explicitly enough in order to achieve better performances. Finally, experiment
has been conducted to test the applicability of fuzzy classification. Although the
classification result is lower than comparison method, fuzzy theory has been proved
to be able to discriminate human and animal skin.
vi
ABSTRAK
Perkembangan teknologi web membenarkan maklumat yang berjumlah besar
dihantar melalui. Antara maklumat yang dihantar antara web ini, sebahagian adalah
dalam bentuk gambar yang tidak sihat. Gambar-gambar ini menjejaskan kesihatan
dan perkembangan manusia, terutamanya kepada kanak-kanak dan remaja. Oleh itu,
satu kaedah untuk menapiskan gambar-gambar tidak sihat diperkenalkan dalam
projek ini. Teknik pengesahan kulit manusia melalui gambar merupakan salah satu
teknik popular. Teknik ini digunakan dalam banyak bidang seperti video pengawasan
dan pendakwaan jenayah siber. Bagaimanapun, beberapa masalah wujud semasa
menggunakan teknik ini. Masalah pertama yang ditemui ialah kesamaan antara
warna kulit manusia dengan warna latar belakang gambar. Selain itu, warna kulit
manusia berbeza apabila dalam keadaan cahaya yang berbeza. Pada masa yang sama,
ciri-ciri kamera yang berlainan juga akan mempengaruhi prestasi ketepatan untuk
mengesahkan kewujudan kulit manusia dalam gambar. Dalam projek ini, Teori
Fuzzy telah digunakan untuk menyelesaikan masalah pertama. Selain itu, Teori
Fuzzy juga digunakan untuk membezakan gambar manusia dengan gambar haiwan
dalam projeck ini. Kesusahan untuk melaksanakan Teori Fuzzy dalam projek ini
ialah membezakan warna kulit manusia dengan warna kulit haiwan yang mempunya
nilai serupa. Peraturan Fuzzy yang jelas diperlukan untuk mencapai prestasi yang
lebih baik semasa mengesahkan kewujudan kulit manusia dalam gambar. Walaupun
prestasi ujikaji adalah lebih buruk daripada kaedah dibandingkan, Teori Fuzzy telah
dibuktikan dapat membezakan gambar kulit manusia dengan gambar haiwan.
vii
TABLE OF CONTENTS
CHAPTER TITLE PAGE
TITLE PAGE i
DECLARATION ii
DEDICATION iii
iv
ACKNOWLEDGEMENTS
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS vii
LIST OF TABLES xi
LIST OF FIGURES xii
LIST OF ABBREVIATIONS xiv
LIST OF SYMBOLS xv
LIST OF APPENDIX xvi
1 INTRODUCTION 1
1.1 Introduction 1
1.1.1 Application of Skin Detection In Video 2
Surveillance
1.1.2 Application of Skin Detection In Hand 2
Detection
1.1.3 Application of Skin Detection In Cyber- 2
crime Prosecution
1.2 Problem Background 3
1.3 Problem Statement 5
1.4 Project Aim 5
1.5 Objectives 6
viii
1.6 Project Scopes 6
1.7 Significant of Study 7
1.8 Conclusion 7
2 LITERATURE REVIEW 8
2.1 Introduction 8
2.2 Colorspaces 9
2.2.1 RGB 9
2.2.2 Normalized RGB 10
2.2.3 HIS, HSV, HSL – Hue Saturation 11
Intensity (Value, Lightness)
12
2.2.4 TSL – Tint, Saturation, Lightness
2.2.5 YCbCr 13
2.3 Skin Modeling 16
2.3.1 Explicitly Defined Skin Region 16
2.3.2 Non-parametric Skin Distribution 17
Modeling
2.3.2.1 Normalized Lookup Table 17
(LUT)
2.3.2.2 Bayes Classifier 18
2.3.3 Parametric Skin Modeling 20
2.3.3.1 Single Gaussians 21
2.3.3.2 Mixture of Gaussian (MoG) 21
2.3.3.3 Elliptical Boundary Model 22
2.4 Fuzzy Methods 25
2.4.1 Takagi Sugeno Fuzzy Inference 25
System
2.4.2 Modified Fuzzy C-Mean Algorithm 26
(MFCM)
2.4.3 Fuzzy Fusion 27
2.4.4 Linear Matrix Inequality (LMI) 29
Fuzzy Clustering
2.5 Summary 33
ix
3 METHODOLOGY 34
3.1 Introduction 34
3.2 Proposed Methodology 35
3.2.1 Data collection 38
3.2.2 Preprocessing 38
3.2.3 Feature Extraction 39
3.2.3.1 Colorspace Selection 39
3.2.3.2 Skin Modelling 39
3.2.3.2.1 Integration of Skin 41
Modelling in Fuzzy
Rules
3.2.4 Background Subtraction 42
3.2.5 Fuzzy Classification 44
3.3 Result Evaluation Method 47
3.4 Summary 49
4 RESULT AND DISCUSSION 50
4.1 Introduction 50
4.2 Skin Detection in Images 50
4.3 Experimental Setup 52
4.3.1 Skin Modelling 52
4.3.2 Background Subtraction 54
4.3.3 Fuzzy Classification 54
4.4 Experimental Result 55
4.4.1 Analysis of Fuzzy Logic Ability to 56
Discriminate Human and Animal
Skin Images
4.4.2 Analysis of Fuzzy Logic Ability to 57
Discriminate Porn and Non-Porn
Images
4.5 Result Comparison 57
x
4.5.1 Results Comparison on Human and 59
Animal Images Classification
between Fuzzy Logic, Explicitly
Defined Skin Region and Takagi
Sugeno Fuzzy Inference System
4.5.2 Results Comparison on Porn and 60
Non-Porn Images Classification
between Proposed Method,
Explicitly Defined Skin Region and
Takagi Sugeno Fuzzy Inference
System
4.5.3 Accuracy Rates Comparison between 61
Proposed Method, Explicitly Defined
Skin Region and Fuzzy Sugeno
Inference System on Different
Images Type
4.6 Result Discussion 62
4.7 Conclusion 65
5 CONCLUSION 66
5.1 Introduction 66
5.2 Project Achievement 67
5.3 Future Work 68
5.4 Conclusion 68
REFERENCES 69
APPENDIX A 72
APPENDIX B 73
APPENDIX C 74
xi
LIST OF TABLES
TABLE NO TITLE PAGE
2.1 Comparison of colorspace 14
2.2 Comparison of classifier 23
2.3 Comparison of fuzzy method on skin detection 32
3.1 Modules in methodology 37
3.2 Explanation of data collection 38
3.3 Explanation of preprocessing 39
3.4 Explanation of feature extraction 40
3.5 Explanation of Background Subtraction 44
3.6 Explanation of Fuzzy Classification 47
4.1 Skin Color Boundary of RGB colorspace 53
C.1 Classification Results of Human and Animal Images 74
C.2 Classification Result of Porn and Non-Porn Images 75
xii
LIST OF FIGURES
FIGURE NO TITLE PAGE
2.1 RGB colorspace color cube 10
2.2 HSV graphical depiction 11
2.3 TSL colorspace 12
2.4 YCbCr colorspace 13
2.5 Application of explicit defined skin region in finding 17
face
2.6 3D color histogram 18
2.7 The skin/non-skin u-matrix. 20
2.8(a) Takagi Sugeno fuzzy inference system input image 26
2.8(b) Takagi Sugeno fuzzy inference system output image 26
2.9 Block diagram of the framework for the detection of 29
skin based on the fusion paradigm
3.1 General skin detection process 35
3.2 Methodology of this project 36
3.3 Integration of skin modeling in membership function 41
4.1 Experiment Method 51
4.2 Skin discrete probability of red color channel 52
4.3 Skin discrete probability of green color channel 53
4.4 Skin discrete probability of blue color channel 53
4.5(a) Image before background subtraction 54
4.5(b) Image after background subtraction 54
4.6 Mamdani Fuzzy Inference Method 55
4.7 Receivers Operating Characteristic Curve (ROC) of 56
skin percentage of human and animal skin images
samples
xiii
4.8 Receivers Operating Characteristic Curve (ROC) of 58
skin percentage of porn and non-porn images samples
4.9 ROC Graph on comparison of classification result on 59
human and animal images
4.10 ROC Graph on comparison of classification result on 60
porn and non-porn images
4.11 Comparison of accuracy rates of different methods on 61
different image types
4.12(a) Image without losing data before subtraction 62
4.12(b) Image losing data after subtraction. 62
4.13 Comparison of accuracy before and after subtraction 63
4.14 Image with bright background 63
4.15(a) Human skin images falsely detected as false positive 64
4.15(b) Human skin images falsely detected as false positive 64
xiv
LIST OF ABBREVATIONS
B - Blue
BG - Blue Green
Cb - Chrominance Blue
CIE - Commission On Illumination
Cr - Chrominance Red
CRT - Catorade Ray Tube
EM - Expectation Maximazation
FPR - False Positive Rate
G - Green
HIS - Hue Saturation Intensity
HSL - Hue Saturation Lightness
HSV - Hue Saturation Value
LUT - Normalized Lookup Table
ML - Bayes Maximum Likelihood
MoG - Mixture of Gaussian
pdf - Probability Joint Function
R - Red
RB - Red Blue
RG - Red Green
ROC - Receiver Operating Characteristic
SGM - Symmetric Gaussian Model
SOM - Self Organizing Map
TPR - True Positive Rate
TSL - Tint, Saturation, Lightness
Y - Luma
xv
LIST OF SYMBOLS
c - Color vector
k - Prior probabilities
N - Number of mixture components
Norm - Normalized coefiecient either sum of all histogram
value or maximum bin value
n(c) - Pixel counts in the c-bin color of non-skin class
P (c ) - Probability Distribution
s (c ) - Pixel count in the c- bin color skin class
fi - Number of samples
Tn - Total counts in non-skin color histogram bin
Ts - Total counts in skin color histogram bin
wi - Weighted factor, contribution of ith Gaussians
- Determinant Constant
- Diagonal covariance matrix
- Mahalanobis distance
- Mean Vector
- Model parameter
- Model parameter
- Threshold Value
- Threshold value chosen as trade off between true and
false positives
xvi
LIST OF APPENDIX
APPENDIX NO TITLE PAGE
1 20 Samples of Human Skin Images 72
2 20 Samples of Animal Skin Images 73
3 Classification Results 74
CHAPTER 1
INTRODUCTION
1.1 Introduction
With fast-growing World Wide Web and more simplified way to access
Internet, people are easier and have more choices to find and locate information.
Many of this information available in Internet are in the form of images such as
photo, videos etc. As most people want to understand the image contents before they
locate it, the importance of image processing increases. So, various image processing
methods have been proposed to achieve this objective. One of the important
techniques of image processing is the skin detection technique. As a popular
technique, it proposes a way to detect human and human-body parts in images using
skin value. It has been used in various applications such as video surveillance,
human-machine interface, cyber-crime prosecution, gesture recognition, hand
detection, teleconference. The application of skin detection in video surveillance,
hand detection and cyber-crime prosecution will be discussed in Section 1.1.1,
Section 1.1.2 and Section 1.1.3.
2
1.1.1 Application of Skin Detection in Video Surveillance
The application of video surveillance allows users to identify, alert, analyse
and respond to the threat such as theft and terrorism. This is where the skin detection
comes in as it can be used to detect the face of the people in the video who may be
the person involve in stealing if theft happened or the culprit that commit a criminal.
It provides help for police to deal with criminals and find the culprits. Various
approaches have been proposed by researchers to improve the application of skin
detection in video surveillance. T. Kim et al (2005) had used an integrated approach
of multiple face detection techniques to improve the performance of skin detection in
video surveillance. Then, Robertson et al (2006) used the skin detection method to
estimate the direction of the head in order to help to determine human behaviour.
1.1.2 Application of Skin Detection in Hand Detection
The hand detection is implemented to measure the length and shape of fingers
and knuckles. Optical camera and light-emitting diodes that have mirrors and
reflectors are used to take two orthogonal, two dimensional images of the back and
side of hands. Skin detection technique is applied in hand detection to improve the
performance of the hand detection. Based on the research by K¨olsch and Turk
(2004), the best detection they obtained achieved outstanding performance in
practical application, indoors and outdoors with the combination of skin color
verification.
1.1.3 Application of Skin Detection in Cyber-crime Prosecution
Although the robustness of information available within the Internet provides
people a better way to acquire information, it also exposes people to the illegal and
harmful content such as violent and nude image. There is a need to block and filter
this undesirable content from the web especially from children. To fulfil this
3
requirement, some companies such as NetNanny and SuftWatch operate by
maintaining lists of URL’s and newsgroups and require constant manual updating.
Due to the rapid changing and growing of Internet, this approach is not enough to
cope with all these evolving web contents. By taking advantage of the strong
relationships between adult images and images with large patch of skin, a skin
detector can be developed in order to provide an efficient and effective way to detect
adult images. Several researches have been done to fit the skin detection in web
content filtering. Zhang et al (2004) suggested that the adult images can be blocked
by using statistical skin detection. They build a first order model which imposes
constraint on color gradients of neighbouring pixels.
The application of skin detection in various fields shows its popularity within
image processing technique. It is computationally effective and robust information
against rotation, scaling and partial occlusions. However, this skin color modeling is
not perfect yet, as there are still problems to be solved to achieve high accuracy and
effective skin detection method.
1.2 Problem Background
Skin detection has been a popular technique to classify or detect the skin
pixels within an image. Several advantages have been provided by skin detection.
First, it is fast in processing due to its low level processing. Then, Stern and Efros
(2002) stated that it is also invariance against rotations, partial occlusions and poses
change. However, a survey conducted by Kakumanu et al (2007) has shown several
factors need to be considered to apply skin detections which are illumination, camera
characteristic and ethnicity.
The illumination factor related with the lightning condition when an image is
taken which including indoor, outdoor, highlights, shadows and non-white lights.
The transformation of lightning condition in an environment will produce a change
4
on the skin color that leads to color constancy problem. This color constancy
problem will seriously affect the performance of the skin detection system
The camera characteristic is difference from one camera to other camera
depending on the camera sensor characteristic. Although under same lightning
condition, the performance of the skin detection system will still be variant depend
on the camera characteristic.
Although the skin color differences which vary from one region to another
region can be identified using human eyes, the differentiation and variation of skin
color becomes difficult when it comes to computation. For example, the skin color of
people between different ethnicity from Caucasian to Asian and African ranges from
white to yellow and black. Besides that, the color value of human skin pixel and
other pixels within an image may fall within the same color boundary which makes
the computation complicated. For example, the color value of lion pixel value may
have similar RGB value as human skin value.
The problems that have been encountered in visual spectrum can be solved by
applying non-visual spectrum such as infrared and spectral imaging which is stated
by Terrillon et al (1998). Skin color in non-visual spectrum method is invariant to
changes in illumination conditions, ethnicity, and make up and shadow. However,
the performance of non-visual spectrum method was decreased by the tiresome setup
procedure and high cost equipments. Therefore, there is still much room to be
improved in the area of skin detection.
5
1.3 Problem Statement
To solve the color likelihood problem between human skin pixels and background
pixels, the skin color boundary need to be determined which can be achieved by
building a skin color model. This identified skin color boundary will be used as
references in fuzzy classification later to classify a pixel as skin or non-skin pixels.
So, this project examines the following questions
How the color likelihood problem of human skin pixel and background pixel can be
solved by building a skin color model? How the fuzzy logic can be used to classify
skin and non-skin pixels based on the identified skin color model?
Then, this project intends to classify human and animal images using Fuzzy Logic.
Therefore, another question is
How fuzzy rules can be used to classify human and animal images? What is the
performance of fuzzy logic when classifying human and animal images?
1.4 Project Aims
This project will use RGB colorspace to extract color features. These
extracted color features will be used to build skin color model. Types of existing
colorspaces include Red Green Blue (RGB), normalized RGB, Hue Saturation
Intensity (HIS) and YCbCr.
In this project, suitable skin color modelling method that works well with
RGB colorspace will be identified. The skin color modelling method will help to
discriminate the human skin and animal skin images. The available skin modelling
methods are explicitly defined skin region, nonparametric skin distribution modeling,
parametric skin distribution modeling and dynamic skin distribution method.
6
The images will be subtracted in order to acquire object of interest. Then, the
subtracted images will be processed with fuzzy method in order to solve problem in
skin detection method. In the end, an algorithm that can classify human skin and
animal images with high true positive rate and low false positive rate is desirable.
1.5 Objectives
The objectives of this project are as follows:
1. To propose a new set of fuzzy rules in discriminate human skin and skin-
like pixels.
2. To study human and animal skin images using fuzzy classification.
3. To evaluate and compare the classification result with simulation result of
explicitly defined skin region and Takagi-Sugeno Fuzzy Inference System
1.6 Project Scopes
This project is focus on the skin color extraction and classification. The
performance of fuzzy classifier is evaluated. This project covers the following area:
1. Asian skin region: Only skin color information of Asian people will be
covered in this project.
2. Image format: Images in JPEG format will be used to perform skin
detection
3. RGB colorspace will be used for feature extraction: This project will use
RGB colorspace to represent the skin color information.
4. Fuzzy classification for skin detection: Fuzzy logic will be used in this
project for the classification of skin and non-skin pixels.
5. This project will be conducted by using vb.net as programming language.
7
1.7 Significance of Study
This study evaluates the performance of skin detection based on fuzzy
classification. The result is compared to the result acquired from previous skin
detection technique to check whether this approach can achieve better classification
performance. The result of the evaluation will help to solve the problems faced when
discriminating human skin pixels and pixels that have similar color information as
human skin. This approach could be used to the development of a methodology that
will be of value in filtering adult images within web.
1.8 Conclusion
In conclusion, the report consists of 5 chapters. Chapter 1 presents the
introduction of the study, problems background, objectives and scopes of the project.
Chapter 2 gives literature reviews on the existing colorspace and skin detection
technique. Project methodology is discussed in Chapter 3 and Chapter 4 exhibits the
experimental results. The conclusion and suggestion for future work will be
explained in Chapter 5.
CHAPTER 2
LITERATURE REVIEWS
2.1 Introduction
Considers that a large part of information that flows through web is images,
the importance of image processing as a tool to understand image contents is highly
increased. Skin detection as one of the popular image processing techniques is used
to track people, filtering web contents and facilitating human-computer interaction.
Skin detection provides several attractive attributes, (i) high processing speed due to
its low level processing and (ii) invariance against rotations, partial occlusions and
pose change.
From the past decades, many methods have been proposed to detect the skin
pixels within the images, photos and videos. Although different methods have been
proposed to conduct skin detection, Kakumanu et al (2007) had stated that it
basically involves two main processes. These two important processes are feature
extraction and classification. In skin detection, the feature extraction process
involves extracting color features from images. The rationale behind this approach is
that human skin has very consistent color which distinct from other object. When
using color as cue to detect skin, a question appeared: which colorspace better
represent skin color. Many researchers have centered their work on selecting the
suitable and best colorspace to work on skin classification method which is first step
in building a skin color modeling system. Therefore, the existing colorspace used to
represent color information will be discussed in Section 2.2. Among the existing
colorspaces are RGB, normalized RGB, HIS, HSV, YCbCr and YIQ. In this chapter,
9
we discuss the advantages and disadvantages of some of the most popular
colorspaces employed.
After feature extraction, these extracted features will be classified to
determine whether the particular pixel or region belongs to skin color. To achieve
this intention, many modelling techniques have been proposed. Among the proposed
techniques are explicitly defined skin region, non-parametric skin distribution
modeling, parametric skin-color modeling. These stated techniques will be further
discussed in Section 2.3. Besides that, fuzzy methods that have been used in skin
detection are discussed in Section 2.4. Finally, the summary of this chapter will be
given in Section 2.5.
2.2 Colorspaces
2.2.1 RGB
As one of the most common used colorspace, it is widely used for processing
and storing of digital images. RGB corresponds to the combination of three primary
colors, Red, Green and Blue. It is originally developed with CRT as an additive
colorspace and used to extract color texture features separately or from cross-
correlation between RB, RG, BG planes. Jones and Rehg (1999) have used the RGB
colorspace to construct a Histogram Color Model to identify the separability of skin
and non-skin pixels. However, several disadvantages have limited the usefulness of
this colorspace, especially in color analysis and color-based algorithms. These
disadvantages include the high correlation between channels, significant perceptual
non-uniformity, mixing or chrominance and luminance data. The color cube of RGB
colorspace is shown in Figure 2.1.
10
Figure 2.1: RGB colorspace color cube
2.2.2 Normalized RGB
To reduce the effect of lighting condition and ethnicity towards the
performance of skin detection, RGB colorspace is normalized by using a simple
procedure which is shown in (1).
R G B
r , g , b
RG B RG B RG B (1)
As a result of normalization, the sum of the normalized components is unity (r + g +
b = 1) and less dependence on lighting. Since the sum of these components is 1, the
third component does not hold any significant information and can be diminished to
obtain dimensionality reduction. One of the remarkable properties of this colorspace
is that it is invariant to the changes surface orientation for matte and dull surface
relative to lightning condition. It has been used by Mustafa and Abdelazeem (2005)
and Diplaros et al (2004).
11
2.2.3 HIS, HSV, HSL-Hue Saturation Intensity (Value, Lightness)
Hue-saturation based colorspace is another popular colorspace that is based
on human perception color. H stands for Hue which defines the dominant color of an
area. S stands for Saturation which measures the colorfulness of an area in proportion
to its brightness. The intensity, value and lightness are all related to the color
luminance. It was introduced for users who need to define the color properties
numerically. The graphical depiction of HSV colorspace is shown in Figure 2.2.
Figure 2.2: HSV graphical depiction
One of the advantages of Hue-saturation based colorspace is it is invariant to
highlight in white light sources. Besides that, it is also invariant to matte surfaces,
ambient light and surface orientation relative to light sources. However, the bad
confliction between computation of “brightness” and the color vision properties
make it becomes undesirable. It can be transformed to and from RGB colorspace
based on the formulas shown in (2), (3) and (4).
1
(( R G ) ( R B))
H arccos 2 (2)
(( R G ) 2 ( R B)(G B))
min( R, G , B) (3)
S 1 3
RG B
1 (4)
V ( R G B)
3
12
2.2.4 TSL – Tint, Saturation, Lightness
TSL colorspace is similar and closes to Hue and Saturation in meaning, as it
is transformed from of normalized RGB into more intuitive in values. It has been
proved to perform well in face detection and Gaussian Modelling. The
transformation from RGB to TSL is showed in (5), (6) and (7).
1 r' 1
2 arctan g ' 4 , if g' 0
1 r' 3 (5)
T arctan , if g' 0
2 g' 4
1
, if g' 0
2
9 2
S (r ' g ' 2 )
5 (6)
L 0.299 R 0.587G 0.114 B (7)
1 1
where r ' r , g ' g and r, g come from (1). Due to the chromaticity, non-
3 3
uniformity is found existing in TSL colorspace even in the condition which camera
was calibrated to the light sources. The TSL colorspace has been used by Terillon et
al. (1998) and Brown et al (2001). Figure 2.3 shows the 3D model of TSL colorspace.
Figure 2.3: TSL colorspace
13
2.2.5 YCrCb
YCrCb is an encoded non-linear RGB signal that used by European television
studios and for image compression. As Y is the luma component, which is the
weighted sum of RGB value while Cr is the red and Cb is the blue chroma
component. The transformation from RGB to YCbCr is shown in (8), (9) and (10).
Y 0.299 R 0.587G 0.114 B (8)
Cr R Y (9)
Cb B Y (10)
In YCrCb colorspace, intensity component can be easily access. This
colorspace reduces the redundancy present in RGB channels and represent the color
with statistically independent component. Kumar et al (2006) removed the Y and Cb
components from the converted image and only the Cr component remained as it
proves that all skin candidates is rich in red color. It is also adopted in Hsu et al
(2002) because of its perceptually uniform and it is similar to the TSL colorspace in
terms of the separation of luminance and chrominance as well as the compactness of
the skin cluster. Figure 2.4 shows the 3D model of YCbCr colorspace.
Figure 2.4: YCbCr colorspace
14
Table 2.1: Comparison of Colorspace
Colorspace Paper Technique Advantages Disadvantages Justification
Category
2.2.1 Basic A Probabilistic Approach To Skin Detection Explicitly Skin 1. Nullifying brightness 1. High false positive and 1. Non-skin region and skin
Colorspace (F.H.B. Cardoso, 1999 ) Color Boundary discrepancies among negative rates color region may have
(RGB) pixels similar RGB value.
An Approach To Image Extraction And Accurate Explicitly Skin 1. Widely used for 1. Not reliable as represent 1. Skin luminance may vary
Skin Detection From Web Pages (Girgis et al, Color Boundary storing and not only color but within and across person
2007) processing digital luminance due to ambient lightning.
images
Statistical Color Model With Application To Skin Statistical Model 1. High detection rates 1. Fail to detect correctly 1. The false detections are
Detection (Jones and Rehg, 1999) with Histogram in highly saturated or sparse and scattered in
Gaussian Model shadowed skin. non-skin images,
especially images with
wood and copper color
model
2.2.2 Basic Face Detection Based On Skin Color Using Neural Neural Network 1. Contains no 1. Detected skin region is 1. Lose data since luminance
Colorspace Network (Mustafa and Abdelazeem, 2005) luminance discontinuous due to information is eliminated
(Normalized information lightning effect
2. Contain only two
RGB)
components which
speeds up calculation
Skin Detection Using The EM Algorithm With Expectation 1. Skin component is 1. Low performance in 1.3.3 Performance may
Spatial Constraints (Diplaros et al, 2004) Maximization adequately describe detecting saturated or decrease when detection
Algorithm shadow skin shadow region
A SOM Based Approach To Skin Detection With Self Organized 1. Show consistent 1. 5% of Performance 1. The effect of camera
Application In Real Time System (Brown et al, Map result with Gaussian Loss over 20 properties toward
2001) method configurations performance are not
considered.
14
15
Colorspace Paper Technique Advantages Disadvantages Justification
Category
2.2.3 & 2.2.4 Estimation And Prediction OF Evolving Color Normalized 1. Robust to minor 1. Costly to use to convert 1. Inconvenient for
Perceptual Distribution For Skin Segmentation Under Varying Lookup illuminant changes from RGB parametric skin color
Colorspace ( HIS, Illumination (Sigal et al, 2000) Table(LUT) 2. Perform well for models that need tight
HSV,HSL,TSL) estimation and cluster for skin region.
prediction of skin
color distribution
evolution in images
sequences taken from
video
Active Face and Feature Tracking (Jordao et al. Explicitly Defined 1. Skin area is easily 1. Unable to detect people 1. Low performance when
1999) Skin Region detected when it falls with different skin working under
within the threshold region unconstraint environment
Comparative Performance of Different Gaussian Model 1. High detection 1. False positive occurred 1. False positive may be
Chrominance Spaces For Color Segmentation and performance caused by strong shadow
Detection of Human Faces in Complex Scene or strong illumination
Image (Terrillon
et al. 2000)
2.2.5 Orthogonal An Efficient Skin Illumination Compensation Explicitly Defined 1. Intensity component 1. Detection rates decrease 1. Losing image data as
Colorspace Model For Efficient Face Detection (Ravi et al, Skin Region can be easily when face merged with lightning information is
2006) accessed background color compensated
Face Detection On Color Image (Hsu et al. 2002) Gaussian Model 1. Perceptually uniform 1. Face difficulty in 1. Losing image data as
and widely used in detecting low-luma and lightning information is
video compression high-luma skin tone compensated
method.
2. Similar to TSL in
terms of separation of
luminance and
chrominance
15
16
2.3 Skin Modeling
Kakumanu et al (2007) stated that there are basically two types of skin
modelling methods which are pixel and non-pixel based classification. A lot of
different techniques and approaches have been used by different researches to duel
with the problems. These techniques are usually used to measure the distance of the
pixel color to the skin tone.
2.3.1 Explicitly Defined Skin Region
This is one of the easiest methods as it explicitly defines skin-color
boundaries in different colorspaces. Different ranges of thresholds are defined
according to each colorspace components as the image pixels that fall between the
predefined ranges are considered as skin pixels. A performance comparison of three
different colorspaces, CbCr, HS and GT based on explicitly defined skin region has
been stated in Phung et al (2005). The advantage of this method is obviously the
simplicity which normally avoids of attempting too complex rules to prevent over-
fitting data. However, it is important to select good colorspace and suitable decision
rules to achieve high recognition rate with this method. The application of this
method can be seen in Gomez and Morales (2002), Phung et al (2005), Girgis et al
(2005) and Peer et al (2003). The example of explicit defined skin region which is
implemented in Peer et al (2003) was shown in (11). The application of this method
in face recognition is shown in Figure 2.5.
(R, G, B) is classified as skin if
R > 95 and G >40 and B >20 and
Max{R, G, B} – min{R, G, B} > 15 and (11)
|R - G| >15 and R >G and R > B
17
Figure 2.5: Application of explicit defined skin region in finding face. 1) Reduces the
original image resolution of 2048×1536 pixels to 160×120 pixels. 2) Eliminate all
pixels that cannot represent a face. 3) Segment all the regions containing face-like
pixels using region growing. 4) Eliminate regions, which cannot represent a face
using heuristic rules.
2.3.2 Non-parametric Skin Distribution Modeling
Non-parametric skin distribution modeling estimates skin color distribution
from the training data without deriving an explicit model of skin color.
2.3.2.1 Normalized Lookup Table (LUT)
In Lookup table, the chrominance plane of colorspaces is quantized into
number of bins which corresponding to particular range of color component value
pairs (in 2D case) and triple (in 3D case) to form a 2D or 3D histogram. It is a stable
18
object representation unaffected by occlusion changes in the view and can be used to
differentiate a large number of objects. The histogram count is then normalized,
converting histogram value into discrete probability distribution:
skin[c]
P skin (12)
Norm
where skin [c] gives the value of the histogram related to the color c and the Norm is
the normalized coefiecient either sum of all histogram value or maximum bin value.
The lookup table then gives the normalized value which estimates the possibility that
the color in that pixels belong to skin. Figure 2.4 shows the 3D color histogram built
from RGB colorspace which is used by Jones and Rehg [5].
Figure 2.6: 3D color histogram
2.3.2.2 Bayes Classifier
The value of Pskin (c ) obtained in the normalization is further developed to two
different types of histogram in Jones and Rehg [5]. It is defined as the probability
that an observed color belong to skin and non-skin class. To compute the value,
Bayes rule is used:
19
s (c )
P(c | skin )
Ts (13)
n (c )
P(c | Non skin)
Tn (14)
where s(c) is the pixels count in the c- bin color skin class and n(c) is the pixel counts
in the c-bin color of non-skin class. It has been proved that certain separation exists
among skin and non-skin class. This leads to the building of fast and accurate skin
classifiers for images that collected in unconstrained imaging environment if the
training dataset is large enough. A skin classifier can be built from Bayes Maximum
Likelihood (ML) that implies
P(c | skin )
P(c | non skin) (15)
1 P( skin)
k
P( skin) (16)
where 0 1 is the threshold value that can be adjusted among true and false
positive value. The threshold value is determined from the ROC (Receiver Operating
Calculation) curve based on the training dataset. The ROC curve shows the
relationship between true and false values. The choices of prior probabilities do not
affect the detection behaviour as it is possible to choose an appropriate value of K
given same threshold value. This method is also applied in (Sigal et al, 2000).
Self Organizing Map is a type of neural network that is trained using
unsupervised learning to produce mapping that seeks to preserve the topological
properties of input spaces. These map units usually form a two-dimensional regular
lattice where the location of each unit carries semantic information. This advantage
allows SOM acts as a clustering tool of high dimensional data. The SOM is also in
favour because of its generalizing capabilities. Figure 2.6 shows the skin and non-
skin u-matrix produced from SOM method applied in Brown et al (2001).
20
Figure 2.7: The skin/non-skin u-matrix.
Brown et al (2001) used various colorspaces to compare the performance of
the two different SOM classifiers. The results show that the performance of SOM
classifiers does not change much corresponding to different colorspaces. At the
same time, it also showed that the choice of colorspace plays much important roles of
GMM models performance than SOM. It has been stressed that the SOM methods
need less resources than histogram and mixture models and is efficiently
implemented for run-time applications.
2.3.3 Parametric Skin-Color Modeling
Parametric skin color modeling is developed to adequate the need for more
compact skin model representation. Besides that, requirement for a model which has
the ability to generalize and interpolate the training leads to the development of this
model.
21
2.3.3.1 Single Gaussians
Under certain lightning condition, skin color distribution can be modeled
through elliptical Gaussian Joint probability density function (pdf), defined as
1 1
P (c ) 1 1
exp[ (c ) T 1 (c )]
2 2
2 (17)
2 | |
where c is the color vector, µ and is the mean vector and diagonal covariance
matrix, respectively. The probability p(c) is used to calculate the skin-color
likelihood. The differentiation can be either obtained through the comparison of
threshold value estimated from training data or comparing Mahalanobis distance λ,
from the image pixel c to a certain threshold. This threshold can be judged from the
ROC curve calculated from training data where
(c ) T 1 (c ) (18)
2.3.3.2 Mixture of Gaussian (MoG)
It is stated by Ruiz-del-Solar and Vershae (2004) that less training samples
are needed to obtain good probabilities estimator in MoG. It is considered to be a
more sophisticated model that capable to describe complex-shaped distributions. A
Gaussian Mixture density function is expressed as
N 1 1
P(c ) i 1 wi 1 1
exp[ (c ) T 1 (c )]
2 2
2 (19)
2 | |
22
where N is the number of mixture components and the weighted factor, wi is the
contribution of ith Gaussians. This model training is performed through using
iterative Expectation Maximization (EM) technique which ensures that the N-
component to be known beforehand. A critical part of this method is the selection of
component number N as different researchers have chose to use different values of N,
ranging from 2 to 16.
2.3.3.3 Elliptical Boundary Model
Elliptical boundary model is introduced as an alternative to solve the high
positive rate encountered in Symmetric Gaussian model. The performance of this
method is comparable to MoG and is as simple as SGM in computational complexity.
It is defined as
(c) [c ]T 1 [c ] (20)
where c is the color vector and and is the model parameter defined as
n
1 n 1
ci , f (c i i ) (c i ) T
n i l N i 1 (21)
where N is the total number of samples in the training data set, fi is the number of
samples with chrominance ci while is the mean of the chrominance vectors in the
training data set. The pixel with chrominance c is classified as skin pixel if (c) ,
where is the threshold value chosen as trade off between true and false positives.
The disadvantage of this method is that it can only be used with binary classification.
This method has been applied in (Lee and Yoo, 2002).
23
Table 2.2: Comparison of Classifier
Classifier Category Paper Colorspace Advantages Disadvantages Justification
2.3.1Explicitly Defined Human Skin Colour Clustering For RGB, YCbCr 1. Simplicity of skin 1. Too many pixels are labeled 1. A robust decision rules
Skin Region Face Detection (Peer et al, 2003) detection rules under standard illumination will make this method a
when using YCbCr favorite to detect skin
colorspace under standard
Automatic Feature Construction And Normalized 1. Better performance 1. Do not consider the effect of illumination level
A Simple Rule Induction Algorithm RGB than SPM in rules with more than one 2. Threshold complexity
For Skin Detection (Gomez and precision and success selected criterion added when considering
Morales, 2002) rates factor added
Active Face And Feature Tracking HSV 1. Skin area is easily 1. Hue variance is small and
(Jordao et al, 1999) detected within fixed.
threshold 2. Skin color of different races
may added the threshold
complexity
Nonparametric Skin Estimation And Prediction OF HSV 1. Stable to rapid 1. The detection performance is 1. Good to use for detection
Distribution Modeling Evolving Color Distribution For Skin changes in the low if the algorithm is over in changing background as
Segmentation Under Varying appearance of skin segmented the effect is less compare
Illumination (Sigal et al, 2000) color due to with foreground
illuminant changes, 2. Fast in training and usage
surface inflection and 3. Much storage space are
rapid changes in required
background 4. Unable to generalize
training data
Statistical Color Model With RGB 1. Better performance 1. Need lots of training data in
Application To Skin Detection (Jones than Gaussian model order to achieve better
and Reg, 1999) in speed and performance
accuracy
2. Demonstrate
separability between
skin and non-skin
pixel
A SOM Based Approach To Skin HSV, 1. Less dependant on 1. Face difficulty when dealing
Detection With Application In Real Normalized the choice of with non-skin samples
Time System (Brown et al, 2001) RGB configuration than
mixture model
23
24
Classifier Category Paper Colorspace Advantages Disadvantages Justification
Parametric Skin Face Detection On Color Image (Hsu YCbCr 1. Able to detect dark 1. Performance decrease when 1. The detection performance
Distribution Modeling et al, 2002) and light skin tone detecting group of people in varies significantly from
color an image colorspace to colorspace
2. Able to detect skin color
distribution under fixed
Comparative Performance of Different TSL, 1. Performed well with 1. Problem in detecting dark lightning condition
Chrominance Spaces For Color Normalized the TSL colorspace skin in normalized
Segmentation and Detection of Human RGB 2. Successfully colorspace
discriminate face 2. False positive occur due to
Faces in Complex Scene Image
cluster limited color discrimination
(Terrillon et al, 2000) of SGI camera
An Elliptical Boundary Of Skin Normalized RG 1. Better performance in 1. Usage is limited to binary
Detection (Lee and Yoo, 2002) accuracy than Single classification as the
Gaussian and continuous information
Mixture of Gaussian given by probability density
function is not given
24
25
2.4 Fuzzy Methods
Besides explicitly defined skin region, parametric and non-parametric method,
fuzzy methods also emerge as popular techniques in skin detection. Many fuzzy
approaches have been proposed to perform skin detection. In this project, we are
going to focus on fuzzy approaches which use color as features.
2.4.1 Takagi Sugeno Fuzzy Inference System
Hamid and Jemma (2006) proposed a Takagi Sugeno fuzzy inference system
(FIS) for pixel classification. This system consists of two inputs which are Cb and Cr
and one output which is either skin or non-skin. Each input is categorized into three
sub-sets, light, medium and dark. Then, If-Then rules are applied in each pixel in the
image in order to decide whether the pixel belongs to skin or non-skin region. The
fuzzy rules applied are
i. If Cb is Light and Cr is Light, then the pixel = 0.
ii. If Cb is Light and Cr is Medium, then the pixel = 0.
iii. If Cb is Light and Cr is Dark, then the pixel = 0.
iv. If Cb is Medium and Cr is Light, then the pixel = 0.
v. If Cb is Medium and Cr is Medium, then the pixel = 1.
vi. If Cb is Medium and Cr is Dark, then the pixel = 1.
vii. If Cb is Dark and Cr is Light, then the pixel = 0.
viii. If Cb is Dark and Cr is Medium, then the pixel = 1.
ix. If Cb is Dark and Cr is Dark, then the pixel = 0.
After that, determine the degree of membership to appropriate fuzzy sets
through membership functions. Once the inputs have been fuzzified, the final
decision of the inference system is the average of the output ( z i ) corresponding to
26
the rule ( ri ) weighted by the normalized degree pi of the rule. Figure 2.7 shows the
input and output of the images.
(a) (b)
Figure 2.8: Takagi Sugeno Fuzzy Inference System (FIS) (a) Input image (b) Output
image
2.4.2 Modified Fuzzy C-Mean Algorithm (MFCM)
A modified fuzzy clustering method was proposed by Chahir and Elmoataz
(2006) to classify pixels within an image into C class by minimizing the objective
function below.
C N C
J (u ij ) 2 d 2 ( x j , ci ) pi log( p i )
i 1 j 1 i 1 (22)
N
1 Ni
where Pi
N
u
j 1
ij
N
. N is the cardinality of cluster i, Pi is interpreted as the
2
probability of cluster i. d ij d 2 ( x j , ci ) is the standard Euclidean Distance between
ith centroid ( ci ) and jth pixel.
In order to take account of distribution of Hue, Saturation, Value and spectral
distribution of pixel, D, distance function was chosen as
4 4
N ik
d ij wk ( x jk , cik ) and Pi . wk serves as weighting constants between the
k 1 k 1 N
27
different channels. cik and x jk represents centroid of class i in channel k and jth pixel
in the same channel. N ik is interpreted as the cardinality of cluster I in channel k.
C
1 1
2
d ij
(d
k
2
log Pk )
kj
u ij C
2
[log Pi C
]
1 2 Nd ij 1 (23)
k
( 2)
d kj
k
( 2)
d kj
After updating centroids and membership function, update the prior
probabilities of clusters. Discard the cluster whose probabilities are given threshold
which must be small enough to discard non-significant clusters. Compute the
Euclidean distance, d ij between centroids and pixels. If | J n J n1 | , then
2
n n 1 , update and membership matrix (U)
2.4.3 Fuzzy Fusion
Fuzzy Integral was introduced by Sugeno which said to be outperforms other
fusion operators such as maximum, weighted sum or order weighted averaging. The
outperformance resulted from the ability of fuzzy integral to compute a large
diversity of results. The results from the increment number of parameters have to be
tuned to produce the outperformance. As a result, the relevance of methodologies for
parameterizing the operator in an automated manner increases.
There are two popular approaches in fuzzy integral, the Sugeno Fuzzy Integral
and the Choquet Fuzzy Integral. The Sugeno Fuzzy Integral is defined as
n
S [ X 1 , , X n ] i 1[h(i ) ( xi ) ( A( i ) )] (24)
28
While the Choquet Integral is defined as
n
C [ X 1 , , X n ] h(i ) X i [ ( A(i ) ) ( A(i 1) )]
i 1 (25)
where ( A(0) ) 0 . The xi i 1,2,3 denotes the image gray level of each color
channel in a particular color representation, h(i ) denotes the fuzzification function
applied on these data and ( A(i ) ) is the weight of the importance of color channel in
the skin detection.
( A j ) ({ X 1 , , X n }) j 1, , n (26)
A fuzzy measure presents 2 n coefficients ( A j ) j 1, ,2 n as subset
A j was formed among the input information sources. From all coefficient, just n are
taken into account in each fuzzy integration ( A j ) ({ X 1 , , X n }) j 1, , n
which are selected upon the sorting operation denoted by the enclosed subindices.
In fuzzy integral, each canonical region of features space is defined a set of
weighting coefficient to improve the robustness of the operator. The robustness of
the fuzzy integral indicates the facts that whenever there is a change in the
illumination condition, it modifies the grayvalue of the pixels in the color channels
instead of the ordinal relationship among these grayvalue. Fuzzy fusion has been
applied by Soria-Frisch et al (2007) as an approach to improve the result of different
methodology taken by its own. This performance of this method has been
outstanding compared with statistical model in (Hsu et al, 2002) and (Jones and Rehg,
1999).
29
Figure 2.9 Block diagram of the framework for the detection of skin based on the
fusion paradigm
2.4.4 Linear Matrix Inequality (LMI) Fuzzy Clustering
M. H. Kim et al (2005) had proposed to use LMI fuzzy clustering to
determine the rule structure and parameters of the membership function which based
on Takagi-Sugeno fuzzy classifier. In the proposed method, the number of cluster
becomes the number of fuzzy rule and the membership functions in each rule are
treated as fuzzy cluster function. As a result, the firing strength of output is
represented by the clustering method instead of fuzzy set.
Consider a finite set of input features X {x 1 , x 2 , , x N d } , x k F as
classification data. x i is the ith input feature set containing HSI pixel information.
N c is the given number of fuzzy cluster. The result of LMI clustering is expressed
by a partition U as
U [u ij ], i 1, , N c , j 1, , N d (27)
where u ij is a crisp numerical value in [0,1] and express the membership of element
x j belongs to the ith cluster. Partition matrix has two constraints which are
30
Nc
u ij 1 , for all j 1, 2, , N d
i 1 (28)
Nd
0 u ij N d ,for all i 1,2, , N c
j 1 (29)
In addition, a cluster additional membership function matrix has been used to
determine data partition. The membership matrix W is defined as
W [ wij ], i 1, , N c , j 1, , N d (30)
where wij is the firing strength of element x j belongs to the ith cluster.
i
( mk x kj ) 2
n i
k
wij e (31)
k 1
After membership matrix is calculated, the partition matrix is updated by using
membership degree
u ik 1, i 1,2, , N c (32)
Nc
k arg j , j C i , max u hj 0
h 1 (33)
where C i is the set of data belongs to class of the ith cluster.
When partition matrix is updated, the width and the center of membership
i
function are updated via LMI optimization method. The center mk is simply updated
by averaging x kj belongs to the ith cluster. The width update can be denoted as
identifying membership function satisfying following two constraints.
31
i 1, x k C i (34)
i 0, x k C i (35)
For computational convenience, the parameters of i ( x k ) can be reformulated as
follows
i
i
( c1 x k ) 2
z
i i
( c2 x2 ) ( c3 xn )
i
i
i
v1 v2 vn
i ( x k ) e e xe
3 ( c ij xik ) 2
v ij (36)
e j 1
k
ci )T Vi ( x k ci )
e ( x
k T
) Vi ( e k )
e ( e
1 1
where Vi diag ( i
, , i ) is the diagonal matrix containing the widths of the
V1 V3
Gaussian membership functions of the ith cluster, and ci [c1i , , c3 ] represents
i
center values of the membership function of the ith cluster.
32
Table 2.3: Comparison of Fuzzy Methods on Skin Detection
Method Paper Colorspace Techniques Advantages Disadvantages Justification
2.4.1 Takagi Fuzzy Classification, YCbCr i. Three input membership iii. Overcome the i. Insufficient to detect i. Simple method to
Sugeno Fuzzy Image Segmentation function is defined – light, limitation of skin in different apply
Inference and Shape Analysis medium and dark classic method illuminance condition ii. Insufficient to classify
System for Human Face ii. The skin range for Cb and which face is ii. Not sufficient to be used skin and non-skin
Detection (Hamid and Cr based on the image correctly identified to detect face pixel in different
Jemma, 2006) database fall within illumination
[77,127] and [139, 210]
2.4.2 Skin-color Detection HSV i. Fuzzy c-mean is used to iv. A more compact i. Time consuming as time i. Achieve optimum
Modified using Fuzzy update the centroid of a and more is needed to generate a performance if a
Fuzzy C- Clustering (Chahir skin cluster homogeneous suitable rule to perform robust cluster is
Mean and Elmoataz, 2005) ii. Update skin probability of cluster can be skin detection identified
Algorithm each cluster determined ii. Time consuming
(MFCM) iii. Calculate the Euclidean when size of dataset
distance between centroid increase
and pixel which high
membership value is
assigned to color value
which close to centroid
2.4.3 Fuzzy Fuzzy Fusion for Skin RGB i. A new parameter is i. Outperform i. Falsely detect some i. Integration of two
Fusion Detection (Soria- denoted to the fuzzy method proposed background pixel as different methods
Frisch, 2007) measure in order to by Jones and Rehg skin pixel allow it posses the
integrate MoG, Hsu [5] and Hsu et al advantages of both
methodology and DoFI [11] methods
ii. Genetic algorithm is ii. Performance is
applied to assess the fuzzy unknown under
measure coefficient different illumination
level.
2.4.4 Linear New Skin Model for HSI i. Gaussian membership i. Different skin i. Time consuming in i. Performance on
Face Detection (Kim function is used clusters correspond order to generate different dataset is
Matrix
et al, 2005) ii. Center and width of to different superior rule and unknown.
Inequality membership function is illuminance are membership function
updated by LMI Fuzzy identified
(LMI) Fuzzy
Clustering
Clustering
32
33
2.5 Summary
It has been proven that every color space has an optimum skin detector which
the performance of all these skin detectors is the same. Therefore, the performance of
the skin detection scheme is actually depending on the design of the detection
scheme.
Different skin detection schemes yield different performance as each
possesses different advantages and limitation. The common limitations of skin
detection schemes are the existence of pixels with skin-like color and the changing
illumination condition. The fuzzy fusion is designed to combine different detection
methodologies as each provides different pieces of evidence to solve the limitations.
In this project, fuzzy logic will be used to classify pixel into skin and non-skin pixels.
Finally, the performance of the method proposed in this project will be compared
with Explicitly Defined Skin Region Model by Peer et al (2003) and Takagi Sugeno
Fuzzy Inference System by Hamid and Jemma (2006).
CHAPTER 3
METHODOLOGY
3.1 Introduction
In this chapter, the methodology that will be proposed in this project will be
discussed. Methodology is a systematic analysis of methods and procedures that will
be applied to achieve the objectives stated in Chapter 1. Through the study of
methodology, the idea of how this project is implemented can be identified. In Figure
3.1, we show the process of skin detection. The proposed methodology used in this
project will be discussed in the section 3.2. Section 3.3 will discuss result evaluation
method. Then, the conclusion for the proposed methodology will be discussed in
section 3.4.
35
Color Features
Preprocessing Extracted
Web Pages
Image
Features
Selection
Color Features
Classification
Result Classified By
Subtracted Image
Fuzzy Classifier
Figure 3.1: General skin detection process
3.2 Proposed Methodology
As mentioned in Chapter 1, this project is focus on solving the problems that
skin detection encountered when using color as cue. One of the problems faced
during skin detection is the color likelihood problem between background color and
skin color. This problem occurs when a pixel contains similar color information as
human skin color information which causes the computer hard to establish the
differences between them. Therefore in this chapter, a methodology was proposed to
solve this problem. This methodology consists of five modules which are data
collection, preprocessing, feature extraction, image segmentation and classification.
These five modules are shown in Figure 3.2 and how these five modules explore the
objectives stated in Chapter 1 is illustrated in Table 3.1. Further detail of these
modules will be explained at section 3.2.1, 3.2.2 and 3.2.3.
36
Part a: Data Part c: Feature Extraction
Retrieval Colorspace Selection
Web Pages
Part b: Skin Modeling
Preprocessing Processed Image
Color Features
Color Region
Part e: Fuzzy
Classification Part d: Background Subtraction
Animal Image Human Skin
Group Image Group
Figure 3.2: Methodology of this project
According to Figure 3.2 shown above, the following steps will be taken in
this methodology:
a. Retrieve data using web-crawler.
b. Resize the images to smaller dimension.
c. Extract features from the images.
i. Determine suitable colorspace
ii. Build skin color model
d. Subtract background in order to get the object of interest
e. Classify whether an image belong to human skin or animal image based on
fuzzy classification
The methodology proposed starts from web pages retrieval using web-crawler.
The retrieved web pages are then preprocessed to filter undesirable noises. After
preprocessing, text will be filtered and only images will be left. These images then
were used for feature extraction. To do feature extraction, the suitable colorspace
37
must first be determined. Then, the color value is extracted from the images and the
skin model is built by using color histogram method.
Once features extraction completed, the image is subtracted to isolate the
object of interest. Finally, the subtracted images will be classified by fuzzy classier to
determine whether pixels within images belong to skin pixel.
Table 3.1 Modules in methodology
Modules Objective Problem Process
Statement
a) Data Retrieval - - - Retrieve web
pages that
contain images
b) Preprocessing - - - Filter
undesirable
noises and text
which left only
images
c)Feature Extraction - - - Determine the
i. Colorspace selection suitable
ii. Skin Modelling colorspace to be
used in this
project.
- Extract color
features using
color histogram.
d) Background - - - Subtract image
Subtraction to isolate the
object of
interest
e) Fuzzy Classification i. To study human and - How fuzzy classifier - Classify
animal skin images using able to discriminate whether an
fuzzy classification human and animal skin image belongs
ii. To classify the images to human skin
detection performance - How fuzzy classifier or animal
when dueling with porn differentiate porn and image group
and non-porn image non-porn images
38
3.2.1 Data collection
The skin detection process starts from web page retrieval. These web pages
are retrieved by using web crawler. The web-crawler to be used in this project is
Webripper which is an open-source. The web crawler will be used to periodically
search and download web pages, adult sexual images and suspected images from the
internet. After all the suspected web pages have been attained, the attained data will
be sent to preprocessing stage to eliminate unwanted noise.
Table 3.2 Explanation of data collection
Process Explanation Techniques
Data retrieval Web pages that contain images will be retrieved from i. Web Ripper
various sources. At the same time, suspected images
will also be downloaded.
3.2.2 Preprocessing
The downloaded web pages will be filtered to get rid of text and only images
will be left. Then, images other than Asian ethnic are filtered as well as this project
will only focus on Asian ethnic within this project. After that, the images that contain
human and animal skin will be cropped into images with pure human skin and
animal skin. These images will later be resized into 24x24 dimensions. The
preprocessing steps are explained below. Table 3.2 gives a brief explanation of these
two modules.
Step 1 : Filter downloaded web pages to get rid of text.
Step 2 : Select images with Asian ethnic only.
Step 3 : Cropped selected images into images with pure human and animal skin
Step 4 : Resize each cropped image into 24x24 dimension
39
Table 3.3 Explanation of preprocessing
Process Explanation
Preprocessing Web pages downloaded are filtered to get rid of undesirable noises. The
undesirable noises include text, html tags and thumbnails. The images will
then be scaled to lower dimension.
3.2.3 Feature Extraction
After the preprocessing step, we need to extract the features from the images.
The features that we intend to extract are color information. The color information
extracted is important to use for classification later. To extract color information, we
must first determine suitable colorspace. Table 3.3 will give a brief description of
feature extraction
3.2.3.1 Colorspace Selection
There are many existing colorspaces which are used to represent color in
either video or images. Some of the popular colorspaces are RGB, HSV, YCbCr and
CIE-Lab. The selection of colorspace will affect the performance of the classification
in the later stage. In this project, the selected colorspace is RGB which is popular
because of the fact that it is easy to use. The RGB value corresponds to the red, green
and blue information of the particular pixel within images.
3.2.3.2 Skin Modelling
After the colorspace selection has been made, the color features will be
extracted from the images and a skin color model will be built. The purpose of
building skin color model is to identify the skin color distribution. Since RGB
40
colorspace is used to extract color features, the value corresponds to the three color
channels which are red, green and blue will be acquired.
The modelling method used in this project is color histogram. It was proposed
by Jones and Reg (1999) as a statistical model to detect skin and non-skin pixels. It is
a standard statistical description of the frequencies of color occurrence within an
image. To create a color histogram for human skin, build a table with 256x256x256
dimensions. These three columns are corresponding to red, green and blue value
while 256 is the range of RGB value from 0 to 255. After that, get the RGB of each
pixel and add up 1 to the corresponding color channel in the table. Then, calculate
the skin discrete probability, P(c) of each color channel to create the color histogram.
skin(c ) (37)
P (c )
Norm
where skin(c) is the total count of each color channel and Norm is the maximum
count of all color channel .The skin modelling steps are explained below.
Step 1 : Build a table with dimension of 256x256x256 which corresponds to red,
green and blue color value.
Step 2 : Get the RGB value of each pixel
Step 3 : Fill the table by adding value of 1 to corresponding color channel
regarding to RGB value of each pixel
Step 4 : Calculate the skin discrete probability, P(c) as in (37)
Step 4 : Build color histogram base on P(c) of each color channel
Table 3.4 Explanation of feature extraction
Step Process Explanation
i Colorspace Selection Select suitable colorspace from existing colorspace. The
performance of colorspace in classification will be evaluated.
ii Skin Modelling Calculate the skin discrete probability of each color channel to
identify the skin color distribution.
41
3.2.3.2.1 Integration of Skin Modeling in Fuzzy Rules
The color histogram for each color channel was built by calculating skin
discrete probability of each channel within RGB value. Based on (37), the highest
skin discrete probability within the color channel of RGB value can be determined.
The color channel with highest skin discrete probability of each color histogram was
defined as the center of Gaussian membership function. Then, by justifying the
distance between the color channels with skin discrete probability more than 0.3, the
width of the Gaussian membership function is identified. In the example given in
Figure 3.3, the highest skin discrete probability of red color channel fall in 231. So,
value 231 is defined as the center of Gaussian membership function. Meanwhile, the
range of skin distribution is within 160 to 250. Therefore, the width of the Gaussian
membership function is 250 -169 which is 81.
The Highest Skin Discrete
Probability within color
histogram is defined as
center, c = 231
The range of skin distribution with skin
discrete probability => 0.3, is defined as
width,
a = 250 – 169
= 81
Figure 3.3: Integration of skin modeling in fuzzy membership function
42
3.2.4 Background Subtraction
Background subtraction technique has been adopted in many vision-based
interfaces to extract or track moving objects. This technique intends to separate the
user of interest from the image in order to convey user intention properly. In this
project, the background subtraction will be implemented based on the technique
stated by Hong and Woo (2003).
To implement the background subtraction, we must first get the RGB value of
each pixel within the image. Then, we get the mean value and standard deviation of
each pixel. The following equations show how the vector of mean and standard
deviation of each pixel is calculated
1 N 1
i ( R, G , B )
N
0
I i ( R, G , B )
(38)
1 N 1
i ( R, G , B ) 0
( I i ( R, G , B) i ( R, G , B)) 2
N (39)
where I i ( R, G , B) represents the vector of pixel i’s color channel in RGB and N is
the number of pixels within an image. With the mean vector and standard deviation
of each pixel color channel calculated, the threshold value is determined in order to
subtract the background scene from the object of user interest. The threshold value of
pixel i is mapped by function of standard deviation of pixel i which are shown in (40).
Thi ( R, G, B) i ( R, G, B) (40)
where Thi is the threshold value of pixel i in RGB while is the determinant
constant which determines the confidence interval. For this project, 2 as it has
about 95% of confidence interval that decides the threshold ranges.
43
To compare the differences between color channel and threshold value of
pixel i, equation (41) is applied which is shown below.
Fi u ( Di ( R) Thi ( R)) u ( Di (G ) Thi (G )) u ( Di ( B) Thi ( B)) (41)
where Fi is the determinant function which characterizes pixel i in each colorspace.
At the same time, u is a unit step function which value is either 0 or 1. If
Di ( x ) Thi ( x) , then u is 1. Otherwise, it is 0.
The pixel will then be characterized into two groups based on the equation
(42) as follow.
B : 0 Fi c1
Ii s (42)
H : Fi c1
where B is the background image and H s is the segmented user images with shadows.
c1 is the determinant constant which is set as 2 in this project to subtract the
background from the object of interest. The background subtraction steps are
explained below. Table 3.4 explains the purpose of applying background subtraction.
Step 1 : Get the RGB value of each pixel within image.
Step 2 : Calculate the mean vector and standard deviation of each pixel as in (38)
and (39).
Step 3 : Determine the threshold value, Thi by mapping standard deviation and
selected determinant constant, .
Step 4 : Calculate the determinant function, Fi as in (41) and determine u.
If Di ( x ) Thi ( x) , then u = 1 else u = 0.
Step 5 : Characterize pixel i.
If 0 Fi c , I i is background image, B.
If Fi c , I i is segmented user images, H s
44
Table 3.5 Explanation of Background Subtraction
Process Purpose Proposed
Techniques
Background Separate the object of interest from background i. Background
Subtraction for further image processing Subtraction for
Vision-Based User
Interface
3.2.4 Fuzzy Classification
This is the core part of this project which a fuzzy classifier was proposed to
solve the likelihood problem of skin detection. This classification technique will then
be used to determine whether an image belong to human or animal image. The main
reason of using fuzzy classifier is to solve the problems that stated earlier in Chapter
1. Considering the color representation in different illumination levels and likelihood
between background and skin color add complexity in defining the boundary
between skin and non-skin pixels in term of color. This complexity leads to the
question of fuzziness. Therefore, fuzzy theory appears to be a good solution in
solving the fuzziness in skin detection problem.
The fuzzy theory was proposed by Lofti Zadeh in 1965. The implementation
of fuzzy theory starts with defining fuzzy sets. In this project, three inputs were
defined which are I Re d , I Green and I Blue which correspond to the RGB colorspace.
Then, the membership degree of each input is identified by applying membership
function.
Membership function is a curve that defines how each point of input is
mapped to a membership value between 0 and 1. The function can be an arbitrary
shape whose shape suits to different problems from the prospect of simplicity,
convenience, speed and efficiency. As Gaussian membership function had been used
in (Tasaltin and Taylan, 2007) and (M. H. Kim et al, 2005) to determine the human
skin membership degree of color value, the Gaussian membership function will be
used in this project to define the membership value. The Gaussian membership
45
function is popular for specifying fuzzy set because of their smoothness and concise
notation. The membership degree of each input I ( R ,G , B ) belongs to fuzzy set High,
FHigh is,
1
High (43)
I ( R ,G , B ) c 2b
1 | |
a
where a and c is the width and center of fuzzy set High, FHigh . Meanwhile, the
membership degree of input I ( R ,G , B ) to fuzzy set Low, FLow can be find based on
equation (34).
(c I ( R , G , B ) ) 2
Low ( I ( R ,G , B ) ) exp( ) (44)
2 2
where c and is the center and width of fuzzy set . The width and center value of
each membership function is determined from the skin modeling. After specifying
the membership values of I ( R ,G , B ) to FHigh and FLow , the fuzzy rules are interpreted. To
do so, first fuzzifies the input. Then, applies the operator to the antecedents and
shapes the fuzzy set using the degree of support. The fuzzy rules are set as below.
Rules 1 : If I Re d is FHigh and I Green is FHigh and I Blue is FHigh , then ORules1 is FSkin
Rules 2 : If I Re d is FHigh and I Green is FHigh and I Blue is FLow , then ORules 2 is FMedium
Rules 3 : If I Re d is FHigh and I Green is FLow and I Blue is FHigh , then ORules 3 is FMedium
Rules 4 : If I Re d is FHigh and I Green is FLow and I Blue is FLow , then ORules 4 is FNon Skin
Rules 5 : If I Re d is FLow and I Green is FLow and I Blue is FLow , then ORules 5 is FNon Skin
Rules 6 : If I Re d is FLow and I Green is FHigh and I Blue is FHigh , then ORules 6 is FMedium
Rules 7 : If I Re d is FLow and I Green is FHigh and I Blue is FLow , then ORules 7 is FNon Skin
Rules 8 : If I Re d is FLow and I Green is FLow and I Blue is FHigh , then ORules 8 is FNon Skin
where ORulesi is the output of each rules which determine the output fuzzy set belongs
to fuzzy set Skin, FSkin , Near-to Skin, FMedium or Non-skin, FNon Skin . The output fuzzy
46
set will then be aggregated to a single output fuzzy set. The aggregation of rules is as
follow.
Skin ORules1 (45)
Medium ORules 2 O Rules 3 ORules 6 (46)
Non Skin O Rules 4 ORules 5 ORules 7 O Rules8 (47)
Finally, the resulting set is defuzzified to get the number. The defuzzification
method used in this project is center of gravity (COG) which is stated in (48).
b
a
A ( x ) xd ( x )
COG b
(48)
a
A ( x)d ( x)
The number will then determine which group that the image belongs to. The
output number is divided into three groups which are Skin, Near-to Skin and Non-
skin. The output number within 0 to 0.39 is described as Non-skin pixel while output
number within 0.4 to 0.69 is defined as Near-to Skin. The output number of the last
group which is the Skin pixel falls within 0.7 to 1.0. The steps of fuzzy classification
are explained as below.
Step 1 : Three inputs are defined which are I Re d , I Green and I Blue correspond to
RGB value.
Step 2 : Determine the membership degree of each input, High ( I ( R ,G , B ) ) to
fuzzy sets High, FHigh and the membership degree, Low ( I ( R ,G , B ) ) to
fuzzy set Low, FLow .
Step 3 : Three output fuzzy sets are identified, which are Skin, FSkin , Near-to
Skin, FMedium and Non-skin, FNon Skin .
47
Step 4 : The if-then rules are set up using logical operator. The set up rules are
i. O Rules1 High ( I Re d ) High ( I Green ) High ( I Blue )
ii. O Rules 2 High ( I Re d ) High ( I Green ) Low ( I Blue )
iii. O Rules3 High ( I Re d ) Low ( I Green ) High ( I Blue )
iv. O Rules 4 High ( I Re d ) Low ( I Green ) High ( I Blue )
v. O Rules5 Low ( I Re d ) Low ( I Green ) Low ( I Blue )
vi. O Rules 6 Low ( I Re d ) High ( I Green ) High ( I Blue )
vii. O Rules 7 Low ( I Re d ) High ( I Green ) Low ( I Blue )
viii. O Rules8 Low ( I Re d ) Low ( I Green ) High ( I Blue )
Step 5 : Aggregate all the output using (45), (46) and (47) which the output of
each rule is combined into single fuzzy set.
Step 6 : Defuzzification is implemented based on (48) to convert the fuzzy
output into a crisp number.
Table 3.6 Explanation of Fuzzy Classification
Process Explanation Techniques
Fuzzy Classification Classify an pixel within image either i. Fuzzy Logic
belongs to skin or non-skin pixels
3.3 Result Evaluation Method
A sample is classified as true positive if both the predicted and actual value is
true. It is defined as false positive if the predicted value is positive but the actual
value is negative. Conversely, if it is predicted to be negative and the actual value is
positive, it is defined as false negative. However, if the predicted and actual value are
both negative, it is classified as true negative. The result is later represented in
Receiver Operating Characteristic curve (ROC) which T. Fawcett (2007) gave a
detail analysis.
48
The ROC curve allows us to analysis and selects the optimal model that best
fits the method. To draw ROC curve, the true positive rate (TPR) and false positive
rate (FPR) need to be identified. TPR which is also referred as sensitivity measures
the classifier performance to check the percentage of correctly classified positive
images among all positive samples. TPR is defined as
TP
TPR (49)
(TP FN )
where TP is the total amount of true positive samples and FN is the total amount of
false negative samples. On the other hand, FPR calculates how many incorrect
positive results occur among all negative samples. It is defined as
FP
FPR
( FP TN ) (50)
where FP is the total amount of false positive samples and TN is the total amount of
true negative samples.
The Area under ROC curve can be found by constructing a trapezoid under
the curve. The Area under ROC is used to measure the discrimination, which is the
ability to classify whether an image is fall into skin image group or non-skin image
group. T. G. Tape has stated a traditional point system that measure the Area under
ROC curve which is shown as below.
i. 0.9 – 1 = excellent
ii. 0.8 – 0.9 = good
iii. 0.7 – 0.8 = fair
iv. 0.6 – 0.7 = poor
v. 0.5 – 0.6 = fail
49
Meanwhile, the positive likelihood ratio and negative likelihood ratio are
evaluated when the highest accuracy is achieved. Positive likelihood ratio is the
probability of a positive test result given the presence of the human skin pixel and the
probability of a negative test result in the absence of human skin pixel. Negative
likelihood ratio is the probability of a negative test result given the presence of the
human skin pixel and the probability of a negative test result in the absence of human
skin pixel.
True Positive Rate
Positive Likelihood Ratio
False Positive Rate (51)
False Negative Rate
Negative Likelihood Ratio
True Negative Rate (52)
Then, the P-value is obtained from the experiment which is the probability of
an observed Area under ROC curve is found. A classification method with a P- value
lower than the true Area under ROC curve is considered good as it is able to
discriminate two different groups of images.
3.4 Summary
This chapter proposed the methodology that will be implemented in this
project. This methodology includes five main modules which are data collection,
preprocessing, feature extraction, image segmentation and fuzzy classification.
Section 3.2 shows the general view of the methodology. Section 3.2.1 explains how
the data is collected and how the collected data is preprocessed. Meanwhile, Section
3.2.2 discussed about the feature extraction method used in this project. Then, the
detail of image segmentation is stated in Section 3.2.3. The last module which is the
fuzzy classification is further explained in Section 3.2.4. Then, the result evaluation
method will be discussed in Section 3.3. Finally, this project’s objectives are
expected to be achieved through the combination of these five modules.
CHAPTER 4
RESULT AND DISCUSSION
4.1 Introduction
In this chapter, the experiment implemented in this project will be described.
Then, the experiment result will be analysed. The main focus of the experiment is to
identify how the fuzzy rules conducted will affect the performance of the skin
detection. Section 4.2 will give a brief description of how the experiment is
implemented while Section 4.3 illustrated the steps taken to implement the
experiment. At the same time, Section 4.4 shows the result of the experiment while
the result comparison is shown in Section 4.5. Then, Section 4.6 discussed the result
evaluated. Finally, the conclusion for this chapter is shown in Section 4.7.
4.2 Skin Detection in Images
The experiment conducted is based on the methodology stated in chapter 3
which includes three main parts. These three main parts are feature extraction,
background substraction and fuzzy classification. The feature extraction is the first
process to be run through which intends to extract color features from the input
images. These extracted features will later be used in fuzzy classification to identify
the skin pixels within the image. At the same time, skin color boundary is identified
by building the skin model using RGB colorspace and color histogram. The skin
color boundary is associated to the setting of fuzzy rules which plays an important
part in fuzzy classification. Then, the image background is subtracted in order to get
51
the relevant object within the image. After the image is subtracted, only the
remaining object will go through fuzzy classification. The classification result of
each pixel will then be grouped up to decide whether human exists within an image.
There are four main processes in this experiment which are:
i. Color Feature Extraction
ii. Skin Modelling
iii. Background Subtraction
iv. Fuzzy Classification
The framework applied to conduct this experiment is shown below
Color Feature Skin Modelling
Images
Extraction
Color
Feature
Skin Color
Boundary
Background Subtraction
Subtracted Image
Fuzzy Classification
Skin Pixels Total Up
Image Group
Figure 4.1: Experiment method
52
4.3 Experimental Setup
To setup the experiment, several approaches and parameters have been used.
Section 4.3.1 discussed the skin modelling while Section 4.3.2 shows how the
background subtraction is done. Then, Section 4.3.3 shows the implementation of
fuzzy theory in skin detection.
4.3.1 Skin Modelling
The range of skin color will be identified to be used as reference in fuzzy
classification to determine whether a particular pixel belongs to skin pixel. The range
of red, green and blue color channels is 0 to 255. The identification of skin color
range is done through the building of color histogram. The color histogram is built by
using statistical analysis of 100 pure human skin images. Figure 4.2 shows the skin
color distribution in Red channel while Figure 4.3 and Figure 4.4 show the skin color
distribution of Green and Blue channel. Table 4.1 shows the skin color boundary of
red, green and blue value.
Figure 4.2: Skin discrete probability of red color channel
53
Figure 4.3: Skin discrete probability of green color channel
Figure 4.4: Skin discrete probability of blue color channel
Table 4.1 Skin Color Boundary of RGB colorspace
Red Green Blue
Skin Color Boundary 169 – 250 140 – 210 50 – 208
Non-skin Color 0 – 168 & 251-255 0 – 139 & 211 – 255 0 – 49 & 209 – 255
Boundary
54
4.3.2 Background Subtraction
In this process, the background of the image will be subtracted in order to
identify the object of interest. Once the objects of interest are identified, the
subtracted image will proceed for classification in later stage. The background
subtraction technique used in this project will base on the technique that proposed by
Hong and Woo (2003). Figure 4.5(a) shows the image before background subtraction
while Figure 4.5(b) shows the image after subtraction. After background subtraction,
only human object remained while other parts of the image are blackened.
(a) (b)
Figure 4.5: (a) Image before background subtraction. (b) Image after background
subtraction
4.3.3 Fuzzy Classification
The input for fuzzy classifier is the pixel values correspond to the RGB
colorspace. The output of the classification will be the result of whether the
particular pixel is skin or not skin. This fuzzy classification is based on the Mamdani
fuzzy inference method (Anderson and Hall, 1999). The testing is conducted by
using vb.net as programming language and based on the Matlab Fuzzy Logic
Toolbox. The Mamdani inference method is shown in Figure 4.6.
55
Fuzzify Inputs
Apply Fuzzy Operator
Apply Implication Method
Aggregate Outputs
Defuzzification
Final Output
Figure 4.6: Mamdani fuzzy inference method
4.4 Experimental Result
The classification that will be done in this project is to classify the pure
human skin images and animal images. Then, classification is also done on porn and
non-porn images to test the usability of fuzzy classification in filtering unhealthy
web content. The result was obtained through fuzzy classification which tested on
four types of images stated above. Each type of images consists of 100 samples.
Therefore in this section, we will analysis the result based on the discriminate ability
of fuzzy classification. The analysis of experiment result of first classification will be
shown in Section 4.4.1 and the second classification in Section 4.4.2. Further result
discussion will be shown in Section 4.6.
56
4.4.1 Analysis of Fuzzy Logic Ability to Discriminate Human and Animal Skin
Images
In this analysis, we will evaluate the true positive rate (TPR) and false
positive rate (FPR) of classification result which is shown in Table C.1 as listed in
Appendix C. To determine the discriminate ability of fuzzy classification, we build
the Receiver Operating Characteristic curve (ROC) based on the TPR and FPR that
displayed in Figure 4.7.
100
80
Sensitivity: 68.0
True Positive Rate
Specificity: 93.0
60 Criterion : >80.85
40
20
0
0 20 40 60 80 100
False Positive Rate
Figure 4.7: Receivers Operating Characteristic Curve (ROC) of skin percentage of
human and animal skin images samples
Figure 4.7 shows that the Area under ROC curve (AUC) is 0.807 which can
be considered well based on the traditional academic point system. Although it did
not achieve the perfection, the ROC curve showed that the applied fuzzy rules are
able to discriminate skin and non-skin pixels. The highest accuracy of classification
57
achieved when the sensitivity is 68% and the specificity is 93% at criterion 80.85%
which is closest to optimal result at point (0,100).
With sensitivity equals to 68% and the specificity as 93%, the positive
likelihood ratio is 9.71 and the negative likelihood ratio is 0.34. As the positive
likelihood ratio is more than negative likelihood ratio, this means that the applied
fuzzy rules well performed when classified human skin images. Meanwhile, a value
of 0.0001 of P-value is obtained from the experiment which proved that the fuzzy
rules have the ability to classify between human and animal skin within images with
the value is significant low and different from 0.5.
4.4.2 Analysis of Fuzzy Logic Ability to Discriminate Porn and Non-Porn
Images
The classification result of porn and non-porn images is shown in Table C.2
which is listed in Appendix C shows. In Figure 4.8, the classification result of porn
and non-porn images is shown in ROC curve. The value of Area under ROC for
classification result on porn and non-porn images using fuzzy logic is only 5.5 which
is very unsatisfied and can be considered fail. The highest accuracy rate was
achieved when the criterion was 97 which the true positive rate was 68% and the true
negative rate is 98%. Although the positive likelihood ratio is only slightly better
than the negative likelihood ratio, it proved that fuzzy rules are capable in
discriminating porn and non-porn images. As stated in 3.3, a classification method
with p-value under the true Area under ROC curve (0.5) is considered good.
Therefore, the p-value of 0.2121 from Figure 4.8 which is still far below 0.5 also
provided evidence that this method proposed are able to discriminate between porn
and non-porn images.
58
100
Sensitivity: 85.0
80 Specificity: 39.0
Criterion : =0 100.00 0.00
>0 96.00 1.00
>0.6797 94.00 1.00
>1.818 94.00 7.00
>2.138 93.00 7.00
>5.3418 93.00 14.00
>5.418 92.00 14.00
>6.051 92.00 17.00
>6.2402 91.00 17.00
>6.3106 91.00 18.00
>9.134 89.00 18.00
>10.28 89.00 20.00
>11.58 86.00 20.00
>12.03 86.00 21.00
>12.05 85.00 21.00
>16.29 85.00 33.00
>17.1 84.00 33.00
>42.35 84.00 64.00
>45.51 81.00 64.00
>49.65 81.00 68.00
>49.89 80.00 68.00
>53.27 80.00 70.00
>54.32 78.00 70.00
>54.89 78.00 71.00
>56 77.00 71.00
>64.44 77.00 81.00
>65.92 75.00 81.00
>67.21 75.00 82.00
>68.55 74.00 82.00
>71.53 74.00 84.00
>71.6 73.00 84.00
>71.81 73.00 85.00
>72.13 72.00 85.00
>74.03 72.00 86.00
>74.05 71.00 86.00
>76.04 71.00 90.00
>77.38 70.00 90.00
>77.69 70.00 91.00
>80.14 68.00 91.00
>80.85 * 68.00 93.00
>89.31 63.00 93.00
>91.22 63.00 94.00
>93.78 62.00 94.00
>94.44 62.00 95.00
>95.02 61.00 95.00
>96.68 61.00 97.00
>99.94 46.00 97.00
>100 0.00 100.00
75
Table C.2: Classification Result of Porn and Non-Porn Images
Criterion True Positive Rate (TPR) False Positive Rate (FPR)
< 4.332 0.00 100.00
<=4.332 1.00 100.00
<=21.55 1.00 95.00
<=23.7 3.00 95.00
<=26.09 3.00 93.00
<=26.59 5.00 93.00
<=32.67 5.00 91.00
<=33.95 7.00 91.00
<=36.88 7.00 88.00
<=37.49 8.00 88.00
<=39.59 8.00 84.00
<=42.41 11.00 84.00
<=47.09 11.00 81.00
<=47.61 12.00 81.00
<=48.38 12.00 79.00
<=50.42 15.00 79.00
<=53.93 15.00 73.00
<=54.59 18.00 73.00
<=55.79 18.00 72.00
<=57.83 20.00 72.00
<=58.18 20.00 71.00
<=59.94 24.00 71.00
<=61.19 24.00 69.00
<=61.29 25.00 69.00
<=61.36 25.00 68.00
<=61.48 26.00 68.00
<=63.73 26.00 66.00
<=65.02 29.00 66.00
<=65.24 29.00 65.00
<=65.4 31.00 65.00
<=66.31 31.00 63.00
<=66.77 32.00 63.00
<=67.62 32.00 62.00
<=68.01 33.00 62.00
<=68.49 33.00 61.00
<=68.58 34.00 61.00
<=68.96 34.00 60.00
<=70.87 39.00 60.00
<=71.37 39.00 59.00
<=72.12 42.00 59.00
<=72.22 42.00 58.00
<=72.85 44.00 58.00
<=74.65 44.00 56.00
<=76 46.00 56.00
<=76.64 46.00 54.00
<=78.25 48.00 54.00
<=78.42 48.00 53.00
<=78.98 49.00 53.00
<=80.26 49.00 51.00
<=80.82 50.00 51.00
<=81.03 50.00 50.00
<=82.29 54.00 50.00
<=82.47 54.00 49.00
<=86.96 59.00 49.00
<=87 59.00 48.00
<=89.79 64.00 48.00
<=89.9 64.00 47.00
<=91.76 69.00 47.00
<=92.15 69.00 45.00
<=92.22 70.00 45.00
<=92.33 70.00 44.00
<=92.52 72.00 44.00
<=92.98 72.00 43.00
<=93.32 74.00 43.00
<=93.66 74.00 41.00
<=93.88 76.00 41.00
<=93.96 76.00 40.00
<=94.81 79.00 40.00
76
Criterion True Positive Rate (TPR) False Positive Rate (FPR)
<=96.61 79.00 39.00
<=97.64 * 85.00 39.00
<=97.65 85.00 38.00
<=97.66 86.00 38.00
<=97.87 86.00 36.00
<=98.24 87.00 36.00
<=98.32 87.00 34.00
<=98.45 88.00 34.00
<=98.49 88.00 33.00
<=98.73 90.00 33.00
<=98.75 90.00 32.00
<=98.88 91.00 31.00
<=99.23 91.00 28.00
<=99.74 95.00 28.00
<=99.79 95.00 27.00
<=99.83 97.00 27.00
<=99.93 97.00 20.00
<=100 100.00 0.00