1 Introduction

1.1 Motivation

One of the most deadly forms of skin cancer is melanoma [1]. It refers to the malignancy of melanocytes. Although melanoma survival rate accounts to 20% when the disease metastasizes to other organs, the deadly disease is associated with high mortality and morbidity [2]. The melanocytic cells are confined to the skin; they are further liable to metastasize and spread to the lymph nodes. Several imaging modalities were developed to aid dermatologist in examining the pigmented skin lesions. One among the most popular imaging modalities used by dermatologists to identify the presence of melanoma is the dermoscope [3]. Dermoscopy is an in vivo non-invasive method that uses polarized light for evaluation of colors and microstructures of the pigmented skin lesions. Although dermoscopy provides better accuracy in comparison to the conventional ABCD (asymmetry, border irregularity, color, dermoscopic structures) criteria, the diagnostic precision is dependent on the dermatologist’s experience and is time-consuming. This discrepancy highlights the need for computer-aided diagnostic tool that provides objective and accurate diagnosis.

A complete computer-aided diagnosis (CAD) tool for melanoma diagnosis mainly consists of three major steps: segmentation, feature extraction, and lesion classification. Although these steps are performed sequentially, the major concern is that, the segmentation accuracy has a major decisive influence on the lesion diagnosis [4]. Irrespective of the surrounding skin, the region of interest (ROI) characteristics pre-dominantly effects the lesion classification. However, due to the smooth transition between the lesion and surrounding skin, hair artifacts, and variabilities in skin texture, the accuracy of segmentation is adversely affected. This paper aims to propose an effective system for detection of dermoscopic hair and segmentation of lesion. The system incorporates the domain knowledge of the skin lesions for ROI extraction.

1.2 Related work

The presence of hair greatly affects the accuracy of the segmentation algorithm. Thus, the primary step for the development of a CAD tool is the detection and exclusion of dermoscopic hair. The literature reports numerous studies in this regard [5,6,7,8,9,10,11]. Abuzalegah et al. [5] constructed directional filters by subtracting Gaussian filters from a set of isotropic filters. The two most widely used algorithms for hair detection include the dull razor [6] and E-shaver [7]. The former was based on using morphological operation whereas the latter was based on the use of Radon transform. It has been observed [8] that PDE (partial differential equation)-based techniques result in blur images. Morphological operators such as erosion and dilation were exploited by Fleming et al. [9]. A comparative study of hair detection and exclusion algorithm has been performed by Abbas et al. [10]. Most of the hair detection methods are based on the underlying assumption that the color of the hair is much darker than the surrounding skin. None of the methods reported in literature take into account the dermoscopic knowledge of the hair shafts, as a result of which certain hair pixels are erroneously classified as lesion pixels. The proposed method is based on 2D (2-dimensional) Gabor filtering using directional filters. The Gabor filter parameters are selected taking into account the dermoscopic knowledge of the hair shafts.

The hair detection process is followed by lesion segmentation, which forms the most crucial part of CAD system. Several segmentation techniques have been proposed in the past for segmenting the skin lesions [12,13,14,15,16,17,18,19,20,21,22,23]. These techniques can be divided into two categories as given in [1], i.e., low-level segmentation and high-level segmentation techniques. Low-level segmentation techniques are conventional approaches that include methods that are computationally simpler and faster and require post processing, whereas high-level segmentation techniques include those approaches that are built using sophisticated segmentation algorithms, to avoid post processing, and to deal with low-contrast lesion boundaries. Thresholding, region-based, and edge-based techniques belong to low-level techniques. The quantitative differences such as abrupt changes in the intensity values between the lesion and the skin form the basis of low-level segmentation techniques. Most of the approaches use a combination of two segmentation approaches, such as in [12] where fuzzy theory and thresholding were used. A fusion of thresholding methods was used by Celebi et al. [13], wherein a Markov random field (MRF) fusion strategy is adopted.

Soft-computing and deformable models belong to high-level segmentation techniques. Neural network and evolutionary computing algorithms form a part of soft-computing approaches [14, 15]. However, these techniques are associated with greater computational complexity. Recently, convolutional neural network (CNN) has garnered significant attention to increase the accuracy of segmentation [16,17,18]. Qui et al. [16] used a fully convolutional neural network with a pre-trained VGG 16-layer net. Yu et al. [17] adopted a residual learning technique. However, limited availability of training data, vanishing gradient, presence of artifacts, and poor contrast degrades the segmentation accuracy. Optimization techniques such as ant colony and dynamic programming [15, 19, 20] have also been used for ROI detection.

Deformable models belong to a category of high-level segmentation techniques [21,22,23], wherein the evolution and moving direction of the curve are determined by the speed function. Geometric deformable models have several advantages in contrast to the other segmentation methods. To name a few, (i) geometric deformable models form closed and smooth contours even in complex imaging conditions and presence of noise. This is mainly due to the fact that the geometric deformable models are driven by probability fields computed from image features; (ii) geometric deformable models possess the ability to handle topological changes; and (iii) in contrast to the low-level segmentation, deformable models avoid the necessity for post processing. However, there are two major issues associated with the deformable models. First, geometric deformable models are semi-automatic and require manual delineation of the contour close to the ROI boundary. Second, the speed function should be appropriately defined, such that the moving contour achieves a stable status when the lesion boundary is encountered.

1.3 Problem statement

Based on the literature, a clinically inspired framework must incorporate the major requirements mentioned below.

  1. 1.

    Effective hair detection and exclusion algorithm

  2. 2.

    An automated and effective skin lesion segmentation algorithm using chroma-based geometric deformable model

  3. 3.

    Achieve a balance in sensitivity and specificity in distinguishing the lesion from the skin

1.4 Contributions

The main contributions of the paper are as follows.

  • A novel and automated hair detection algorithm is proposed using dermoscopic knowledge-based 2D directional Gabor filters. To the best knowledge of the authors, the hair detection algorithm considering dermoscopic hair attributes is the first of its kind in literature.

  • An automated segmentation algorithm is proposed using geometric deformable models considering the chrominance characteristics of the lesions. Finally, we show that the proposed system has achieved an acceptable balance between sensitivity and specificity.

1.5 Comparison and novelty of the proposed work with the state-of-art methods

The novelty of the proposed system is twofold. Firstly, a dermoscopic inspired hair detection algorithm is proposed. In comparison to the hair detection methods proposed in literature [5,6,7,8,9,10], the proposed hair detection algorithm takes into account the dermoscopic knowledge of the hair shafts, thus avoiding an overlap between the lesion attributes and hair attributes. Barata et al. [24] used heuristic Gaussian parameters for detection of hair masks, whereas in the proposed method, the Gabor parameters are set according to attributes of dermoscopic hair shafts. In addition to this, rather than using an experimentally determined threshold as in [24], the proposed hair detection method automatically determines the threshold using gray-level based entropy thresholding.

Secondly, an automated lesion segmentation algorithm is proposed taking into account the chrominance characteristics of the lesions. In comparison to the method proposed by Ma et al. [4], the proposed method is completely automatic. Additionally, the method proposed in [4] takes into account the lightness and saturation values, consequently producing a higher overlap error in comparison to the proposed method. The lightness component greatly affects the color difference between the lesion and the surrounding skin, thereby causing unreliable segmentation. The proposed segmentation algorithm takes into account the lesion properties to mathematically define the speed function in comparison to other complex segmentation methods based on abstract image properties [12,13,14,15,16,17,18,19,20,21,22,23, 25]. Such an automatic and computationally simpler segmentation algorithm may be informative from a dermatologist’s perspective.

2 Methods

The proposed framework is succinctly described in this section. An overview of the proposed methodology is depicted in Fig. 1. The initial process includes pre-processing of the dermoscopic images to eliminate artifacts such as dark corners, ruler markings, hair, and dark frames. A bank of 2D Gabor filters is employed for the detection of hair masks. This is followed by automated segmentation of the dermoscopic images. To efficiently eliminate the dark corners, circular masks are created with a radius of c/2, where c indicates the image column dimensions. The mask generated for the dermoscopic image is illustrated in Fig. 2. These masks are subsequently overlaid on the lesion-segmented images to eliminate the dark corners. The proposed hair detection and lesion segmentation method is described in the following sections.

Fig. 1
figure 1

Overview of the proposed system

Fig. 2
figure 2

Illustration of mask. a Dermoscopic image. b Mask for image a

2.1 Hair detection and removal

A novel Gabor filter-based hair detection algorithm using dermoscopic knowledge is proposed. The motivation behind developing such an algorithm is (i) most of the techniques reported in literature are based on the underlying assumption that the color of the hair is much darker than the surrounding skin [5,6,7,8,9,10]. Such an assumption creates ambiguities in hair detection process, since the color of the lesion mainly relies on the localization of melanin [26]. In case of benign lesion, melanin is present in the upper and lower epidermis, and hence, these lesions appear dark brown to light brown or sometimes black in color. Thus, a significant overlap between the lesion attributes and hair attributes occurs. (ii) In case of lighter hair, considering the color differences between the hair and the surrounding skin would result in incorrect detection of the hair shafts. This signifies the fact that color variation difference is not the only criteria to be considered for developing an efficient hair detection algorithm.

The proposed hair detection algorithm takes into account the attributes specific to the dermoscopic hair (such as hair width and orientation). The band-pass frequency f of the Gabor filter is derived with respect to the width of hair shafts. The filter orientation (θ) takes into account the direction of the hair shafts. The width of hair shafts is computed by considering the details of the dermoscopic hair. Since these properties are unique to dermoscopic hair, an overlap between the lesion attributes and the hair features is eliminated. Thus, the novelty of the proposed hair detection algorithm is that the Gabor filter parameters are tuned by considering the properties of the dermoscopic hair.

The proposed hair shaft detection method starts by choosing the luminance component of the CIE L*a*b color space. The luminance component mimics the perceptual lightness response of the human visual system (HVS), and hence, it is used for processing. Further, the luminance channel is convolved with a bank of N + 1, 2D Gabor filters (N = 15). The response of Gabor filtering is as given in Eq. (1).

$$ R\left(x,y\right)=G\left(x,y\right)\times L\left(x,y\right) $$
(1)

where L(x, y) is the luminance component and G(x, y) is the real part of the 2D Gabor filter defined as given in Eq. (2).

$$ G\left(x,y\right)=\exp \left[-\pi \left(\frac{{x_q}^2}{{\sigma_x}^2}+\frac{{y_q}^2}{{\sigma_y}^2}\right)\right]\cos \left(2\pi f{x}_q\right) $$
(2)

where

$$ {x}_q=x\cos {\theta}_i+y\sin {\theta}_i,{y}_q=-x\sin {\theta}_i+y\cos {\theta}_i $$

θi is the filter orientation, f is the band-pass central frequency, and σx and σy indicate the standard deviation in x and y direction. Gabor filters are sinusoidally modulated Gaussian functions with major properties such as ability of tuning it to specific orientations, adjustable bandwidth, and robustness to noise.

2.1.1 Domain-specific estimation of Gabor parameters

The procedure for estimating Gabor parameters is adopted from Liu et al. [27] with certain modifications. The frequency f is derived with respect to the width of the hair shafts. It is set as given in Eq. (3).

$$ f=\frac{\beta }{t} $$
(3)

where β is the scaling constant associated with band-pass central frequency f and t is the hair shaft width. The normal terminal hairs viewed from trichoscopy (× 30 magnification) are more than 55 μm wide [28]. Therefore, to accommodate the thick and thin hair, the hair shaft width range is taken as 55–140 μm. Thus, the value of t is chosen as 4.6 (ratio of maximum range to magnification). The spread of the Gabor filter (σx) and elongation of filter (σy) are calculated as given in [27].

$$ \mathrm{Accordingly}\ {\sigma}_x=\frac{8\lambda t}{\alpha \beta \pi}\ \mathrm{and}\kern0.5em {\sigma}_y=0.8{\sigma}_x $$

where  λ =  √ (2 ln 2/π) is the wavelength of the cosine factor of Gabor function and α is the scaling constant associated with the orientation bandwidth. Here, the range of scaling constants α and β is given as 1<α ≤ 1.5,β = [0.5–1]. For the possible range of α and β values, the response images for 30 combinations of σx and σy were plotted. It is observed that for σx = 10 and σy = 8, the hair strands were appropriately detected. For values of (σx < 10, σy < 8), and (σx > 10, σy > 8),smoothed and zero response images were obtained respectively. However, none of the possible combinations of α and β values resulted in (σx < 10, σy > 8) and (σx > 10, σy < 8). The response images for the possible cases of σx and σy are shown in Fig. 3. The rotation parameter θ is varied in steps of \( \frac{\pi }{N}\Big({12}^{{}^{\circ}} \)) from 0° to 180°. It is observed that a decrease in the step size (12°) resulted an average increase in processing time from 4.5 to 9.8 s, without any change in the response. Subsequently, an increase in step size resulted in loss of detail in the response image. The value of N = 15 gives a step size of 12°, since the angle is varied from 0° to 180°; 16 directional filters expressed in the form of N + 1 are required. Thus, it can be inferred that the number of directional filters depends on the step size of rotation parameter θ.

Fig. 3
figure 3

Illustration of Gabor filter parameters for possible cases of [σx, σy].a Dermoscopic image. b [σx = 9, σy=7]. cσx =10, σy=8]. d [σx = 11, σy=9]

The output combination of the N + 1 filters is performed by retaining the maximum response at each pixel as given in Eq. (4).

$$ {r}_{\mathrm{max}}={\max}_{\theta_i}\left[r\left(x,y\right)\right] $$
(4)

The enhanced hair shafts are further extracted from the Gabor response by applying entropy-based thresholding using the gray-level co-occurrence matrix (GLCM). Entropy-based thresholding using GLCM is employed to extract the hair strands. The optimal threshold is computed by taking into account the spatial distribution of gray levels embedded in the co-occurrence matrix. The GLCM-based entropy is simple and contains most of the information for threshold computation. The GLCM matrix of the response image is divided into four quadrants (two local quadrants and two joint quadrants). The local quadrants are considered since they represent the gray-level transition that arises within the object and background of the image. The second-order entropy of the object HA(Th)) and background HC(Th)) is computed from the local quadrant as given in [29]. The local transition entropies are summed up to compute the total second-order entropy of the object and background (HT(Th)) as given in Eq. (5).

$$ {H}_T(Th)={H}_A(Th)\left)+{H}_C(Th)\right) $$
(5)

Finally, the gray level corresponding to the maximum HT(Th) is used as a threshold as given in Eq. (6).

$$ T=\arg \left[\max {H}_T(Th)\right] $$
(6)

The threshold T is used to segment the hair strands from the Gabor response image. Further, the isolated pixels are filtered out by applying connected component labelling. Consequently, Mumford-Shah-based inpainting [30] is applied to obtain the hair excluded dermoscopic image. Figure 4 illustrates the results of hair detection and removal. The proposed hair detection and exclusion algorithms also effectively eliminate the ruler markings present in the dermoscopic images. An illustration of the ruler markings detected is depicted in Fig. 5.

Fig. 4
figure 4

Hair detection and exclusion. a Original images. b Gabor response. c Hair masks. d Hair occluded dermoscopic images

Fig. 5
figure 5

Ruler marking detection. a Original images. b Ruler masks. c Ruler marking-occluded dermoscopic images

2.2 Segmentation of region of interest

The performance of the geometric deformable models mainly relies on the initial conditions used and the evolution of the speed function. Color plays a very important role in dermoscopy, since the color of melanin mainly depends on the extent of the localization in the skin. Thus, the segmentation approach is proposed by exploiting the aforementioned domain knowledge of skin lesions by considering the chroma component, rather than the conventional RGB channels. The ROI refers to the lesion area and non-region of interest (NROI) refers to the surrounding skin. An illustration of ROI and NROI in dermoscopic image is depicted in Fig. 6.

Fig. 6
figure 6

ROI and NROI in a dermoscopic image

2.2.1 Initial curve

The speed function governs the movement of the initial contour. Due to the variabilities in the intensity patterns of the dermoscopic images, the curve evolution method proposed in this work is flexible to contraction and expansion of the initial contour in contrast to the method proposed in [4]. The initial contour is placed close to the lesion boundary to speed up the curve evolution. A coarse initial contour is obtained by region growing the pixels into two groups. Region growing is performed by automatic selection of a seed point and a threshold t. The coordinates of maximum intensity are chosen as seed point; lesion pixels have darker intensities compared to the background skin pixels. The threshold is determined by fitting a polynomial of degree 4 to the histogram of the dermoscopic image. The degree of polynomial 4 is chosen optimally to avoid overfitting and under fitting issues. Further, the point of inflection on the polynomial is used as the threshold as illustrated in Fig. 7. The initial contour is given in Eq. (7).

Fig. 7
figure 7

Polynomial fitting to the smoothed histogram

$$ \varnothing \left(x,y,0\right)=\left\{\begin{array}{c}1\kern2em \mathrm{if}\ d\left(\ S\left(x,y\right),F\left(x,y\right)\right)\le t\\ {}0\kern2.25em \mathrm{if}\ d\left(\ S\left(x,y\right),F\left(x,y\right)\right)>t\end{array}\right\} $$
(7)

where S(x, y) indicates the seed point. F(x, y) is the dermoscopic grayscale image and d corresponds to the Euclidean distance. Thus, the internal and external regions of the initial contour ∅(x, y, 0) can be written as given in Eq. (8).

$$ {\displaystyle \begin{array}{l}{\varnothing}_I=\left\{\left(x,y\right)\left|\varnothing \left(x,y,t\right)\right\rangle 0\right\}\\ {}{\varnothing}_E=\left\{\left(x,y\right)|\varnothing \left(x,y,t\right)\le 0\right\}\end{array}} $$
(8)

2.2.2 Speed function

The CIE L*a*b color space provides the means to measure the perceptual differences between any two colors. By excluding L, the lightness component of the capturing device does not affect the color dissimilarities between the lesion and normal skin. Hence, the magnitude of the chroma component of the CIE L*a*b color space is used instead of the luminance component. An illustration of chroma component for the corresponding dermoscopic image is shown in Fig. 8. The chroma component is computed as given in Eq. (9).

$$ C\left(x,y\right)=\sqrt{a^2+{b}^2\kern0.5em } $$
(9)
Fig. 8
figure 8

Chroma. a Dermoscopic image. b Chroma component of a

Further, the speed function in [31] is modified as Eq. (10).

$$ F=\left({\left|\Big({F}_L\left(x,y\right)-{u}_L\right|}^2-{\left|{F}_L\left(x,y\right)-{v}_L\right|}^2\right)+\left({\left|{F}_S\left(x,y\right)-{u}_S\right|}^2-{\left|{F}_S\left(x,y\right)-{v}_S\right|}^2\ \right) $$
(10)

where

$$ {F}_L\left(x,y\right)=e\hat{\mkern6mu} -\frac{{\left(\ C\left(x,y\right)-{\mu}_L\right)}^2}{2{\sigma_L}^2} $$
(11)
$$ {F}_S\left(x,y\right)=e\hat{\mkern6mu} -\frac{{\left(\ C\left(x,y\right)-{\mu}_S\right)}^2}{2{\sigma_s}^2} $$
(12)

where uL and vL are the averages of FL(x, y) inside and outside the initial contour respectively. Similarly, uS and vS are the averages of FS(x, y) inside and outside the initial contour respectively. The statistical values μL and σL are the mean and standard deviation of the lesion region respectively and μS and σS are the mean and standard deviation of the normal skin region respectively. The aforementioned modification in the speed function facilitates the incorporation of lesion and normal skin information in the speed function. The minimization of the speed function is performed using gradient descent as given in Eq. (13).

$$ \frac{d\varnothing }{dt}=\frac{F}{\max (F)}+\alpha \times \left|\nabla \varnothing \left(x,y\right)\right| $$
(13)

As the initial curve covers the area of the lesions, the speed function facilitates the evolving curve to contract and expand until an appreciable difference in the chroma values with respect to the normal skin is encountered. The statistical values μL,σL, μS, and σS are computed approximately overlaying the initial contour obtained from the automatic region growing method on the dermoscopic image. The summary of the procedure is given in Algorithm 1 and Fig. 9 depicts the results of segmentation. It can be observed from Fig. 9d that the area differences between the lesion borders obtained by the proposed method and the ground truth masks are minimum, thus reducing the overlap error.

Fig. 9
figure 9

The proposed segmentation approach. a Original images. b Initial contour. c Segmented images. d Boundary of ground truth and segmented region overlapped on the original image (red corresponds to ground truth; yellow corresponds to segmented output)

figure e

The major contribution of the proposed work in terms of curve evolution lies in the modification of the well-known Chan-Vese speed function [31]. The modified speed function takes into account the lesion and the surrounding skin force. The lesion forces are computed by considering the statistical values such as mean and standard deviation of the lesion area and the surrounding skin area. Such a modification is performed to attract the motion of the curve towards the lesion boundaries. In case of skin lesions due to the inhomogeneous variabilities in the dermoscopic images, the curve evolution may lead to pseudo detection of the lesion boundaries. In the proposed approach, the initial curve gets attracted to the lesion boundaries irrespective of the background variabilities and low-contrast boundaries. Figure 10 illustrates the deformation of the curve using the proposed method and the conventional Chan-Vese method. It can be observed from Fig. 10 that the deformation obtained through the proposed method is robust to surrounding inhomogeneities in comparison to the conventional Chan-Vese method [31].

Fig. 10
figure 10

Comparative analysis of the proposed segmentation approach with conventional Chan-Vese. a Original images. b Deformation through conventional Chan-Vese. c Mask obtained by corresponding deformation given in b. d Deformation through the proposed segmentation approach. e Mask obtained by corresponding deformation given in d

3 Results

3.1 Dataset and evaluation parameters

The experiments were performed using a multi-source dataset of 1100 images taken from PH2 [32] and ISBI (International Symposium on Biomedical Imaging) 2016 [33] datasets. The PH2 dataset consists of 160 benign and 40 malignant melanoma lesions, whereas the ISBI 2016 dataset consists of 173 melanoma and 727 benign skin lesions. The datasets consist of segmented ground truths. Ground truth refers to the well-defined reference masks used for evaluating the efficacy of the proposed segmentation methods. The ISBI 2016 and PH2 databases contain ground truth masks created by an expert clinician using semi-automated and manual processes. The algorithms used in this work were implemented in MATLAB 2016®. The performance of the proposed lesion segmentation was evaluated using four metrics: sensitivity (SE), specificity (SP), accuracy (ACC), and overlap error (OE). The metrics are evaluated as given in Eqs. (14–17).

$$ \mathrm{SE}=\frac{\mathrm{TP}}{\left(\mathrm{FN}+\mathrm{TP}\right)} $$
(14)
$$ \mathrm{SP}=\frac{\mathrm{TN}}{\left(\mathrm{FP}+\mathrm{TN}\right)} $$
(15)
$$ \mathrm{ACC}=\frac{\mathrm{TN}+\mathrm{TP}}{\left(\mathrm{FN}+\mathrm{FP}+\mathrm{TN}+\mathrm{TP}\right)} $$
(16)
$$ \mathrm{OE}=\frac{\mathrm{Area}\left(S\oplus G\right)}{\mathrm{Area}\ (G)} $$
(17)

where true positive (TP) indicates the pixels which are accurately recognized as lesion pixels. False positive (FP) indicates the pixels incorrectly recognized as lesion pixels. True negative (TN) indicates the pixels which are effectively recognized as non-lesion pixels. False negative (FN) indicates the pixels which are incorrectly recognized as non-lesion pixels. S indicates the segmented image using the proposed method and G indicates the ground truth image. Overlap error is defined as a quantitative difference in the lesion area between the segmented result and the ground truth. It indicates an overlap difference between the lesion regions of ground truth and the proposed segmented result. Figure 11 provides an illustration of the overlap error between the ground truth and the segmented masks. Table 1 reports the mean and standard deviation values of the performance parameters for the proposed lesion segmentation method.

Fig. 11
figure 11

Illustration of overlap error. a Dermoscopic image. b Ground truth mask for a. c Segmented mask. d Non-overlapped area between b and c

Table 1 Results of quantitative analysis of the proposed lesion segmentation method

4 Discussion

In the present study, an automatic segmentation method is proposed. The discussion section is divided into three parts; the first part indicates the effect of pre-processing on segmentation accuracy, the second part deals with the effect of identification of initial contour automatically on segmentation accuracy, and the third part provides a comparative analysis between the state-of-the-art methods and the proposed method.

4.1 Effect of pre-processing on segmentation error

Dermoscopic images contain extraneous artifacts such as hair, dark corners, and ruler markings. Consequently, since these artifacts are darker than the surrounding skin, they hinder the process of segmentation. In order to eliminate the effects of these artifacts on lesion segmentation process, the dermoscopic images are pre-processed. In Table 2, a brief summary of the steps that are performed to study the effect of pre-processing on efficiency of lesion segmentation is described.

Table 2 Summary of steps for demonstrating effects of pre-processing

The overlap error as given in Eq. (17) is computed for segmented images with respect to the ground truth images for a subset of 24 images. It can be observed from Fig. 12 that the overlap error is significantly low with pre-processing in comparison to without pre-processing. This implies the efficacy of the hair detection algorithm in lesion segmentation.

Fig. 12
figure 12

Effect of pre-processing on segmentation accuracy

4.2 Statistical analysis to assess the effect of initial contour on performance

A paired t test is conducted to test the hypothesis stated below. Paired t test is used because it gives the statistical significance, by considering the effect of change on the segmentation accuracy after the application of color information-based deformable model [34].

  • Statement: The accuracy of ROI detection has significantly improved by employing color information-based deformable model segmentation at 5% significance level.

  • Step 1: Form alternate and null hypothesis based on the statement.

  • Null Hypothesis (Ho): There is no significant increase in the lesion segmentation accuracy by employing color information-based active contour segmentation (Ho: μ1= μ2).

  • Alternate Hypothesis (Ha): There is significant increase in the lesion segmentation accuracy by employing color information-based deformable model segmentation (Haμ1< μ2).

According to paired t test, if the value of tcalculated is greater than tstatistic, then, the null hypothesis falls in the rejection region. The value for tcalculated is calculated from the sample data as given in Eq. (18) and the value of tstatistic is obtained from Student t-distribution [34]. To perform the paired t test, for PH2 and ISBI 2016 datasets, the sample sizes chosen are 34 and 24 respectively. The minimum sample size required for performing the paired t test is calculated by considering the mean and standard deviation of differences for the paired samples by using the Medcalc statistical software [35]. The detail description of the sample size calculation is given in [36]. The first pair consists of accuracy values obtained from the automatic region growing (initial contour), while the second pair consists of accuracy values post segmentation (initial contour + deformable model).

$$ {t}_{\mathrm{calculated}}=\frac{\overline{D}}{\sigma /\surd n} $$
(18)

where \( \overline{D} \) is the mean of differences, σ is the standard deviation of differences, and n is the sample size. Using Eq. (18), the value of tcalculated obtained for PH2 dataset using 34 samples is 1.771, and from Student’s t distribution for 5% significance level, the value of tstatistic obtained is 1.645. Similarly, the value of tcalculated obtained for ISBI 2016 dataset using 24 samples is 2.44, and from Student’s t distribution for 5% significance level, the value of tstatistic obtained is 1.714. Since tcalculated > tstatistic, for both the datasets, the null hypothesis is rejected. Thus, the alternate hypothesis is accepted, implying the fact that the proposed segmentation method has significantly improved the performance accuracy.

Figures 13 and 14 show the box plots for coarse and fine segmentation for PH2 and ISBI 2016 datasets respectively. Coarse segmentation refers to the initial lesion contour obtained through region growing and polynomial curve fitting. Fine segmentation refers to the final lesion contour obtained after application of chroma-based deformable models. It can be observed that a significant improvement in the performance can be observed after application of chroma-based deformable models (fine segmentation). The box plots indicate the average performance values for 900 and 200 images of ISBI 2016 and PH2 databases respectively. The significant improvement in the performance values after the application of chroma-based deformable models signifies the efficacy of the proposed method.

Fig. 13
figure 13

Box plots for PH2 dataset. a Sensitivity. b Specificity. c Overlap error. d Accuracy

Fig. 14
figure 14

Box plots for ISBI 2016 dataset. a Sensitivity. b Specificity. c Overlap error. d Accuracy

4.3 Comparative analysis

A comparative analysis of the proposed method with the state-of-the-art lesion segmentation methods is illustrated in Table 3. A brief overview of the pros and cons associated with segmentation approaches stated in Table 3 in comparison with the proposed lesion segmentation method is discussed in this section.

Table 3 Comparison of the proposed method with state-of-the-art lesion segmentation methods

Recently, CNNs have been used for segmentation of skin lesions. Yuan et al. [18] proposed an automated skin lesion segmentation technique by leveraging 19-layer deep CNN. In addition to this, the loss function based on Jacquard distance is designed to handle lesion-background imbalance. Although good segmentation accuracy was achieved, automatic parameter tuning posed certain difficulties leading to few over and under segmentation errors. Yu et al. [17] proposed deep residual networks of more than 50 layers for segmentation and classification of skin lesions. The deeper network produced more richer and distinguishing features for melanoma recognition. However, the two-stage framework was computationally expensive and suffers from limited data problem. Deeper networks face degradation problem, which becomes severe as the number of layers increases. Bozorgtabar et al. [37] proposed a super pixel-based fine tuning method to enhance CNN-based lesion segmentation. The super pixel approach learns a global map for skin lesion and also acquires information about the lesion boundary. However, the super pixel fine tuning method is incorporated only in the last layer of the CNN and is considered rudimentary in nature. Additionally, the differences from the training dataset are not considered for learning, which is the major weakness of the method.

An automatic skin lesion segmentation method using Delaunay triangulation was proposed by Pennisi et al. [38]; the method is completely automatic and computationally simpler. However, the segmentation method is strongly sensitive to images containing irregular borders and structureless areas (in particular malignant lesions). A robust saliency-based skin lesion segmentation framework is proposed by Ahn et al. [39]. The method uses reconstruction errors from a sparse representation model. The reconstruction error is refined by employing a Bayesian framework for accurate detection of lesion boundaries. Although good segmentation accuracy was achieved by exploiting the human visual system, the method failed to identify small, visually indistinctive lesions and lesions present at the image boundary. Fan et al. [40] proposed an automatic segmentation that initially enhances the dermoscopic image by fusing color and brightness saliency maps. Further, the image is segmented using Otsu threshold. Although the segmentation method was robust to challenging conditions, the optimization function used to improve the segmentation accuracy relies on the histogram distribution of the enhanced image, producing undesirable segmentation in the presence of artifacts.

In contrast to the segmentation methods proposed in [17, 18, 37,38,39,40], the proposed segmentation algorithm is computationally simpler, works efficiently on smaller and large datasets, is independent of the skin lesion type (benign/malignant), and provides robust segmentation irrespective of the size and position of the lesion. Additionally, robust segmentation in the presence of noise with a low overlap error rate is obtained.

5 Conclusions

A novel approach for dermoscopic hair detection and lesion segmentation is proposed. The proposed algorithm takes into account the domain knowledge of the skin lesions and defines the speed function based on chroma information and statistical values. The curve evolution stops at the lesion boundary. Numerical experiments illustrate the efficacy of the algorithms. The implementation issues are discussed with the aid of quantitative and qualitative analysis. In comparison with the other algorithms, the novel approach uses the color information from the dermoscopic images. Color plays a prominent role in dermoscopy, since the color of the lesion is a pathologically significant feature for malignancy detection. Hence, the proposed segmentation approach exploits the color property of the skin lesions. The proposed hair detection method takes into account the width, magnitude, and direction of the hair shafts for efficient detection of the hair. The segmentation approach is fully automatic without the need to explicitly define the initial contour. Future work involves the use of color information to extract the color features for classification of skin lesions.