Building a Convolutional Neural Network Model for Tuberculosis Detection Using Chest X-Ray Images




Tuberculosis, Artificial Intelligence, Deep Learning, CNN, Machine Learning, Radiography, CXR


Background: Tuberculosis (TB) is a highly infectious disease with a high mortality rate if left untreated. Traditional diagnostic methods, like skin tests and sputum smear cultures, are unreliable and time-consuming. Artificial Intelligence (AI) and Deep Learning (DL) can revolutionize healthcare by improving disease diagnosis. This study developed an AI system using Convolutional Neural Network (CNN) to detect TB by analyzing digitalized chest X-ray (CXR) images, which can significantly improve the accuracy and speed of TB diagnosis, leading to better patient outcomes.

 Methods: A CNN model was developed; it uses a methodology that cuts the edges for analyzing the CXR images for detecting the tuberculosis symptoms in it. A database of chest X-ray images for tuberculosis which was gathered by a team of researchers was used to train the model for detecting tuberculosis.

 Result: This study uses deep learning to predict tuberculosis using a CNN model with 97% accuracy on CXR images. The patient can be informed about the severity of tuberculosis by the model, which analyzes and checks the tuberculosis symptoms in their CXR image.

 Conclusion: In summary, the advancement of AI and DL has brought about a significant transformation in the healthcare industry, particularly in the detection, diagnosis, and treatment of diseases. The use of AI and DL in tuberculosis diagnosis has been explored in this study through the development of a CNN model that was trained on chest X-ray images. AI and DL can significantly reduce tuberculosis mortality rates by aiding in early detection.

Author Biographies

Mohammad Nazir Akbari, Kabul University

Department of Information Systems, Faculty of Computer Science, Kabul University, Kabul, Afghanistan.

Abed Azizi, Kabul University

Department of Information Systems, Faculty of Computer Science, Kabul University, Kabul, Afghanistan.

Sherbano Muhmand, Emergency hospital

Italian NGO Emergency ONG Onlus, Emergency hospital, Panjsher, Afghanistan.

Abdul Wakil Qarluq, Dalian Medical University

Department of Biochemistry and Molecular Biology, Dalian Medical University, Dalian, Liaoning Province, P.R China.


Natarajan A, Beena PM, Devnikar AV, Mali S. A systemic review on tuberculosis. The Indian journal of tuberculosis. 2020;67(3):295-311.

Bagcchi S. WHO's Global Tuberculosis Report 2022. The Lancet Microbe. 2023;4(1):e20.

Rabozzi G, Bonizzi L, Crespi E, Somaruga C, Sokooti M, Tabibi R, et al. Emerging zoonoses: the “one health approach”. Safety and health at work. 2012;3(1):77-83.

Menzies NA, Wolf E, Connors D, Bellerose M, Sbarra AN, Cohen T, et al. Progression from latent infection to active disease in dynamic tuberculosis transmission models: a systematic review of the validity of modelling assumptions. The Lancet Infectious Diseases. 2018;18(8):e228-e38.

Lange C, Mori T. Advances in the diagnosis of tuberculosis. Respirology. 2010;15(2):220-40.

Campbell IA, Bah-Sow O. Pulmonary tuberculosis: diagnosis and treatment. Bmj. 2006;332(7551):1194-7.

Kulkarni S, Jha S. Artificial intelligence, radiology, and tuberculosis: a review. Academic radiology. 2020;27(1):71-5.

Jarrahi MH. Artificial intelligence and the future of work: Human-AI symbiosis in organizational decision making. Business horizons. 2018;61(4):577-86.

Rong G, Mendez A, Assi EB, Zhao B, Sawan M. Artificial intelligence in healthcare: review and prediction case studies. Engineering. 2020;6(3):291-301.

Mak K-K, Pichika MR. Artificial intelligence in drug development: present status and future prospects. Drug discovery today. 2019;24(3):773-80.

Bini SA. Artificial intelligence, machine learning, deep learning, and cognitive computing: what do these terms mean and how will they impact health care? The Journal of arthroplasty. 2018;33(8):2358-61.

Rahman T, Khandakar A, Kadir MA, Islam KR, Islam KF, Mazhar R, et al. Reliable tuberculosis detection using chest X-ray with deep learning, segmentation and visualization. IEEE Access. 2020;8:191586-601.

Jaeger S, Candemir S, Antani S, Wáng Y-XJ, Lu P-X, Thoma G. Two public chest X-ray datasets for computer-aided screening of pulmonary diseases. Quantitative imaging in medicine and surgery. 2014;4(6):475.

[Online] BPHBTP. 2020 [Available from:


[Online]. kRPDC. [Available from:

Shorten C, Khoshgoftaar T. A survey on image data augmentation for deep learning. J Big Data 6 (1): 1–48. 2019.

Yamashita R, Nishio M, Do R. Gian, and K. Togashi,“. Convolutional neural networks: An overview and application in radiology,” Insights Imag. 2018;9(4):611-29.

Skourt BA, El Hassani A, Majda A. Mixed-pooling-dropout for convolutional neural network regularization. Journal of King Saud University-Computer and Information Sciences. 2022;34(8):4756-62.

Hossin M. Sulaiman,“. A review on evaluation metrics for data calassification evaluations,” IJDKP) Int J Data Min Knowl Manag Process. 2020;5(2).

M P. End-to-End Introduction to Evaluating Regression Models [Internet]: Analytics Vidhya. 2021 September 1st, 2022. Available from:

Majnik M, Bosnić Z. ROC analysis of classifiers in machine learning: A survey. Intelligent data analysis. 2013;17(3):531-58.

Showkatian E, Salehi M, Ghaffari H, Reiazi R, Sadighi N. Deep learning-based automatic detection of tuberculosis disease in chest X-ray images. Polish journal of radiology. 2022;87:e118-e24.




How to Cite

Akbari, M. N., Azizi, A., Muhmand, S., & Qarluq, A. W. (2023). Building a Convolutional Neural Network Model for Tuberculosis Detection Using Chest X-Ray Images. Afghanistan Journal of Infectious Diseases, 1(1), 21–26.