Accepted: 31-10-2022 | Received in revised: 16-01-2023 | Published: 03-02-2023 80 Accredited Ranking SINTA 2 Decree of the Director General of Higher Education, Research, and Technology, No. 158/E/KPT/2021 Validity period from Volume 5 Number 2 of 2021 to Volume 10 Number 1 of 2026 Published online on: http://jurnal.iaii.or.id JURNAL RESTI (Rekayasa Sistem dan Teknologi Informasi) Vol. 7 No. 1 (2023) 80 - 86 ISSN Media Electronic: 2580-0760 Comparison of Mycobacterium Tuberculosis Image Detection Accuracy Using CNN and Combination CNN-KNN Waluyo Nugroho 1 , R. Rizal Isnanto 2 , Adian Fatchur Rochim 3 1 Department of Electrical Engineering, Faculty of Engineering, Diponegoro University 2,3 Department of Computer Engineering, Faculty of Engineering, Diponegoro University 1 waluyo.programmer@gmail.com, 2 rizal_isnanto@yahoo.com, 3 adian@ce.undip.ac.id Abstract Mycobacterium tuberculosis is a pathogenic bacterium that causes respiratory tract disease in the lungs, namely tuberculosis (TB). The problem is to find out the bacterial colonies when the observation is still done manually using a microscope with a magnification of 1000 times. It took a long time and was tiring for the observer's eye. Based on this background, an automatic detection system for Mycobacterium tuberculosis was designed. Mycobacterium tuberculosis image data were obtained from the Semarang City Health Center. The dataset used is 220 sputum images, which are divided into 180 training data and 40 testing data. The method used in this research is a combination of Convolutional Neural Network (CNN) and K-Nearest Neighbor (KNN). CNN is used for image feature extraction. Furthermore, the results of the CNN feature extraction are classified using the KNN. The results of the accuracy of the combination of CNN-KNN and CNN were also compared. The stages of the process are color transformation, feature extraction, and data training with CNN, then classification with KNN. The results of the classification test between CNN and the CNN-KNN combination show that the CNN-KNN combination is better. The result of CNN-KNN accuracy is 92.5%, while CNN's accuracy is 90%. Keywords: mycobacterium tuberculosis, automatic detection system, convolutional neural network, k-nearest neighbor 1. Introduction Tuberculosis is an infectious disease caused by the bacterium Mycobacterium tuberculosis [1]. This disease can attack the lungs, circulatory system, lymphatic system, and respiratory tract, so if left unchecked it can cause human death [2]. Tuberculosis is caused by a dirty environment and humid areas. This disease can be transmitted between humans when coughing, sneezing, and talking [3]. Mycobacterium tuberculosis has a rod shape with varying curvature and a length between 1 to 10 mm [4]. Based on the 2019 WHO report, TB disease is still the most common cause of death. It is estimated that TB patients have increased to 10 million people, while deaths due to TB have increased by 208,000 people, from 88% of adults and 12% of children. Common countries with a large percentage are India (26%), Indonesia (8.5%), China (8.4%), Philippines (6.0%), Pakistan (5.7%), Nigeria (4.4%), Bangladesh (3.6%) and Africa South (3.6%) [5]. Every year, millions of people around the world are infected with tuberculosis, so WHO announced that tuberculosis is a global emergency disease. The city of Semarang, Central Java, Indonesia has many tuberculosis patients. In 2019, male tuberculosis patients in Semarang reached 3,438, while there were 1,875 cases in women, and children have 840 cases [6]. The case value for men is higher, this is because men are less concerned about the aspect of maintaining individual health than women. Tuberculosis has the risk of being transmitted to all ages and genders, so prevention and treatment must be taken seriously. The dataset used in this research will be taken from the Semarang City Public Health Center. Tuberculosis can be detected in several ways, including chest X-ray (CXR), sputum microscopy, GeneXpert MTB/RIF test, tuberculin skin test (TST), and interferon-gamma release assay (IGRA) [7]. Examination of tuberculosis patients using a microscope on sputum to detect Mycobacterium tuberculosis bacteria is still a popular diagnostic test in several countries, because of its low cost. Examination of tuberculosis with a microscope can be done with a Ziehl-Neelsen (ZN) staining process and a microscope magnification of 1000x [8]. The ZN staining process is used to change the color of Mycobacterium tuberculosis bacteria to red on a blue background, so that the