Keywords

1 Introduction

The medical field is continuously striving for developing computer-aided techniques for the detection of different types of cancers in their early stages. One such type of cancer that needs attention is skin cancer. In skin cancer, the cell grows in an abnormal manner leading to serious cancerous tissues in the body. These cells spread from the primary location to different parts of the body and affect those parts leading to cancer. More than 90% of skin cancer cases around the globe are the result of harmful UV radiation exposure. One of the major types of skin cancer due to radiation exposure is melanoma skin cancer which is witnessed prominent evidence in white skinned population across the globe [7, 13]. Early detection of this cancer helps in reducing the mortality rate. Preventive solutions include the design of a non-invasive computer-aided system to analyze dermoscopic images of skin lesions [2] for early detection. These dermoscopic images contain artifacts such as hairs and unwanted spots that need to be removed before the classification process. Asymmetry, Border, Color, and Diameter (ABCD) features are widely used for skin cancer detection. Many existing methods are based on the detection of lesion boundaries using segmentation, but these lesions are hindered due to the hairs present in the images. If the color of hair is similar to the lesion, they are considered a lesion else considered a split in the lesion. Several techniques have been developed for addressing this kind of issue, One of the common techniques is an application of a low pass filter to remove hairs as they detect low-intensity pixels i.e. thin and light hairs. However, it does not remove thick hair. Similarly, averaging filter results in smoothing which leads to the loss of necessary information from the image [6].Deep learning models have been used widely for detection of skin lesion and disease. VGG-16 pretrained model is used for skin cancer detection and compared with RESNET-50 by the authors [10] This paper presents enhanced methods for the detection and removal of hairs from dermoscopic images and a comparative analysis of those methods with existing hair removal approaches. The paper is organized as follows: Sect. 2 presents an overview of existing approaches, the Proposed system is presented in Sect. 3, results are illustrated in Sect. 4, and conclusions are drawn in Sect. 5.

2 Related Work

Hair detection and removal is a primary and important stage in skin cancer detection, if not handled properly, greatly affects the classification accuracy leading to a wrong diagnosis. Therefore, there is a need to design an automated technique for the same while preserving lesion features. Some of the well-known approaches used in literature are Dull Razor (DR) [8], Adaptive Principal Curvature (APC) [18] and E- shaver [6], etc. Related work introduces the basic and most widely used hair detection and removal approaches stated above. The Dull Razor algorithm involves steps such as bottom hat filtering, thresholding, and inpainting. Commonly extracted features include ABCD features, Gray-Level Co-occurrence Matrix (GLCM) texture features, Deep features, etc. from the Dull Razor applied images. Multi-class classification is performed to classify cancer into various categories [4, 5, 11, 17] after extraction of texture and statistical features. Dull Razor is fast and efficient at hair removal but fails to detect and remove thin hairs or hairs in the shade from dermoscopic images. E-shaver algorithm utilizes edge detection operators for detecting hairs in combination with different filters to detect dark and light hairs. Basic image processing operations of averaging and thresholding are also applied to obtain the mask to be applied for the inpainting task. Inpainting is performed using the interpolation method, the E- shaver algorithm leaves a grey shadow at the hair location as smoothing was not performed. Another approach similar to E-shaver is Virtual shave [3], which uses a top hat filter to detect the hairs followed by the application of morphological operations. Inpainting is performed using PDE based approach that replaces hair pixels with its neighborhood pixels, the virtual shave was applied on 20 images, test on a large dataset is required to generalize the methodology used.

Some of the researchers used APC technique for hair detection and removal. The APC algorithm uses the hessian matrix for hair detection and removal, segmentation is performed using Otsu’s thresholding. ABCD features are extracted and further used for classification [18], a subset of images was used which have a different set of resolutions so there is difficulty in defining the diameters of skin lesions across images. A similar approach was utilized for the early detection of skin cancer using the Adaptive Contour Technique (ACT) and ABCD features [16]. Many researchers adapted image processing operations such as noise reduction, grayscale conversion, and thresholding for hair detection and removal followed by lesion segmentation. ABCDE features are extracted and classification is done using KNN. However, this technique does not give good accuracy [9, 20].

3 Hair Removal Techniques

This section presents 8 different methods which include variations in terms of the color space such as RGB, HSV, and YCbCr, and hybridization of existing methods to improve the performance of the hair detection and removal process. The Dataset images are resized to 512\(\,\times \,\)512 before being fed to the below algorithms for processing.

  1. 1.

    Modified Dull Razor with RGB Plane:- In this, DR [8] algorithm is applied on RGB planes separately, and further the output is enhanced by additional morphological operations (dilation & erosion) to generate individual plane masks. The individual mask is used to obtain the final mask by performing a logical AND operation between Red and Green plane values followed by an OR operation with the Blue plane values, steps shown in Algorithm 1.

    figure a
  2. 2.

    Modified Dull Razor with HSV Plane:- In the hair detection and removal process, color description plays an important role which is very well represented by the HSV model and the RGB model. V plane is selected for further process. This methodology involves the use of HSV instead of RGB along with Modified DR as shown in Algorithm 2.

    figure b
  3. 3.

    Modified Dull Razor with YCbCr Plane:- YCbCr representation produces better results compared to RGB in many skin segmentation approaches [14]. This methodology uses the information from the Y plane of YCbCr im- age. The Y plane is fed as input to the Modified DR algorithm. The steps of Modified DR on the Y plane enhance the process of hair removal as represented in Algorithm 3.

    figure c
  4. 4.

    Dull Razor based Adaptive Principal Curvature:- The original RGB image is processed using the DR algorithm and the output of DR is fed to the APC algorithm for further processing. The mask of APC is used for inpainting and producing the final hair-removed image. The steps are shown in Algorithm 4.

    figure d
  5. 5.

    Modified Dull Razor with RGB Plane based Adaptive Principal Curvature:- The steps of the Modified DR algorithm are applied to the input image and the inpainted image is fed to the APC. The Combination of Modified DR and APC yields improved resultant hair-removed images (Algorithm 5).

    figure e
  6. 6.

    HSV Plane based Adaptive Principal Curvature:- In this methodology, the RGB image is converted to HSV and V plane is selected for next stages. The Modified DR is applied on V plane, inpainted image is passed to APC algorithm as represented in Algorithm 6.

    figure f
  7. 7.

    YCbCr Plane based Adaptive Principal Curvature:- The RGB image is converted to YCbCr and Y plane is selected for further processing. Filtering is performed on Y plane using prewitt edge detection mask followed by thresholding. Prewitt mask provides clear detection of hair pixels so prewitt operator is used as discussed by the authors [3]. Hessian image is generated using APC algorithm and morphological dilation is applied which is followed by image cleaning to obtain the final mask. This mask is inpainted on original image to obtain the hair removed image. This process is demonstrated in Algorithm 7.

    figure g
  8. 8.

    Modified E-shaver Algorithm:- The E-shaver Algorithm discussed in literature section uses edge detection operations and threshold mechanism for detecting presence of light hairs and dark hairs. Experimentation was carried on 5 operators and one was chosen for analysis . The proposed Modified E-shaver algorithm uses the operator analysed by the researchers in E-shaver algorithm with addition of steps such as image blurring, removing noise pixels to enhance hair detection and morphological operations. The steps of the algorithm are stated in Algorithm 8.

    figure h

4 Implementation Details

The proposed system is implemented in Google Colab Environment using Keras library. The VGG-16 [10] network was trained from scratch with randomly initialized weights and using the Adam optimizer with a learning rate experimentally set to 10-4. Input shape of image is set to (224,224,3), no of epochs used in training is 30. The loss function applied is the categorical cross entropy and metrics considered is accuracy.

5 Result Analysis and Discussion

The results of different proposed techniques for hair detection and removal are presented using visual and statistical representations along with classification using VGG-16 pre-trained model. Classification results are calculated on 1489 images from ISIC-2020 dataset [15] which consists of 488 melanoma images and 1001 non melanoma images. Sample visual results for proposed hair removal techniques are presented for images shown in Fig. 1.

Fig. 1.
figure 1

Sample Images from ISIC 2020 Dataset [15]

Figure 2 shows results of DR and variants of DR respectively with intermediate steps. The Input image undergoes grayscale conversion, black hat filtering and thresholding as shown in the Fig. 2a. Final image represents the inpainted output with proper hair removal image. Similarly, Fig. 2b shows all intermediate results for Modified DR. Figure 2c shows all the results for Modified DR with HSV. This method produces some noisy effect in the final hair removed image. In Fig. 2d, Y plane undergoes steps of DR that yields useful mask for final step of inpainting with clear hair removed output.

Fig. 2.
figure 2

Visual Results of Dull Razor and Variants

Figure 3 shows output of APC and its variants applied on the dermoscopic images for hair detection and removal. The Fig. 3a shows visual results of all the steps of APC. The final inpainted image still consists of presence of some hair artifacts. Similarly, Fig. 3b shows output of hybridization of DR and APC. It is observed that the final inpainted image shows skin lesion clearly but with blur background. Figure 3c shows steps of Modified DR applied on input image followed by APC on the mask of Modified DR with RGB plane. The final inpainted image is clear. Figure 3d shows intermediate steps of HSV based APC. Here also inpainted image shows few hair artifacts. The Fig. 3e shows visual results of YCbCr based APC. In the final hair removed image skin lesion is clearly visible with no background noise. The results of Modified E-shaver are shown in Fig. 3f. This algorithm also gives clear visualization of skin lesion.

The set of proposed algorithms are also evaluated using statistical parameters such as Accuracy (ACC), Sensitivity (SENS), Specificity (SPEC), False Positive Rate (FPR), Peak to Signal Noise Ratio (PSNR) & Structural Similarity Index (SSIM) on various input images [1, 12, 19]. Analysis is done in terms of performance metrics for various method on input images as shown in Fig. 1. Accuracy of 79% is achieved for Modified E-shaver and DR algorithm as shown in Fig. 4a, b and e. Sensitivity of 100% is achieved for Modified DR_YCbCr as shown in Fig. 4b, c and for Modified DR_HSV based APC as shown in Fig. 4e. Specificity of 95% and 94% is achieved for DR based APC algorithm as in Fig. 4f and d respectively. FPR value achieved is 5% for DR based APC for ISIC_06, followed by 9% for ISIC_01 as shown in Fig. 4f and a respectively. PSNR obtained is 45% for Modified E-shaver algorithm and 42% for APC algorithm as shown in Fig. 4e and a respectively. Highest SSIM of 99% is obtained for Modified E-shaver algorithm for ISIC_05, followed by 95% is obtained for Modified E-shaver and Modified DR_RGB algorithm for ISIC_02 as shown in Fig. 4b. Overall analysis indicates that Modified E-shaver and Modified DR variants combination yields better results for all the selected sample images. The other combinations or hybridisation show satisfactory performance for all the performance metrics that indicates a successful outcome of the proposed algorithms.

Table 1 presents classification results of proposed techniques and original dataset obtained for VGG-16. Analysis indicates that proposed hair detection and removal methods performed with better efficiency compared to original dataset.

Table 1. Classification Results of VGG-16
Fig. 3.
figure 3

Visual Results of Adaptive Principal Curvature, its Variants and Modified E-shaver

Fig. 4.
figure 4

Statistical Analysis of ISIC Images.

6 Conclusion

Skin cancer has been studied for decades and many tools and techniques have been developed for accurate and fast detection of the same. The first stage of skin cancer detection involves the detection and removal of hairs present in the skin region. Different techniques available include DR, E-shaver, APC, etc. The analysis of these existing methods provides insights into the need for improvement in the first stage for improved performance. Hybridization of various existing techniques with different color spaces such as HSV, RGB, and YCbCr are presented. The algorithms are evaluated using standard performance metrics which indicate the higher performance of the proposed algorithms. The classification results for sample images from ISIC-2020 dataset is obtained using the VGG-16 model for the proposed methods. The Hybridization methods have higher results compared to the original dataset images. Future work includes designing background invariant algorithms for hair detection and removal along with fused feature extraction methods and its impact on classification accuracy.