# Image Segmentation for Human Skin Detection
## 2 Background
### Segmentation of Body Parts  
This work, in addition to presenting the segmentation of skin and non-skin pixels, evaluates each segmented RI from the previous step to determine the proportion of skin on display. In approaches proposed by other authors, especially when dealing with specific applications such as biometric applications, the determination of the proportion of skin present in the image [1; 4; 20; 21] was not included in their studies. Considering the forensic application, for example, the proposed approach needs to estimate the proportion of visible skin in the examined image. Digital images can contain large regions of visible skin due to the size of the image without generating forensic interest, or they can contain small regions of skin--due to the total size of the image--and present objects of forensic interest. Thus, this algorithm needs to present the complete region of the human body present in the image as well as having this region segmented by body part. For this task, a layer was implemented in the processing using the BodyPix neural network model [22]. Figure 2: Architecture diagram of Mask R-CNN. BodyPix is a body segmentation model built under the TensorFlow framework. Taking as input an image containing a human body, it uses a pretrained neural network to separate the parts of a body into segments as specified in Table 1. Among the variety of uses of this model is the use intended to remove human objects from an evaluated image. Therefore, in this work--especially in the task of determining the proportion of visible skin--it was necessary to extract the visible parts of the human body from the RIs and thus calculate the proportion of skin as a ratio for the area of each visible part. In this work, the BodyPix model is used to segment the major parts of the human body and thus determine the total pixels in the image corresponding to each human body part. However, because the original segmentation was very detailed (i.e., containing regions for each limb), the body parts were grouped into larger segments than were available from the original model. Parts such as legs (right and left) and feet were grouped under the class  
Figure 3: Example of a processed image after submission of the region of interest recognition process. \"legs\" to consider as a single class all visible pixels in the image examined belonging to the legs. Similarly, the other body regions were grouped as described in Table 2.  
After associating the images to each part of the body, it was possible to measure more precisely the number of pixels pertaining only to the human body. Thus, it was possible to calculate the proportion of visible skin concerning the total pixels that belonged to the person being evaluated and not under the total pixels of the image, which generates distorted values and is not useful for the application of forensic objectives. Figure 4 shows an example of the proposed segmentation. The human body in the input image (Figure 4a) was subdivided into four parts to be assessed individually. For forensic applications, this individual analysis is important because by allowing one to know the content of each human body part in each person present in the examined image, it is possible to efficiently and accurately identify the objects of interest and discard the insignificant ones. For example, an image in which only one hand is displayed in proportion to the total size of the image will correspond to a large portion of the total size of the image. In this case, it makes the analysis unfeasible, because an image with only this fragment is irrelevant to the evaluation.