Chest X-ray Image Classification to Identify Lung Diseases Using Convolutional Neural Network and Convolutional Block Attention Module

Chandra Halim - Bina Nusantara University, Jakarta, 11480, Indonesia
Nathanael Geordie Eka Putra - Bina Nusantara University, Jakarta, 11480, Indonesia
Nico Ardian Nugroho - Bina Nusantara University, Jakarta, 11480, Indonesia
Derwin Suhartono - Bina Nusantara University, Jakarta, 11480, Indonesia

Citation Format:



Image classification, the process of categorizing and labeling groups of pixels or vectors within an image based on specific rules, is continuously developed by many researchers in the world to solve many problems. One of those problems is x-ray image classification to determine lung diseases. This research tries to solve the problem of classifying COVID-19, pneumonia, and healthy lungs using x-ray images. The image datasets were collected from several sources. This research aims to build a reliable and robust Convolutional Neural Network (CNN) enhanced with Convolutional Block Attention Module (CBAM) mechanism. CNN is used to do the feature extraction and the classification, whereas CBAM is used to improve the performance of the CNN by focusing on the important features in given data. Research methods are done through extensive data selection, preprocessing, and parameter tuning to achieve a well-performing model. While there is still a lack of research on x-ray classification using the attention mechanism, this research proposes it as the main method. This research also does a further experiment on the effect of the imbalanced dataset on the model. The evaluation is done using a cross-validation method. This research results reach 97.74% of accuracy, precision, recall, and f1-score. This research concludes that CBAM increases the performance of a CNN module. Using a larger dataset can be beneficial in this kind of research as well as evaluation by radiologists.

Full Text:



W. H. Organization, "WHO coronavirus (COVID-19) dashboard." 2022. [Online]. Available:

W. H. Organization, "Listings of WHO's response to COVID-19." 2020. [Online]. Available:

W. H. Organization, “Coronavirus.†2020. [Online]. Available:

Y. Shi et al., "An overview of COVID-19," Journal of Zhejiang University-SCIENCE B, vol. 21, no. 5, pp. 343–360, May 2020, doi: 10.1631/jzus.B2000083.

B. Singh, B. Datta, A. Ashish, and G. Dutta, "A comprehensive review on current COVID-19 detection methods: From lab care to point of care diagnosis," Sensors International, vol. 2, p. 100119, 2021, doi: 10.1016/j.sintl.2021.100119.

Y. Fang et al., "Sensitivity of Chest CT for COVID-19: Comparison to RT-PCR," Radiology, vol. 296, no. 2, pp. E115–E117, Sep. 2020, doi: 10.1148/radiol.2020200432.

M. Dramé et al., "Should RT-PCR be considered a gold standard in the diagnosis of COVID-19?," Journal of Medical Virology, vol. 92, no. 11. John Wiley and Sons Inc, pp. 2312–2313, November 1, 2020. doi: 10.1002/jmv.25996.

W. Guan et al., "Clinical Characteristics of Coronavirus Disease 2019 in China," New England Journal of Medicine, vol. 382, no. 18, pp. 1708–1720, Sep. 2020, doi: 10.1056/NEJMoa2002032.

C. Huang et al., “Clinical features of patients infected with 2019 novel coronavirus in Wuhan, China,†The Lancet, vol. 395, no. 10223, pp. 497–506, Sep. 2020, doi: 10.1016/S0140-6736(20)30183-5.

M.-Y. Ng et al., "Imaging Profile of the COVID-19 Infection: Radiologic Findings and Literature Review," Radiol Cardiothorac Imaging, vol. 2, no. 1, p. e200034, Sep. 2020, doi: 10.1148/ryct.2020200034.

S. Sathi et al., "Role of Chest X-Ray in Coronavirus Disease and Correlation of Radiological Features with Clinical Outcomes in Indian Patients," Canadian Journal of Infectious Diseases and Medical Microbiology, vol. 2021, pp. 1–8, Oct. 2021, doi: 10.1155/2021/6326947.

N. H. Service, “Pneumonia.†2017. [Online]. Available:

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, Sep. 2020, doi: 10.3390/app10093233.

A. U. Ibrahim, M. Ozsoz, S. Serte, F. Al-Turjman, and P. S. Yakoi, "Pneumonia Classification Using Deep Learning from Chest X-ray Images During COVID-19," Cognit Comput, Sep. 2021, doi: 10.1007/s12559-020-09787-5.

K. Hammoudi et al., "Deep Learning on Chest X-ray Images to Detect and Evaluate Pneumonia Cases at the Era of COVID-19," J Med Syst, vol. 45, no. 7, p. 75, Sep. 2021, doi: 10.1007/s10916-021-01745-4.

S.-H. Wang, S. L. Fernandes, Z. Zhu, and Y.-D. Zhang, "AVNC: Attention-Based VGG-Style Network for COVID-19 Diagnosis by CBAM," IEEE Sens J, vol. 22, no. 18, pp. 17431–17438, Sep. 2022, doi: 10.1109/JSEN.2021.3062442.

T. Ozturk, M. Talo, E. A. Yildirim, U. B. Baloglu, O. Yildirim, and U. R. Acharya, "Automated detection of COVID-19 cases using deep neural networks with X-ray images," Comput Biol Med, vol. 121, p. 103792, Sep. 2020, doi: 10.1016/j.compbiomed.2020.103792.

S. Woo, J. Park, J.-Y. Lee, and I. S. Kweon, "CBAM: Convolutional Block Attention Module." pp. 3–19, 2018. doi: 10.1007/978-3-030-01234-2_1.

L. Wang, Z. Q. Lin, and A. Wong, "COVID-Net: a tailored deep convolutional neural network design for detection of COVID-19 cases from chest X-ray images," Sci Rep, vol. 10, no. 1, p. 19549, Sep. 2020, doi: 10.1038/s41598-020-76550-z.

S. García, J. Luengo, and F. Herrera, "Intelligent Systems Reference Library 72 Data Preprocessing in Data Mining." [Online]. Available:

D. Chicco, "Ten quick tips for machine learning in computational biology," BioData Min, vol. 10, no. 1, p. 35, Sep. 2017, doi: 10.1186/s13040-017-0155-3.

Y.-X. Tang et al., "Automated abnormality classification of chest radiographs using deep convolutional neural networks," NPJ Digit Med, vol. 3, no. 1, pp. 1–8, 2020.

H. Kaur, H. S. Pannu, and A. K. Malhi, "A Systematic Review on Imbalanced Data Challenges in Machine Learning," ACM Comput Surv, vol. 52, no. 4, pp. 1–36, Jul. 2020, doi: 10.1145/3343440.

J. M. Johnson and T. M. Khoshgoftaar, "Survey on deep learning with class imbalance," J Big Data, vol. 6, no. 1, p. 27, Dec. 2019, doi: 10.1186/s40537-019-0192-5.

H. M. Bui, M. Lech, E. Cheng, K. Neville, and I. S. Burnett, "Using grayscale images for object recognition with convolutional-recursive neural network," in 2016 IEEE Sixth International Conference on Communications and Electronics (ICCE), Sep. 2016, pp. 321–325. doi: 10.1109/CCE.2016.7562656.

N. Srivastava, G. Hinton, A. Krizhevsky, and R. Salakhutdinov, "Dropout: A Simple Way to Prevent Neural Networks from Overfitting," 2014.

D. Berrar, "Cross-Validation," Encyclopedia of Bioinformatics and Computational Biology. Elsevier, pp. 542–545, 2019. doi: 10.1016/B978-0-12-809633-8.20349-X.

D. Anguita, A. Ghio, S. Ridella, and D. Sterpi, "K-Fold Cross Validation for Error Rate Estimate in Support Vector Machines.," in DMIN, 2009, pp. 291–297.

D. Laflly, Toward an Open Resource Using Services Cloud Computing for Environmental Data, vol. 1. Wiley, 2020.

G. James, D. Witten, T. Hastie, and R. Tibshirani, "An Introduction to Statistical Learning with Applications in R Second Edition," 2021.