# Image Segmentation for Human Skin Detection
## 3 Skin Detection
### Methods  
Our approach is based in four tasks:  
1. Explicit boundaries: In this method, a small region in a given color space is selected, where the pixels that belong to that region are considered skin. This approach is one of the simplest and most widely used, although it has many limitations regarding the challenges already discussed in this article. Known in the literature as _thresholding_, it seeks to determine a threshold for considering pixels belonging to the skin group. Many approaches improve their results by applying conversion techniques from the RGB color space to other color spaces where one can work with the chrominance and luminance values in separate ways. As an example, [PERSON] [2] converted the RGB color space to \(YCbCr\) and considered a _thresholding_ of \(80\leq Cb\leq 120\) and \(133\leq Cr\leq 140\).  
[PERSON] [15] used in his approach explicit boundaries directly over the RGB color model: \[(R>95),(G>40),(B>20)\] \[(Max(R,G,B)-Min(R,G,B))>15\] (2) \[(ABS(R-G)>15),(R>G),(R>B)\]
2. Histogram based: A skin and non-skin color model is obtained by training with a training dataset, where skin and non-skin pixels are identified. After obtaining the global histogram based on this dataset, the color space is divided into two classes of pixels (skin and non-skin). This approach is widely used [1; 21] as it shows better results for varied condition images and needs low computational power for its execution. [PERSON] et al. [24] used in their work a histogram-based approach as the basis for their hybrid implementation, which ultimately classified skin and non-skin pixels using a _k-means_ clustering algorithm.
3. Neural networks: The Neural networks play an important role in research related to skin segmentation, especially the _(multilayer perceptron)_ (MLP) model. Given a dataset of skin and non-skin samples and the determination of the learning parameters, the net adjusts the synaptic weights according to the expected training result. After obtaining the network training, it is possible to classify skin and non-skin pixels in an analyzed image. For example, to overcome the problems related to ethnic differences and capture conditions such as the lighting and object organization, the author of [29] used in his work a neural network architecture composed of convolutional layers followed by a deep learning layer for classification of skin and non-skin pixels [5].  
The final task of the proposed solution is the segmentation of the skin and non-skin pixels present in the examined image for each part of the body previously segmented. In this step, the objective is to know the proportion of visible skin concerning the total number of pixels corresponding to the examined part, thus being able to present an accurate indicator of the skin content in the image.  
Because it was necessary to determine a color space for this process, the shape that best represented the color hues, especially for a human observer, was chosen by us. Therefore, the \(H\) and \(S\) components, related to the hue from the HSV model, were mixed with the \(a\) and \(b\) components of the hue coordinates from the CIE-Lab model. In this way, we modified the skin tone components to reduce the impact of false positives in images with complex backgrounds containing skin-like elements. At the same time, we removed the components responsible for the pixel brightness intensity.  
We applied the U-Net neural network model to determine the skin pixel map. In this case, we elaborated on a heterogeneous dataset--based on the mixture of several datasets collected during the literature review--for network training. It was necessary to assemble this dataset because each one available in the literature--related to skin segmentation--was directed to its respective application. For example, an image dataset for a face recognition application contains only face examples, other applications only contain abdomen examples, and so on. Then, by collecting these datasets, we compiled for the network training a new, totally heterogeneous dataset.