Lung X-ray Image Classification for Distinguishing Tuberculosis and Pneumonia Using Pretrained CNN Feature Extractors and Supervised Classifiers

Authors

  • Ardian Mohib Airlangga University, Indonesia
  • Imam Yuadi Airlangga University, Indonesia
  • Ira Puspitasari Airlangga University, Indonesia
  • Yusi Dyah Patriani Diponegoro University, Indonesia
Pages Icon

DOI:

https://doi.org/10.63158/journalisi.v8i3.1595

Keywords:

tuberculosis, pneumonia, chest radiography, transfer learning, CNN feature extraction, supervised classification

Abstract

Tuberculosis (TB) and pneumonia (PNA) are infectious lung diseases with overlapping chest X-ray (CXR) manifestations, making automated differential classification clinically important and methodologically challenging. This study proposes a supervised CXR classification workflow to distinguish TB from PNA using pretrained convolutional neural network (CNN) feature extractors and supervised classifiers. A publicly available de-identified dataset comprising 390 TB and 390 PNA images was used. Images were screened to exclude duplicates, corrupted files, non-CXR images, unclear labels, and identifiable cases. Preprocessing included format standardization, resizing according to CNN input requirements, and normalization. To reduce augmentation-based leakage risk, no heavy pre-validation augmentation was applied. Image embeddings were extracted using VGG-16, Inception V3, and VGG-19, then classified using Logistic Regression, Support Vector Machine, and Neural Network models. Performance was evaluated using stratified 5-fold cross-validation with AUC, accuracy, F1-score, precision, recall, MCC, and confusion matrix analysis. The Inception V3–Logistic Regression combination achieved the best performance, with AUC of 0.999, accuracy of 0.992, F1-score of 0.992, and MCC of 0.985.

Downloads

Download data is not yet available.

References

[1] N. Oktavia, B. S. Miranda, and D. I. Swasono, “CNN-Based Classification of Infectious Lung Diseases using Thorax X-Ray Analysis,” Engineering and Technology Journal, vol. 09, no. 10, Oct. 2024, doi: 10.47191/etj/v9i10.14.

[2] S. K. Mohapatra, M. Abebe, L. Mekuanint, S. Prasad, P. K. Bala, and S. K. Dhala, “Pneumonia and tuberculosis detection with chest x-ray images and medical records using deep learning techniques,” Review of Computer Engineering Research, vol. 10, no. 4, pp. 136–149, Nov. 2023, doi: 10.18488/76.v10i4.3533.

[3] B. U. Maheswari et al., “Explainable deep-neural-network supported scheme for tuberculosis detection from chest radiographs,” BMC Med. Imaging, vol. 24, no. 1, p. 32, Feb. 2024, doi: 10.1186/s12880-024-01202-x.

[4] K. Guo, J. Cheng, K. Li, L. Wang, Y. Lv, and D. Cao, “Diagnosis and detection of pneumonia using weak-label based on X-ray images: a multi-center study,” BMC Med. Imaging, vol. 23, no. 1, p. 209, Dec. 2023, doi: 10.1186/s12880-023-01174-4.

[5] L. Venkataramana, D. V. V. Prasad, S. Saraswathi, C. M. Mithumary, R. Karthikeyan, and N. Monika, “Classification of COVID-19 from tuberculosis and pneumonia using deep learning techniques,” Med. Biol. Eng. Comput., vol. 60, no. 9, pp. 2681–2691, Sep. 2022, doi: 10.1007/s11517-022-02632-x.

[6] T. Xu and Z. Yuan, “Convolution Neural Network With Coordinate Attention for the Automatic Detection of Pulmonary Tuberculosis Images on Chest X-Rays,” IEEE Access, vol. 10, pp. 86710–86717, 2022, doi: 10.1109/ACCESS.2022.3199419.

[7] W. Khan, N. Zaki, and L. Ali, “Intelligent Pneumonia Identification From Chest X-Rays: A Systematic Literature Review,” IEEE Access, vol. 9, pp. 51747–51771, 2021, doi: 10.1109/ACCESS.2021.3069937.

[8] S.-L. Yi, S.-L. Qin, F.-R. She, and T.-W. Wang, “RED-CNN: The Multi-Classification Network for Pulmonary Diseases,” Electronics (Basel)., vol. 11, no. 18, p. 2896, Sep. 2022, doi: 10.3390/electronics11182896.

[9] Y. Xie et al., “Computer-Aided System for the Detection of Multicategory Pulmonary Tuberculosis in Radiographs,” J. Healthc. Eng., vol. 2020, pp. 1–12, Aug. 2020, doi: 10.1155/2020/9205082.

[10] Y.-X. Tang et al., “Automated abnormality classification of chest radiographs using deep convolutional neural networks,” NPJ Digit. Med., vol. 3, no. 1, p. 70, May 2020, doi: 10.1038/s41746-020-0273-z.

[11] E. Showkatian, M. Salehi, H. Ghaffari, R. Reiazi, and N. Sadighi, “Deep learning-based automatic detection of tuberculosis disease in chest X-ray images,” Pol. J. Radiol., vol. 87, pp. 118–124, Feb. 2022, doi: 10.5114/pjr.2022.113435.

[12] R. Kundu, R. Das, Z. W. Geem, G.-T. Han, and R. Sarkar, “Pneumonia detection in chest X-ray images using an ensemble of deep learning models,” PLoS One, vol. 16, no. 9, p. e0256630, Sep. 2021, doi: 10.1371/journal.pone.0256630.

[13] T. H. Mandeel, S. M. Awad, and S. Naji, “Pneumonia binary classification using multi-scale feature classification network on chest x-ray images,” IAES International Journal of Artificial Intelligence (IJ-AI), vol. 11, no. 4, p. 1469, Dec. 2022, doi: 10.11591/ijai.v11.i4.pp1469-1477.

[14] A. I. Khan, J. L. Shah, and M. M. Bhat, “CoroNet: A deep neural network for detection and diagnosis of COVID-19 from chest x-ray images,” Comput. Methods Programs Biomed., vol. 196, p. 105581, Nov. 2020, doi: 10.1016/j.cmpb.2020.105581.

[15] A. Abbas, M. M. Abdelsamea, and M. M. Gaber, “Classification of COVID-19 in chest X-ray images using DeTraC deep convolutional neural network,” Applied Intelligence, vol. 51, no. 2, pp. 854–864, Feb. 2021, doi: 10.1007/s10489-020-01829-7.

[16] A. Harshavardhan, S. Cheerla, A. Parkavi, S. A. Latha Mary, K. Qureshi, and H. R. Mhaske, “Deep learning modified neural networks with chicken swarm optimization-based lungs disease detection and severity classification,” J. Electron. Imaging, vol. 32, no. 06, May 2023, doi: 10.1117/1.JEI.32.6.062603.

[17] D. M. Ibrahim, N. M. Elshennawy, and A. M. Sarhan, “Deep-chest: Multi-classification deep learning model for diagnosing COVID-19, pneumonia, and lung cancer chest diseases,” Comput. Biol. Med., vol. 132, p. 104348, May 2021, doi: 10.1016/j.compbiomed.2021.104348.

[18] D. Z. K. G. M. Kermany, “Large Dataset of Labeled Optical Coherence Tomography (OCT) and Chest X-Ray Images,” Mendeley Data.

[19] S. Jaeger, S. Candemir, S. Antani, Y.-X. J. Wáng, P.-X. Lu, and G. Thoma, “Two public chest X-ray datasets for computer-aided screening of pulmonary diseases.,” Quant. Imaging Med. Surg., vol. 4, no. 6, pp. 475–7, Dec. 2014, doi: 10.3978/j.issn.2223-4292.2014.11.20.

[20] S. Urooj, S. Suchitra, L. Krishnasamy, N. Sharma, and N. Pathak, “Stochastic Learning-Based Artificial Neural Network Model for an Automatic Tuberculosis Detection System Using Chest X-Ray Images,” IEEE Access, vol. 10, pp. 103632–103643, 2022, doi: 10.1109/ACCESS.2022.3208882.

[21] W. Zhang, H. Wang, Z. Lai, and C. Hou, “Constrained Contrastive Representation: Classification On Chest X-Rays With Limited Data,” in 2021 IEEE International Conference on Multimedia and Expo (ICME), IEEE, Jul. 2021, pp. 1–6. doi: 10.1109/ICME51207.2021.9428273.

[22] N. Habib, Md. M. Hasan, Md. M. Reza, and M. M. Rahman, “Ensemble of CheXNet and VGG-19 Feature Extractor with Random Forest Classifier for Pediatric Pneumonia Detection,” SN Comput. Sci., vol. 1, no. 6, p. 359, Nov. 2020, doi: 10.1007/s42979-020-00373-y.

[23] T. Rahman et al., “Transfer Learning with Deep Convolutional Neural Network (CNN) for Pneumonia Detection Using Chest X-ray,” Applied Sciences, vol. 10, no. 9, p. 3233, May 2020, doi: 10.3390/app10093233.

[24] O. A. Fagbuagun, O. Nwankwo, S. A. Akinpelu, and O. Folorunsho, “Model development for pneumonia detection from chest radiograph using transfer learning,” TELKOMNIKA (Telecommunication Computing Electronics and Control), vol. 20, no. 3, p. 544, Jun. 2022, doi: 10.12928/telkomnika.v20i3.23296.

[25] R. Wajgi et al., “Optimized tuberculosis classification system for chest X‐ray images: Fusing hyperparameter tuning with transfer learning approaches,” Engineering Reports, vol. 6, no. 11, Nov. 2024, doi: 10.1002/eng2.12906.

[26] J. Luján-García, C. Yáñez-Márquez, Y. Villuendas-Rey, and O. Camacho-Nieto, “A Transfer Learning Method for Pneumonia Classification and Visualization,” Applied Sciences, vol. 10, no. 8, p. 2908, Apr. 2020, doi: 10.3390/app10082908.

[27] T. Rahman et al., “Reliable Tuberculosis Detection Using Chest X-Ray With Deep Learning, Segmentation and Visualization,” IEEE Access, vol. 8, pp. 191586–191601, 2020, doi: 10.1109/ACCESS.2020.3031384.

Downloads

Published

2026-06-22

Issue

Section

Articles