# Skin Lesion Segmentation Method for Dermoscopy Images Using Artificial Bee Colony Algorithm
## 2 Materials and Methods
### Methodology for Detection of Melanoma Skin Lesions  
The detection of skin lesions is an important and difficult assignment in dermatoscopic images because of numerous truths. The change between the lesion and the avoiding skin is smooth. The pictures captured from digital cameras have shadows that appear associated in masking as the skin lesion. Artifacts such as types of bubbles, multiple colored lesions, specular reflections, presence of hair, uneven illumination, and noise figure are present as a part of dermoscopic pictures.  
In this section, the methodology consists of melanoma detection based on the ABC method and is explained step by step.  
The proposed methodology focuses on extracting the lesion from its context, that is, separating it from the rest of the image without harming its color, geometry, and format. The methodology consists of the topics presented in Figure 2.  
The formation of the database consists of images collected from different sources, which are bases with different types of resolution, lighting, etc. so in pre-processing step, we remove the noise from the images by using morphological filtering. The proposed method needs to reject the unwanted spatial structures, reconstructing or attenuating their proportions in the dermatoscopic images. One of the main elements that can compromise any segmentation system is the ones contained in the lesions [32].  
In the preprocessing step, we use the median filter and morphological filtering based on the Gaussian kernel to eliminate hairs and smooths the image against noise. The morphological filtering aims to improve the colors of the lesion in order to highlight its geometry before the bottom and respecting its shape without deforming it. Median filtering is applied to the gray image and it appliesnonlinear function in the image for remove the salt and pepper noise. This method is more efficient than convolution operation and it reduces the noise and safeguards edges in the image. 2D median filter with size 20 \(\times\) 20 and morphological filtering based on Gaussian kernel was applied to eliminate hairs and smooths the image against noise. This process is implicitly embedded in this step. Figure 2b illustrates the results of this step. In the next step, the ABC algorithm was used to find the optimal thresholding value based on the histogram of the enhanced image (Figure 2c,d). By using the optimal thresholding value, we can segment and find the boundaries of the skin lesions. The result of this step was shown in Figure 2e. For the evaluation of the performance, the achieved result (segmented image) was compared with the ground truth image. Finally, the result and ground truth were overlain on the original dermatoscopic image (Figure 2g).  
The flowchart for artificial bee colony-based melanoma segmentation is shown in Figure 3.  
Figure 2: Skin lesion segmentation method using Artificial Bee Colony (ABC) algorithm: (**a**) Input image; (**b**) Image after enhancement; (**c**) Histogram of enhanced image; (**d**) Applying ABC to find optimum thresholding; (**e**) Segmented image; (**f**) Segmented and ground truth results overlay on the image; (**g**) Output image.