Comparison of K-Means Clustering and Otsu Thresholding Methods in the Detection of Tuberculosis Extra Pulmonary Bacilli in the HSV Color Space

Bob Subhan Riza(1*), Jufriadif Na’am(2), Sumijan Sumijan(3)

(1) Faculty of Engineering and Computer Science, Universitas Potensi Utama, Medan
(2) Computer Science Faculty, Putra Indonesia University, Padang
(3) Computer Science Faculty, Putra Indonesia University, Padang
(*) Corresponding Author


Tuberculosis Extra Pulmonary (TBEP) is an infectious disease caused by the bacterium Mycobacterium tuberculosis and can cause death. Patients suffering from this disease must be treated quickly without waiting long. Currently, anyone who will be detected caused by this bacterium takes a long time and costs a lot. The biopsy is one of the techniques used to take the patient's lung fluid and give Ziehl Neelsen chemical dye and then observe using a microscope to determine this TBEP disease. This research aims to help detect bacteria quickly and precisely by performing computer-aided image processing by creating an application system. The technique used is to develop the segmentation method. The segmentation process is to develop a Hue Saturation Value (HSV) color space transformation technique with the K-Means and Otsu Thresholding techniques. From the results of the two methods used, it turns out that the Otsu Thresholding method can detect TBEP results with more accuracy than the K-Means method. So the method developed is beneficial in accelerating and minimizing costs for detecting TBEP.


Tuberculosis Extra Pulmonary; K-Means; Otsu Thresholding; Hue Saturation Value (HSV); Segmentation

Full Text:



[1] B. S. Riza, M. Y. Mashor, M. K. Osman, and H. Jaafar, “Automated segmentation procedure for Ziehl-Neelsen stained tissue slide images,” 2017 5th Int. Conf. Cyber IT Serv. Manag. CITSM 2017, Oct. 2017, doi: 10.1109/CITSM.2017.8089292.

[2] B. S. Riza, M. Y. Mashor, M. K. Osman, and H. Jaafar, “Segmentation for Tuberculosis Ziehl-Neelsen Stained Tissue Slide Image Using Thresholding,” 2018 6th Int. Conf. Cyber IT Serv. Manag. CITSM 2018, Mar. 2019, doi: 10.1109/CITSM.2018.8674335.

[3] “Etiologi Tuberkulosis Paru - Alomedika.” (accessed May 09, 2022).

[4] T. Ferkol and D. Schraufnagel, “The global burden of respiratory disease,” Ann. Am. Thorac. Soc., vol. 11, no. 3, pp. 404–406, 2014, doi: 10.1513/ANNALSATS.201311-405PS.

[5] Y. Cao et al., “Improving Tuberculosis Diagnostics Using Deep Learning and Mobile Health Technologies among Resource-Poor and Marginalized Communities,” Proc. - 2016 IEEE 1st Int. Conf. Connect. Heal. Appl. Syst. Eng. Technol. CHASE 2016, pp. 274–281, Aug. 2016, doi: 10.1109/CHASE.2016.18.

[6] “(5) Detection of Tuberculosis Bacilli using Image Processing Techniques | Request PDF.” (accessed May 12, 2022).

[7] “Global tuberculosis report 2017.” (accessed May 09, 2022).

[8] “Global tuberculosis report 2020.” (accessed May 09, 2022).

[9] P. Bulan, “Pendahuluan DICARI PARA PEMIMPIN UNTUK DUNIA BEBAS TBC,” Accessed: May 09, 2022. [Online]. Available:

[10] H. Hartatik, “Diagnosa Penyakit Pulmonary Tuberculosis Dan Extrapulmonary Tuberculosis Menggunakan Algoritma Certainty Factor (CF),” CSRID (Computer Sci. Res. Its Dev. Journal), vol. 8, no. 1, pp. 11–24, Mar. 2016, doi: 10.22303/CSRID.8.1.2016.11-24.

[11] “Buku Ajar Tuberkulosis Ekstra Paru — Universitas Indonesia.” (accessed May 09, 2022).

[12] “ACADSTAFF UGM.” (accessed May 12, 2022).

[13] C. C. Pawar and S. R. Ganorkar, “TUBERCULOSIS SCREENING USING DIGITAL IMAGE PROCESSING TECHNIQUES,” Int. Res. J. Eng. Technol., 2016, Accessed: May 09, 2022. [Online]. Available:

[14] J. L. Díaz-Huerta, A. del Carmen Téllez-Anguiano, M. Fraga-Aguilar, J. A. Gutiérrez-Gnecchi, and S. Arellano-Calderón, “Image processing for AFB segmentation in bacilloscopies of pulmonary tuberculosis diagnosis,” PLoS One, vol. 14, no. 7, p. e0218861, Jul. 2019, doi: 10.1371/JOURNAL.PONE.0218861.

[15] N. Kamal and A. Chakrabarty, “Tuberculosis Diagnosis through Image Processing.”

[16] H. Yousefi, F. Mohammadi, N. Mirian, and N. Amini, “Tuberculosis Bacilli Identification: A Novel Feature Extraction Approach via Statistical Shape and Color Models,” Proc. - 19th IEEE Int. Conf. Mach. Learn. Appl. ICMLA 2020, pp. 366–371, Dec. 2020, doi: 10.1109/ICMLA51294.2020.00065.

[17] “Mycobacterium Tuberculosis identification based on colour feature extraction using expert system.” (accessed May 12, 2022).

[18] A. Rachmacl, N. Chamidah, and R. Rulaningtyas, “Classification of mycobacterium tuberculosis based on color feature extraction using adaptive boosting method,” AIP Conf. Proc., vol. 2329, no. 1, p. 050005, Feb. 2021, doi: 10.1063/5.0042283.

[19] T. A. Aris, A. S. A. Nasir, L. C. Chin, H. Jaafar, and Z. Mohamed, “Fast k-means clustering algorithm for malaria detection in thick blood smear,” 2020 IEEE 10th Int. Conf. Syst. Eng. Technol. ICSET 2020 - Proc., pp. 267–272, Nov. 2020, doi: 10.1109/ICSET51301.2020.9265380.

[20] N. Otsu, “THRESHOLD SELECTION METHOD FROM GRAY-LEVEL HISTOGRAMS.,” IEEE Trans Syst Man Cybern, vol. SMC-9, no. 1, pp. 62–66, 1979, doi: 10.1109/TSMC.1979.4310076.


Article Metrics

Abstract views : 696 | views : 472


  • There are currently no refbacks.

Copyright (c) 2022 IJCCS (Indonesian Journal of Computing and Cybernetics Systems)

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright of :
IJCCS (Indonesian Journal of Computing and Cybernetics Systems)
ISSN 1978-1520 (print); ISSN 2460-7258 (online)
is a scientific journal the results of Computing
and Cybernetics Systems
A publication of IndoCEISS.
Gedung S1 Ruang 416 FMIPA UGM, Sekip Utara, Yogyakarta 55281
Fax: +62274 555133 |

View My Stats1
View My Stats2