DOI: 10.46810/tdfd.1927529 ISSN: 2149-6366

SE-ResNet18: Attention-Enhanced Deep Learning for Multi-Class Classification of Tuberculosis and Pneumonia from Chest X-ray Images

Hind Ayad Majeed Alkakjea, Erdal Özbay
Tuberculosis and pneumonia are major causes of respiratory mortality worldwide, requiring accurate and timely diagnosis. This study proposes SE-ResNet18, an attention-enhanced deep learning model for multi-class classification of chest X-ray images into Normal, Pneumonia, Tuberculosis, and Unknown categories. The model integrates Squeeze-and-Excitation (SE) blocks into the ResNet18 architecture to improve channel-wise feature representation. A dataset of 15,316 chest radiographs was used, split into training (13,028), validation (761), and testing (1,527) sets. Transfer learning was applied using ImageNet-pretrained weights, followed by fine-tuning for 10 epochs with the Adam optimizer (learning rate: 1×10⁻⁵). To enhance generalization, limited data augmentation (horizontal flipping and ±5° rotation) was applied only to the training set. Dropout (p = 0.4) was used in the classification head to reduce overfitting. The proposed model achieved 98.03% accuracy and a macro F1-score of 0.97 on the test set, indicating balanced performance across classes. Class-wise results were: Unknown (1.00 precision, recall, F1-score), Tuberculosis (0.95 precision, 0.99 recall, 0.97 F1-score), Pneumonia (0.98 precision, 0.96 recall, 0.97 F1-score), and Normal (0.96 precision, 0.95 recall, 0.95 F1-score). No misclassification occurred between Pneumonia and Tuberculosis. Confidence analysis showed well-calibrated predictions, with higher confidence for correct predictions (0.947) than errors (0.823), enabling identification of uncertain cases for expert review.