Automated Tuberculosis Detection from Chest X-Ray Images Using CNN and Transformer-Based Deep Learning Models

Authors

  • Dontha Madhusudhana Rao Department of Computer Science and Engineering, Amrita Vishwa Vidyapeetham, Guntur, India Author
  • Dasari Karthik Reddy Department of Computer Science and Engineering, Amrita Vishwa Vidyapeetham, Guntur, India Author
  • Muppala Dhanvith Varma Department of Computer Science and Engineering, Amrita Vishwa Vidyapeetham, Guntur, India Author
  • Chennupati Bharath Chandra Department of Computer Science and Engineering, Amrita Vishwa Vidyapeetham, Guntur, India Author
  • Marthala Santhosh Reddy Department of Computer Science and Engineering, Amrita Vishwa Vidyapeetham, Guntur, India Author
  • Saroj Kumar Biswas Department of Computer Science and Engineering, National Institute of Technology Silchar, Silchar, India Author

DOI:

https://doi.org/10.68337/cpsm.v1.i1.2026-004

Keywords:

Tuberculosis screening, chest X-ray, deep learning, convolutional neural network, vision transformer, adaptive patch reduction

Abstract

Tuberculosis (TB) is a contagious infectious disease that mainly affects the lungs and is associated with persistent cough, chest pain, fever, night sweats, and weight loss. Late diagnosis and a shortage of qualified radiologists contribute greatly to the spread of the disease and to deaths from it, especially in low- and middle-income regions. Effective and accurate diagnosis of TB is therefore necessary to improve treatment outcomes and to reduce transmission in the community. Recent advances in deep learning have substantially improved diagnostic accuracy, particularly in clinical evaluation and noninvasive methods, by introducing new techniques for the early detection of TB. This study compares convolutional neural network (CNN) and transformer models for early TB diagnosis from chest X-ray (CXR) images in the TB Chest X-ray dataset, framed as a binary classification of TB-positive and normal cases. Seven architectures were trained with a hold-out 80:20 validation split: four CNNs (VGG16, ResNet-50, EfficientNet-B0, and MobileNet-V2) and three transformers fitted with an Adaptive Patch Reduction Block (PRB), namely the Vision Transformer (ViT-PRB), the Data-efficient image Transformer (DeiT-PRB), and the Pyramid Vision Transformer (PVT-PRB). The results indicate that the transformer-based models performed better than the conventional CNNs, and PVT-PRB, which combines the PRB with global attention, achieved the highest classification accuracy of 96%.

References

[1] Karthikeyan Sundaram and Venkataraman Prabhu, "Contagious illness of tuberculosis and correlation with various types of cancer," Med. Microecol., vol. 24, Art. no. 100123, 2025, doi: 10.1016/j.medmic.2025.100123.

[2] Hyewon Lee, Jinsun Kim, Jieun Kim, and Young-Joon Park, "Review of the global burden of tuberculosis in 2023: Insights from the WHO Global Tuberculosis Report 2024," Public Health Wkly. Rep., vol. 18, no. 11 suppl., pp. S55-S69, 2025, doi: 10.56786/PHWR.2025.18.11suppl.5.

[3] Alex Kayongo, Brian Nyiro, Trishul Siddharthan, Bruce Kirenga, William Checkley, Moses Lutaakome Joloba, Jerrold Ellner, and Padmini Salgame, "Mechanisms of lung damage in tuberculosis: Implications for chronic obstructive pulmonary disease," Front. Cell. Infect. Microbiol., vol. 13, Art. no. 1146571, 2023, doi: 10.3389/fcimb.2023.1146571.

[4] Nickolas Yedgarian, Jacqueline Agopian, Brandon Flaig, Fouad Hajjar, Arshavir Karapetyan, Kannan Murthy, Ani Patrikyan, Kirakos Tomas, Kevin Tumanyan, Mohammad J. Nasiri, Selvakumar Subbian, and Vishwanath Venketaraman, "The intricate process of calcification in granuloma formation and the complications following M. tuberculosis infection," Biomolecules, vol. 15, no. 7, Art. no. 1036, 2025, doi: 10.3390/biom15071036.

[5] Imane Djerfi and Imane Belfethi, "Study of tuberculosis treatment," M.S. thesis, Inst. Natural and Life Sci., Abdelhafid Boussouf Univ. Center, Mila, Algeria, 2025. [Online]. Available: https://dspace.univ-mila.dz/jspui/bitstream/123456789/4327/1/study%20of%20tuberculosis%20treatment.pdf

[6] Vetriselvan Subramaniyan, Shivkanya Fuloria, Mahendran Sekar, Shalini Shanmugavelu, Kamini Vijeepallam, Usha Kumari, Kamal Narain, Dhanalekshmi Unnikrishnan Meenakshi, Mohammad Nazmul Hasan Maziz, and Neeraj Kumar Fuloria, "Introduction to lung disease," in Targeting Epigenetics in Inflammatory Lung Diseases. Singapore: Springer, 2023, pp. 1-16, doi: 10.1007/978-981-99-4780-5_1.

[7] Vartika Srivastava, Ravinder Kumar, Mohmmad Younus Wani, Keven Robinson, and Aijaz Ahmad, "Role of artificial intelligence in early diagnosis and treatment of infectious diseases," Infect. Dis., vol. 57, no. 1, pp. 1-26, 2025, doi: 10.1080/23744235.2024.2425712.

[8] Evans Kotei and Ramkumar Thirunavukarasu, "A comprehensive review on advancement in deep learning techniques for automatic detection of tuberculosis from chest X-ray images," Arch. Comput. Methods Eng., vol. 31, no. 1, pp. 455-474, 2024, doi: 10.1007/s11831-023-09987-w.

[9] Josef Yayan, Karl-Josef Franke, Melanie Berger, Wolfram Windisch, and Kurt Rasche, "Early detection of tuberculosis: A systematic review," Pneumonia, vol. 16, Art. no. 11, 2024, doi: 10.1186/s41479-024-00133-z.

[10] Seng Hansun, Ahmadreza Argha, Siaw-Teng Liaw, Branko G. Celler, and Guy B. Marks, "Machine and deep learning for tuberculosis detection on chest X-rays: Systematic literature review," J. Med. Internet Res., vol. 25, Art. no. e43154, 2023, doi: 10.2196/43154.

[11] Adnane Ait Nasser and Moulay A. Akhloufi, "A review of recent advances in deep learning models for chest disease detection using radiography," Diagnostics, vol. 13, no. 1, Art. no. 159, 2023, doi: 10.3390/diagnostics13010159.

[12] Alex Mirugwe, Lillian Tamale, and Juwa Nyirenda, "Improving tuberculosis detection in chest X-ray images through transfer learning and deep learning: Comparative study of convolutional neural network architectures," JMIRx Med, vol. 6, Art. no. e66029, 2025, doi: 10.2196/66029.

[13] Vinayak Sharma, Nillmani, Sachin Kumar Gupta, and Kaushal Kumar Shukla, "Deep learning models for tuberculosis detection and infected region visualization in chest X-ray images," Intell. Med., vol. 4, no. 2, pp. 104-113, 2024, doi: 10.1016/j.imed.2023.06.001.

[14] Goram Mufarah M. Alshmrani, Qiang Ni, Richard Jiang, Haris Pervaiz, and Nada M. Elshennawy, "A deep learning architecture for multi-class lung diseases classification using chest X-ray (CXR) images," Alex. Eng. J., vol. 64, pp. 923-935, 2023, doi: 10.1016/j.aej.2022.10.053.

[15] Hassaan Malik, Tayyaba Anees, Muizzud Din, and Ahmad Naeem, "CDC_Net: Multi-classification convolutional neural network model for detection of COVID-19, pneumothorax, pneumonia, lung cancer, and tuberculosis using chest X-rays," Multimed. Tools Appl., vol. 82, no. 9, pp. 13855-13880, 2023, doi: 10.1007/s11042-022-13843-7.

[16] Sahar Kazemzadeh, Jin Yu, Shahar Jamshy, Rory Pilgrim, Zaid Nabulsi, Christina Chen, Neeral Beladia, Charles Lau, Scott Mayer McKinney, Thad Hughes, Atilla P. Kiraly, Sreenivasa Raju Kalidindi, Monde Muyoyeta, Jameson Malemela, Ting Shih, Greg S. Corrado, Lily Peng, Katherine Chou, Po-Hsuan Cameron Chen, Yun Liu, Krish Eswaran, Daniel Tse, Shravya Shetty, and Shruthi Prabhakara, "Deep learning detection of active pulmonary tuberculosis at chest radiography matched the clinical performance of radiologists," Radiology, vol. 306, no. 1, pp. 124-137, 2023, doi: 10.1148/radiol.212213.

[17] Subhankar Chattoraj, Bhargava Reddy, Manoj Tadepalli, and Preetham Putha, "Comparing deep learning models for tuberculosis detection: A retrospective study of digital vs. analog chest radiographs," Indian J. Tuberc., vol. 72, suppl. 2, pp. S43-S46, 2025, doi: 10.1016/j.ijtb.2024.05.008.

[18] Vo Trong Quang Huy and Chih-Min Lin, "An improved DenseNet deep neural network model for tuberculosis detection using chest X-ray images," IEEE Access, vol. 11, pp. 42839-42849, 2023, doi: 10.1109/ACCESS.2023.3270774.

[19] Si-Yuan Lu, Ziquan Zhu, Yao Tang, Xin Zhang, and Xingxiang Liu, "CTBViT: A novel ViT for tuberculosis classification with efficient block and randomized classifier," Biomed. Signal Process. Control, vol. 100, Art. no. 106981, 2025, doi: 10.1016/j.bspc.2024.106981.

[20] Ibrahim Abdulrab Ahmed, Ebrahim Mohammed Senan, Hamzeh Salameh Ahmad Shatnawi, Ziad Mohammad Alkhraisha, and Mamoun Mohammad Ali Al-Azzam, "Multi-techniques for analyzing X-ray images for early detection and differentiation of pneumonia and tuberculosis based on hybrid features," Diagnostics, vol. 13, no. 4, Art. no. 814, 2023, doi: 10.3390/diagnostics13040814.

[21] Ibomoiye Domor Mienye, Theo G. Swart, George Obaido, Matt Jordan, and Philip Ilono, "Deep convolutional neural networks in medical image analysis: A review," Information, vol. 16, no. 3, Art. no. 195, 2025, doi: 10.3390/info16030195.

[22] Sanjeev K. Goswami, "Deep learning classification of tuberculosis chest X-rays," Cureus, vol. 15, no. 7, Art. no. e41583, 2023, doi: 10.7759/cureus.41583.

[23] Chiu-Fan Chen, Chun-Hsiang Hsu, You-Cheng Jiang, Wen-Ren Lin, Wei-Cheng Hong, I-Yuan Chen, Min-Hsi Lin, Kuo-An Chu, Chao-Hsien Lee, David Lin Lee, and Po-Fan Chen, "A deep learning-based algorithm for pulmonary tuberculosis detection in chest radiography," Sci. Rep., vol. 14, Art. no. 14917, 2024, doi: 10.1038/s41598-024-65703-z.

[24] Seng Hansun, Ahmadreza Argha, Ivan Bakhshayeshi, Arya Wicaksana, Hamid Alinejad-Rokny, Greg J. Fox, Siaw-Teng Liaw, Branko G. Celler, and Guy B. Marks, "Diagnostic performance of artificial intelligence-based methods for tuberculosis detection: Systematic review," J. Med. Internet Res., vol. 27, Art. no. e69068, 2025, doi: 10.2196/69068.

Downloads

Published

2026-09-30 — Updated on 2026-10-01

Versions

Data Availability Statement

This study used the publicly available TB Chest X-ray Dataset, compiled from the Tawsifur Rahman and Yasser Hessein tuberculosis chest X-ray collections (Kaggle).

How to Cite

Automated Tuberculosis Detection from Chest X-Ray Images Using CNN and Transformer-Based Deep Learning Models. (2026). Conference Proceedings in Science and Management, 1(1), 14-18. https://doi.org/10.68337/cpsm.v1.i1.2026-004 (Original work published 2026)