Hair Removal Combining Saliency, Shape and Color

Featured Application: Hairremovalisapreliminaryandoftennecessarystepintheautomaticprocess-ing of dermoscopic images since hair can negatively affect or compromise the distinction of a lesion region from the normal surrounding healthy skin. A featured application is skin lesion segmentation. Abstract: In a computer-aided system for skin cancer diagnosis, hair removal is one of the main challenges to face before applying a process of automatic skin lesion segmentation and classiﬁcation. In this paper, we propose a straightforward method to detect and remove hair from dermoscopic images. Preliminarily, the regions to consider as candidate hair regions and the border/corner components located on the image frame are automatically detected. Then, the hair regions are determined using information regarding the saliency, shape and image colors. Finally, the detected hair regions are restored by a simple inpainting method. The method is evaluated on a publicly available dataset, comprising 340 images in total, extracted from two commonly used public databases, and on an available speciﬁc dataset including 13 images already used by other authors for evaluation and comparison purposes. We propose also a method for qualitative and quantitative evaluation of a hair removal method. The results of the evaluation are promising as the detection of the hair regions is accurate, and the performance results are satisfactory in comparison to other existing hair removal methods.


Introduction
In almost every specialist area of medicine, including dermatology, image analysis is transforming the diagnostic methods. In particular, computer-aided diagnosis systems for dermoscopic images have proven to be useful tools to improve significantly the common dermoscopic diagnostic practice, which is usually characterized by limited accuracy and is mainly based on visual inspection. Indeed, to differentiate melanoma from other pigmented skin lesions, these systems display morphological features not easily perceptible by the naked eye and support the assessment process of the human expert [1,2]. Typically, a computer-aided system is structured in four main consecutive steps: preprocessing, segmentation, feature extraction, and classification, each playing a key role in enabling correct diagnosis [3]. During the preprocessing, the dermoscopic image is subjected to noise removal, image enhancement, color quantization, and artifacts removal processes [4,5]. Noise removal and image enhancement techniques are employed to minimize the effects due to different illumination conditions and poor resolution of the acquisition process [6]. Color quantization [7][8][9][10] is a technique of reducing the total number of unique colors in the image often used as a preprocessing step for many applications that are carried out more efficiently on a numerically smaller color set. For example, color quantization is employed effectively as a preliminary computation phase for skin lesion segmentation [11][12][13][14][15]. The removal methods of artifacts, such as bubbles, hair, shadows and reflections, aims to eliminate their negative effect and disturbance on the diagnostic operations of the area of interest (i.e., the skin lesion) [16]. Particularly, if the area of the skin lesion is partially occluded by the hair, although such occlusions may not be critical for human investigation, this presence poses major challenges for automatic image analysis method such as segmentation and classification. Indeed, the hair removal (HR) methods and skin lesion segmentation (SLS) methods are highly correlated. Usually, SLS methods can determine the skin lesion region without the need to apply preliminary hair removal since these methods can include explicitly or implicitly hair removal operations. However, it is appropriate to consider that (a) in any case, a partial hair removal facilitates and increases the efficiency of the segmentation step; (b) the hair presence can lead to errors in lesion detection in some situations, especially when there is a massive presence of hair (see Figure 1); (c) for diagnostic and therapeutic purposes, HR is helpful at least to visualize the free-hair lesion to the expert. obtained in the three previous steps, are related mainly to how the initial candidate hair components are considered (see Section 2 for more details). In the last step, hair removal is performed using a standard inpainting method.
The method is evaluated and compared extensively with other existing methods since a detailed quantitative and qualitative analysis on two publicly available databases PH 2 [28] and ISIC2016 [29], usually used in dermoscopic image processing, is performed.
The experimental results confirm (a) the effectiveness and the utility of the employment of saliency, shape, and color information for HR; (b) that HR-SSC achieves good quantitative results with an adequate balance and has a competitive and satisfactory performance concerning other existing HR methods; (c) that HR-SSC implementation is simple and rather fast since it does not require a large amount of computational power based on a high number of parameters and of labeled training images.
Additional contributions of this work are (a) the availability of appropriate datasets to be used for testing and comparing each new method; (b) the proposal of a method for qualitative and quantitative evaluation of an HR method.
The paper is organized as follows: in Section 2, we describe the method HR-SSC, detailing its main steps; in Section 3, we provide a quantitative and qualitative evaluation of experimental results, also highlighting the pros and cons; finally, discussion and conclusions are drawn in Section 4.

The Proposed Method
The proposed method, as mentioned above, is based on three elements: the notion of visual saliency, shape, and color. Indeed, since the saliency of an item is the element for it To address the hair issue, several hair removal methods have been proposed. HR methods usually consist of two steps: (a) the detection of occluding hair and generation of the hair binary mask; (b) the removal of the detected hair. Typically, hair detection is accomplished through object detection methods enucleating thin items, while hair removal is obtained through standard inpainting methods. As reported in [17], at least six main hair removal methods are widely used in the literature [18][19][20][21][22][23].
The method proposed in [18] by Lee et al., also known as Dullrazor, consists of four steps. The hair regions are initially detected through the morphological closing operator on each RGB color channel separately and with three structuring elements having different directions (step 1). To generate the binary mask, a thresholding process is applied to the absolute difference between the original color channel and the image generated by the closing (step 2). The mask pixels undergo a bilinear interpolation between two nearby not-mask pixels (step 3). Finally, to the resulting image, an adaptive median filter is applied (step 4).
The method [19] by Xie et al. also consists of four steps. The hair area is improved using a morphological closing top-hat operator (step 1). The binary image is obtained through a statistical thresholding process (step 2). To extract the hairs, the elongate feature property of connected regions is employed (step 3). To restore the information occluded by the hair, they apply the image inpainting method based on partial differential equation (PDE), which realizes the diffusion of information through the difference between pixels (step 4).
In the method proposed in [20] by Abbas et al., there are three computational steps. In the CIELab uniform color space, the hairs are detected by a derivative of Gaussian (DoG) (step 1). Morphological techniques to link broken hair segments, eliminate small and circular objects, and fill the gaps between lines are applied (step 2). The adopted inpainting method is based on coherence transport (step 3).
The method in [21] by Huang et al. comprises three steps. To the grayscale version of the image, a multiscale curvilinear matched filter is applied (step 1). To detect the hair regions, hysteresis thresholding is employed (step 2). Then, region growing and the linear discriminant analysis (LDA) technique, based on the pixel color information in the CIELab color space, are applied to recover the missing information left by the removed hair (step 3).
The method [22] by Toossi et al. includes four steps. The image is converted to a grayscale image via a principal component analysis (PCA), and the noise is filtered with a Wiener filter (step 1). Hair is detected by using an adaptive canny edge detector (step 2). A refining process with morphological operators to eliminate unwanted objects and obtain a smooth hair mask is then applied (step 3). The inpainting process is carried out by a multi-resolution transport inpainting method based on wavelets (step 4).
As with [20,21], in [23] by Bibiloni et al., hair removal is made up of three steps. The contrast of the luminance of the image is improved with the Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm (step 1). The hair is detected using soft color morphology operators in the CIELab color space (step 2). The inpainting phase is based on the arithmetic mean of the modified opening and closing morphological transformations to recover the missing pixels (step 3). The common element of these HR methods and most of the other existing methods, e.g., [24,25], is the employment of morphological operations and, to a minor extent, of information derived from color. On the other hand, although deep learning has been used successfully to solve many difficult computer vision problems, inexplicably, to the best of our knowledge, only two very recent HR methods relying on neural network architecture exist [26,27].
Despite the sufficiently wide variety of the existing papers, the problem of hair removal results to be not solved satisfactorily yet. The main critical points are the failure to identify hair accurately and the undesirable effects such as unremoved thin hair and color alteration.
We address the HR problem using information regarding the saliency, shape, and color of the image objects. These are three elements that have proved to be extremely useful because each of them allows capturing a fundamental aspect of the problem at hand. Indeed, besides the shape aspects, detectable by mathematical morphology properties, it is also appropriate to perform the hair detection based on information related to the significant image elements and detectable by their saliency and color properties. In the following, we refer to the proposed method as saliency shape color for hair removal, shortly indicated as HR-SSC or simply SSC.
As described in Section 2, HR-SSC consists of five steps. The core of the method is step 4, named hair object detection, in which the hair regions are determined. The innovative elements of this step, whose success also depends on the correctness of the results obtained in the three previous steps, are related mainly to how the initial candidate hair components are considered (see Section 2 for more details). In the last step, hair removal is performed using a standard inpainting method.
The method is evaluated and compared extensively with other existing methods since a detailed quantitative and qualitative analysis on two publicly available databases PH 2 [28] and ISIC2016 [29], usually used in dermoscopic image processing, is performed.
The experimental results confirm (a) the effectiveness and the utility of the employment of saliency, shape, and color information for HR; (b) that HR-SSC achieves good quantitative results with an adequate balance and has a competitive and satisfactory performance concerning other existing HR methods; (c) that HR-SSC implementation is simple and rather fast since it does not require a large amount of computational power based on a high number of parameters and of labeled training images.
Additional contributions of this work are (a) the availability of appropriate datasets to be used for testing and comparing each new method; (b) the proposal of a method for qualitative and quantitative evaluation of an HR method.
The paper is organized as follows: in Section 2, we describe the method HR-SSC, detailing its main steps; in Section 3, we provide a quantitative and qualitative evaluation of experimental results, also highlighting the pros and cons; finally, discussion and conclusions are drawn in Section 4.

The Proposed Method
The proposed method, as mentioned above, is based on three elements: the notion of visual saliency, shape, and color. Indeed, since the saliency of an item is the element for it stands out from its neighbors [30], its use allows to enucleate the most relevant subsets and to focus on the hair regions especially. Moreover, since hair regions have a well-defined structure, the shape-oriented operations of the mathematical morphology, that "simplify image data, preserving their essential shape characteristics and eliminating irrelevancies" [31], lend themselves well to detect the hair object. On the other hand, the properties of the color model can result essential to distinguish between no-hair and hair regions when information related to saliency and shape is not enough to manage ambiguous cases [11].
The method consists of five main steps as described in the diagram shown in Figure 2. The step "Hair object detection" is the main step and is preceded by three preliminary steps, called "size reduction", "Pseudo-Hair detection" and "Border and corner component detection" aimed respectively at reducing the image size, determining the initial candidate regions to consider as hair regions, called pseudo-hair, and determining the components located on the frame of the image. The "Hair object detection" step is followed by the hair removal step and the resizing called "Inpainting and rescaling". Specifically, the method can be briefly described as follows. value. The connected components of SM including pixels of the image frame are considered as border components and stored in the bidimensional array, named BC.
Moreover, the image corner components, usually much darker than the image center, are detected following the same procedure proposed in [34]. Specifically, the representation of the input image in the HSV color space is examined; the channel V undergoes a thresholding process by a predefined threshold value δ. Then, the components of the thresholded V covering most of the frame or the corner area of the image are considered as image corner components and are stored in the bidimensional array, named CC (see Figure 3c).

Step4.
Hair object detection-Preliminarily, the no-hair regions are detected and stored in the bidimensional array, named NR, as follows. NR is initially computed as the product S.*V and binarized by the Otsu method. Then, the salient pixels not belonging to HR and BC are included in NR, the pseudo-hair regions currently detected in HR are removed from NR, and small holes in NR are filled. Successively, if NR has a significant extension (area), the detected no-hair regions are removed from HR. If the current HR is not empty, border components are suitably considered and possibly removed from HR taking also into account the gray version of the input image Ig and a fixed gray value, say Δ, indicating a minimum reference gray value for the hair component. Finally, corner components and eventual remaining components corresponding to colored disks are eliminated from HR.  Step 1. Size reduction-The first step is devoted to limit the computation burden of the successive steps by reducing the size of the input image with a scale factor s equal to the ratio of a fixed value, say Maxdim, and the number of columns. To perform this, we resort to the classical and most common bicubic downsampling, implemented by the Matlab command imresize with bicubic option and scale factor s. The size reduction step is an optional but highly recommended operation since it significantly limits the computation time.
Step 2. Pseudo-Hair detection-This step is based on top-hat transformation, i.e., a morphological operator capable of extracting small elements and details from a grayscale image, commonly used for feature extraction, background equalization, and other enhancement operations. There are two types of transformation: the white top-hat transformation, defined as the difference between the original image and its aperture by a structuring element, and the black top-hat transformation (or bottom-hat transformation), defined dually as the difference between the closure by a structuring element and the original image [32,33]. Following [19,34], to obtain the binarized version HR initially containing the pseudo-hair components, we apply a bottom-hat filter in the red band R of the RGB image and then the Otsu threshold method [35] by the Matlab command imbinarize. Then, if HR is not empty, the actual hair regions are determined during the successive steps 3-5.
Indeed, the components currently detected in HR (i.e., the so-called pseudo-hair components) can correspond to hair regions but can also correspond to portions of other types of artifacts survived this preliminary treatment, such as marker ink signs, dark spots belonging to the lesion, marker colored disks [34], and regions wrongly identified. These regions not corresponding to hair regions are called no-hair regions in the following, and if they exist, they are detected and eliminated in the successive steps. In Figure 3b some examples of pseudo-hair are shown, where the no-hair regions are approximatively indicated by a red arrow. Step 3. Border and corner component detection-The border components are detected based on their saliency and proximity to the image frame, by applying the following process, named called border detection, already used in [14,15]. The saliency map (SM) with well-defined boundaries of salient objects is computed by the method proposed in [36]. Successively, SM is enhanced by increasing the contrast in the following way: the values of the input intensity image are mapped to new values obtained by saturating the bottom 1% and the top 1% of all pixel values, by the Matlab command imadjust. Then, the saliency map SM is binarized by as-signing to the foreground all pixels with a saliency value greater than the average saliency value. The connected components of SM including pixels of the image frame are considered as border components and stored in the bidimensional array, named BC.
Moreover, the image corner components, usually much darker than the image center, are detected following the same procedure proposed in [34]. Specifically, the representation of the input image in the HSV color space is examined; the channel V undergoes a thresholding process by a predefined threshold value δ. Then, the components of the thresholded V covering most of the frame or the corner area of the image are considered as image corner components and are stored in the bidimensional array, named CC (see Figure 3c).
Step 4. Hair object detection-Preliminarily, the no-hair regions are detected and stored in the bidimensional array, named NR, as follows. NR is initially computed as the product S.*V and binarized by the Otsu method. Then, the salient pixels not belonging to HR and BC are included in NR, the pseudo-hair regions currently detected in HR are removed from NR, and small holes in NR are filled. Successively, if NR has a significant extension (area), the detected no-hair regions are removed from HR. If the current HR is not empty, border components are suitably considered and possibly removed from HR taking also into account the gray version of the input image Ig and a fixed gray value, say ∆, indicating a minimum reference gray value for the hair component. Finally, corner components and eventual remaining components corresponding to colored disks are eliminated from HR.
At the end of this step, the regions in HR are located in correspondence with the detected hair objects and form a binary hair-mask on which to perform the next reconstruction step. See the Matlab pseudocode given below for more details. In Figure 3d, examples of detected hair are given. Step 5. Inpainting and rescaling-If HR is empty, the image is considered hairless; otherwise, the reconstruction process is applied. After a preliminary enlargement of HR by n steps of dilation, the inpainting is carried out by calling the Matlab function regionfill on each image channel separately, by using HR as hair-mask and then joining the resulting channels. If the size reduction step has been performed, a scaling is newly applied using the Matlab function imresize with the bicubic option.
In Figure 3e, examples of the resulting image are given.
Different parameter settings to achieve a trade-off between quality and performance have been explored. The better parameter values resulting from this analysis are Maxdim = 500, δ = 0.4, ∆ = 100, n = 3. The experimental results shown in this paper are obtained by this setting. The method is implemented in Matlab using Intel ® core ™ i7-6600U CPU 2.60 GHz with 8 GB installed RAM and a 64-bit Operating System Windows 10.

Experimental Results
This section describes the image datasets and the evaluation of the experimental results in qualitative and quantitative terms. In fact, the evaluation of the performance of the proposed method and the comparison with other methods are very hard tasks due to the lack of publicly available source code of the existing methods, the limited literature, and the different evaluation methodology often employing not well-specified datasets and different quality measures. To overcome these critical issues, (a) we select some adequate datasets (see Section 3.1); (b) we perform qualitative evaluations/comparisons from different points of view (see Section 3.2); (c) following [17,37], we perform quantitative evaluations and comparisons by generating synthetic hair on skin lesion images originally hair-free in a controlled way (see Section 3.3). Note that the controlled hair introduction modality offers the advantage that the added hair regions are known and constituted a reference image, i.e., a ground truth. Accordingly, since the quantitative evaluation of the performance of an HR method requires a reference image, this modality is the unique way to evaluate the results by comparing the added hair regions in the reference image (ground truth) with the detected hair regions in the binary mask.

Datasets
We test our method by considering images available on two publicly available databases of dermoscopic images: PH 2 [28] and ISIC2016 [29]. PH 2 is a dermoscopic image database acquired at the Dermatology Service of Hospital Pedro Hispano to support comparative studies on segmentation/classification methods. This database includes clinical/histological diagnosis, medical annotation, and the evaluation of many dermoscopic criteria. It provides 200 dermoscopic RGB images and the corresponding ground truth, including 80 atypical nevi, 80 common nevi, and 40 melanomas. All the images are 8-bit RGB and have resolution 760 × 560 pixels. ISIC2016 is one of the largest databases of dermoscopic images of skin lesions with quality control held by the International Symposium on Biomedical Imaging (ISBI) to improve melanoma diagnosis. It includes images representative of both benign and malignant skin lesions. For each image, the ground truth is also available. ISIC2016 consists of 397 (75 melanomas) and 900 (173 melanomas) annotated images as testing and training data, respectively. The images are 8-bit RGB and have a size ranging from 542 × 718 to 2848 × 4288. PH 2 and ISIC2016 databases contain numerous images with complex backgrounds and complicated skin conditions with the presence of hair and other artifacts/aberrations.
Since in PH 2 and ISIC2016 hairless and hairy images are not distinguished, it is not possible to evaluate the performance of an HR method on each total dataset, and it is necessary to separate them preliminarily. Hence, from PH 2 and ISIC2016 we extract two datasets, denoted as H-data and NH-data, each constituted by 170 images, which respectively contain images with evident hair and images without hair. These images are selected randomly and subdivided into the two datasets according to a human visual inspection. These datasets, totally comprising 340 images, are available at the Github link indicated in the section Data Availability Statement.
To accurately and comprehensively validate the goodness of detecting hair and, at the same time, to make a deeper comparison with the published results of the existing methods [18][19][20][21][22][23], which in the following we indicate with the name of the first author (i.e., Lee, Xie, Huang, Abbas, Toossi, Bibiloni), we also consider a specific dataset available in [37]. This dataset, here call NH13-data and shown in Figure 4, is constituted by 13 images without hair. We consider also the hairy images obtained starting from NH13-data by the GAN method [38] and HairSim method [39], that starting from a hair-free dermoscopic image, provide a hair-occluded image and the corresponding binary hair-mask. These datasets are available in [37], are denoted as H13GAN-data and H13Sim-data, and are shown in Figures 5 and 6, respectively.   . Image dataset H13GAN-data generated by applying the GAN method [38] to NH13-data and published in [37].

Figure 6.
Image dataset H13Sim-data generated by applying the HairSim method [39] to NH13-data and published in [37].   . Image dataset H13GAN-data generated by applying the GAN method [38] to NH13-data and published in [37].

Figure 6.
Image dataset H13Sim-data generated by applying the HairSim method [39] to NH13-data and published in [37].   . Image dataset H13GAN-data generated by applying the GAN method [38] to NH13-data and published in [37].
Moreover, to validate the performance of the method on a larger dataset, we simulate the presence of hair on NH-data using the HairSim method by generating the HSim-data set. Note that for HSim-data and H-data, only the methods Lee, Xie, and HR-SSC are considered. The choice of these methods is based on the fact that first, they are the Appl. Sci. 2021, 11, 447 9 of 28 only methods, including the deep learning class of methods, with an available source code, second, they are used widely in the literature, and third, they have higher quality measures in [37]. We consider all images of H-data and HSim-data, but, given the high number of images, we limit to show the results for a13 images sample for each dataset, here named sH-data and sHSim-data, respectively. To favor the visual comparison of the results, the sNH-data from which sHSim-data are generated are shown in Figure 7, while in Figures 8 and 9 sHSim-data and sH-data, together with the corresponding added hair, are respectively shown. Additionally, all of these datasets are available at the above Github link to support the possibility of comparison by other authors. Figure 5. Image dataset H13GAN-data generated by applying the GAN method [38] to NH13-data and published in [37]. Figure 6. Image dataset H13Sim-data generated by applying the HairSim method [39] to NH13-data and published in [37].   ISIC_0000040  ISIC_0000096  ISIC_0000184  ISIC_0000257  ISIC_0000410  ISIC_0000503  ISIC_0006982   ISIC_0007693  ISIC_0009993  ISIC_0010182  ISIC_0010226  ISIC_0010584  ISIC_0011323   Hair Sim   ISIC_0000040  ISIC_0000096  ISIC_0000184  ISIC_0000257  ISIC_0000410  ISIC_0000503  ISIC_0006982   ISIC_0007693  ISIC_0009993  ISIC_0010182  ISIC_0010226  ISIC_0010584  ISIC_0011323 Hair Sim Figure 8. Image dataset sHSim-data with the hair mask produced by applying the HairSim method to sNH-data. Figure 9. Image dataset sH-data selected randomly from H-data.
In regard to the assessment of point (a), we find that the classification error is within 25%, 65%, 10%, respectively, for Lee, Xie, and HR-SSC. As concerns the assessment of   In regard to the assessment of point (a), we find that the classification error is within 25%, 65%, 10%, respectively, for Lee, Xie, and HR-SSC. As concerns the assessment of point (b), the visual inspection of the results shows that the resulting perceptual quality is in accordance with the percentages obtained for point (a). To verify the effectiveness of the hair removal methods, a recent SLS method [14,15] is applied. The segmentation results show that hair removal applied before the segmentation process involves an improvement of about 70%, 20%, 90% for Lee, Xie, and HR-SSC, respectively. The results of the visual comparison on the various datasets of point (c) are given in Figures 10 and 11 on H13GAN-data and H13Sim-data, respectively. To give major visual evidence and to facilitate the comparison, in Figures 12 and 13, the results on sHSim-data and the corresponding final mask are respectively shown. The same is true for Figures 14 and 15, where results on H-data with the corresponding final mask are shown.
In summary, in relation to the qualitative evaluation, from the visual examination of the resulting images of each method available in [37] and HR-SSC on H13GAN-data and H13Sim-data (see Figures 10 and 11), it appears that evident hair regions are not detected by Abbas and Toossi. Limiting the comparison only to the three methods of Lee, Xie, and HR-SSC, evident hair regions are not detected by Xie on the HSim-data and, to a lesser extent, on H-data. See the results on the sample sHsim-data in Figure 12 and on the sample Figure 9. Image dataset sH-data selected randomly from H-data.

Qualitative Evaluation
To perform a qualitative evaluation, we check, for each method under consideration, if the set of images selected as hairy images by a method is (almost) equal to the corresponding original dataset, and we verify if the appearance of the inpainted image is good. For this purpose, we consider all the images (with and without hair) belonging to both H-data and NH-data, and we perform the following evaluations.
(a) We check whether, in most cases, the hair determination is successful or not, i.e., that the images are re-confirmed as belonging to H-data and NH-data, respectively. This allows us to determine for the different considered methods how much the resulting sets belonging to H-data or NH-data are equal to the initial ones. (b) We verify if the appearance of the hairless resulting image is, according to human subjective judgment, compatible with a hairless and good quality version of it. Moreover, we test whether the presence of the hair can preclude or alter a subsequent step of skin lesion segmentation. (c) We visually compare the obtained results by the proposed method and those directly available in [37] or by the available implementation of Lee and Xie on H13GAN-data, H13Sim-data, HSim-data, and H-data to determine their overall performance.
In regard to the assessment of point (a), we find that the classification error is within 25%, 65%, 10%, respectively, for Lee, Xie, and HR-SSC. As concerns the assessment of point (b), the visual inspection of the results shows that the resulting perceptual quality is in accordance with the percentages obtained for point (a). To verify the effectiveness of the hair removal methods, a recent SLS method [14,15] is applied. The segmentation results show that hair removal applied before the segmentation process involves an improvement of about 70%, 20%, 90% for Lee, Xie, and HR-SSC, respectively. The results of the visual comparison on the various datasets of point (c) are given in Figures 10 and 11 on H13GANdata and H13Sim-data, respectively. To give major visual evidence and to facilitate the comparison, in Figures 12 and 13, the results on sHSim-data and the corresponding final mask are respectively shown. The same is true for Figures 14 and 15, where results on H-data with the corresponding final mask are shown.
In summary, in relation to the qualitative evaluation, from the visual examination of the resulting images of each method available in [37] and HR-SSC on H13GAN-data and H13Sim-data (see Figures 10 and 11), it appears that evident hair regions are not detected by Abbas and Toossi. Limiting the comparison only to the three methods of Lee, Xie, and HR-SSC, evident hair regions are not detected by Xie on the HSim-data and, to a lesser extent, on H-data. See the results on the sample sHsim-data in Figure 12 and on the sample sH-data in Figure 14. Note that HR-SSC is able also to remove the ruler marks that can be mistaken as hair (see Figures 14 and 15). sH-data in Figure 14. Note that HR-SSC is able also to remove the ruler marks that can be mistaken as hair (see Figures 14 and 15).

Quantitative evaluation
We quantitatively evaluate the resulting images on the hairless image datasets to which hair has been added (see Section 3.1) by considering the original image as ground truth and expressing a quantitative evaluation in terms of the following: Although the above quality measures are related to human perception to a small extent, and the problem to define adequate metrics for the performance evaluation of color image processing methods remains an open problem widely studied [41][42][43][44][45], most often, these measures are extensively employed to evaluate the performance of many types of image analysis methods, including the HR methods [17,37]. In turn, we see these quality measure values as valid indicators since they contribute to delineate the trend of the performance of an HR method, and, at the same time, we consider them not suitable alone to give evidence of its effectiveness. To overcome this gap, since the determination of the effective hair area and the true/false rate are the major critical points for the quantitative evaluation of HR methods, we extend the performance evaluation by measuring the hair

Quantitative Evaluation
We quantitatively evaluate the resulting images on the hairless image datasets to which hair has been added (see Section 3.1) by considering the original image as ground truth and expressing a quantitative evaluation in terms of the following: Although the above quality measures are related to human perception to a small extent, and the problem to define adequate metrics for the performance evaluation of color image processing methods remains an open problem widely studied [41][42][43][44][45], most often, these measures are extensively employed to evaluate the performance of many types of image analysis methods, including the HR methods [17,37]. In turn, we see these quality measure values as valid indicators since they contribute to delineate the trend of the performance of an HR method, and, at the same time, we consider them not suitable alone to give evidence of its effectiveness. To overcome this gap, since the determination of the effective hair area and the true/false rate are the major critical points for the quantitative evaluation of HR methods, we extend the performance evaluation by measuring the hair area and true/false rate (see respective Sections 3.3.2 and 3.3.3). As mentioned above, following [17,37], we consider the images in which, in a controlled way, the hair regions are introduced on input hair-free images by using suitable hair insertion methods [38,39] that provide a hair-occluded image and the corresponding binary hair mask. The resulting binary mask is used as ground truth to quantitatively evaluate the performance by computing the detected area and the false discovery rate/true discovery rate (FDR/TDR).
Note that we use the hairy images used in [17] and those available at [37]. Then, we extend the controlled hair simulation on a larger dataset, and to allow comparison with other HR methods on the same image dataset, we made it available at the already mentioned Github link. Indeed, currently, the direct comparison with the results shown in another paper is in practice impossible since the experimental results are given for a not well-specified dataset. Accordingly, we think that having a shared dataset with the corresponding ground truth is a useful tool favoring the comparison and increasing the quality of the performance evaluation.  [17,37], we consider the images in which, in a controlled way, the hair regions are introduced on input hair-free images by using suitable hair insertion methods [38,39] that provide a hair-occluded image and the corresponding binary hair mask. The resulting binary mask is used as ground truth to quantitatively evaluate the performance by computing the detected area and the false discovery rate/true discovery rate (FDR/TDR). IMD006  IMD010  IMD017  IMD018  IMD019  IMD020  IMD030   IMD033  IMD044  IMD050  IMD061  IMD63  IMD75   Lee   IMD006  IMD010  IMD017  IMD018  IMD019  IMD020  IMD030   IMD033  IMD044  IMD050  IMD061  IMD63  IMD75   Xie   IMD006  IMD010  IMD017  IMD018  IMD019  IMD020  IMD030   IMD033  IMD044  IMD050  IMD061  IMD63  IMD75   Abbas   IMD006  IMD010  IMD017  IMD018  IMD019  IMD020  IMD030   IMD033  IMD044  IMD050  IMD061  IMD63 IMD006  IMD010  IMD017  IMD018  IMD019  IMD020  IMD030   IMD033  IMD044  IMD050  IMD061  IMD63  IMD75   Toossi   IMD006  IMD010  IMD017  IMD018  IMD019  IMD020  IMD030   IMD033  IMD044  IMD050  IMD061  IMD63  IMD75   Bibiloni   IMD006  IMD010  IMD017  IMD018  IMD019  IMD020  IMD030   IMD033  IMD044  IMD050  IMD061  IMD63  IMD75 HR-SSC Note that we use the hairy images used in [17] and those available at [37]. Then, we extend the controlled hair simulation on a larger dataset, and to allow comparison with other HR methods on the same image dataset, we made it available at the already mentioned Github link. Indeed, currently, the direct comparison with the results shown in another paper is in practice impossible since the experimental results are given for a not well-specified dataset. Accordingly, we think that having a shared dataset with the corresponding ground truth is a useful tool favoring the comparison and increasing the quality of the performance evaluation.

Quantitative Evaluation Based on Quality Measures
To carry out a quantitative evaluation based on quality measures, we consider the results obtained by all methods (see Figures 10 and 11) on the image datasets H13Sim-data and H13Sim-data (see Figures 5 and 6), and we compute the metric values by considering the original images in NH13-data as ground truths (see Figure 4). The metric values are shown in Tables 1 and 2. Moreover, since the cardinality of the NH13-data is too limited, we repeat this quantitative quality evaluation also on HSim-data to verify if by varying the insertion of the hairs and increasing the cardinality of the set of reference data, we obtain a similar result. This quality evaluation is performed by limiting the considered methods to Lee, Xie, and HR-SSC. For the sake of brevity, in Table 3, we show the metric values only for sHSim-data by considering the corresponding resulting images (see Figure 12) and the sNH_data (see Figure 7). In Table 4 we report the average quality measures referring to H13GAN-data, H13Sim-data, sH13Sim-data, and HSim-data. The quantitative metrics for the set HSim-data including 170 images are also available at the mentioned Github link since they require much editing space.

Quantitative Evaluation Based on Quality Measures
To carry out a quantitative evaluation based on quality measures, we consider the results obtained by all methods (see Figures 10 and 11) on the image datasets H13Sim-data and H13Sim-data (see Figures 5 and 6), and we compute the metric values by considering the original images in NH13-data as ground truths (see Figure 4). The metric values are shown in Tables 1 and 2. Moreover, since the cardinality of the NH13-data is too limited, we repeat this quantitative quality evaluation also on HSim-data to verify if by varying the insertion of the hairs and increasing the cardinality of the set of reference data, we obtain a similar result. This quality evaluation is performed by limiting the considered methods to Lee, Xie, and HR-SSC. For the sake of brevity, in Table 3, we show the metric values only for sHSim-data by considering the corresponding resulting images (see Figure 12) and the sNH_data (see Figure 7). In Table 4 we report the average quality measures referring to H13GAN-data, H13Sim-data, sH13Sim-data, and HSim-data. The quantitative metrics for the set HSim-data including 170 images are also available at the mentioned Github link since they require much editing space.
SSC. For the sake of brevity, in Table 5, we show the resulting area values for sHSim-data. Moreover, we compare the average hair area <AI > introduced in HSim-data by the Hair-Sim method with the average hair area detected by each method (Table 6).
Since in our experiment <AI > = 42648, from Table 6, it can be observed that the average hair area computed by HR-SSC is the one that comes closest to <AI >, while the average hair area computed by Xie is by far the most distant. This evaluation trend in terms of area on HSim-data and sHSim-data confirms the trend indicated in Section 3.3.1.

Figure 12
Results of methods Lee, Xie, and HR-SSC on sHSim-data. Figure 12. Results of methods Lee, Xie, and HR-SSC on sHSim-data.
Based on the quantitative analysis using the nine metrics, the trend of the various methods turns out to be completely different on H13GAN-data and H13Sim-Data in comparison with those on a set with greater cardinality HSim-data as well as on its sample sHSim-data of 13 images. This is highlighted in Figures 16 and 17, where the trends of each quality measure on the dataset containing 13 images belonging to different datasets but generated by the same HairSim method for the hair simulation, i.e., H13Sim-data and sHSim-data, are shown. Appl. Sci. 2021, 11, x FOR PEER REVIEW  21 of 27   ISIC_0000040  ISIC_0000096  ISIC_0000184  ISIC_0000257  ISIC_0000410  ISIC_0000503  ISIC_0006982   ISIC_0007693  ISIC_0009993  ISIC_0010182  ISIC_0010226  ISIC_0010584  ISIC_0011323   Lee   ISIC_0000040  ISIC_0000096  ISIC_0000184  ISIC_0000257  ISIC_0000410  ISIC_0000503  ISIC_0006982   ISIC_0007693  ISIC_0009993  ISIC_0010182  ISIC_0010226  ISIC_0010584  ISIC_0011323   Xie   ISIC_0000040  ISIC_0000096  ISIC_0000184  ISIC_0000257  ISIC_0000410  ISIC_0000503  ISIC_0006982   ISIC_0007693  ISIC_0009993  ISIC_0010182  ISIC_0010226  ISIC_0010584  ISIC_0011323 HR-SSC Figure 13. Resulting mask of HairSim method and the resulting mask of methods Lee, Xie, and HR-SSC on sHSim-data.

Quantitative Evaluation in Terms of True/False Discovery Rate
We evaluate the quality of the resulting images also in terms of true discovery rate (TDR) and false discovery rate (FDR), defined as the following: where FP and TP denote false positive and true positive assessments, respectively. For the sake of brevity, in           Figure 15. Resulting masks of methods Lee, Xie, and HR-SSC on sH-data. Figure 16. Trends of quality measures on H13Sim-data for the methods Lee, Xie, and HR-SSC. Figure 16. Trends of quality measures on H13Sim-data for the methods Lee, Xie, and HR-SSC.  Figure 17. Trends of quality measures on sHSim-data for the methods Lee, Xie, and HR-SSC.

Quantitative Evaluation Based on the Area of the Detected Hair Regions
To perform a quantitative evaluation based on area, we compare the area values obtained by the methods Lee, Xie, and HR-SSC on HSim-data, that is, the dataset in which hair is added in a controlled way. In detail, for each image I, we calculate the hair area introduced by the HairSim method, indicated as A I , and we compare this value with the area identified by each method, indicated as A L , A x , A R , respectively for Lee, Xie, and HR-SSC. For the sake of brevity, in Table 5, we show the resulting area values for sHSim-data. Moreover, we compare the average hair area <A I > introduced in HSim-data by the HairSim method with the average hair area detected by each method (Table 6). Since in our experiment <A I > = 42648, from Table 6, it can be observed that the average hair area computed by HR-SSC is the one that comes closest to <A I >, while the average hair area computed by Xie is by far the most distant. This evaluation trend in terms of area on HSim-data and sHSim-data confirms the trend indicated in Section 3.3.1.

Quantitative Evaluation in Terms of True/False Discovery Rate
We evaluate the quality of the resulting images also in terms of true discovery rate (TDR) and false discovery rate (FDR), defined as the following: where FP and TP denote false positive and true positive assessments, respectively. For the sake of brevity, in Table 7, we show the resulting FDR and TDR values only for sHSim-data. Moreover, the average <FDR> and <TDR> values of each method for HSim-data are shown in Table 8. From the examination of Tables 7 and 8, a lower value of FDR and a higher value of TDR for HR-SSC, an intermediate value of FDR and TDR for Lee, and a higher value of FDR and a lower value of TDR for Xie can be observed. With respect to Lee, HR-SSC reports the percentage improvements of TDR and FDR equal to 35% and 27%, respectively, on Hsim-data, and equal to 33% and 27%, respectively, on sHSim-data. This evaluation trend in terms of FDR/TDR on Hsim-data, sHSim-data confirms the trend indicated in Section 3.3.1.

Discussion and Conclusions
In this paper, we propose the method HR-SSC based on the combined use of saliency, shape, and color. Initially, the computation burden of the hair removal process is lowered optionally by reducing the size of the image. Then, pseudo-hair regions and border/corner components are determined and employed in the successive process of hair mask detection. Successively, the image is restored by an inpainting process. A further contribution of this paper includes the proposal of a method for qualitative and quantitative evaluation of an HR method, and the availability of appropriate datasets to be used for testing and comparing by others. According to the proposed evaluation method, we perform a detailed quantitative and qualitative analysis of the experimental results on these datasets. Specifically, we qualitatively evaluate the performance of the proposed method and six state-of-the-art methods. We quantitatively evaluate the performance of HR methods under examination using a hair simulation technique applied on available dermoscopic image datasets, nine commonly adopted quality measures, area criteria, and FDR/TDR indicators.
Based on the experimental results and the performance evaluation, HR-SSC detects and removes the hair from the dermoscopic image by preserving the image features for its subsequent image segmentation process. Moreover, HR-SSC has a competitive and satisfactory performance concerning other considered methods as the probability of missing hair regions and/or detecting false hair regions is low. This is visually evident from the evaluation carried out, but it is to a lesser extent if we restrict the analysis to NH13-data. Indeed, as also reported in [17], the quantitative results on H13GAN-data and H13Sim-data (see Tables 1 and 2) indicate that the method Xie statistically outperforms the other methods under consideration, including HR-SSC. However, this experimental evidence does not match the qualitative/quantitative results obtained on the larger dataset HSim-data and on its sample, which, on the contrary, indicate a better performance of the proposed method. This trend is validated also by the qualitative evaluation based on area and TDR/FDR as reported respectively in Sections 3.3.2 and 3.3.3.
In summary, according to the performance evaluation, HR-SSC achieves good qualitative and quantitative results with an adequate balance. Moreover, it detects hair regions rapidly by processes with limited complexity. The results have also demonstrated the effectiveness and the utility of the employment of saliency, shape, and color information for hair removal problems. Finally, the implementation does not require any extensive learning based on a high number of parameters and labeled training images, and its execution time is quite fast.
In future investigations, there is room to extend the comparative studies with other existing methods and to improve this work by applying more efficient and efficacy inpainting methods to increase the performance quality.

Data Availability Statement:
The data presented in this study are openly available at the following GitHub link: https://github.com/gramella/HR.