Development of a Web-Based Expert System for Early Tuberculosis Diagnosis Using K-Nearest Neighbors

Authors

  • Lukas Valentino Politeknik Negeri Malang
  • Vivi Nur Wijayaningrum Politeknik Negeri Malang
  • Candra Bella Vista Politeknik Negeri Malang

DOI:

https://doi.org/10.30871/jaic.v10i2.11747

Keywords:

expert system, KNN, machine learning, tuberculosis diagnosis

Abstract

Tuberculosis (TB) remains a major infectious disease that continues to challenge global public health, particularly in regions with limited access to early diagnostic services. Early and accurate detection of TB is essential to prevent further transmission and ensure effective treatment. This study aims to develop an intelligent expert system for early TB diagnosis based on the K-Nearest Neighbors (KNN) algorithm. To achieve this, the proposed system classifies patient conditions as TB or Non-TB based on clinical symptoms obtained from anonymized medical record data from a regional hospital in East Java, Indonesia. The dataset comprises eight symptom-based attributes, and several experiments were conducted to optimize parameters, including test-size ratio, number of neighbors (K), and K-Fold cross-validation. Results showed that the best model performance was achieved at K = 5 with a 10% test size, yielding an F1-score of 0.8571, precision of 1.00, and recall of 0.75. In addition, functional and non-functional testing confirmed that the developed web-based system operates reliably and securely. Overall, the proposed system provides an accurate and accessible diagnostic solution for early TB detection, especially in communities with limited healthcare infrastructure.

Downloads

Download data is not yet available.

References

[1] Y. Chen et al., “Global burden of HIV-negative multidrug- and extensively drug-resistant tuberculosis based on Global Burden of Disease Study 2021,” Science in One Health, vol. 3, p. 100072, Jan. 2024, doi: 10.1016/j.soh.2024.100072.

[2] O. B. Kwon et al., “Nutrition Status and Comorbidities Are Important Factors Associated With Mortality During Anti-Tuberculosis Treatment,” J Korean Med Sci, vol. 40, no. 17, p. e73, 2025, doi: 10.3346/jkms.2025.40.e73.

[3] Z. Indra, “Development of an Expert System To Diagnose Tb in Pandemi Time Using the Forward Chaining Method in Puskesmas Medan, Johor,” Karismatika, vol. 2, no. 1, pp. 40–46, 2022.

[4] V. N. Wijayaningrum, T. H. Saragih, and N. N. Putriwijaya, “Optimal multi-layer perceptron parameters for early stage diabetes risk prediction,” in IOP Conference Series: Materials Science and Engineering, 2021, p. 012070. doi: 10.1088/1757-899x/1073/1/012070.

[5] T. A. Assegie, “Heart disease prediction model with k-nearest neighbor algorithm,” International Journal of Informatics and Communication Technology (IJ-ICT), vol. 10, no. 3, pp. 225–230, Dec. 2021, doi: 10.11591/ijict.v10i3.pp225-230.

[6] W. Lestari and S. Sumarlinda, “Implementation of K-Nearest Neighbor (KNN) And Support Vector Machine (SVM) For Clasification Cardiovascular Disease,” International Journal of Multi Science, vol. 2, no. 10, pp. 30–36, 2022, [Online]. Available: https://archive.ics.uci.edu/ml/datasets/heart+disease.

[7] B. U. Maheswari, T. Guhan, C. F. Britto, A. Sheeba, M. P. Rajakumar, and K. Pratyush, “Performance analysis of classifying the breast cancer images using KNN and naive bayes classifier,” in AIP Conference Proceedings, AIP Publishing LLC, 2023, p. 020012. doi: https://doi.org/10.1063/5.0164139.

[8] S. Sravani and P. R. Karthikeyan, “Detection of cardiovascular disease using KNN in comparison with naive bayes to measure precision, recall and f-score,” in AIP Conference Proceedings, AIP Publishing LLC, 2023, p. 030002. doi: https://doi.org/10.1063/5.0177014.

[9] F. Madani, K. Kusworo, and F. Farikhin, “Heart Disease Prediction Using Optimized Weighted K-Nearest Neighbor (WKNN),” Jurnal Penelitian Pendidikan IPA, vol. 10, no. 11, pp. 8847–8854, Nov. 2024, doi: 10.29303/jppipa.v10i11.9257.

[10] Y. D. Pratama and A. Salam, “Comparison of Data Normalization Techniques on KNN Classification Performance for Pima Indians Diabetes Dataset,” Journal of Applied Informatics and Computing (JAIC), vol. 9, no. 3, pp. 693–706, 2025, [Online]. Available: http://jurnal.polibatam.ac.id/index.php/JAIC

[11] M. S. Ghaisani and A. Baita, “Implementation of the K-Nearest Neighbors (KNN) Regressor Method to Predict Toyota Used Car Prices,” Journal of Applied Informatics and Computing (JAIC), vol. 9, no. 1, pp. 194–201, 2025, [Online]. Available: http://jurnal.polibatam.ac.id/index.php/JAIC

[12] M. F. Nasution, W. Wanayumini, and R. Roesnelly, “Classification of K-Nearest Neighbor (K-NN) and Convolutional Neural Network (CNN) for the Identification of Bronchitis Disease in Toddlers Using GLCM Feature Extraction Based on Thorax X-Ray Images,” in Proceeding of International Conference on Education, Society And Humanity, Mar. 2024, pp. 1637–1648.

[13] B. Lewandowicz and K. Kisiała, “Comparison of Support Vector Machine, Naive Bayes, and K-Nearest Neighbors Algorithms for Classifying Heart Disease,” in International Conference on Information and Software Technologies, Cham: Springer Nature Switzerland, 2024, pp. 274–285. doi: https://doi.org/10.1007/978-3-031-48981-5_22.

[14] Z. Munira, H. Husaini, and Z. Khalid, “Expert System for Diagnosing Exanthema Virus Using Web-Based KNN (K-Nearest Neighbor) Method,” InnoComp : Journal of Informatics and Computing, vol. 1, no. 1, pp. 17–24, 2025, [Online]. Available: https://ejournal.sagita.or.id/index.php/InnoComp

[15] I. Khasanah, “Enhancing Alzheimer’s Disease Diagnosis with K-NN: A Study on Pre-processed MRI Data,” International Journal of Artificial Intelligence in Medical Issues, vol. 2, no. 1, pp. 49–60, May 2024, doi: 10.56705/ijaimi.v2i1.150.

[16] A. A. Permana and A. Arsanah, “Enhancing Early Diagnosis of Heart Disease: A Comparative Study of K-NN and Naive Bayes Classifiers Using the UCI Heart Disease Dataset,” Journal of Intelligent Computing & Health Informatics, vol. 5, no. 1, pp. 35–42, Apr. 2024, doi: 10.26714/jichi.v5i1.11251.

[17] Ari Peryanto, D. Susanto, and B. H. Jihad, “Classification of Skin Disease Images Using K-Nearest Neighbour (KNN),” Journal of Advanced Health Informatics Research, vol. 2, no. 3, pp. 168–174, Feb. 2025, doi: 10.59247/jahir.v2i3.300.

[18] V. N. Wijayaningrum, A. P. Kirana, I. K. Putri, and T. O. Satrio, “Prediction of Student Academic Performance in Practicum Courses Based on Activity Logs and Student Background,” Proceedings - IEIT 2022: 2022 International Conference on Electrical and Information Technology, pp. 366–371, 2022, doi: 10.1109/IEIT56384.2022.9967888.

Downloads

Published

2026-04-16

How to Cite

[1]
L. Valentino, V. N. Wijayaningrum, and C. B. Vista, “Development of a Web-Based Expert System for Early Tuberculosis Diagnosis Using K-Nearest Neighbors”, JAIC, vol. 10, no. 2, pp. 1276–1281, Apr. 2026.

Similar Articles

1 2 3 4 5 > >> 

You may also start an advanced similarity search for this article.