^{1}

^{2}

^{1}

^{2}

Skin detection is an interesting problem in image processing and is an important preprocessing step for further techniques like face detection, objectionable image detection, etc. However, its performance has not really been high because of the high overlapped degree between “skin” and “nonskin” pixels. This paper proposes a new approach to improve the skin detection performance using the Bayesian classifier and connected component algorithm. Specifically, the Bayesian classifier is utilized to identify “true skin” pixels using the first posterior probability threshold, which is approximate to 1, and to identify "skin candidate" pixels using the second posterior probability threshold. Subsequently, the connected component algorithm is used to find all the connected components containing the “skin candidate” pixels. According to the fact that a skin pixel often connects with other skin pixels in an image, all pixels in a connected component are classified as “skin” if there is at least one “true skin” pixel in that connected component. It means that the “nonskin” pixels whose color is similar to skin are classified as “nonskin” when they have the posterior probabilities lower than the first posterior probability threshold and do not connect with any “true skin” pixel. This idea can help us to improve the skin classification performance, especially the false positive rate.

Skin detection is an indication of the presence of a human skin in a digital image by converting the original image to a binary image in which “1” represents a “skin” pixel and “0” represents a “nonskin” pixel. It is a very interesting problem as well as an important preprocessing step for further techniques like face detection, hand gestures detection, semantic filtering of web contents, etc. [

So far, two major groups of methods have been developed for solving this problem using either color or texture features [

The skin and nonskin region in a certain image.

The main contribution of this paper is to propose a new approach for the skin detection using the Bayesian classifier and the connected component algorithm. First, the Bayesian classifier is used to compute the posterior probability that a pixel belongs to the skin class. Normally, the Bayesian classifier assigns a pixel to the skin class if its posterior probability is larger than 0.5. It leads to a high false positive rate because of the high overlapping degree between two regions as illustrated in Figure

The remainder of this article is organized as follows. Section

We consider

In the continuous case,

Because

In the case of two classes like the skin detection problem, the new observation

When processing binary images, we often expect to group the pixels, which have values of 1, into the maximally connected regions. These regions are called the connected components of the binary image. Mathematically, two pixels _{i} is a neighbor of_{i-1} where the neighbors are defined using either 4 connected or 8 connected regions as shown in Figure

(a) 4 connected neighborhoods; (b) 8 connected neighborhoods.

This paper applies the connected component algorithm [

An illustration of connected component algorithm.

For building the Bayesian model and computing the posterior probability, the Skin Detection Dataset’ downloaded from

Let

Compute the posterior probability that the pixel belongs to the skin class,

If

If

Find all connected components containing “skin candidate” pixels.

Classify the pixels with the following rule: if the connected component contains at least one “true skin” pixel, then all pixels belonging to that component are classified as “skin” and vice versa.

In the above algorithm, in order to control the false positive rate at a low level, we choose

This section presents two examples to demonstrate the effectiveness of the proposed algorithm. Specifically, Example 1 describes in detail how the new method works via a certain image file taken from the Pratheepan.FacePhoto dataset [

To illustrate the proposed method and clarify the effect of the threshold values on classification performance, this subsection performs an experiment on a certain image downloaded from

The original and the output binary images using different thresholds

Let us now consider another illustration in which the U and V channels of the current image are extracted. Figures

The skin and nonskin pixels and the skin region built by Bayesian classifier with different thresholds

In the next step, the threshold

The “true skin”, “skin candidate”, and nonskin pixels in the image.

The final results are presented in Figure

The final results.

Regarding the problem of thresholds selection, the effects of thresholds on the performance measured by the accuracy, the detection rate, and the false positive rate are investigated on a large number of images given the ground truth. The detailed results obtained for the investigated thresholds are presented in Tables

The survey of threshold

| | | |
---|---|---|---|

0.9 | 0.8186 | | 0.1812 |

| |||

0.99 | 0.8186 | 0.8080 | 0.1777 |

| |||

0.994 | 0.8196 | 0.8080 | 0.1762 |

| |||

0.997 | | 0.8027 | |

The survey of threshold

| | | |
---|---|---|---|

0.2 | 0.8215 | | 0.1757 |

| |||

0.25 | 0.8221 | 0.8088 | 0.1732 |

| |||

0.3 | 0.822 | 0.8027 | 0.1711 |

| |||

0.35 | 0.8222 | 0.7984 | 0.1693 |

| |||

0.4 | 0.8224 | 0.7941 | 0.1676 |

| |||

0.425 | 0.8224 | 0.792 | 0.1668 |

| |||

0.45 | 0.8225 | 0.7899 | 0.1659 |

| |||

0.475 | | 0.7878 | 0.1649 |

| |||

0.5 | 0.8224 | 0.7845 | |

In this section, we examined whether the proposed method improves the classification performance. In particular, the results including accuracy, detection rate, and false detection rate of the proposed method on the whole Pratheepan.FacePhoto dataset are presented and compared with some other methods such as the Bayesian classifier (BC), linear discriminant analysis (LDA), binary logistic regression (BLR), and Adaptive Neuron Fuzzy Inference System (ANFIS). For illustration purpose, some selected original and output binary images of comparative methods are presented in Figure

The performance of comparative methods.

| | | |
---|---|---|---|

| | 0.7878 | |

| |||

| 0.8191 | 0.7994 | 0.1739 |

| |||

| 0.7507 | 0.7727 | 0.2571 |

| |||

| 0.7710 | 0.6738 | 0.1944 |

| |||

| 0.7881 | | 0.2424 |

Some original and output binary images of comparative methods.

For the detection rate, the right detection pixels accounted for 78.78% of the true pixels. It can be seen from Table

This paper has proposed a new approach to detect skin in color image using the Bayesian classifier and connected component algorithm. The illustrative examples have also been presented in detail. The results have shown that the proposed method is competitive in terms of detection rate and outperforms the others in terms of false positive rate and accuracy. In the future, the proposed method can be further studied for other applications, like face detection, objectionable image detection, etc.

The data used to support the findings of this study are available from the corresponding author upon request.

The authors declare that they have no conflicts of interest.