Keywords: Haar feature based face detection; OpenCV; skin color analysis; RGB;
Face detection is one of the tasks that can be done easily by human vision but very complex for a machine. Several studies are available on face detection which discusses different techniques like feature based face detection, example based face detection, geometric based face detection, neural network based face detection and many more [1-3]. Now a day's almost every smart phone uses face detection for automatic focusing on the face area when capturing a photo.
The main goal of any face detection system is to achieve a very high detection rate along with low computational cost. A face detection method detects facial features and ignores anything else, such as building, trees and also bodies. However, many face detection method fail to detect correct faces from images. David, Kriegman, and Ahuja presented a survey of face detection and presented the trends of researches in face detection [4]. In the survey authors categorized and evaluated different face detection algorithms. Some limitations of those algorithms were also discussed in a brief. A common problem of the existing methods is that they treat non facial area as a facial area. The popular Haar like feature based face detection [9, 12] also suffers from the same problem.
This paper presents a technique to improve feature based face detection introducing human skin color (HSC) characteristic. A number studies are available on human skin color based face detections [5-8, 13-25]. The methods analyzed different color spaces (e.g., RGB, YCbCr, HIS, TSL, HSV) and their main focus was to generate a rule with the help of these color spaces which can determine whether a color is similar to human skin color or not. Different studies have also shown different techniques to model human skin color. In this study, HSC property has been incorporated with the popular Haar Feature Based Face Detection (HFFD) in OpenCV, and found to improve its performance.
The rest of the paper is organized as follows. Section II explains HAAR feature based face detection method. Section III presents the proposed face detection technique incorporating of human skin color analysis in HAAR. Section IV presents experimental results to identify the proficiency of the proposed method. Section V concludes the paper with a brief summary.
The task of classifier is to find HAAR features throughout the input image. As the face size varies with image size, classifies uses a window that can be scaled at any size and can be moved to the any position. This scaling is achieved by the detector itself rather than scaling images. And this window is moved left to right and upper to down throughout the whole images. The classifier searches the features across this window. These features are also scaled to any multiply. For an example, for 24x24 resolution window the land for edge feature 1(b) (shown in Figure 1) scaled with 2x2 pixels, the classifier will find this 2x2 pixels feature throughout the whole window. Then this features size will be increased to 4x4 pixels and again classifier will find this 4x4 pixels feature to the whole window. This process is done for several scales. Thus the combination of the features, scaling and positions become very large (more than 160,000); thus incurs a very high computational cost. To overcome this situation, Adboost is used to select some important features those explain a face very well from the large number of features. Such selection discards a large amount of unnecessary computation during the training process. The first two important features selected by AdaBoost are shown in Figure 3.
Finally, to detect a rectangular feature (F) from an image, the sum of the pixels which lie within the shaded rectangles ( Ps ) were subtracted from the sum of pixels in the white rectangles ( Pw ).
The set of features was quite large and computing these feature value one by one is very inefficient for a large image. To overcome this problem, a technique called "Integral Image" is used through which rectangle features could be computed very easily. It is an intermediate representation of an image in which a location (x, y) contains the sum of the pixels above and to the left
Area X = Sum of pixels in the rectangular area from the lefttop corner to pixel X.
Area B= 0+2+7 = 9
Area C = 0+3 = 3
Area P= 0+2+7+3+3+1 = 16
Area D= 0+3+4 = 7
Area Q= 0+2+7+3+3+1+4+8+7 = 35
Number of pixels in white area in doted area = (Area Q + Area C - Area D – Area P) = 35 + 3 - 7 - 16 = 15
Number of pixels in shaded area in doted area = (Area A + Area P - Area B – Area C) = 0 + 16 - 9 - 3 = 4
Rectangular feature value in doted area f = 15 - 4 = 11
To show how this characteristic behaves on real human image, an analysis on images of five people having different skin colors is presented in Figure 8. Images have been selected carefully for proper understanding of the matter and the people of images have distinct skin colors of dark, darkish, light dark, white and very white. Facial area of an image was divided into 100 blocks with some consecutive pixels. Average RGB value of each block is measured and plotted in line charts presented in the right side of corresponding images. In the line chart, X axis represents the direction of block numbers and Y axis depicts the average values of red, green and blue components of corresponding block individually. From the line charts, it is clearly observed that R>G>B conditions are matched in almost all blocks for any image. Few exceptions are acceptable for eye, mustache or beard region blocks. Table 1 shows summary of RBG counts of 100 blocks for each image of Figure 8. From the table it is found that R>G>B is true for 90 or above for all the faces. Finally, it is obvious that R>G>B is true for average RBG values of whole facial area.
Image Index |
Image Type |
Num. of blocks where R>G>B con. matched |
Num. of blocks where R>G>B con. not matched |
a |
Dark |
90 |
10 |
b |
Darkish |
100 |
0 |
c |
Light Dark |
90 |
10 |
d |
White |
100 |
0 |
e |
Very White |
93 |
7 |
Sample Image 2 has complex background and performance of HFFD is very poor for the image. Although proposed HFFDHSC reduced wrong detection, still six WD is available for the image. For better understanding, Table 3 presents status of HSC incorporation on all 13 faces detected by HFFD. Table presents correctness ratio with Number of Pixels Satisfy HSC Condition (NPSH) and Number of Pixels Violet HSC Condition (NPVH). In the table we can see that Faces 3, 4, 6, 8 and 10 have their correctness ratio less than 50%. Therefore, those five faces were eliminated by our proposed method as the wrong detections.
Sample Image |
Actual Faces |
HFFD |
Proposed HFFD-HSC |
||
Detected faces |
WD |
Detected faces |
WD |
||
1 |
4 |
5 |
1 |
4 |
0 |
2 |
3 |
13 |
11 |
8 |
6 |
3 |
10 |
10 |
1 |
9 |
0 |
4 |
3 |
6 |
4 |
3 |
1 |
Face Index |
NPSP |
NPVP |
Correctness Ratio (%) = NPSP/(NPSP+NPVP) |
1 |
37 |
12 |
75.51 |
2 |
81 |
0 |
100 |
3 |
0 |
100 |
0 |
4 |
0 |
100 |
0 |
5 |
196 |
0 |
100 |
6 |
2 |
359 |
0.55 |
7 |
251 |
190 |
56.91 |
8 |
295 |
434 |
40.46 |
9 |
464 |
265 |
63.64 |
10 |
393 |
448 |
46.73 |
11 |
3068 |
68 |
97.83 |
12 |
10422 |
1899 |
84.58 |
13 |
9574 |
2970 |
76.32 |
Data Set |
Total Images |
HFFD |
Proposed HFFD-HSC |
||||
Detected faces |
WD |
Req. Time in Sec. |
Detected faces |
WD |
Req. Time in Sec. |
||
1 |
1022 |
1034 |
12 |
1561 |
1024 |
2 |
1600 |
2 |
1028 |
1129 |
101 |
1506 |
1038 |
10 |
1547 |
3 |
1010 |
1020 |
10 |
1495 |
1010 |
0 |
1536 |
4 |
1008 |
1064 |
56 |
1542 |
1012 |
4 |
1582 |
5 |
1002 |
1024 |
22 |
1563 |
1003 |
1 |
1603 |
6 |
1000 |
1015 |
15 |
1470 |
1000 |
0 |
1509 |
7 |
1000 |
1022 |
22 |
1550 |
1002 |
2 |
1592 |
8 |
947 |
953 |
6 |
1570 |
947 |
0 |
1611 |
9 |
1005 |
1083 |
78 |
1477 |
1013 |
8 |
1516 |
10 |
949 |
950 |
1 |
1503 |
949 |
0 |
1542 |
Sample Image |
Face Index |
NPSP |
NPVP |
Correctness Ratio (%) = NPSP/(NPSP+NPVP) |
a |
1 |
0 |
121 |
0 |
2 |
3358 |
998 |
77.08 |
|
b |
1 |
3059 |
1037 |
74.68 |
c |
1 |
9 |
91 |
9 |
2 |
2425 |
600 |
80.17 |
|
3 |
2648 |
488 |
84.34 |
|
4 |
2814 |
667 |
80.83 |
|
d |
1 |
49 |
0 |
100 |
e |
1 |
780 |
4 |
99.5 |
2 |
256 |
0 |
100 |
|
f |
1 |
63 |
1 |
98.83 |
g |
1 |
2986 |
983 |
75.23 |
h |
1 |
327 |
3273 |
9 |
i |
1 |
0 |
1521 |
0 |
Table 4 also shows the required time in seconds for individual data set by HFFD and proposed HFFD-HSC. It is worthy notable that proposed HFFD-HSC verifies the outcome of HFFD with human skin color characteristics and require additional computational time. However, additional time required by HFFD-HSC is minimal. As an example, required time for data set 1 were 1561 seconds and 1600 seconds by HFFD and HFFD-HSC, respectively. Therefore, additional time required by HFFD-HSC is only 39 seconds (=1600-1561) for 1022 images of the data set.
For better understanding, Table 5 shows individual face wise analysis of each image of Figure 14. Among nine images, three contains (i.e., a, c and e) more than one faces. From the table it is observed that for first image (i.e., 14(a)) the true face is verified by proposed HFFD-HSC and WD of face 1 by HFFD in bottom left corner is properly identified with correctness ratio 0%. Similar effect also found for Figure 14(c) and WD of face 1 by HFFD in middle left position is properly identified with correctness ratio 9%. On the other hand, due to green and blue light effects, proposed HFFD-HSC failed to verify the true faces identified by HFFD in Figure 14(h) and Figure 14(i). Finally, only extreme images with green and blue light effects the proposed method failed to improve performance.
- Chauhan M, Sakle M. Study & Analysis of Different Face Detection Techniques. International Journal of Computer Science and Information Technologies (IJCSIT). 2014;5(2):1615-1618.
- Sung K, Poggio T. Example-based learning for view-based human face detection. IEEE Transactions on Pattern Analysis and Machine Intelligence. 1998;20(1):39-51.
- Atharifard A, Ghofrani S. Robust Component-Based Face Detection Using Color Feature. Proceedings of the World Congress on Engineering. 2011;II.
- David MY, Kriegman J, Ahuja N. Detecting Faces in images: A Survey. IEEE Transactions on Pattern Analysis and Machine Intelligence. 2002;24(1):34-58.
- Kovac J, Peer P, Solina F. Human Skin Colour Clustering for Face Detection. EUROCON 2003. Computer as a Tool. 2003.
- Singh SKr, Chauhan DS, Vatsa M, Singh R. A Robust Skin Color Based Face Detection Algorithm. Tamkang Journal of Science and Engineering. 2003;6(4):227-234.
- Rahman NAA, Wei KC, See J. RGB-H-CbCr Skin Color Model for Human Face Detection. MMU International Symposium on Information & Communications Technologies (M2USIC). 2006.
- Zangana HM, Al-Shaikhli IF. A New Algorithm for Human Face Detection Using Skin Color Tone. IOSR Journal of Computer Engineering. 2013;11(6):31-38.
- Viola P, Jones M. Rapid Object Detection using a Boosted Cascade of Simple Features. In Prof. of the 2001 IEEE Computer Vision and Pattern Recognition (CVRP). 2001.
- OpenCV face detection. Available from: http://docs.opencv.org/trunk/d7/d8b/tutorial_py_face_detection.html
- Put face database. Available from: https://biometrics.cie.put.poznan.pl/index.php?view=article&id=4
- Papageorgiou CP, Oren M, Poggio T. A General Framework for Object Detection. International Conference on Computer Vision. 1998.
- Chandrappa DN, Ravishankar M, Babu DRR. Face Detection in Color Images Using Skin Color Model Algorithm Based on Skin Color Information. In Proc. of the 3rd International Conference on Electronics Computer Technology (ICECT). 2011;1:254-258.
- Phung SL, Bouzerdoum A, Chai D. A Novel Skin Color Model in YCbCr Color Space and its Applications to Human Face Detection. In Proc. of the International Conference on Image Processing. 2002:289-292.
- Li Z, Xue L, Tan F. Face Detection in Complex Background Based on Skin Color Features and Improved Adaboost Algorithm. In Proc. of the IEEE International Conference on Progress in Informatics and Computing. 2010:723-727.
- Hsu RL, Abdel-Mottaleb M, Jain AK. Face detection in color images. IEEE Trans. PAMI. 2002;24(5):696-707.
- Phung SL, Chai D, Bouzerdoum A. A universal and robust human skin color model using neural networks. Proc. IJCNN'01.2001:2844-2849.
- Gundimada S, Tao L, Asari V. Face Detection Technique Based on Intensity and Skin Color Distribution. ICIP2004. 2004:1413-1416.
- Wang Y, Yuan B. A Novel Approach for Human Face Detection from Color Images under Complex Background. Pattern Recognition. 2001;34(10):1983-1992.
- Hsu RL, Abdel-Mottaleb M, Jain AK. Face Detection in Color Images. IEEE Transaction on Pattern Analysis and Machine Intelligence. 2002;24(5):696-706.
- Vezhnevets V, Sazonov V, Andreeva A. A survey on pixel based skin color detection techniques. In: Proc. Graphicon. 2003:85-92.
- Vijay Lakshmi HC, Patil Kulakarni S. Segmentation Algorithm for Multiple Face Detection in Color Images with Skin Tone Regions using Color Spaces and Edge Detection Techniques. In International Journal of Computer Theory and Engineering. 2010;2(4);1793-8201.
- Vijay Lakshmi HC, Patil Kulakarni S. Face Localization and Detection Algorithm for Colour Images using Wavelet Approximations. International Conference ACVIT-09. 2009.
- Garcia C, Tziritas G. Face Detection Using Quantized Skin Color Regions Merging and Wavelet Packet Analysis. IEEE Trans. Multimedia. 1999;1(3):264-277.
- Jones MJ, Rehg JM. Statistical color models with application to skin detection. Proc. CVPR'99. 1999:274-280.