22
Journal of Engineering Science and Technology Vol. 15, No. 1 (2020) 227 - 248 © School of Engineering, Taylor’s University 227 THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING SEGMENTATION OF WHITE BLOOD CELL CYTOPLASM IMAGE IKA HERAWATI 1 , FARIDAH 1, *, BALZA ACHMAD 1 , RESSY JAYA YANTI 2 1 Departement of Nuclear Engineering and Engineering Physics, Faculty of Engineering, Universitas Gadjah Mada, Indonesia Jalan Grafika No.2 UGM Campus, 55281, Sleman, Yogyakarta, Indonesia 2 Departement of Electrical and Information Technology Engineering, Universitas Gadjah Mada, Indonesia Jalan Grafika No.2 UGM Campus, 55281, Sleman, Yogyakarta, Indonesia *Corresponding Author: [email protected] Abstract The appropriate image contrast becomes one of the critical success factors in white blood cell segmentation process because of blood cell composition complexity and background clarity. Segmentation of white blood cells can be divided into two, namely nucleus segmentation and cytoplasm segmentation. Nucleus segmentation cannot be used to obtain the cell cytoplasm, whereas, in cytoplasm segmentation, the nucleus indirectly is also obtained because the nucleus is always in the cytoplasm. This study has successfully compared the effect of three contrast enhancement methods namely top hat and bottom hat transform, linear contrast stretching and fuzzy logic-based image histogram as a pre-processing stage for K-means clustering segmentation of white blood cell cytoplasm using 15 images of blood sample of RGB, HSV and Lab colour model. The results of the analysis show that the image resulted by pre-processing stage using the top hat and bottom hat transform for an image with RGB colour model yields the highest average sensitivity and accuracy, 80.95% and 99.19%, and it also has the lowest execution time, 71.06 s. While the highest average value of specificity and the lowest value of deformation, 99.51% and 38.93%, produced by the fuzzy logic-based image histogram method. While for RGB, HSV and lab variations in linear contrast stretching method, the RGB image resulted best in sensitivity, specificity, accuracy, deformation and execution time. Those are 79.26%; 99.49%; 99.15%; 39.87% and 74.83 s. Keywords: Contrast image enhancement, Cytoplasm segmentation, Image histogram, K-means clustering, White blood cells.

THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

Journal of Engineering Science and Technology Vol. 15, No. 1 (2020) 227 - 248 © School of Engineering, Taylor’s University

227

THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING SEGMENTATION OF WHITE BLOOD CELL CYTOPLASM IMAGE

IKA HERAWATI1, FARIDAH1,*, BALZA ACHMAD1, RESSY JAYA YANTI2

1Departement of Nuclear Engineering and Engineering Physics, Faculty of Engineering, Universitas Gadjah Mada, Indonesia

Jalan Grafika No.2 UGM Campus, 55281, Sleman, Yogyakarta, Indonesia 2Departement of Electrical and Information Technology Engineering,

Universitas Gadjah Mada, Indonesia Jalan Grafika No.2 UGM Campus, 55281, Sleman, Yogyakarta, Indonesia

*Corresponding Author: [email protected]

Abstract

The appropriate image contrast becomes one of the critical success factors in white blood cell segmentation process because of blood cell composition complexity and background clarity. Segmentation of white blood cells can be divided into two, namely nucleus segmentation and cytoplasm segmentation. Nucleus segmentation cannot be used to obtain the cell cytoplasm, whereas, in cytoplasm segmentation, the nucleus indirectly is also obtained because the nucleus is always in the cytoplasm. This study has successfully compared the effect of three contrast enhancement methods namely top hat and bottom hat transform, linear contrast stretching and fuzzy logic-based image histogram as a pre-processing stage for K-means clustering segmentation of white blood cell cytoplasm using 15 images of blood sample of RGB, HSV and Lab colour model. The results of the analysis show that the image resulted by pre-processing stage using the top hat and bottom hat transform for an image with RGB colour model yields the highest average sensitivity and accuracy, 80.95% and 99.19%, and it also has the lowest execution time, 71.06 s. While the highest average value of specificity and the lowest value of deformation, 99.51% and 38.93%, produced by the fuzzy logic-based image histogram method. While for RGB, HSV and lab variations in linear contrast stretching method, the RGB image resulted best in sensitivity, specificity, accuracy, deformation and execution time. Those are 79.26%; 99.49%; 99.15%; 39.87% and 74.83 s.

Keywords: Contrast image enhancement, Cytoplasm segmentation, Image histogram, K-means clustering, White blood cells.

Page 2: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

228 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

1. Introduction The composition of blood cells is not only white blood cells, which have the smallest number, but also red blood cells and other blood cell components, and the background, which is complex and blurred [1]. Certainly, factors such as inequality lighting, noise and low contrast in the image will increase the difficulty of the white blood cell segmentation process. Therefore, it is important for white blood cell images to have uniform illumination, minimal noise and appropriate contrast in order to produce more accurate segmentation results.

A blood sample image is said to have the appropriate contrast qualities to be used in white blood cell segmentation if the image contrast can accentuate the white blood cell object contained in the image than any other objects. Hence, the method of contrast quality enhancement is usually used as a pre-processing stage of segmentation in order to produce more accurate segmentation results. It is not just for segmentation of white blood cells, but also the segmentation of other objects.

Segmentation of white blood cells can be done through two ways, nucleus segmentation and cytoplasm segmentation. Nucleus segmentation is a common segmentation and is quite easy to implement because white blood cells usually have a darker colour of nucleus compared to other objects in the image. In addition, nucleus segmentation cannot be used to obtain cell cytoplasm.

While segmentation of cytoplasm is a segmentation that is still done rarely because it is quite difficult to distinguish it from a background or red blood cells. In addition, when the cytoplasm of a white blood cell is successfully segmented, indirectly it has also succeeded in obtaining the nucleus object. Therefore, cytoplasm segmentation also becomes an important technique for further image processing.

Many researches have been done in relation to various contrast enhancement methods as a pre-processing stage for segmentation. Regarding the facts that quite a lot of contrast enhancement techniques are used to segment the white blood cell image and there are few researches in white blood cell cytoplasm segmentation, this study will compare contrast enhancement methods using three methods, which are top hat and bottom hat transform, linear contrast stretching and fuzzy logic-based image histogram using different colour image models for K-means clustering segmentation of white cell cytoplasm.

The aim is to know the effect of contrast enhancement method as a pre-processing stage in segmenting the white blood cell cytoplasm. While the limitation used in this study are the processing stage is just contrast enhancement method; RGB, HSV and Lab colour variation are only done on linear contrast stretching method; cytoplasm segmentation is done using K-means clustering method only, the software used to design and apply contrast enhancement and segmentation are MATLAB R2013a 64-bit and the post-processing stage involved is a post-processing stage that is only applicable to the blood sample image used in this study.

The result shows that top hat and bottom hat transforms to produce a better-enhanced image compared to the others.

Page 3: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 229

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

2. Theoretical Background

2.1. Enhancing image contrast Top hat and bottom hat contrast enhancement are performed on RGB image using Eq. (1) [2].

BTHN IIII −+= (1)

Top hat transform resulted in an image obtained by reducing the original image with opening operation resulted. Equations (2) and (3) show how to calculate opening operation and top-hat transform respectively [3].

( ) BBAIoB ⊕Θ= (2)

)(IoBIITH −= (3)

The opening operation usually used to smooth the contour of an object and eliminates thin protrusions. Whereas, for bottom hat transform, resulted in an image produced by reducing image resulted by closing operation with the original image. The calculation of closing operation and bottom hat transform are using Eqs. (4) and (5) respectively [4].

( ) BBABI Θ⊕=• (4)

IBII BH −•= )( (5)

The closing operation is used to remove small holes in the image object, and to change the small area in the background into the object area. Applying top hat and bottom transforms will produce a new colour channel histogram and a resulted image will be displayed to see the effect of the contrast enhancement using these methods.

Linear contrast stretching is done using minimum and maximum grey values of RGB, HSV and Lab colour image. This method is done using Eq. (6).

[ ][ ])),(min()),(max(255)),(min(),(),(

yxIyxIyxIyxIyxI

oOOOf −

−= (6)

New histogram and new colour channel image from the new image will also be displayed to see the effect of the contrast enhancement. The effect of each contrast enhancement method in enhancing image contrast will be determined using parameter value in Eq. (7) for each colour channel of the contrast-enhanced image. Visibility is the difference contrast between pixels in an image. Closer to the value of 1, the difference contrast is getting bigger [5].

minmax

minmax

IIIIvisibility

+−

= (7)

Then, for segmented cytoplasm results, we will calculate the sensitivity, specificity and accuracy value using confusion matrix in Eqs. (8) to (10) through matching segmented cytoplasm image with ground truth image, which is a white blood cell cytoplasm image obtained manually using image J.

Page 4: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

230 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

%100xFNTP

TPySensitivit+

= (8)

%100xFPTN

TNySpecificit+

= (9)

%100xFNFPTNTP

TNTPAccuracy+++

+= (10)

Sensitivity value indicates the percentage of success of the program in detecting pixel cytoplasm of white blood cells on blood sample image used. Specificity value indicates the success percentage of the program in detecting pixels, which are not white cell cytoplasm pixels. And accuracy shows the success percentage of the program in distinguishing cytoplasm pixels and other object pixels contained in the blood sample image.

2.2. Fuzzy logic Fuzzy logic based image histogram has a similar principle to linear contrast stretching, which uses minimal and maximum grey values of each image channel to perform contrast enhancement. The range between the minimum and the maximum grey value of the original image (max-min) divided by i into n - 1 input membership function with range [0 255] for RGB and lab colour channels and [0 1] for HSV colour channel.

The minimum grey value that has been selected will be the minimum value of the 1st membership function input parameter (fki1) and the maximum grey value becomes the maximum value of the nth input membership function(fkin) for fuzzy inference system. The parameters used in the input membership function input are fki1 = [min min + i min + 2i], fki2 = [min + i min + 2i min + 3i],. . ., fki (n-1) = [min + (n-2) i min + (n-1) i max]. Smaller the value of i, the input membership function will be more.

For the output of the fuzzy inference system, the output membership function must have an equal number of the input membership functions (Σfko = Σfki), which is n-1 with 0 as the minimum grey value and 255 as the maximum grey value for RGB and lab image colour channels as well as 0 as the minimum grey value and 1 as the maximum grey value for HSV image colour channels.

Since the max-min range of the output membership function is 255 and the membership function must be n-1, the divider is no longer i but j, so the parameter of the output membership function becomes fko1 = [0 j 2j], fko2 = [j 2j 3j],. . ., fko (n-1) = [(n-2) j (n-1) j 255]. The rules of the fuzzy inference system used in this study are:

(1) IF fki1 THEN fko1 (2) IF fki2 THEN fko2

⋮ (n) IF fki (n-1) THEN fko (n-1)

Page 5: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 231

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

2.3. K-means clustering Of the various techniques that can be used to simplify the computation and accelerate convergence, we shall briefly consider one elementary, approximate method. The estimates are basically still frequency ratios, the sample mean and sample covariance matrices [6].

( ) ( ) ( )( ) ( )∑ =

= c

j jjjk

iiikki

wPwxpwPwxpxwP

1ˆ,|

ˆ,|ˆ,|ˆθ

θθ (11)

( ) ( )∑−−−

1 ˆˆi li

tli xx µµ

(12) 2|ˆ| kkx µ− (13)

Theoretically, it is clear that the probability of local-maximum-likelihood estimate in the Eq. (11) is large when the squared ‘Mahalanobis’ distance in Eq. (12) is small. Suppose that we merely compute the square ‘Euclidean’ distance in Eq. (13) to find the mean ˆµmnearest to Xk and approximate 𝑃𝑃��𝑤𝑤𝑖𝑖�𝑥𝑥𝑘𝑘 ,𝜃𝜃�� as:

𝑃𝑃��𝑤𝑤𝑖𝑖�𝑥𝑥𝑘𝑘 ,𝜃𝜃�� ≈ � 1 → 𝑖𝑖𝑖𝑖, 𝑖𝑖 = 𝑚𝑚 0 → 𝑜𝑜𝑜𝑜ℎ𝑒𝑒𝑒𝑒𝑤𝑤𝑖𝑖𝑒𝑒𝑒𝑒

(14)

Algorithm 1 (K-means clustering) begin initializing 𝑛𝑛, 𝑐𝑐, 𝜇𝜇1, 𝜇𝜇2, … 𝜇𝜇𝑐𝑐 do classify n samples according to nearest 𝜇𝜇𝑖𝑖 recompute 𝜇𝜇𝑖𝑖 until no change in 𝜇𝜇𝒊𝒊

return 𝜇𝜇1, 𝜇𝜇2, … 𝜇𝜇𝑐𝑐 end.

3. Related Work Li et al. [7] used the image quality enhancement technique, which is a linear contrast stretching to segment the white blood cells from the image of acute lymphoblastic leukaemia using a dual thresholding method. The result of algorithm implementation involving RGB and HSV image shows that the accuracy of white blood cell segmentation reaches 97.85%.

Zhang et al. [8] had done segmentation of white blood cells using K-means clustering based on colour models involving top hat and bottom hat transform as contrast enhancement techniques follow with colour correction technique on RGB images. Segmentation result using the proposed method was able to produce an accuracy of 95.7% for segmentation of white blood cell nucleus and 91.3% for cytoplasm segmentation. Kamra and Kaur [9] have proposed an algorithm involving multi-scale top-hat transformation and bottom hat transformation for image contrast enhancement in grayscale images. The results, which are compared using DV, BV, entropy as quality metrics with different structuring elements at different scales both qualitatively and quantitatively, show better-enhanced image result.

Page 6: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

232 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

Ramasamy and Perumal [10] presented a method for image enhancement of medical image using top hat transform, bottom hat transforms and arithmetic operation. Selection of size of disk-shaped mask for structuring element used in this proposed method was done until optimum image results are obtained. Optimum structuring element selection method will be compared with constant size of structuring element selection using a qualitative measurement of PSNR and AMBE. The result shows that optimum disk-shaped structural element selection obtains the better contrast, highest PSNR, lowest AMBE, and highest correct classification rate than the constant size of structural element selection.

Lashmi et al. [3] have proposed a fuzzy contrast enhancement method in both direct and indirect methods. For the direct method, fuzzy logic is used and histogram equalization is used for indirect method. Histogram equalized image in an indirect method is mapped into a fuzzy domain using S membership function. The parameters of the membership function are selected based on the characteristics of the image and they are optimized. Defuzzification is done to obtain the enhanced image by using a suitable formula. Then contrast improvement index (CII) parameter of several images are calculated and then it is compared with that obtained in other techniques. The result shows that the proposed method produces image result with greater CII than other techniques. Hassanpour et al. [4] have proposed a method for medical image contrast enhancement using a top hat and bottom hat transform. Medical images used in this research produced by X-Ray and CT-Scan. The result shows that the contrast improvement ratio (CIR) value of the proposed method is better in improving medical image quality when it compared to histogram equalization and limited contrast adaptive histogram.

4. Methodology Software and hardware are used in this study. The software for designing and implementing algorithms are MATLAB R2013a 64-bit, Image J used to create a ground truth image (for matching the result of segmentation with the original image) and Microsoft Excel 2013 used for data processing of cytoplasm segmentation results. While the hardware used is ASUS X45U Laptop with specifications: Windows 10 Pro 64-bit operating system; AMD E2-1800 APU with Radeon (tm) HD Graphics 1.70 GHz; 8.00 GB RAM and Thermaltake personal computer with Windows 10 Education 64-bit operating system, i7-4790 CPU 3.60 GHz, 16 GB DDR3 RAM. The study materials are a sample of healthy and sick blood cells containing the nucleus and cytoplasm of white blood cells. Data identification is performed on the blood sample data in order to find out whether the image is classified as low, high or normal contrast through the histogram of each colour image channel. In addition, this data identification is useful for determining the minimum and maximum value of the grey value range that will be used in fuzzy logic-based image histogram. The data identification process is done by using MATLAB R2013a. After data identification, the process of the contrast enhancement algorithm design is also performed using MATLAB R2013a software.

The colour conversion process is only done to get HSV and lab image since the input image used is RGB image. Then the image will be separated into its constituent colour channels through the channel separation process. This channel separation is done because the contrast enhancement will be made on all colour image channels in either RGB, HSV or lab except for the top hat and bottom hat

Page 7: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 233

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

transform, which done on RGB image directly. After channel separation, the main process of contrast enhancement is done using the top hat and bottom hat transform, linear contrast stretching and fuzzy logic based on image histogram. The selection of the number of linguistic variables in the contrast enhancement method using fuzzy logic is not based on trial and error. The limitation of this research is to use four linguistic variables, which are assumed to provide significant contrast values. This is because the design of the fuzzy inference system for each colour channel requires considerable computational time in the execution of algorithms when compared to the execution of other algorithms. The more linguistic variables used, the more trials needed to get the minimum value and maximum image contrast value to be used so as not to produce excessive contrast enhancement, in other words, the result shown is not significant (for this case study) but have a direct impact on the process of designing fuzzy interference system and algorithm execution times. The next process after contrast enhancement is channel merger. This process aims to get the image of contrast enhancement in the form of colour images RGB, HSV or lab. Next is the design of the K-means clustering segmentation algorithm as shown in Fig. 1.

Fig. 1. K-means clustering segmentation algorithm.

K-means clustering algorithm will be applied to the image resulted by contrast enhancement method. This algorithm used to separate between background, white blood cell nucleus, the cytoplasm of white blood cells and red blood cells of a blood sample image in different clusters, was chosen because it may produce tighter clusters compared with hierarchical clustering and it is no need to put a class label. The optimal number of clusters, which is capable to separate these objects is different for each blood sample image and it was obtained by trial and error. From the clustering results, only the nucleus cluster and cytoplasm cluster will be used for further processing. The nucleus cluster is a cluster consisting of dominant nucleus object and cytoplasm cluster is a cluster that has cytoplasm object predominantly.

After both of nucleus cluster and cytoplasm cluster are obtained, the next step is post-processing shown in Fig. 2. The nucleus cluster has been obtained through K-means clustering algorithm is converted to a binary image using the thresholding method. Then area opening I is done to get the more perfect form of the nucleus in the form of the binary image.

Then the cytoplasm cluster generated by the K-means clustering algorithm is also converted to a binary image using thresholding. Cytoplasm cluster resulted by thresholding will be combined with the result of area opening I to get the

Page 8: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

234 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

whole white blood cell object in the image. The closing operation is done later with the aim to perfect the form of white blood cell result of the merger. While the branch-points operation is used to remove branched pixels that arise from the merger process.

The result of the branch-points operation will be processed further through area opening II to get the whole white blood cell without the presence of noise objects. Furthermore, the median filtering operation is used to remove any noise pixels that may remain after area opening II, in order to obtain white blood cells in the blood sample image perfectly. The last step of post-processing is masking the cytoplasm of a white blood cell. This step will remove the nucleus part of the median filtering result and leave only the cytoplasm. This cytoplasm in the form of the binary image will be masked using the initial RGB image to produce a segmented cytoplasm in the form of RGB colour image.

The effect of each contrast enhancement method in enhancing image contrast will be determined using visibility value for each colour channel of the contrast-enhanced image. Then, for segmented cytoplasm results, we will calculate the sensitivity, specificity and accuracy based on confusion matrix in Fig. 3, through matching segmented cytoplasm image with ground truth image, which is white blood cell cytoplasm image obtained manually using software called Image J.

Fig. 2. Post-processing algorithm.

Page 9: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 235

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

Sensitivity value indicates the percentage of success of the program in detecting pixel cytoplasm of white blood cells on blood sample image used. Specificity value indicates the success percentage of the program in detecting pixels, which are not white cell cytoplasm pixels. And accuracy shows the success percentage of the program in distinguishing cytoplasm pixels and other object pixels contained in the blood sample image. The morphological change of segmented cytoplasm, which is referred to as deformation, will also be measured by comparing the number of segmented cytoplasm pixels to the number of original cytoplasm pixels present in the input image. Deformation is measured by subtracting the number of pixels of the cytoplasm in the ground truth image by the number of successfully segmented cytoplasm pixels. Another parameter to be measured is the execution time.

Fig. 3. Confusion matrix.

5. Dataset Dataset used in this study consists of 15 blood sample images in RGB colour, which had been identified using histogram of each colour image channel so it can be determined whether the image is in high contrast, normal contrast or low contrast. Data identification results of blood sample images used in this study shown by Table 1.

Figure 4(a) shows the low contrast image visualization, whereas the high contrast image is shown in Fig. 4(b).

Table 1. Data identification results of blood sample images. Image quantity Name

Low contrast 2 1.png, 12.png High contrast 13 20.png; 30.png;

64.png; 83.png; 84.png; 85.png; 86.png; 87.png; 88.png; 89.png; 90.png; 91.png;

92.png

(a) Low contrast.

(b) High contrast.

Fig. 4. Image visualization.

Page 10: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

236 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

6. Results and Discussion

6.1. Contrast enhancement implementation The colour conversion that has been done results in HSV and Lab image as shown in Table 2 for low-contrast RGB images.

While the colour conversions result for high contrast RGB images are shown in Table 3. Visually, low contrast and high contrast image will produce HSV and Lab images with different colour structures. The nucleus objects in low contrast HSV images will look more prominent than the one in high-contrast HSV image.

From Tables 4 and 5, for RGB image, high contrast and low contrast image will produce different R, G and B channel. For HSV image, the difference is only seen in channel V. While in Lab image, the difference lies in channel L.

The results of high contrast image channel separation are shown in Table 5.

Table 2. Low contrast RGB conversion result to HSV and Lab image. Colour model RGB HSV Lab

Visualization

Table 3. High contrast RGB conversion result to HSV and Lab image. Colour model RGB HSV Lab

Visualization

Table 4. Low contrast image channel separation results. Channel R G B

Visualization

Channel H S V

Visualization

Channel L a b

Visualization

Page 11: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 237

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

Table 5. High contrast channel image separation results. Channel R G B

Visualization

Channel H S V

Visualization

Channel L a b

Visualization

6.2. Contrast enhancement implementation 6.2.1. Top hat and bottom hat transform

The effect of top hat and bottom hat contrast enhancement on the colour channel image histogram is shown in Table 6.

From Table 6, it can be seen that in addition to increasing the range of grey values in each image channel, the implementation of top hat and bottom hat transform algorithm will also reduce the number of pixels at a certain grey value and increase the number of pixels at other grey value. This allows the occurrence of narrowing or widening of the region with the same pixel intensity, besides certain objects in the image will have a more prominent contrast than other objects.

Table 6. Process of low contrast image histogram transformation due to top hat and bottom hat transform algorithm.

Channel R G B

RGB image histogram

Top hat image histogram

Page 12: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

238 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

Channel R G B

Bottom hat image histogram

(Citra RGB + top hat) image histogram

(Citra RGB + top hat - bottom hat) image histogram

6.2.2. Linear contrast stretching The effect of linear contrast stretching on low contrast image channel histogram is shown in Table 7 with the RGB colour model. Tables 7 and 8, it can be showed that increasing the range of grey values due to linear contrast stretching on low contrast images will make the range between the grey values of the number of pixels with the grey values of the number of other pixels increase in among RGB, HSV and lab images. Certainly, this will also impact on the prominence of certain objects in the blood sample image, and hopefully one of these objects is cytoplasm. While on high contrast images, linear contrast stretching will shift the grey range values of the initial image channel histogram to the left toward a lower grey value. This generally applies to only a few channels on each image, so there are channels remained that most of the pixels of its image predominate at a high grey value. This condition will also affect the prominence of certain objects in the image of blood samples. Another effect is the occurrence of certain colour dominance on RGB image results.

While on high contrast image, the effect is shown in Table 8.

Table 7. Image histogram of each colour channel before and after contrast linear stretching on low contrast image.

Channel R G B

Before contrast linear stretching

After contrast linear stretching

Page 13: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 239

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

Table 8. Image histogram of each colour channel before and after linear contrast stretching on high contrast image.

Channel R G B

Before contrast linear stretching

After contrast linear stretching

6.2.3. Fuzzy logic-based image histogram

The effect of fuzzy logic-based image histogram on the histogram of the low contrast image channel is shown in Table 9 with the RGB colour model.

While on high contrast image, the effect is shown in Table 10.

Tables 9 and 10, it can be seen that the grey value range of high contrast or low contrast RGB image is increased so that the range between the grey values of a number of pixels to the grey values of a number of other pixels also increases although this greater increase occurs in low contrast RGB image.

The increasing of grey value range causes the objects in the blood sample image can be more distinguishable against other objects in the same image including cytoplasm. While the case of colour dominance that appears in RGB image results, this case is like linear contrast stretching case, which is caused by many image pixels on multiple colour channels predominates at a high grey value.

Table 9. Image channel histogram before and after fuzzy logic implementation on low contrast image.

Channel R G B

Before contrast fuzzy logic

After contrast fuzzy logic

Page 14: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

240 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

Table 10. Image channel histogram before and after fuzzy logic implementation on high contrast image.

Channel R G B

Before contrast fuzzy logic

After contrast fuzzy logic

6.3. K-means clustering implementation Clustering requires a different number of clusters for each blood sample image. Nevertheless, regarding the results of experiments that the author did, in general, the optimal number of clusters for image data used is in the range of 4 - 8 clusters. In addition, the test results show that low contrast and high contrast images are not related to the many clusters required for optimal clustering. High contrast images may not necessarily have fewer optimal clusters than low-contrast images and vice versa. The result of K-means clustering of the contrast-enhanced image using each method is shown in Table 11.

Table 11. K-means clustering results of enhanced contrast image.

Contrast enhancement method

Enhancement contrast image K-means clustering result

Top hat - bottom hat transform

Linear contrast stretching

Fuzzy logic based image histogram

Page 15: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 241

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

The cluster formed is then separated, then the nucleus and cytoplasm cluster will be obtained as in Fig. 5.

(a) Nucleus cluster.

(b) Cytoplasm cluster.

Fig. 5. Nucleus and cytoplasm cluster.

6.4. Post-processing implementation Implementation of thresholding and area opening I will obtain a segmented nucleus as shown in Fig. 6(a) for thresholding result and Fig. 6(b) for area opening I result.

While the cytoplasm clusters thresholding result is shown in Fig. 7.

The image merger between the segmented nucleus and cytoplasm cluster resulted by thresholding will obtain Fig. 8.

(a) Result of thresholding.

(b) Result of area opening I.

Fig. 6. Segmented nucleus.

Fig. 7. Result of cytoplasm

cluster thresholding. Fig. 8. Merger result.

Page 16: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

242 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

Because the white blood cell shape is still far from perfect, the closing operation is applied. The result is shown in Fig. 9.

The resulting image still contains a noise object such as branched pixels; therefore branch-points operation is applied. The result is shown in Fig. 10.

Since the corresponding pixels in the object are successfully broken by branch-points operation, the area opening II can be done easily. The result of the area opening II is shown in Fig. 11.

The result of area opening II still leaves pixels of noise attached to the white blood cell object, therefore median filtering operation is used. The result is shown in Fig. 12.

Then masking process is performed to obtain segmented cytoplasm in the form of RGB colour image. This masking process is performed simultaneously with the process of removing the segmented nucleus from the white blood cell object in Fig. 12. The result of the masking process is shown in Fig. 13.

Fig. 9. Result of closing operation. Fig. 10. Result of branch

-points operation.

Fig. 11. Result of area opening II. Fig. 12. Results of median

filtering operation.

Fig. 13. Segmented cytoplasm.

Page 17: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 243

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

6.5. Result analysis Analysis of image contrast enhancement results of each method is done through calculating the average value of image visibility on each colour channel either RGB image, HSV or lab. While the analysis of K-means clustering segmentation results of cytoplasm is done by calculating the average of sensitivity, specificity, accuracy, and deformation value as segmentation parameter value for all segmented cytoplasm from enhanced contrast image resulted by the three methods, which are top hat and bottom hat transform as method I, linear contrast stretching as method II and fuzzy logic-based image histogram as method III. Execution time is also considered. The average image visibility value of enhanced contrast RGB image is shown in Table 12, while for RGB, HSV and lab images of linear contrast stretching results, the average image visibility value is shown by Table 13.

Table 12. Average image visibility value for each colour channel of enhanced contrast RGB image by three methods.

Method Image visibility R G B

I 1.00 1.00 1.00 II 1.00 1.00 1.00 III 0.94 0.93 0.94

Table 13. Average image visibility value of each colour channel of enhanced contrast RGB, HSV and lab by linear contrast stretching.

Colour model

Channel Image visibility

RGB R 1.00 G 1.00 B 1.00

HSV H 1.00 Lab L 1.00

A 1.00 b 1.00

The average image appearance value of the contrast image RGB image using the top hat and bottom hat transform method and the linear stretch contrast method is 1.00 for each image channel R, G and B. Likewise for each channel image is also generated in HSV images and Lab linear contrast stretch results are 1.00. The value of 1.00 is the perfect image appearance value. This shows that the top hat and bottom hat transform and linear contrast stretching methods have succeeded in improving the contrast of images used so that the dark and light features of the image can be clearly distinguished. While the results of histogram-based fuzzy logic image show the average image appearance of RGB images valued at 0.94 for R and B channels and 0.93 for channel G. This shows that the differences in dark and bright features in the RGB image result from this method is smaller compared to RGB images from the top hat and bottom hat transform methods and linear contrast stretching methods. However, if the average image appearance value is associated with the results of cytoplasm K-means clustering segmentation, the image that has an image appearance value of 1.00 does not necessarily produce

Page 18: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

244 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

cytoplasm segmentation results that are better than images with image appearance values of less than 1.00.

Based on Table 12, method I, top hat and bottom hat transform and method II, linear contrast stretching yield the image visibility value of 1.00 on each R, G and B enhanced contrast image channels. While the method III, which is fuzzy logic-based image histogram results 0.94 as image visibility value for R and B channels and 0.93 for G channel. Table 13 shows that image resulted by linear contrast stretching, either RGB, HSV or Lab image produce visibility value 1.00 on each image channel. The result has proven that contrast enhancement using method I and method II can increase the contrast image as well in RGB image and lab and HSV image with method II because visibility value of the resulted images has the value of 1.00. While for method III, it can increase the contrast image too but not as well as method I and method II. While for the average segmentation parameter value of K-means clustering segmentation in segmenting cytoplasm on enhanced contrast RGB image result is shown by Table 14. And for RGB, HSV and lab image resulted by linear contrast stretching; the average segmentation parameter value is shown by Table 15.

Table 14. Average segmentation parameter value on enhanced contrast RGB image.

Method Sensitivity (%)

Specificity (%)

Accuracy (%)

Deformation (%)

Execution time (s)

I 80.95 99.5 99.19 40.76 71.06 II 79.26 99.49 99.15 39.87 74.83 III 79.35 99.51 99.17 38.93 6059.34

Table 15. Average segmentation parameter value on enhanced contrast RGB, HSV and Lab image resulted by linear contrast stretching. Colour model

Sensitivity (%)

Specificity (%)

Accuracy (%)

Deformation (%)

Execution time (s)

RGB 79.26 99.49 99.15 39.87 74.83 HSV 73.88 99.46 98.69 43.22 78.80 Lab 68.97 99.49 98.55 50.01 77.94

Table 14 shows that contrast enhancement implementation for cytoplasm segmentation resulted in the highest sensitivity and accuracy value of 80.95% and 99.19% for enhanced contrast RGB image by method I, namely top hat and bottom hat transform. In addition, the execution time of method I is also the fastest compared to the other two methods, which is 71.06 s. While the highest specificity and the lowest deformation generated on enhanced contrast RGB image resulted by method III that is fuzzy logic-based on image histogram with 99.51% and 38.93%. Method III has a much longer execution time when compared to the other two methods. While from Table 15 it can be seen that the use of linear contrast stretching method as a pre-processing stage for K-means clustering segmentation of white cell cytoplasm yields the highest average sensitivity, specificity and accuracy value of 79.26%; 99.49% and 99.15% and the lowest deformation and execution time, which are 39.87% and 74.83 s for the RGB colour image. Table 16 shows the result of K-means clustering cytoplasm segmentation for RGB, HSV and

Page 19: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 245

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

lab images without going through the pre-processing stage, which is contrast enhancement for this study.

The top hat and bottom hat transform method can create the highest average value of cytoplasm K-means clustering results except for the average value of specificity shown in Table 14. This is because in applying this method, we can determine the optimal size of structuring element to create an image with optimal contrast improvement by visually separating the cytoplasm of white blood cells with the background or red blood cells surrounding them, while the contrast stretching method and fuzzy logic-based on histogram image, the author cannot intervene in determining the image of contrast improvement because the resulting image will automatically follow the linear contrast stretching equation or the rule in the fuzzy logic used, where both will only stretch the grey value to 0 - 255. Linear contrast stretching methods and fuzzy logic-based image histograms can indeed increase the contrast between objects in the image of a blood sample. However, refer to the results of the segmentation created, it can be said that the contrast difference created by the two methods is not perfect when compared to the contrast created by the top hat method and bottom hat transform in separating cytoplasm objects from other blood sample image objects.

On the application of contrast enhancement programs using the linear stretch contrast method as the pre-processing stage for K-Means segmentation of cytoplasm clustering with the image colour models used are RGB, HSV and lab with the results of segmentation shown in Table 15, RGB images show mean sensitivity values, specificity and the highest accuracy and the lowest average deformation and execution time. Refer to the results of the linear contrast stretching method on each RGB, HSV and lab colour channel, it can be seen that this method will increase the image contrast level in each image channel and allow it to show increased contrast between objects in the image of the blood sample visually including cytoplasm objects. This condition applies to high contrast and low contrast RGB images. What distinguishes the two is only the difference in grey values of several pixels with several other pixels. most HSV images, whether high contrast or low contrast, linear contrast stretching will only increase the difference in grey values that are quite significant on channel V, which only affects the background brightness level. The effect given is very small to the increase in the contrast difference between objects in the image of the blood sample. While in the lab image, linear contrast stretching will increase the difference in contrast values on each channel for low contrast images. While high contrast images, the difference in contrast values will increase only on channels a and channel b, which makes RGB images better in producing segmented cytoplasm because the segmentation method used, namely K-Means Clustering classifies image objects based on the colour of the object, which colour between objects will look more and more visually different when the contrast difference is higher.

Comparing Tables 14 and 16 for the RGB colour image, it is evident that three contrast enhancement methods, I, II and III have improved the average value of sensitivity, specificity and accuracy and reduced deformation value. While the comparison of Tables 15 and 16, the implementation of linear contrast stretching on RGB image managed to increase the average value of sensitivity, specificity and accuracy as well as reduce the average value of deformation when compared with RGB image without contrast enhancement process. HSV image resulted in

Page 20: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

246 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

linear contrast stretching will increase the average value of specificity and minimize the average deformation value. While the implementation of linear contrast stretching on Lab image only succeeded in increasing the average value of specificity.

The average value of deformation, which has the highest value is the RGB image from contrast repair using the top hat and bottom hat transform method and the Lab image stretching linear contrast between the two methods and other colour models. This value indicates that many cytoplasm pixels are missing. This deformation arises due to the operation of branch-points and median filtering that are carried out at the post-processing stage. As the author mentioned earlier, these operations will change white pixels (worth 1) to black pixels (worth 0) for certain conditions. In addition, the contrast of the pixels of cytoplasm objects that are quite different on the edges can also cause these pixels to separate at different clusters with the cytoplasm cluster and make the deformation average value for the RGB image as a result of contrast improvement using the top hat method and bottom hat transform and Lab image resulting from linear contrast stretching are high. While for execution time, the fuzzy logic method based on image histogram requires the longest execution time because this method repairs contrast per pixel image. While the top hat and bottom hat transform method require the lowest execution time because of the size of disks from structuring elements used in general only ranges from 25-500 pixels and does not require time to do a colour conversion. While for RGB images with linear contrast stretching methods, the execution time is not as fast as the top hat method and bottom hat transform although it does not take time to do colour conversion too, because linear contrast stretching is done on each image channel.

Table 16. Average segmentation parameter value on RGB, HSV and Lab image without contrast enhancement.

Colour model

Sensitivity (%)

Specificity (%)

Accuracy (%)

Deformation (%)

RGB 78.65 99.47 99.14 42.97 HSV 74.59 99.45 98.42 45.69 Lab 73.65 99.47 98.89 44.54

7. Conclusions Contrast enhancement methods in the form of top hat and bottom hat transform, linear contrast stretching and fuzzy logic-based image histogram as the pre-processing stage for K-means clustering segmentation of white blood cell cytoplasm have a role in improving cytoplasm segmentation result, which is indicated by the increase of sensitivity, specificity and accuracy as well as the reduction in the average deformation values when compared to images without contrast enhancement, except for enhanced contrast HSV and Lab images resulted by linear contrast stretching method. The linear contrast stretching method on each RGB, HSV and lab colour channel, it can be seen that this method will increase the image contrast level in each image channel and allow it to show increased contrast between objects in the image of the blood sample visually including cytoplasm objects. Meanwhile, the average value of deformation, which has the highest value (many cytoplasm pixels are missing) is the RGB image from contrast repair using the top hat and bottom hat transform method

Page 21: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

The Effect of Contrast Enhancement Method for K-Means Clustering . . . . 247

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

and the Lab image stretching linear. K-Means clustering classifies image objects based on the colour of the object, which colour between objects will look more and more visually different when the contrast difference is higher. The result also shows that top hat and bottom hat transform is better than the others two methods in enhancing the image contrast of blood sample images using in this research with the value of sensitivity, specificity and accuracy are 80.95%, 99.5% and 99.19% respectively.

Nomenclatures B Structuring element fki Membership function input fko Membership function output i Grey value divider of the membership function input I Original image If Image resulted by linear contrast stretching Imax Maximum grey value of an image channel Imin Minimum grey value of an image channel IN Resulted image Io Original image of each colour channel j Grey value divider of the membership function output max Maximum grey value of the original image min Minimum grey value of the original image n Number of membership function either input or output x Horizontal image pixel coordinate y Vertical image pixel coordinate

Greek Symbols • Closing operation o Opening operation Θ Erosion operation ⊕ Dilation operation

Abbreviations

FN False Negative FP False Positive HSV Hue, Saturation, Value IBH Image resulted by Bottom Hat transform ITH Image resulted by Top Hat transform RGB Red, Green, Blue TN True Negative TP True Positive

References 1. Dorini, L.B.; Minetto, R.; and Leite, N.J. (2007). White blood cell

segmentation using morphological operators and scale-space analysis. Proceedings of the XX Brazilian Symposium on Computer Graphics and Image Processing. Minas Gerais, Brazil, 294-304.

Page 22: THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K …jestec.taylors.edu.my/Vol 15 issue 1 February 2020/15_1_17.pdf · THE EFFECT OF CONTRAST ENHANCEMENT METHOD FOR K-MEANS CLUSTERING

248 I. Herawati et al.

Journal of Engineering Science and Technology February 2020, Vol. 15(1)

2. Zhang, C.; Xiao, X.; Li, X.; Chen, Y.J.; Zhen, W.; Chang, J.; Zheng, C.; and Liu, Z. (2014). White blood cell segmentation by colour-space-based K-means clustering. Sensors, 14, 16128-16147.

3. Lashmi, K.; Sreekala, R.; and Sruthi, V.S. (2017). Fuzzy logic approach to contrast enhancement. International Journal of Advanced Research in Computer and Communication Engineering, 6, Special Issue 4, 112-115.

4. Hassanpour, H., Samadiani, N.; and Salehi, S.M.M. (2015). Using morphological transforms to enhance the contrast of medical images. The Egyptian Journal of Radiology and Nuclear Medicine, 46(2), 481-489.

5. Michelson, A. (1927). Studies in optics. Chicago, Illinois, United States of America: University of Chicago Press.

6. Duda, R.O.; Hart, P.E.; and Stork, D.G. (2000). Pattern recognition (2nd ed.). New York, United States of America: John Wiley and Sons, Inc.

7. Li, Y.; Zhu, R.; Mi, L.; Cao, Y.; and Yao, D. (2016). Segmentation of white blood cell for acute lymphoblastic leukaemia images using dual threshold method. Computational and Mathematical Methods in Medicine, Article ID 9514707, 12 pages.

8. Zhang, C.; Xiao, X.; Li, X.; Chen, Y.J.; Zhen, W.; Chang, J.; Zheng, C.; and Liu, Z. (2014). White blood cell segmentation by colour-space-based K-means clustering. Sensors, 14(9), 16128-16147.

9. Kamra, A.; and Kaur, M. (2017). A novel approach for contrast enhancement of greyscale images using multiscale morphology. International Research Journal of Advanced Engineering and Science, 2(3), 12-15.

10. Ramasamy, U.; and Perumal, K. (2017). Image enhancement of medical images based on an efficient approach of morphological and arithmetic operations. International Journal of Computer Trends and Technology (IJCTT), 49(5), 253-258.