DOI: 10.68337/cpsm.v1.i1.2026-004 ISSN:

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

Dontha Madhusudhana Rao, Dasari Karthik Reddy, Muppala Dhanvith Varma, Chennupati Bharath Chandra, Marthala Santhosh Reddy, Saroj Kumar Biswas

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%.