APPLYING MACHINE LEARNING TO ANALYZE TUBERCULOSIS SERVICE STANDARDS IN INDONESIA
DOI:
https://doi.org/10.37268/mjphm/vol.26/no.1/art.3698Keywords:
Tuberculosis, machine learning, Random Forest, healthcare service quality, early detection, TB preventionAbstract
Tuberculosis (TB) remains a significant public health challenge in Indonesia, with persistent disparities in service quality. Early identification of substandard TB services is critical to prevent transmission and accelerate elimination efforts. This study developed a machine-learning–based model to classify TB service compliance, identify key predictors, and provide evidence to guide targeted TB control policies. A retrospective design was applied using primary and secondary data from 1,722 TB patients in Semarang City, Indonesia. Three algorithms—Random Forest, K-Nearest Neighbors (KNN), and Boosting—were implemented with 5-fold stratified cross-validation, feature selection via Recursive Feature Elimination (RFE), hyperparameter tuning, and variable importance analysis. Model performance was evaluated based on accuracy, AUC, recall, and F1-score, with particular emphasis on the ability to detect the minority class ("non-compliant services"). The Random Forest model achieved the highest test accuracy (97.7%) with an average AUC of 0.655. However, the high accuracy should be interpreted cautiously, given the highly imbalanced class distribution (96.1% compliant vs 3.9% non-compliant), which limits the model's ability to detect minority cases. The analysis, therefore, emphasized recall and F1-score for the minority class as indicators of the model's practical usefulness for early detection. Five key predictors were identified, with anti-TB drug regimen and age contributing most to model performance. The model shows potential as an early warning tool for substandard TB services and can support risk-based interventions. Integration into national health information systems may strengthen decision-making and accelerate TB elimination.
References
World Health Organization. Global tuberculosis report 2024 [Internet]. 2024. Available from: https://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2024
Kementerian Kesehatan Republik Indonesia. Profil Kesehatan Indonesia 2023 [Internet]. Jakarta; 2024. Available from: https://kemkes.go.id/app_asset/file_content_download/172231123666a86244b83fd8.51637104.pdf
Kementerian Kesehatan Republik Indonesia. Strategi nasional penanggulangan tuberkulosis di Indonesia 2020-2024. Vol. 135, Pertemuan Konsolidasi Nasional Penyusunan STRANAS TB. 2020.
Handayani S, Isworo S. Evaluation of Tuberculosis program implementation in Primary Health Care, Semarang, Indonesia. Int J Public Heal Asia Pacific. 2024;1–11.
Rahayu SR, Susilastuti MS, Saefurrohim MZ, Azam M, Indrawati F, Supriyono M, et al. Lost to Follow-Up among Tuberculosis Patients during the Public-Private Mix Era in Rural Area of Indonesia. Ethiop J Health Sci. 2023;33(1).
Dinas Kesehatan Kota Semarang. Profil Kesehatan Kota Semarang 2023 [Internet]. Semarang; 2023. Available from: https://pustakadata.semarangkota.go.id/upload/pdf/451-profil-kesehatan-2022.pdf
Kementerian Kesehatan Republik Indonesia. Pedoman Nasional Pelayanan Kedokteran: Tatalaksana Tuberkulosis. Jakarta; 2020.
Ahmad RA, Matthys F, Dwihardiani B, Rintiswati N, de Vlas SJ, Mahendradhata Y, et al. Diagnostic work-up and loss of tuberculosis suspects in Jogjakarta, Indonesia. BMC Public Health. 2012;12:1–6.
Lestari BW, McAllister S, Hadisoemarto PF, Afifah N, Jani ID, Murray M, et al. Patient pathways and delays to diagnosis and treatment of tuberculosis in an urban setting in Indonesia. Lancet Reg Heal Pacific. 2020;5.
Lestari BW, Nijman G, Larasmanah A, Soeroto AY, Santoso P, Alisjahbana B, et al. Management of drug-resistant tuberculosis in Indonesia: a four-year cascade of care analysis. Lancet Reg Heal Asia. 2024;22.
Sugiyono RI, Naysilla AM, Susanto NH, Handayani D, Burhan E, Karuniawati A, et al. Treatment outcomes of pulmonary TB in adults in Indonesia. IJTLD open. 2025;2(3):145–52.
Udwadia Z, Furin J. Quality of drug-resistant tuberculosis care: Gaps and solutions. J Clin Tuberc other Mycobact Dis. 2019;16:100101.
Iswandari HD, Sugiharto S, Harsono H. The evaluation of pulmonary tuberculosis (TB) control program at Bandarharjo Community Health Center Semarang city in 2021. In: AIP Conference Proceedings. AIP Publishing; 2023.
Tuharea R, Suparwati A, Sriatmi A. Analysis on Factors Associated with the Implementation of the Pulmonary Tuberculosis Care Finding in Tuberculosis Control Program at Primary Healthcare Center in Semarang. J Manaj Kesehat Indones. 2(2).
Paskaria C, Sunjaya DK, Parwati I, Bestari MB. Digital Health to Strengthen District-Based Public–Private Mix Tuberculosis Control in Purwakarta District, Indonesia: A Qualitative Research. Int J Environ Res Public Health. 2022;19(19):12097.
Reviono R, Setianingsih W, Damayanti KE, Ekasari R. The dynamic of tuberculosis case finding in the era of the public–private mix strategy for tuberculosis control in Central Java, Indonesia. Glob Health Action. 2017;10(1):1353777.
Surya A, Setyaningsih B, Suryani Nasution H, Gita Parwati C, Yuzwar YE, Osberg M, et al. Quality tuberculosis Care in Indonesia: using patient pathway analysis to optimize public–private collaboration. J Infect Dis. 2017;216(suppl_7):S724–32.
Fuady A, Houweling TAJ, Mansyur M, Burhan E, Richardus JH. Cost of seeking care for tuberculosis since the implementation of universal health coverage in Indonesia. BMC Health Serv Res. 2020;20:1–10.
Fuady A, Houweling TAJ, Mansyur M, Burhan E, Richardus JH. Catastrophic costs due to tuberculosis worsen treatment outcomes: a prospective cohort study in Indonesia. Trans R Soc Trop Med Hyg. 2020;114(9):666–73.
Hansun S, Argha A, Bakhshayeshi I, Wicaksana A, Alinejad-Rokny H, Fox GJ, et al. Diagnostic Performance of Artificial Intelligence–Based Methods for Tuberculosis Detection: Systematic Review. J Med Internet Res. 2025;27:e69068.
KB HM, Jose SA, Jirawattanapanit A, Mathew K. A comprehensive study on tuberculosis prediction models: Integrating machine learning into epidemiological analysis. J Theor Biol. 2025;597:111988.
Gadicherla S, Krishnappa L, Madhuri B, Mitra SG, Ramaprasad A, Seevan R, et al. Envisioning a learning surveillance system for tuberculosis. PLoS One. 2020;15(12):e0243610.
Chen J, Jiang Y, Li Z, Zhang M, Liu L, Li A, et al. Predictive machine learning models for anticipating loss to follow-up in tuberculosis patients throughout anti-TB treatment journey. Sci Rep. 2024;14(1):24685.
Peng A zhou, Kong XH, Liu S tao, Zhang H fen, Xie L ling, Ma L juan, et al. Explainable machine learning for early predicting treatment failure risk among patients with TB-diabetes comorbidity. Sci Rep. 2024;14(1):6814.
Ahamed Fayaz S, Babu L, Paridayal L, Vasantha M, Paramasivam P, Sundarakumar K, et al. Machine learning algorithms to predict treatment success for patients with pulmonary tuberculosis. PLoS One. 2024;19(10):e0309151.
Balakrishnan V, Kherabi Y, Ramanathan G, Paul SA, Tiong CK. Machine learning approaches in diagnosing tuberculosis through biomarkers-A systematic review. Prog Biophys Mol Biol. 2023;179:16–25.
Global TB Programme. The End TB Strategy. Geneva; 2015.
Tanimu JJ, Hamada M, Hassan M, Ilu SY. A contemporary machine learning method for accurate prediction of cervical cancer. In: SHS Web of Conferences. EDP Sciences; 2021. p. 4004.
Allen J, Liu H, Iqbal S, Zheng D, Stansby G. Deep learning-based photoplethysmography classification for peripheral arterial disease detection: A proof-of-concept study. Physiol Meas. 2021;42(5):54002.
Genuer R, Poggi JM, Genuer R, Poggi JM. Random forests. Springer; 2020.
Cappelli F, Castronuovo G, Grimaldi S, Telesca V. Random Forest and Feature Importance Measures for Discriminating the Most Influential Environmental Factors in Predicting Cardiovascular and Respiratory Diseases. Int J Environ Res Public Health. 2024;21(7):867.
Ramteke RJ, Monali KY. Automatic medical image classification and abnormality detection using k-nearest neighbour. Int J Adv Comput Res. 2012;2(4):190.
Najwaini E, Tarigan TE, Putra FP. Application of the K-Nearest Neighbors (KNN) Algorithm on the Brain Tumor Dataset. Int J Artif Intell Med Issues. 2023;1(1):18–26.
Dou Y, Liu J, Meng W, Zhang Y. Comparative analysis of supervised learning algorithms for prediction of cardiovascular diseases. Technol Heal Care. 2024;32(1_suppl):241–51.
Ansyari MR, Mazdadi MI, Indriani F, Kartini D, Saragih TH. Implementation of Random Forest and Extreme Gradient Boosting in the Classification of Heart Disease Using Particle Swarm Optimization Feature Selection. J Electron Electromed Eng Med Informatics. 2023;5(4):250–60.
Nellore SB. Various performance measures in Binary classification-An Overview of ROC study. IJISET-International J Innov Sci Eng Technol. 2015;2(9):596–605.
Davis J, Goadrich M. The relationship between Precision-Recall and ROC curves. In: Proceedings of the 23rd international conference on Machine learning. 2006. p. 233–40.
Amoori N, Cheraghian B, Amini P, Alavi SM. Identification of Risk Factors Associated with Tuberculosis in Southwest Iran: A Machine Learning Method. Med J Islam Repub Iran. 2024;38:5.
Tang N, Yuan M, Chen Z, Ma J, Sun R, Yang Y, et al. Machine learning prediction model of tuberculosis incidence based on meteorological factors and air pollutants. Int J Environ Res Public Health. 2023;20(5):3910.
Coimbra AG, Oliveira CG, Libório MP, Mannan H, Santos LI, Fusco E, et al. Approaches for handling imbalanced data used in machine learning in the healthcare field: A case study on Chagas disease database prediction. PLoS One. 2025;20(5):e0320966.
Ren Y, Wu D, Tong Y, López-DeFede A, Gareau S. Issue of data imbalance on low birthweight baby outcomes prediction and associated risk factors identification: establishment of benchmarking key machine learning models with data rebalancing strategies. J Med Internet Res. 2023;25:e44081.
Aubaidan BH, Kadir RA, Lajb MT, Anwar M, Qureshi KN, Taha BA, et al. A review of intelligent data analysis: Machine learning approaches for addressing class imbalance in healthcare-challenges and perspectives. Intell Data Anal. 2025;29(3):699–719.
Owusu-Adjei M, Ben Hayfron-Acquah J, Frimpong T, Abdul-Salaam G. Imbalanced class distribution and performance evaluation metrics: A systematic review of prediction accuracy for determining model performance in healthcare systems. PLOS Digit Heal. 2023;2(11):e0000290.
Bagcchi S. WHO’s global tuberculosis report 2022. The Lancet Microbe. 2023;4(1):e20.
Parwati NM, Bakta IM, Januraga PP, Wirawan IMA. A health belief model-based motivational interviewing for medication adherence and treatment success in pulmonary tuberculosis patients. Int J Environ Res Public Health. 2021;18(24):13238.
Lestari BW, Afifah N, McAllister S, Miranda AV, Herawati E, Hadisoemarto PF, et al. Determinants of adherence towards tuberculosis guidelines among Indonesian private practitioners: a qualitative study. BMJ Glob Heal. 2024;9(12):e015261.
Dewi IK, Hairi FM, Andriani H. Enhancing Tuberculosis Care Quality in Karawang District: A Comparative Study Between Public and Private Hospitals. 2024;
Chavez-Rimache L, Ugarte-Gil C, Brunette MJ. The community as an active part in the implementation of interventions for the prevention and care of tuberculosis: A scoping review. PLOS Glob Public Heal. 2023;3(12):e0001482.
Assefa DG, Dememew ZG, Zeleke ED, Manyazewal T, Bedru A. Financial burden of tuberculosis diagnosis and treatment for patients in Ethiopia: a systematic review and meta-analysis. BMC Public Health. 2024;24(1):260.
Pfob A, Lu SC, Sidey-Gibbons C. Machine learning in medicine: a practical introduction to techniques for data pre-processing, hyperparameter tuning, and model comparison. BMC Med Res Methodol. 2022;22(1):282.
Hossain MR, Timmer D. Machine learning model optimization with hyper parameter tuning approach. Glob J Comput Sci Technol D Neural Artif Intell. 2021;21(2):31.
Munandar AR, Rozak F, Simatupang A, Kurniasari D. Safe breath: A concept for air quality monitoring app using internet of things and early detection to support Tuberculosis elimination by 2030. J Evidence-based Nurs Public Heal. 2025;2(1):1–18.
Ahmad RA, Nelli L, Surendra H, Arisanti RR, Lesmanawati DAS, Byrne I, et al. A framework for evaluating health system surveillance sensitivity to support public health decision-making for malaria elimination: a case study from Indonesia. BMC Infect Dis. 2022;22(1):619.
Ramachandran A, Kumar A, Koenig H, De Unanue A, Sung C, Walsh J, et al. Predictive analytics for retention in care in an urban HIV clinic. Sci Rep. 2020;10(1):6421.
Nidoi J, Muttamba W, Walusimbi S, Imoko JF, Lochoro P, Ictho J, et al. Impact of socio-economic factors on Tuberculosis treatment outcomes in north-eastern Uganda: a mixed methods study. BMC Public Health. 2021;21:1–16.
Silva Rodrigues OA, Mogaji HO, Alves LC, Flores-Ortiz R, Cremonese C, Nery JS. Factors associated with unsuccessful tuberculosis treatment among homeless persons in Brazil: A retrospective cohort study from 2015 to 2020. PLoS Negl Trop Dis. 2023;17(10):e0011685.
Mohammed E. The key factors influencing tuberculosis treatment outcomes: A literature review. Int J Recent Innov Med Clin Res. 2024;6(3):76–9.
Nursalim N, Nyorong M, Amirah A. Implementation of management of pulmonary Tuberculosis with the directly observed treatment short course strategy. J Asian Multicult Res Med Heal Sci Study. 2021;2(4):130–42.