Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

A New Face Detection Algorithm Based on Skin

Color Segmentation

Yuanbo Yang, Chenggang Xie, Liebo Du, Qin Lu


College of Mechatronic Engineering and Automation
National University of Defense Technology, NUDT
ChangSha, China
workyyb@126.com

Abstract—In this paper, a new face detection approach based greater differences of light, image sensor and other external
on skin color segmentation is presented. First, the color image is environment factors.
converted into YCgCrcolor space from RGB, because
the performance of clustering is excellent in YCgCr color space. The effect of lighting compensation on the skin color
We get the segmented image by using the algorithm of support distribution is studied in section II. In this section, the result of
vector machine in YCgCr color space. Finally, we offer a face clustering performance in different color space is compared.
verification algorithm according to the geometric features of face Different skin color segmentation methods are studied and
after morphological operation to wide off non-face areas. compared in section III. We select the method of support vector
Experimental results show that the method is valid, fast and machine algorithm to segment the skin color. Experimental
suitable for rapid detection system. results are given in section IV. Section V is conclusion.

Keywords—face detection; Skin segmentation; support vector


II. COLOR SPACE
machine; YCgCr color space
A. Lighting Compensation
I. INTRODUCTION
In reality, the picture we get from camera will inevitably be
With the development of information technology and affected by illumination variation. In order to eliminate this
pattern recognition, the authentication based on face adverse influence, the picture needs to be compensated before
recognition began to apply in finance, security and other fields. converting to other color space. There are two lighting
Face recognition become a hot subject of research currently. compensation methods, "Reference White" [2] and “Gray
Face detection is a key technology of face recognition, which World Theory” [3]. “Reference white” method assumes that
began in the 1960s. Further more, face detection is the first step the image usually contains “real white” pixels. The pixels with
in human computer interaction system. Early face detection top 5% of luminance values are regarded as the reference
algorithm is mainly based on spatial characteristics, such as white. The R, G, and B components of a color image are
template matching and other simple features. However the adjusted so that the average gray value of these reference white
algorithm is poor adaptability because of variability in facial pixels is linearly scaled to 255 [4]. The basic idea of "Gray
expression, pose, and lighting condition. World" assumption is that the average value of R, G, and B in
After decades of development, the current face detection an image should be consistent. We adopt the “Gray World”
algorithms are mainly divided into two large categories based assumption because this method is simple. It can be described
on the structure and pixel. The algorithm based on the structure as follows [5].
detects faces use the spatial distribution of facial features. Viola
­ ª K º ª K º ª K º
and Jones presented a face detection algorithm [1] using °R ' = R ∗ « » ,G ' = G ∗ « »,B' = B∗« »
boosted cascade of Haar-like features, which is the classical ° «¬ Raverage »¼ «¬ Gaverage »¼ «¬ Baverage »¼ (1)
algorithm based on facial structure. Pixel-based algorithm uses ®
the clustering performance of skin color in the color space to ° Raverage + Gaverage + Baverage
°K =
detecting. First, the RGB image is converted to a different ¯ 3
color space and then clusters, such as color space of YCbCr,
HSV, CIE-Luv and CIE-Lab. The first algorithm has reached a R, G and B in (1) are the amount of stimulus of red, green and
high level after improving by researchers. But, this algorithm blue respectively in the recorded scenery. Gaverage , Raverage and
consumes long time for high-resolution images because of Baverage are the average of each color channel. The result after
large amount of calculation. So, it cannot be used in real-time compensating is shown in Fig. 1. It is obvious that the
system directly. The advantage of the second algorithm is the luminance of the image has been changed.
fast calculation because of less iteration. However, the skin
areas detected may include many non face regions due to the

978-1-4673-7189-6/15/$31.00©2015 IEEE 523


Fig. 3 and Fig. 4 show that the lighting compensation
method is resultful. The skin pixels are adjusted to correct
position in Cr-Cg plane and Cr-Cb plane.
Cr-Cg
Cr
80 100 120 140 160 180 200 220
60

70

80

90

(a)
100

Cg
110

120

130

140

150

(a) Cr-Cg
Cr-Cb
Cr
80 100 120 140 160 180 200 220
90

100

((b) 110

120

Fig. 1. (a) Orignal image, (b) Image after compensation 130

Cb
140

B. YCgCr Color Space


150

160

Generally color images are described and stored in three 170

components of R, G and B. They contain the luminance 180

information. If we use the three components as the


(b) Cr-Cb
representation of skin color directly, it is not effective for skin
color segmentation because of poor performance clustering. Fig. 2. Distribution of skin color in Cr-Cg and Cr-Cb
Therefore, we need the original RGB color image is converted
into other color space whose chrominance and luminance are Cr-Cg
Cr
separated. Now, the YCbCr color space is widely used in the 60
80 100 120 140 160 180 200 220

research of establishment of skin color model. There are a lot 70

of relevant literatures. Y indicates the luminance component. 80

Cb and Cr represent the blue component and the red 90

component respectively. The skin color has good performance 100

of clustering in Cb-Cr color space. The distribution of skin


Cg

110

color in different color space was studied in paper [6] and 120

paper [7]. YCgCr and YCbCr color space is similar, except the 130

Cg and Cb component. De Dios and Garcia [8] derived the 140

conversion formula of YCgCr and RGB from the conversion 150

formula of YCbCr and RGB. And they show the excellent (a)
performance of YCgCr color space. The conversion formulas Cr-Cg
are shown as (2) and (3). Cr
80 100 120 140 160 180 200 220
60

ª Y º ª16 º ª 0.256 0.5041 0.0979 º ª R º 70

«Cb » = «128» + « −0.1482 −0.291 0.4392 » «G » (2)


80

« » « » « »« » 90

«¬ Cr ¼» ¬«128¼» ¬« 0.4392 −0.3677 −0.0714 »¼ «¬ B »¼ 100


Cg

110

ª Y º ª16 º ª 0.256 0.5041 0.0979 º ª R º 120

«Cg » = «128» + « −0.318 0.4392 −0.1212 » «G » (3) 130

« » « » « »« » 140

«¬ Cr »¼ «¬128»¼ «¬ 0.4392 −0.3677 −0.0714 »¼ «¬ B »¼ 150

Experiments show that YCgCr is better than YCbCr in (b)


performance of clustering. The distribution of skin color in Cr-
Fig. 3. Distribution of skin color in Cr-Cg, (a) Before compensation (b) After
Cg and Cr-Cb space is shown in Fig. 2. The distribution of skin compensation.
color before and after lighting compensation in Cr-Cg is shown
in Fig. 3. The distribution of skin color before and after lighting
compensation in Cr-Cb is shown in Fig. 4.

524
Cr-Cb
Cr
80 100 120 140 160 180 200 220
90

100

110

120

130
Cb

140

150
(a) Original image (b) Threshold segmentation
160

170

180

(a)
Cr-Cb
Cr
80 100 120 140 160 180 200 220
90

100

110
(c) Segmentation of Gaussian model (d) Method in this paper
120

130
Fig. 5. Result of different segmentation methods
Cb

140

150 Cr-Cg
Cr
160
120 130 140 150 160 170

170
90

180
100

(b)
110

Fig. 4. Distribution of skin color in Cr-Cb, (a) Before compensation (b) After

Cg
120
compensation
130

140
III. FACE DETECTION

A. Skin Detection Fig. 6. The classification result of skin color and non-skin color in Cr-Cg use
After converting the color space, the clustering of skin SVM. Yellow region is the skin area and the other region is non-skin area.
color is better. It is necessary for establishing the model of skin
color. There are many models of skin color. Threshold face regions, such as the arm and other parts of the body, which
segmentation is the simplest method, which has fast computing are not what we need. So we need to confirm the area detected.
speed. The disadvantage of this method is that the model is not First, the noise is removed through morphological operations.
accurate enough. A lot of non-skin pixels are determined as Then the hole in binary picture is filled. Considering the
skin pixel if the threshold value is too large. However, if the geometry characteristics of face, we provide a face verification
threshold value is too small, many skin pixels cannot be algorithm. The criterion of the algorithm is shown below.
detected. One reliable method is the Gaussian skin color model, (1) Removing small area.
which calculates the similarity to determine skin color area [6].
In fact, Gaussian model is the approximation model for skin (2) Aspect ratio of circumscribing rectangle is 0.5 to 1.8.
color. Skin color is not strictly Gaussian distribution. The (3) Because the face is symmetric in vertical and horizontal
classification is not very accurate though it is better than directions, so we divide the circumscribing rectangle of skin
threshold segmentation method. Skin detection can be regard as region into three sections from top to bottom, as show in Fig. 7
a classification problem of two categories, namely skin and (a). Then we calculate the difference for the left and right parts
non-skin. The support vector machine is an effective method to of each section to get the ratio of total area. For example in part
solve two classification problems. The segmentation results of A, the sum of the white pixels which lie in the black rectangle
different segmentation methods are shown in Fig. 5. We can of Fig. 7 (b) is subtracted from the sum of white pixels in the
get the distribution of skin color in specific color space by a lot white rectangle of Fig. 7 (b). Then we get the ratio value of
of samples. We will get the appropriate solution of the problem total numbers of white pixels in Fig. 7 (a). The sum of three
by setting the appropriate parameters after training the samples. ratio values of A, B and C should be greater than a threshold.
In this paper, 369 positive samples and 521 negative samples The parameter of threshold is set to 0.2 in this paper. If the sum
are used. The final classification results are shown in Fig. 6. less than the threshold, we think this area is not face.
B. Face Verification (4) In the same way, the circumscribing rectangle of skin
region is divided into three parts from left to right as shown in
There are always some pixels exist which is similar to skin
Fig.8. The parameter of threshold is set to 0.2.
color in real scenes. The results of segmentation will inevitably
appear some interference. At the same time there are many non

525
(a) (b)

Fig. 7. Step 3 for face Verification

(a) (b)
Fig. 10. Partial experimental results
Fig. 8. Step 4 for face Verification

For example, Fig. 9 (b) is the binary picture of image in V. CONCLUSION


Fig. 9 (a) after step 1. The skin regions detected of Fig. 9 (a) is
shown in Fig. 9 (c). The rectangle of 1st is removed after step 2. This paper describes a new face detection algorithm which
The rectangle of 2nd, 3rd and 4th are removed after step 3 and calculates fast. Support vector machine algorithm is applied to
step 4. skin color segmentation and the result is better than other
methods. In future, we will improve the algorithm by
combining the other features, for example Haar-like feature.


REFERENCES
[1] Paul Viola and Michael Jones, “Robust real-time face detection,”
International Journal of Computer Vision, vol. 57, no. 2, pp. 137-154,
May 2004 .
(a) (b) [2] C. A. Poynton, “A technical introduction to digital video,” Computer
Vision and Image Understanding , pp.62–68, 1996.
[3] Huang, Lui Ming, H. S. Liu, and G. P. Liu. “Real-time Face Tracking in
Video Using Gray World Assumption for Images Preprocess,”
International Journal of Digital Content Technology & Its Applic, vol. 7,
no. 12, pp. 175-182, August 2013.
[4] Hsu, Abdel. Mottaleb, and Jain, “Face detection in color images,” IEEE
Trans Pattern Anal Mach Intell, vol. 24, no. 5, pp. 696-706.
[5] Ghazali, Kamarul Hawari Bin, Jie Ma, Rui Xiao, and Solly Aryza lubisi,
“An Innovative Face Detection Based on YCgCr Color Space,” Physics
Procedia, vol. 25, pp. 2116–2124, April 2012.
(c) (d) [6] J. C. Terrillon, M. N. Shirazi, H. Fukamachi, and S. Akamatsu,
“Comparative performance of different skin chrominance models and
Fig. 9. Example of face verification chrominance spaces for the automatic detection of human faces in color
images,” in Proc Conference on Automatic Face and Gesture
Recognition, 2000, pp. 54- 61.
IV. EXPERIMENTAL RESULTS [7] J. Montenegro, W. Gomez, and P. Sanchez-Orellana. “A comparative
The test set in this article comes from laboratory and AFW study of color spaces in skin-based face segmentation,” in Electrical
Engineering, Computing Science and Automatic Control (CCE), ,
dataset [9]. We use 20 pictures to train which are selected September 2013, pp. 313-317.
randomly from the test set. There are 20 faces totally for [8] De Dios, Juan José, and N. Garcia. “Face detection based on a new color
testing. 16 faces are detected correctly and 3 non-faces are space YCgCr,” in IEEE International Conference on Image Processing,
detected. The accuracy is 80% and the error rate is 15%. Parts vol. 3, , September 2003, pp. 909-912.
of the experimental results are shown in Fig. 10. Experiment is [9] http://www.ics.uci.edu/~xzhu/face/.
tested in Intel (R) Core (TM) i5-4210@1.7GHz 2.4GHz,
Windows7, Visual Studio 2010.

526

You might also like