DXMPsych2012Project

From Psych 221 Image Systems Engineering
Revision as of 23:31, 21 March 2012 by imported>Psych2012 (Histogram)
Jump to navigation Jump to search

Back to Psych 221 Projects 2012




Introduction

With the proliferation of digital cameras and advancement of processors, software image processing and image perception applications have become increasingly important and widely-used. In applications such as face localization, human detection and pose classification, skin detection is usually the first step for segmentation. Skin detection using color information has been long studied. Color based skin detection is fast and simple to implement, however, it usually suffers from high false detection error due to metamerism, i.e. nonskin surface having the same color values as skin. This project will evaluate performance of skin classifiers in different color spaces, and answer the question - is there a color space that is the best for skin detection? In this project, I will build skin classifiers in RGB, YCbCr, HSV, xyY and CIELAB, and evaluate their performance based on the false detection and false dismissal rate. In addition, we will construct hybrid skin classifiers that combine information of multiple color spaces.

Methods

Color Space

We use a pixel based histogram approach to construct skin detectors. For each pixel, we extract the chromatic values in all 5 color spaces, we call these values chromatic features. These chromatic features are used to construct histogram-based skin detectors. There are 10 chromatic features in a pixel, [rgCbCrHSxyab]. We ignore brightness and lightness values in order to achieve illuminant invariance for the skin detectors. In the next section, we will explain how the chromatic features are defined.

RGB

[rg] are the chromatic features in RGB color space. They are normalized red and green values that are defined as

[rg]=[RG]R+G+B

YCbCr

[CbCr] are the blue-difference and red-difference values in YCbCr color space. They are normalized to range between 0 and 1 for this project.

HSV

[HS] are the hue and saturation values in HSV color space.

xyY

xyY color space is a normalized presentation of XYZ color space. [xy] are defined as,

[xy]=[XY]X+Y+Z

CIELAB

[ab] are normalized a* and b* values in CIELAB color space. a and b range between 0 and 1. a=0 indicates green and a=1 indicates red, similarly, b=0 indicates blue and b=1 indicates yellow.

Classification

Histogram

We used MCG-Skin dataset to train, validate and test our skin detectors. MCG-Skin consists of 1000 images of people collected from the Internet, the dataset also contains the ground-truth of human skin for the 1000 images. From the MCG-Skin dataset, we chose 100 images for training, 100 images from validation, and 100 images for testing.

With all the chromatic features define, we constructed a two-dimensional histogram for each color space from the training set. Let Hrg be the histogram of RGB color space, and Hrg(i,j) is the value of bin [i,j] of the histogram. Let N(k) be the number of pixels in training image k, and I(k,l) be the lth pixel of kth image. Define r(k,l) and g(k,l) to be the r and g features of I(k,l). In addition, we denote the bin size of the histogram as τ. The histogram can be expressed as

Hrg[i,j]=k=1100l=1N(k)𝟏{iτrk,l<(i+1)τ}𝟏{jτgk,l<(j+1)τ}(𝟏{isskin(Ik,l)}𝟏{¬isskin(Ik,l)})

In other word, Hrg(i,j) is the number of skin pixels minus the number of non-skin pixels in the range of bin (i,j).

We then normalize the histogram to [0,1] by

Hrg[i,j]=max(Hrg(i,j),0)max(Hrg)

The histogram is further smoother by a 2D Gaussian filter Gσ whose variance is σ2.

Hrg[i,j]=(HrgGσ)[i,j]

Histograms for other color spaces HCbCr, HHS, Hxy and Hab are similarly constructed.


Figure 1: Mesh plot of the histogram in RGB color space

Figure 1 shows a mesh plot of the histogram in RGB color space. Figure 2 shows the same histogram in heat map representation. The x axis represents r value and the y axis represents g value.

Figure 2: Heat map of the histogram in RGB color space

Classifier

The classifier for a color space is a binary matrix that has the same size as the corresponding histogram. Let Crg be the classifier of RGB color space, and let Trg be the threshold for Hrg. Then

Crg[i,j]=𝟏{Hrg[i,j]>Trg}

classifiers for other color spaces CCbCr, CHS, Cxy and Cab are similarly constructed. Figure 3 shows the trained classifiers of the 5 color spaces.

We define 1 to indicate skin, and 0 to indicate non-skin. A pixel I with chromatic features [rgCbCrHSxyab] is labeled either 1 or 0 with following equations. We only present classification using RGB classifier Crg, since classification using classifiers in other color spaces are applied in a similar way.

Ilabel=Crg[i,j]
i=floor(rτ)j=ceiling(gτ)

Note that τ is a hyperparameter that is specific to the classifier. τ of a diffident classifier will take on a different value.

Figure 3: Classifiers of the 5 Color Spaces

Evaluation

We evaluate the performance of a classifier by computing the false dismissal rate ϵFN and the false detection rate ϵFP of the classifier. The false dismissal rate ϵFN of a classifier is the number of skin pixels that are not classified as skin divided by the total number of skin pixels. The false detection rate ϵFP of a classifier is the number of non-skin pixels that are classified as skin divided by the total number of non-skin pixels.

Hyperparameters

In constructing classifiers, we need to find the value of hyperparameters τ, σ, and T for each color space. The hyperparameters of a classifier are calculated by minimizing the false detection and false dismissal error rate of the classifier.

[τσT]=argminτσT(ϵFP+ϵFN)

Hybrid Method

We also constructed a hybrid classifier that combines the results from multiple single-color-space classifiers. The hybrid classifier used a majority vote approach. For example, if we use Crg, CCbCr, Cxy, and Cab in our hybrid classifier, then a pixel is labeled 1 if 2 or more single-color-space classifiers labeled the pixel to be 1. We evaluated the performance of hybrid classifier with different combination of single-color-space classifiers.

Results

Results of single-color-space classifiers

Figure 4 presents the error plot of skin classifiers of the 5 color spaces. The y axis is the error rate. An ideal classifier would have very small values for both false dismissal and false detection.

Figure 4: Error Plot of Single-Color-Space Classifiers

First, we observed that false detection rate are higher than false dismissal rate for all classifiers. This is expected because of metamerism. We also noticed that the false dismissal rate and false detection rate of CCbCr and Cab are lower than the error rates of Csv. This result indicates that skin detection performed in YCbCr and CIELAB color spaces is more accurate than skin detection in HSV color space.

Results with combined method

Figure 5 presents the error plot of hybrid classifiers. The first five hybrid classifiers combined results from 4 single-color-space classifiers. The name of the classifiers indicates which single-color-space classifier it did not use. For example, hybrid classifier "-RGB" combined results from CCbCr, Chs, Cxy, and Cab, but it did not use the results from Cab. The last hybrid classifier used results from all 5 single-color-space classifiers.

Figure 5: Error Plot of Hybrid Classifiers

Again, the false detection rate are high across the hybrid classifiers. The false detection rate, however, are better than single-color-space classifiers. "-HSV" hybrid classifier achieved a false dismissal rate of 0.09. Figure 6 shows an example of a test image classified by "-HSV" hybrid classifier. The classified image is filtered with morphological filters to remove some of the false positives.



Figure 6: Example of Classified Image Using "-HSV" Hybrid Classifier

Conclusions

From the results of this project, we conclude that human skin classifiers in YCbCr and CIELAB color spaces perform better than skin classifier in HSV color space. However, the difference in performance between classifiers in different color spaces is not very big. As a result, in a application that used skin-detection, performance different in different color spaces should not be the biggest factor in deciding which color space to use. The engineer who designs the application should consider to work in device output format to safe computation cost. We observed that combine classifiers have lower false dismissal rate than single-color-space classifiers. In addition, we confirmed the fact that false detection rate is higher for all classifiers, this error is a result of metamorphism. Because of high false detection rate, we have to do some post processing, such as applying morphological filters and connected component noise removal. In this project, we implemented pixel based human skin classifiers. The results show that the performance of this kind of classifiers is far from ideal. The next step is to implement super-pixel based classifiers in order to improve the classification performance.

References

[1] Cahi, D. and Ngan, K. N., “Face Segmentation Using Skin-Color Map in Videophone Applications”, IEEE Transaction on Circuit and Systems for Video Technology, Vol. 9, pp. 551-564 (1999).

[2] Crowley, J. L. and Coutaz, J., “vision for Man Machine Interaction”, Robotics and Autonomous Systems, Vol. 19, pp. 347-358 (1997).

[3] Kjeldsen, R. and Kender., J., “Finding Skin in Color Images”, Proceedings of the Second International Conference on Automatic Face and Gesture Recognition, pp 312-217 (1996).

[4] Singh, S. K., Chauhan, D. S., Vatsa, M. And Singh, R., “A Robust Skin Color Based Face Detection Algorithm”, Tamkang Journal of Science and Engineering, Vol. 6, No. 4, pp. 227-234 (2003).

Appendix I - Code and Data

Code

CodeFiles

Data

zip file with my data