p-ISSN: 2301-5373

e-ISSN: 2654-5101

Jurnal Elektronik Ilmu Komputer Udayana

Volume 9 No. 3, February 2021

Dermoscopy Image Segmentation in Melanoma Skin Cancer using Otsu Thresholding Method

Pingkan Anggriani Pitoya1, I Putu Gede Hendra Suputraa2

aInformatics Department, Udayana University

Bali, Indonesia 1[email protected] 2[email protected]

Abstract

Melanoma is a skin cancer that originates from melanocytes, melanin-producing cells in the skin. It requires quite a long time to detect melanoma through a biopsy. By utilizing technology, the time required to obtain biopsy results in detection of melanoma can be shortened using image pattern recognition. Segmentation is a stage that affects the results in image analysis for pattern recognition in digital images because of the accuracy of a confident segment in an image analysis. Otsu thresholding is a segmentation method aims to find the threshold point that divides the grayscale image of histogram into two different areas automatically. In this study, segmentation was carried out on 15 dermoscopy of melanoma images that were subjected to grayscaling, histogram, segmentation with Otsu Thresholding, binarization, image negation, and testing. The test carried out using the Receiver Operating Character (ROC) method exhibited a mean sensitivity level of 70.3%, a mean specificity level of 95.53%, and a mean accuracy of 94.82%.

Keywords: Melanoma, Otsu Thresholding, Segmentation, Thresholding, Receiver Operating Character

  • 1.    Introduction

Global warming and extreme weather have become the leading factors for an increase incidence of skin cancer, including melanoma. Melanoma originates from melanocytes, cells that produce melanin in skin. Melanin functions to absorb ultraviolet rays and protect the skin from damage. Many people are exposed to excessive ultraviolet rays and causing its penetration into the dermis and damage the DNA of skin cells. Other risks for melanoma include heredity and unhealed old wounds that turn into cancer cells[1].

This skin disease is considered to be deadly and requires an immediate treatment. Furthermore, this disease appears quite similar to nevus, hence make them difficult to distinguish. To detect melanoma, a biopsy performed, a medical procedure that examines samples of body tissues, such as skin, organs, or lumps in certain body parts under a microscope. However, biopsy has several limitations, including a long time required to prepare for the biopsy and to obtain the results, which is around 4-7 days.

The advancing technology results in many innovations developed by humans to facilitate an easier work. With the advancing technology, the prolonged time required to obtain a biopsy result to detect melanoma can be resolved using pattern recognition on images. The use of pattern recognition in images makes it easier to identify melanoma and does not require a long period of time using dermoscopy images.

Segmentation is an indispensable first step in image analysis for pattern recognition in digital images because the accuracy of segmentation determines the success in analyzing an image. The main purpose of segmentation is to divide the image into parts with a strong correlation to the presence of objects in the image[2]. After subjected to segmentation, the image feature extraction process can be conducted. Feature extraction aims to extract the features of an object to differentiate object from one another. In pattern recognition for melanoma, this segmentation stage plays a role in separating the main object from its background to facilitate image processing at the next stage, namely feature extraction and pattern recognition.

Segmentation consists of several methods, one of which is thresholding. Thresholding divides the grayscale image into segments of several classes based on the gray level. Thresholding is used

to maximize contrast in the image so that the background and foreground are clearly visible[3]. Manual thresholding is a floating process producing a binary image with a manually determined threshold value that results in less efficient segmentation process. Through Otsu thresholding method, the threshold value can be obtained automatically based on the input images[4]. Otsu thresholding aims to find the threshold point that divides the grayscale image histogram into two different areas automatically. The gray level of the image is expressed by i to L, where the i level is 0 pixels and L is 255 pixels. The Otsu method has a high level of computational complexity when it comes to multilevel thresholding[5].

In a previous study using Otsu thresholding, a segmentation of the iris images resulted in a mean accuracy of 93.70% from 10 trials of iris images[6]. Another study exhibited a mean accuracy of 94.43% in segmenting wayang images[7].

The objective of this study is to conduct segmentation on dermoscopy images of melanoma, to separate the object from the background and knowing the level of accuracy obtained by comparing the results of manual segmentation and the results of segmentation with otsu thresholding. By doing the segmentation on the dermoscopy image of melanoma skin disease, it will be known how accurate the segmentation is by otsu thresholding. Because by doing the right segmentation, the characteristics of melanoma become more visible, such as the border and the shape of melanoma, facilitating the feature extraction process in conducting pattern recognition.

  • 2.   Reseach Methods

This study consisted of several stages including: data collection, grayscaling, histogram, segmentation, binarization, image negation, and system testing. During data collection, secondary data in the form of a dermoscopy images of melanoma were collected. Initially, dermoscopy images were submitted, then grayscaling stage was proceeded by converting RGB image into a grayscale image. Afterwards, histogram and segmentation stages were conducted using Otsu Threshold, calculating the T threshold automatically based on the input images. Binarization and image negation stages were subsequently performed. During binarization stage, the value of the image will be changed to 0 and 1. During image negation stage, the image with value of 0 is turn into value 1 and vice versa. Finally, testing and calculation of accuracy stages were conducted with the Receiver Operating Character (ROC), comparing the images from manual segmentation to images obtained from otsu threshold.

Figure 1. Research Flowchart

  • 2.1.    Data Collection

Dermoscopy images of skin with melanoma were obtained from https://www.isic-archive.com/. The ISIC (International Skin Imaging Collaboration) is a website displaying archives of melanoma dermoscopy images for teaching, development, and testing of automated diagnostic systems for melanoma. In this study, there were two types of data used, images subjected to segmentation using the otsu threshold and manually segmented data. A total of 30 images consisting of 15 images segmented using the otsu threshold and 15 manually segmented images were obtained.

  • 2.2.    Grayscaling

Grayscale is a digital image with only one channel value per pixel, the value of red = green = blue are used to indicate the intensity of the color. The intensity of the grayscale image is stored in an 8 bit format ranging from 0 for black to 255 for white[7]. To convert a color image into a grayscale image, the average value of the R, G and B values are calculated using the following equation:

Grayscale = (≤±G±Bλ                          (1)

Information:

R : Red intensity

G : Green intensity

B : Blue intensity

  • 2.3.    Histogram

The histogram is a measure of image pixels distribution. It is obtained by calculating the number of appearances of each pixel value, which is then mapped against the intensity of the grayscale image. The stage of histogram formation is an important step before thresholding. Because Otsu Threshold aims to determine the T threshold value, this histogram is a critical step[7]. The histogram were divided into two classes, foreground and background. To calculate the probability for each pixel at level i, following equation [3] is used:

P, = -                                     (2)

i N

Information:

Pi       : Pixel probability to i

ni       : Pixels with grayscale level i

N      : Total pixels in image

  • 2.4.    Image Segmentation

Image segmentation is used to separate an object from the entire image based on certain criteria between the gray level of a pixel and the gray level of its neighboring pixels. One of the methods for segmenting is thresholding method, dividing the grayscale image into segments according to several classes based on the gray level[3].

Otsu Thresholding is a thresholding method aiming to find the threshold point that divides the grayscale image histogram into two different areas automatically. The gray level of the image is expressed by i to L, where the i level is 0 pixels and L is 255 pixels[8]. The Otsu method has a high level of computational complexity when it comes to multilevel thresholding[5]. The Otsu method is used to calculate the T threshold automatically based on the input images.

In Otsu Thresholding, the first step conducted after making a probability histogram is to determine the weights of the two classes expressed by the equation:

w1(t) = ∑U^(i)

W2(t) = ∑U1-P(O

Information:

P       :Probability

i        :Pixels in image

w1(t)  :Weighting of backgroundclass

w2(t)  :Weighting of foreground class

L       :Graylevel

Mean class of backrgound and foreground are calculated by following formulas:

mι(t) = ∑Uι i. P(i)∕wι(t)(5)

m2(t) = t=1i.P(i)∕w2(t)(6)

Information:

m1(t)  :Mean class of background

m2(t)  :Mean class of foreground

P       :Probability

i        :Pixels in image

To achieve the goal of the Otsu method, maximizing the weight of inter-class variance is the right solution. To calculate the inter-class variance, the following equation is used:

σβ(t) = wι. [m1(t) - m2(t)]2 + W2. [m2(t) - mι(t)]2                       (7)

Information:

o-lj2(t)   :Between-Class Variance

m1(t)  :Mean class of background

m2(t)  :Mean class of foreground

w1(t)  :Weighting of background class

w2(t)  :Weighting of foreground class

  • 2.5.    Binarization

Binarization is a process of converting a grayscale image into a binary image, where the pixel values in the image are 0 and 1. During binarization process, a threshold value was used to determine a certain grayscale value which is converted into a pixel value of 0 or 1[9].

  • 2.6.    Image Negation

Image negation is a process of color replacement, white pixels are replaced by black pixels. Meanwhile, black pixels are replaced with white pixels[9].

  • 2.7.    Testing

The testing were carried out using the Receiver Operating Character (ROC) method. ROC aims to measure the accuracy, sensitivity and specificity of the segmentation results. ROC is obtained by plotting the True Positive (TP), False Positive (FP), False Negative (FN), and True Negative (TN)[9]. Following equations were used to calculate the accuracy, sensitivity, and specificity:

TP+TN

Accuracy =(8)

TP+FP+TN+FN

TP

Sensitivity =

TP+FN

Specivisity = tn(10)

FP+TN

  • 3.    Result and Discussion

This study involved dermoscopy image segmentation in melanoma using the Otsu Threshold implemented using Matlab.

Dermoscopy images of melanoma were used as data. Dermoscopy image is an image similar result to a magnifying glass. The images used were 1022 x 767 pixels. Figure 1 is an example of a dermoscopy image subjected to segmentation with otsu threshold. Figure 2 is an example of a manually segmented image.

Figure 1. Dermoscopy image of melanoma

Figure 2. Manually segmented image

The first stage of this study was conducted by submitting dermoscopy image of melanoma in the system for conversion from an RGB image to a grayscale image calculated with equation. Figure

3 is the result of an RGB image successfully converted into a grayscale image.


Figure 3. Grayscale image

The next step is histogram generation from a grayscale image. Making this histogram will facilitate the next stage, namely the segmentation stage. Figure 4 is a histogram of a grayscale image.


The grayscale image that has been made histogram is subjected to image segmentation with Otsu Thresholding. Figure 5 is a segmented image with Otsu Thresholding. Figure 6 illustrate that the threshold value of the input image is 125 with an between-class variance value of 1843.

Figure 5. Segmented image


Figure 6. Chart of segmentation result


Afterwards is the binarization and image negation processes. Binarization is carried out to create an image with a value of 0 and 1. Through image negation process, image with 0 value become 1 and vice versa. Image negation is performed so that the segmentation results can be seen more clearly. Figure 7 demonstrates an image after binarization while Figure 8 demonstrates a result of image negation.

Figure 7. Binary image

Figure 8. Negation image

Finally, testing and calculating the level of accuracy of the segmentation results using Otsu Threshold were conducted as the last stages. Tests were carried out on 15 dermoscopy images. Accuracy calculation using ROC was conducted by comparing the segmented image using Otsu threshold and the manually-segmented image. ROC then demonstrates sensitivity, specificity, and accuracy.

  • Table 1. Test results

    No.

    Original Image

    Manually segmented image

    Image Segmentation Using Otsu Thresholding

    Threshold Value

    Sensitivity

    Specificity

    Accuracy

    1.

    φ

    125

    77.39

    97.16

    95.71

    2.

    127

    78.74

    94.43

    94.92

    3.

    ^^

    135

    68.43

    95.18

    95.09

    4.

    4

    107

    69.36

    96.29

    95.51

    5.

    ^^

    129

    70.27

    96.11

    95.48

    6.

    ^^l

    134

    65.86

    93.52

    94.37

    7.

    ^

    I^l

    116

    66.48

    96.02

    93.81

    8.

    φ

    ■ ^ I

    150

    70.47

    93.34

    94.22

    9.

    L^j

    116

    69.21

    94.29

    93.38

    10 .

    I ⅜ j

    109

    78.29

    96.60

    95.34

    11 .

    I ^ i

    119

    68.35

    97.25

    96.94

    12 .

    I ^^ I

    138

    72.53

    94.74

    95.1

    13 .

    151

    61.84

    95.49

    94.32

    14 .

    I ^^ I

    126

    69.37

    96.92

    94.89

    15 .

    I ^ I

    154

    67.93

    95.66

    94.47

    Average

    70.3

    95.53

    94.82

As demonstrated in Table 1, from the 15 images segmented using Otsu threshold, mean sensitivity of 70.3%, mean specificity of 95.53%, and mean accuracy of 94.82% were obtained.

  • 4.    Conclusion

Based on the results of image segmentation using otsu threshold, it can be concluded that accuracy of dermoscopy image segmentation of melanoma skin was 94.82%. The highest accuracy was 96.94% with a sensitivity of 68.35%, a specificity of 97.25%, and a threshold value of 119.

References

  • [1]    I. Damanyana, R.D Atmaja, and H. Fauzi, “Deteksi Kanker Kulit Melanoma Berbasis Pengolahan Citra Menggunakan Wevelet Transform” e-Proceeding of Engineering, vol. 3, no. 3, p. 4718-4723, 2016.

  • [2]    A.W. Kusuma, R.L. Ellyana, “Penerapan Citra Terkompresi Pada Segmentasi Citra Menggunakan Algoritme K-MEANS” JUTEI, vol. 2, no. 1, p. 65-74, 2018.

  • [3]    M. Hatta and I.G Susrama, “Counting Sperma Aktif Menggunakan Metode Otsu Threshold dan Local Adaptive Threshold” Teknika: Engineering and Sains Journal (TESJ), vol. 1, no. 1, p. 47-54, 2017.

  • [4]    A.T. Utami, “Implementasi Metode Otsu Thresholding Untuk Segmentasi Citra Daun” Universitas Muhammadiyah Surakarta, 2017.

  • [5]    M.D Fauzi, “Klasifikasi Batuan Beku Gabbro Pada Citra Sayatan Tipis Menggunakan Multilevel Otsu’s Thresholding” Jurnal Teknik Informatika dan Sistem Informasi (JATISI), vol. 4, no. 1, p. 47-56, 2017.

  • [6]    M. Alamsyah, “Segmentasi Citra Iris Mata Menggunakan Metode Otsu Thresholding” Journal of Information Technology and Computer Science (Jointecs), vol. 4, no. 1, p. 23-26, 2019.

  • [7]    M.I. Farih, L. Hakim, and M. Munir, “Segmentasi Citra Wayang Dengan Metode Otsu” Cyber-Techn, vol. 11, no. 1, p. 8-18, 2016.

  • [8]    S.I. Syafi’I, R.T. Wahyuningrum, and A. Muntasa, “Segmentasi Obyek Pada Citra Digital Menggunakan Metode Otsu Thresholding” Jurnal Informatika, vol. 13, no. 1, p.1-8, 2015.

  • [9]    I.M.O. Widyantara, A.T.A.P. Kusuma, and N.M.A.E.D. Wirastuti. “Preprocessing pada Segmentasi Citra Paru-Paru dan Jantung Menggunakan Anisotropic Diffusion Filter” Open Journal Systems-Teknologi Elektro, vol. 14, no. 2, p.6-10, 2015.

404