Skin Lesion Segmentation Using Image Bit-Plane Multilayer Approach

: The establishment of automatic diagnostic systems able to detect and classify skin lesions at the initial stage are getting really relevant and e ﬀ ective in providing support for medical personnel during clinical assessment. Image segmentation has a determinant part in computer-aided skin lesion diagnosis pipeline because it makes possible to extract and highlight information on lesion contour texture as, for example, skewness and area unevenness. However, artifacts, low contrast, indistinct boundaries, and di ﬀ erent shapes and areas contribute to make skin lesion segmentation a challenging task. In this paper, a fully automatic computer-aided system for skin lesion segmentation in dermoscopic images is indicated. Adopting this method, noise and artifacts are initially reduced by the singular value decomposition; afterward lesion decomposition into a frame of bit-plane layers is performed. A speciﬁc procedure is implemented for redundant data reduction using simple Boolean operators. Since lesion and background are rarely homogeneous regions, the obtained segmentation region could contain some disjointed areas classiﬁed as lesion. To obtain a single zone classiﬁed as lesion avoiding spurious pixels or holes inside the image under test, mathematical morphological techniques are implemented. The performance obtained highlights the method validity.


Introduction
The adoption of digital technology in the healthcare environment is growing steadily each year with forecasts of further increments in the near future. Healthcare information management systems, electronic medical records, mobile health services, video-consulting, and remote patient monitoring systems are some of the information technology-generated products [1,2]. As a consequence, the overall health of people continues to improve in many ways as a consequence of advances in medical technology, research, and resources set aside to public health and education [3]. Devices, such as sensors, communication systems, and computers, allow the implementation and diffusion of proper and suitable technologies for acquiring, processing, analyzing, and transmitting health-related data [4,5]. The produced systems support medical teams and specialists for detecting, localizing, and screening of abnormalities in such a way that an early risk assessment and an accurate diagnosis is made [6][7][8]. Many improvements are expected in different medical environments, such as the oncological sector since cancer is one of the leading causes of mortality. Among cancerous pathologies, skin melanoma incidence has grown about 15% over the last 10 years compared with the previous decade [9]. It is considered the deadliest type of skin cancer with a high death rate if diagnosed too late: Melanoma accounts for approximately 75% of deaths associated with skin cancer [10]. Therefore, early detection of melanoma is crucial for prognosis improvement.
New approaches have been developed for an early and accurate diagnosis of melanoma, such as biophysics analysis [11], imaging techniques (i.e., dermoscopy), diagnostic algorithms, and image analysis-based criteria [12,13]. Nevertheless, clinical diagnosis is still challenging since it depends on human vision and physician experience and expertise. For these reasons, computer-aided detection and diagnosis (CADe and CADx) systems are becoming effective means to help specialists in detecting and preventing neoplastic pathologies [14]. Image segmentation is a fundamental phase of CADe systems and it is a difficult task in the specific case of dermoscopic image analysis for skin lesion classification. In fact, low contrast between lesion and skin area around lesion, irregular lesion border, artifacts (such as bubbles or body hairs), blood vessels, lack of color uniformity inside nevi, and depigmentation make the segmentation a challenging task. An accurate segmentation is crucial for a correct diagnosis because it makes it possible to extract highlight information on border structure such as asymmetry and lesion area irregularity [15,16].
In this paper the lesion segmentation problem is addressed: An automatic and real-time method for dermoscopic images able to segment skin lesions and identify/highlight border also in the presence of imperfections (such as hairs, bubbles) is presented. In the proposed method, a preprocessing phase aimed at reducing the image noise and at preserving all the spatially correlated information was first performed using the singular value decomposition (SVD) technique. The preprocessed Red Green and Blue (RGB) image under test was afterwards decomposed into a frame of bit-plane layers. In order to extract all the coherent information, thus preserving the contour transitions, a bit-plane binary orthogonalization-like was then implemented and the image segmentation was achieved by appropriately summing up the mostly correlated singular vectors. Morphologic techniques were conveniently used to reduce spurious pixels in segmented regions.
Adopting the publicly available PH 2 database [17] as test bench, experimental results showed good performance and easy hardware development.
In Section 2, a brief review of the most recent and popular segmentation methods indicated in literature is given. Section 3 deals with the techniques used for the procedure development, while in Section 4 the conceived method is described in details, and in Section 5 the database used to test the algorithm is presented. Experimental results and discussions are highlighted in the last section of the paper.

Prior Research
In recent years, several studies have been presented in computer-aided melanoma detection and diagnosis areas [18]. Pigmented skin lesion detection and diagnosis is a crucial and challenging task in dermoscopic images because some elements/factors could alter and corrupt the image, impairing the development of high-performance CADe systems. An accurate segmentation phase enabling the partition of the image into distinct and non-overlapping regions is a fundamental step for a computer-based automatic diagnosis [19].
Various methods have been indicated in literature for the segmentation phase [20][21][22]: Some of them are based on easy and fast computational procedures needing post-processing steps (thresholding, region-and edge-based approaches); other methods combine simple segmentation techniques or perform high-level procedures to avoid post-processing and to reach good performance in presence of low contrast lesion boundaries, too (soft computing methods, deformable models, and so on).
Benefits and robustness of thresholding, and edge-based and region-based methods for the segmentation of dermoscopic images are exploited in [23]. Using active contours, the proposed method adopted adaptive thresholding to select an initial contour and then maximized the Kullback-Leibler divergence of the gray level distribution between lesion and skin to fit a curve to the lesion boundaries. As post-processing phase, lesion periphery was extracted to detect melanoma using image features that were based on local binary patterns. The region-based active contour was, also, the key technique for lesion outline delineation phase in [24]. This procedure, after a preprocessing step for hair and shading effect attenuation, convert the RGB image into gray level image by applying the particle swarm optimization algorithm for the selection of best coefficients. The obtained gray level image was then used as input for the multi-Otsu method, which provides initial contour for border detection using active contour. Also, in [25] a geometric deformable model was adopted to effectively differentiate a skin lesion from surrounding tissue. The preprocessing phase of the procedure in [25] detected hairs, taking into account the dermoscopic knowledge of hair shafts. A 2D-Gabor filter was used, whose parameters were tuned by considering the hair properties: The filter band-pass and orientation take into account the width and the direction of hair shafts, respectively. In the next phase, the implemented deformable model used a speed function which considered the lesion chrominance properties to stop the evolution at the lesion boundary. Automatic initialization of the initial contour and chrominance-based speed function made a robust and flexible segmentation possible. In contrast with a full automatic approach, the manual initialization was adopted in [26] both to reduce the preprocessing phase and to avoid a lowering of the algorithm performance when contiguous area of the initial curve included regions with very different colors from normal skin. The RGB color space was converted for the purpose of using the image color information to distinguish normal skin from lesions. Moreover, the differences in color channels were combined together for deformable model speed function and stopping criterion definition.
With the aim of maximizing the discrimination between lesion and background skin pixels, color channels from various color spaces were analyzed in [27] for the development of an automatic border detection system. The procedure, after the identification of the most efficient color channels, proposed a two stages thresholding to identify firstly the core lesion adopting the Otsu thresholding method and then the edge lesion area by the implementation of a clustering-based histogram thresholding method on the optimal color channels previously determined.
The combination of multiple color spaces was used in [28] for the identification of pixels belonging to skin after an equalization phase for the image contrast enhancement. A triangular tessellation of the edge of the detected skin lesion image was computed using Delaunay triangulation. The triangle area was in compliance with the extracted edge and, in fact, homogeneous and heterogeneous regions produced large and small triangles, respectively. A threshold was used for merging the regions by means of a normalized boundary cost.
A level set-based segmentation method, which integrated texture features and distinguished the feature importance in response to different inner textures, was implemented in [29]. After a preprocessing step aimed at hair/black frame removing and potential lesion area detecting, the prior color probably distribution in the localized area and the Gabor wavelet-based features were extracted and integrated in the definition of the energy functional. For global optimization achieving, a Markov chain Monte Carlo sampling approach guided by the combined energy was adopted.
Aiming to improve the algorithm performance, Khan et al. [30] implemented two different segmentations on the image under test, adopting a probabilistic approach. After a lesion contrast enhancement by a stretching technique, which used low and high threshold values, the mean of the uniform distribution and the mean deviation of the normal distribution were evaluated on the enhanced image and their values were inserted in an activation function to perform two different segmentations. A fusion of segmented images was implemented by utilizing additive law of probability.
To avoid sophisticated pre-and post-processing procedures, convolutional neural network was adopted in [31] for the development of a method able to handle dermoscopic images under various acquisition conditions. By exploiting 19-layer deep convolutional neural network (DFCN) with a little over 290,000 trainable parameters, the indicated system used a limited training dataset for an efficient learning. The DFCN architecture consisted of a convolutional path, in which contextual information was aggregated via convolution and pooling, and a deconvolution pathway in which the full image resolution was recovered by deconvolution and upsampling. To eliminate the need of sample reweighting, a novel loss function based on Jaccard distance, was adopted instead of the widely used cross entropy between predicted values and targets.
The same loss function was used in [32] to implement an efficient segmentation procedure under limited computational resources. The method was based on fully convolutional neural network and consisted of an encoder-decoder structure. The encoder was composed of four dense blocks with each block having four layers, while the decoder had four blocks, with each block having three layers. High-resolution features from early layers as well as high-semantic features of deeper layers were processed by the network because multiple skip connections were arranged between encoder and decoder. Also, in [33] the fully convolutional neural network approach was adopted with multiple key improvements. In fact, the adoption of multistage fully convolution networks refined the skin lesion segmentation results across multiple stages. The complementary multistage segmentations were then integrated in parallel to obtain the final results.
To ensure visual consistency in the segmented region boundaries for skin lesions characterized by fuzzy boundaries and/or low contrast to the background, Bi et al. [34] adopted a deep class-specific learning and a probability-based stepwise integration of the derived class-specific segmentation maps. Based on the image classification probability, complementary segmentation results produced by different deep class-specific learning models were integrated to iteratively maximize label agreement between neighboring pixels. In [35], the deep learning approach was exploited to develop a resolution-independent segmentation method in dermoscopic images. A deep convolutional neural network named as You Only Look Once (YOLO) [36] and the GrabCut algorithm [37] combined in a pipeline architecture was proposed [35]. After a preprocessing phase aimed to remove hairs on lesion, skin lesion localization was performed adopting the YOLO network, which makes the transformation of a detection matter into a regression issue possible. Adopting the GrabCut algorithm and morphological image processing operators for removing artifacts, promising results were obtained by the implemented procedure which was image dimension-independent.
The over-segmentation of skin lesion image into several super-pixels was the key idea to develop a method which is able to deal with the presence of hair in the original image without any additional steps [38]. The Simple Linear Iterative Clustering algorithm was adopted to over-segment the RGB dermoscopic image and then a binary search was performed to find the suitable threshold for merging all the super-pixels into the class of lesion area and healthy skin region. The mean color intensity of each super-pixel was used as merging criterion.
With the aim of developing an accurate procedure which is characterized by a simple, fast, and flexible approach, Aljanabi et al. used a 2D median filter and morphological filtering based on Gaussian kernel for hair removing and image smoothing against noise [39]. The detection of skin lesion boundaries was performed by adopting the artificial bee colony algorithm, which makes possible the definition of an optimal thresholding value based on the histogram of the enhanced image.

Adopted Techniques
In the conceived method, the singular value decomposition (SVD) method was used for dermoscopic image preprocessing stage aimed at reducing the noise inherently present on skin lesion image. The recourse to SVD, instead of a standard low pass filtering technique, was explained by its capability of preserving patterns and correlated information and discarding spatially uncorrelated terms (such as noise and quantization) without affecting significantly the global image quality. Therefore, the proposed procedure was data adaptive.
The SVD technique performed the factorization of a matrix into three components as follows [40,41].
where A is the original data, U and V orthonormal matrices, and S a diagonal matrix, respectively. Matrix A can be decomposed into three matrices, as indicated in Equation (1). V is the matrix of coefficients able to orthogonalize A into the product of U and S, the matrix of "singular values".
The columns of U and V are indicated as the left and right singular vector matrices of A, respectively, while the values along the diagonal of S are arranged in descending order. Such values represent the "importance" of each singular vector in U in describing the entire image.
The SVD aim is to store the most correlated information present in the image in the first singular vectors; the lower singular values associated to singular vectors can be related to uncorrelated information and noise.
The SVD capacity of pulling out the correlated components of an image and exploiting the image information into mutually uncorrelated components, sorted by their specific energy, has been exploited for noise reduction in dermoscopic images.

Implemented Method
The aim of the implemented segmentation procedure was the generation of a mask, which provides an accurate separation between lesion area and surrounding healthy skin. In this way, useful information about the lesion border can be extracted by analyzing the obtained mask.
For this purpose, the image bit plane inherent information is exploited to extract a detailed and noise-free image segmentation. Lesion segmentation problem was addressed with the search of locally correlated color components. Deepening the observation on the spatially correlated information, also low terms were considered, thus making possible the detection of even low-energy patterns on the image.
To pursue this task, the information of bit planes in the digital image was exploited to highlight the principal areas in the image under test which show a strong spatial correlation.
The following phases have been implemented:

Preprocessing Phase
To reduce artifacts and noise generated during the image acquisition phase, the SVD decomposition was carried out for each plane of the RGB image under test.
The image subspace and the noise subspace can be identified by implementing the thresholding technique on the singular values as most of the image energy was confined in the highest singular values (Figure 1). Neglecting the lowest singular values in the image decomposition allows reconstructing a dataadaptive low pass filter, not affecting significatively the pattern structures in the image. To have a denoised image, the reconstruction of the matrix from its SVD decomposition technique was carried out, setting to zero only a given (low) percentage of the lowest singular values in expression (1).
Depending on the specific image to analyze, a variable threshold was adopted for singular value splitting. Therefore, an image-based selection was performed, tuning the chosen singular values for each acquired image. Consequently, the implemented data adaptive preprocessing phase performed differently on each image while preserving the largest part of image energy and neglecting orthogonal components with lowest energy.

Segmentation Phase
The RGB dermoscopic images adopted as test bench used 8 bit planes for each color component, so that 24 bit planes were extracted from each image under test and used for the skin lesion segmentation aim. A three-dimensional binary data set was achieved by stacking the afore mentioned bit planes on each other. This stack of bit planes, named BPS, represents the raw data of this segmentation procedure. Every bit plane of BPS contained local specific information about a distinctive pattern occurring at a certain reflectance level on the image.
Since BPS provides a lot of redundant data, a redundancy reduction was carried out using a specific procedure to obtain a sort of bit plane orthogonalization. The proposed procedure aimed to detect a partition of the image into areas containing pixel levels which were both mutually strongly correlated and uncorrelated/lowly correlated with pixels in different areas.
To enhance the inherent bit planes' correlation, the gray encoding was used. Because each bit plane of BPS was in a binary form, simple Boolean operators were used. In particular, the proposed Several new transformations of bit planes containing mainly color plane coherent areas were consequently generated. Because many of such areas were overlapping and duplicated, a procedure to reduce the number of segmented areas was carried out. Sorting the segmented areas in accordance with their dimensions, a multilevel image description of coherent color areas was performed by selecting a number of slices. Figure 2 shows an example of the segmentation phase output: On the Cartesian axes, pixel number of the tested image is reported and yellow areas show the segmented regions obtained by the proposed binary approach.

Post-Processing Phase
Since in dermoscopic images illumination is maximized at the center of the image and decreases drastically towards borders enough to produce a significant gradient that could heavily affect the segmentation results, a region of interest (ROI) was chosen centered within the image to address the segmentation problem.
Output of the segmentation phase ( Figure 2) was refined using mathematical morphology. By employing a small circular structuring element, with radius R = 1 pixel, spurious pixels inside color coherent areas were avoided using the erosion operation while holes in coherent areas were filled through the dilation. In order to better preserve the fine details of the border, a slightly bigger circular structuring element of radius equal to 3 pixels was used for the dilation.
As the resulting segmented regions might contain more than one connected area, the segmentation of bit planes (each containing a connected area) into a new stack was carried out by means of a common splitting procedure. The obtained regions were candidates to be the starting point for the image segmentation into coherent areas.
To achieve coherent areas characterized by a common image color, the weighted sum of the images present in the final BPS was evaluated by employing a simple algorithm. Denoting with BP(k) the kth bit plane of the reduced dimension BPS, which was obtained at the output of the bit-plane orthogonalization phase, the segmented image (I) was: where N is the number of bit planes composing the reduced BPS.
In Figure 3, the output obtained by adopting the image processing detailed in the aforementioned procedure is shown: The original image and the binary orthogonal segmentation are shown on the left and on the right, respectively. Once the image segmented into color coherent areas is available, the detection of the skin lesion area is obtained following a two-step procedure. Firstly, segmented areas are sorted in descending order according to their extension and the smallest areas are neglected. In such a way, the segmented area which mostly covers the entire image is identified. In the second step the mean color of each area is computed and the lesion is selected as the darkest area among the available ones.

Adopted Database
The method was validated using the publically available PH 2 database composed of 200 dermoscopic images acquired under the same conditions at the Dermatology Service of Hospital Pedro Hispano, Matosinhos, Portugal [17,42]. All images are 8-bit RGB images with 768 × 560 pixels resolution and were captured by a lens with a 20 × magnification.
The PH 2 database, which contains 80 atypical nevi, 80 common nevi, and 40 melanoma, includes manual segmentation and clinical and histological diagnosis of skin lesion as well as the identification of other important dermoscopic criteria such as the assessment of the lesion asymmetry, the identification of colors, pigment network, dots, globules, streaks, regression areas, and blue-whitish veil. All the included dermoscopic images are either from the skin type II or III, according to the Fitzpatrick skin-type classification scale [43]. Therefore, the skin colors in the PH 2 database range from white to cream white.
In this database, manual segmentation of skin lesion provided by expert dermatologists is available as a binary mask in which pixels with intensity value of 1 correspond to the segmented lesion while pixels with value 0 correspond to the background.

Evaluation Metrics
The performance of the implemented procedure was assessed by comparing the CADe outputs with the ground truths indicated by expert clinicians, which are collected inside the used database.
The metrics suggested in the International Skin Imaging Collaboration (ISIC) challenges are evaluated for benchmarking [44][45][46]. The sensitivity represents the method ability to correctly identify the lesion pixels in the image, while the specificity is the method ability to correctly identify the non-lesion pixels. The Jaccard index and the Dice coefficient measure the similarity between the obtained segmentation result and the ground-truth mask. Finally, the accuracy was defined as the observed agreement between the procedure results and the physician opinion about the lesion under test and the balanced accuracy was the arithmetic mean of class-specific accuracies.
The aforementioned metrics are computed adopting the following expressions: Speci f icity (Sp) = TN TN + FP Usually, metrics with the highest values are recommended for computer-aided systems but a trade-off shall be achieved according to their relative importance [47,48].

Results
For the experimental validation of the implemented method, a publicly available database of skin lesion dermoscopic images was used. Therefore, the system performance could be quantitatively compared with other segmentation procedures indicated in literature.
The collection of skin lesion dermoscopic images of the PH 2 database was processed to assess the procedure performance. For comparative purpose, the results were analyzed in two different ways. The first one considered the whole dataset of images, and the next one two subsets of images, melanoma and benign lesions separated.
Comparisons of the obtained performance with other methods indicated in literature which adopted the PH 2 database as test bench showed the procedure validity. In particular, in Table 1 results obtained adopting the whole PH 2 dataset are indicated while Table 2 contains the performance obtained differentiating the images with and without melanoma. In Figure 4, the performance of the proposed method is indicated through the violin plots for (1) melanoma, (2) atypical nevi, and (3)   In Figure 5, an example of segmentation obtained adopting the proposed procedure is presented which shows the performance in terms of FP (green area), FN (red area), and TP (yellow area).

Discussions and Conclusions
The adoption of CADe in the medical environment for the detection and classification of abnormalities as soon as they occur can be a valid support for specialists, especially during the screening phase when both a large amount of diagnostic examinations have to be referred and when diagnostic images are challenging to analyze. In this paper, a method to perform an automatic and accurate segmentation of pigmented skin lesion in dermoscopic images was presented.
For benchmarking purpose, the conceived method was tested, adopting the publicly available PH 2 database.
The possibility of adopting a variety of databases as test bench and the existence of several metrics for the procedure performance evaluation made the comparison among the several methods indicated in literature a hard task. The training phase of a computer method (i.e., feature selection and classifier training) as well as the reached results heavily depended on the characteristics of images composing the selected dataset in terms of resolution, contrast, lightness, sharpness, noise, and so on. Moreover, the provided public databases, show images differently: In the same instance, regions of interest comprised the lesion with its proximity, while others contained the single lesion or only part of the lesion crossing its margin.
For these reasons, it was difficult to develop an "optimal algorithm", which is able to achieve the same results independently from the database adopted to test the conceived procedure.
The PH 2 database used to test the proposed segmentation algorithm is very challenging. In fact, several images are heavily affected by poor illumination and by the presence of hair artifacts, some others contain multiple lesions, various lesions are connected to the boundary edge of the provided image, and a number of skin lesions occupy more than half of the image area, making the matrix computation inconsistent. For these reasons, many studies indicated in literature discard up to 40 images of the database to avoid images having the issues stated above [26,29,35,49,50]. Of course, the removal of the most critical database images during the test phase contributes to increase the procedure performance.
Segmentation performance of the implemented, fully automatic method was quantitatively assessed by likening the results obtained to the ground truth provided by the PH 2 database. The ground truth was obtained by a manual segmentation of skin lesion provided by several experts. Since visual inspection of a lesion area by dermatologists depends on human vision and physician experience and expertise, manual segmentation is subjective and nonreproducible [5]. In fact, different specialists produce distinct segmentations when delineating the same lesion and sometimes the segmentation is performed in a "surgically oriented" mode, that is, the segmented area is normally slightly enlarged with respect to the lesion area and the lesion contour is smoother than the pigmented lesion itself might appear.
The implemented method is a versatile system which allows making changes in each section in an independent way. The presented method is designed to be sensitive even with images characterized by irregular borders.
The method validation was limited to the only PH 2 database that, in any case, is a challenging dataset for the characteristics of images composing it. Future development will include the implementation of the feature extraction phase for lesion classification taking into account one among the adopted criteria for melanoma detection, such as the "ABCDE rule".
In terms of the whole database images, the method achieved good overall performance, and in details the best specificity. Dice index and Jaccard coefficient were reached among the methods considered for the comparison. Therefore, the conceived procedure could help the interpretation of specialists, especially in the case of equivocal lesions because it allows a reproducible diagnosis by eliminating the inter-observer and intra-observer variabilities.