Pneumonia detection in chest X-ray images using an ensemble of deep learning models

Rohit Kundu, Ritacheta Das, Zong Woo Geem, Gi-Tae Han, Ram Sarkar, Rohit Kundu, Ritacheta Das, Zong Woo Geem, Gi-Tae Han, Ram Sarkar

Abstract

Pneumonia is a respiratory infection caused by bacteria or viruses; it affects many individuals, especially in developing and underdeveloped nations, where high levels of pollution, unhygienic living conditions, and overcrowding are relatively common, together with inadequate medical infrastructure. Pneumonia causes pleural effusion, a condition in which fluids fill the lung, causing respiratory difficulty. Early diagnosis of pneumonia is crucial to ensure curative treatment and increase survival rates. Chest X-ray imaging is the most frequently used method for diagnosing pneumonia. However, the examination of chest X-rays is a challenging task and is prone to subjective variability. In this study, we developed a computer-aided diagnosis system for automatic pneumonia detection using chest X-ray images. We employed deep transfer learning to handle the scarcity of available data and designed an ensemble of three convolutional neural network models: GoogLeNet, ResNet-18, and DenseNet-121. A weighted average ensemble technique was adopted, wherein the weights assigned to the base learners were determined using a novel approach. The scores of four standard evaluation metrics, precision, recall, f1-score, and the area under the curve, are fused to form the weight vector, which in studies in the literature was frequently set experimentally, a method that is prone to error. The proposed approach was evaluated on two publicly available pneumonia X-ray datasets, provided by Kermany et al. and the Radiological Society of North America (RSNA), respectively, using a five-fold cross-validation scheme. The proposed method achieved accuracy rates of 98.81% and 86.85% and sensitivity rates of 98.80% and 87.02% on the Kermany and RSNA datasets, respectively. The results were superior to those of state-of-the-art methods and our method performed better than the widely used ensemble techniques. Statistical analyses on the datasets using McNemar's and ANOVA tests showed the robustness of the approach. The codes for the proposed work are available at https://github.com/Rohit-Kundu/Ensemble-Pneumonia-Detection.

Conflict of interest statement

The authors have declared that no competing interests exist.

Figures

Fig 1. Examples of two X-ray plates…
Fig 1. Examples of two X-ray plates that display (a) a healthy lung and (b) a pneumonic lung.
The red arrows in (b) indicate white infiltrates, a distinguishing feature of pneumonia. The images were taken from the Kermany dataset [4].
Fig 2. Representation of the proposed pneumonia…
Fig 2. Representation of the proposed pneumonia detection framework.
Pre = Precision score, Rec = Recall score, F1 = F1-score, AUC = AUC score, and A(i) = {Prei, Reci, F1i, AUCi}; w(i) is the weight generated for the ith base learner to compute the ensemble, pj(i) is the probability score for the jth sample by the ith classifier, and ensj is the fused probability score for the jth sample; and the argmax function returns the position having the highest value in a 1D array, i.e., in this case it generates the predicted class of the sample.
Fig 3. Inception modules in the GoogLeNet…
Fig 3. Inception modules in the GoogLeNet architecture.
(a) The naive inception block that is replaced by (b) the dimension reduction inception block in the GoogLeNet architecture to improve computational efficiency.
Fig 4. Architecture of the GoogLeNet model…
Fig 4. Architecture of the GoogLeNet model used in this study.
The inception block is shown in Fig 3(b).
Fig 5. Architecture of the ResNet-18 model…
Fig 5. Architecture of the ResNet-18 model used in this study.
Fig 6. Basic architecture of the DenseNet…
Fig 6. Basic architecture of the DenseNet convolutional neural network model.
Fig 7. Confusion matrices obtained on the…
Fig 7. Confusion matrices obtained on the Kermany pneumonia chest X-ray dataset by the proposed method by 5-fold cross validation.
a) Fold-1. (b) Fold-2. (c) Fold-3. (d) Fold-4. (e) Fold-5.
Fig 8. Confusion matrices obtained on the…
Fig 8. Confusion matrices obtained on the Radiological Society of North America pneumonia challenge chest X-ray dataset by the proposed method by five-fold cross validation.
a) Fold-1. (b) Fold-2. (c) Fold-3. (d) Fold-4. (e) Fold-5.
Fig 9. Receiver operating characteristic curves obtained…
Fig 9. Receiver operating characteristic curves obtained by the proposed ensemble method on the two pneumonia chest X-ray datasets used in this research.
(a) Kermany dataset [4]. (b) RSNA challenge dataset [33].
Fig 10. Variation of accuracy rates on…
Fig 10. Variation of accuracy rates on the Kermany dataset [4]) achieved by the three base learners, GoogLeNet, ResNet-18, and DenseNet-121 and their ensemble, according to the optimizers chosen for fine tuning.
Fig 11. Variation in performance (accuracy rates)…
Fig 11. Variation in performance (accuracy rates) of the ensemble with respect to the number of fixed non-trainable layers in the base learners on the two datasets used in this study.
(a) Kermany dataset [4]. (b) RSNA challenge dataset [33].
Fig 12. Gradient-weighted class activation map (GradCAM)…
Fig 12. Gradient-weighted class activation map (GradCAM) decision visualization of chest X-ray images when the three chosen base learners were used to form the ensemble.
Different regions of the X-rays are the focus of the different models that capture complementary information. Case-1: (a)–(c) show a pneumonic lung X-ray analyzed using the three base learners; the confidence scores of the three base learners are GoogLeNet: 99.99%, ResNet-18: 75.21%, and DenseNet-121: 98.90% Case-2: (d)–(f) show a healthy lung X-ray analyzed using the three base learners; the confidence scores of the three base learners are GoogLeNet: 99.47%, ResNet-18: 97.61%, and DenseNet-121: 98.93%.
Fig 13. Examples of samples from the…
Fig 13. Examples of samples from the Kermany dataset where two out of three base learners yielded incorrect predictions, but the ensemble yielded the correct prediction.
Both images are of class “Normal”. (a) Case-1: GoogLeNet predicted “Pneumonia” with a confidence score of 53.1%, ResNet-18 predicted “Pneumonia” with a confidence score of 73.8%, and DenseNet-121 predicted “Normal” with a confidence score of 89.4%. The proposed ensemble framework predicted “Normal” (correct classification) with a confidence rate of 68.1 (b) Case-2: GoogLeNet predicted “Normal” with a confidence score of 98.6%, ResNet-18 predicted “Pneumonia” with a confidence score of 58.3%, and DenseNet-121 predicted “Pneumonia” with a confidence score of 69.3%. The proposed ensemble framework predicted “Normal” (correct classification) with a confidence rate of 66.3%.
Fig 14. Examples of samples from the…
Fig 14. Examples of samples from the Kermany dataset [4] that were classified incorrectly by the proposed ensemble framework.
Case-1: (a) shows an image originally belonging to class “Normal” but misclassified as “Pneumonia” by the framework. The GradCAM analysis images are shown in (c), (d), and (e) for GoogLeNet, ResNet-18, and DenseNet-121, respectively. Case-2: (b) shows an image of class “Pneumonia” predicted to belong to the “Normal” class by the framework. The GradCAM analysis images are shown in (f), (g), and (h)for GoogLeNet, ResNet-18, and DenseNet-121, respectively.

References

    1. WHO Pneumonia. World Health Organization. (2019),
    1. Neuman M., Lee E., Bixby S., Diperna S., Hellinger J., Markowitz R., et al.. Variability in the interpretation of chest radiographs for the diagnosis of pneumonia in children. Journal Of Hospital Medicine. 7, 294–298 (2012) doi: 10.1002/jhm.955
    1. Williams G., Macaskill P., Kerr M., Fitzgerald D., Isaacs D., Codarini M., et al.. Variability and accuracy in interpretation of consolidation on chest radiography for diagnosing pneumonia in children under 5 years of age. Pediatric Pulmonology. 48, 1195–1200 (2013) doi: 10.1002/ppul.22806
    1. Kermany D., Zhang K. & Goldbaum M. Labeled Optical Coherence Tomography (OCT) and Chest X-Ray Images for Classification. (Mendeley,2018)
    1. Lal S., Rehman S., Shah J., Meraj T., Rauf H., Damaševičius R., et al.. Adversarial Attack and Defence through Adversarial Training and Feature Fusion for Diabetic Retinopathy Recognition. Sensors. 21, 3922 (2021) doi: 10.3390/s21113922
    1. Rauf H., Lali M., Khan M., Kadry S., Alolaiyan H., Razaq A., et al.. Time series forecasting of COVID-19 transmission in Asia Pacific countries using deep neural networks. Personal And Ubiquitous Computing. pp. 1–18 (2021) doi: 10.1007/s00779-020-01494-0
    1. Deng J., Dong W., Socher R., Li L., Li K. & Fei-Fei, L. Imagenet: A large-scale hierarchical image database. 2009 IEEE Conference On Computer Vision And Pattern Recognition. pp. 248-255 (2009)
    1. Dalhoumi S., Dray G., Montmain J., Derosière, G. & Perrey S. An adaptive accuracy-weighted ensemble for inter-subjects classification in brain-computer interfacing. 2015 7th International IEEE/EMBS Conference On Neural Engineering (NER). pp. 126-129 (2015)
    1. Albahli S., Rauf H., Algosaibi A. & Balas V. AI-driven deep CNN approach for multi-label pathology classification using chest X-Rays. PeerJ Computer Science. 7 pp. e495 (2021) doi: 10.7717/peerj-cs.495
    1. Rahman T., Chowdhury M., Khandakar A., Islam K., Islam K., Mahbub Z., et al.. Transfer learning with deep convolutional neural network (CNN) for pneumonia detection using chest X-ray. Applied Sciences. 10, 3233 (2020) doi: 10.3390/app10093233
    1. Liang G. & Zheng L. A transfer learning method with deep residual network for pediatric pneumonia diagnosis. Computer Methods And Programs In Biomedicine. 187 pp. 104964 (2020) doi: 10.1016/j.cmpb.2019.06.023
    1. Ibrahim A., Ozsoz M., Serte S., Al-Turjman F. & Yakoi P. Pneumonia classification using deep learning from chest X-ray images during COVID-19. Cognitive Computation. pp. 1–13 (2021) doi: 10.1007/s12559-020-09787-5
    1. Zubair S. An Efficient Method to Predict Pneumonia from Chest X-Rays Using Deep Learning Approach. The Importance Of Health Informatics In Public Health During A Pandemic. 272 pp. 457 (2020)
    1. Rajpurkar P., Irvin J., Zhu K., Yang B., Mehta H., Duan T., et al. & Others Chexnet: Radiologist-level pneumonia detection on chest x-rays with deep learning. ArXiv Preprint ArXiv:1711.05225. (2017)
    1. Albahli S., Rauf H., Arif M., Nafis M. & Algosaibi A. Identification of thoracic diseases by exploiting deep neural networks. Neural Networks. 5 pp. 6 (2021)
    1. Chandra T. & Verma K. Pneumonia detection on chest X-Ray using machine learning paradigm. Proceedings Of 3rd International Conference On Computer Vision And Image Processing. pp. 21-33 (2020)
    1. Kuo K., Talley P., Huang C. & Cheng L. Predicting hospital-acquired pneumonia among schizophrenic patients: a machine learning approach. BMC Medical Informatics And Decision Making. 19, 1–8 (2019) doi: 10.1186/s12911-019-0792-1
    1. Yue H., Yu Q., Liu C., Huang Y., Jiang Z., Shao C., et al.. & Others Machine learning-based CT radiomics method for predicting hospital stay in patients with pneumonia associated with SARS-CoV-2 infection: a multicenter study. Annals Of Translational Medicine. 8 (2020) doi: 10.21037/atm-20-3026
    1. Sharma H., Jain J., Bansal P. & Gupta S. Feature extraction and classification of chest x-ray images using cnn to detect pneumonia. 2020 10th International Conference On Cloud Computing, Data Science & Engineering (Confluence). pp. 227-231 (2020)
    1. Stephen O., Sain M., Maduh U. & Jeong D. An efficient deep learning approach to pneumonia classification in healthcare. Journal Of Healthcare Engineering. 2019 (2019) doi: 10.1155/2019/4180949
    1. Janizek J., Erion G., DeGrave A. & Lee S. An adversarial approach for the robust classification of pneumonia from chest radiographs. Proceedings Of The ACM Conference On Health, Inference, And Learning. pp. 69-79 (2020)
    1. Zhang J., Xie Y., Pang G., Liao Z., Verjans J., Li W., et al.. & Others Viral Pneumonia Screening on Chest X-rays Using Confidence-Aware Anomaly Detection. IEEE Transactions On Medical Imaging. (2020)
    1. Tuncer T., Ozyurt F., Dogan S. & Subasi A. A novel Covid-19 and pneumonia classification method based on F-transform. Chemometrics And Intelligent Laboratory Systems. 210 pp. 104256 (2021) doi: 10.1016/j.chemolab.2021.104256
    1. Jaiswal A., Tiwari P., Kumar S., Gupta D., Khanna A. & Rodrigues J. Identifying pneumonia in chest X-rays: A deep learning approach. Measurement. 145 pp. 511–518 (2019) doi: 10.1016/j.measurement.2019.05.076
    1. Gabruseva T., Poplavskiy D. & Kalinin A. Deep learning for automatic pneumonia detection. Proceedings Of The IEEE/CVF Conference On Computer Vision And Pattern Recognition Workshops. pp. 350-351 (2020)
    1. Pan I., Cadrin-Chênevert A. & Cheng P. Tackling the radiological society of north america pneumonia detection challenge. American Journal Of Roentgenology. 213, 568–574 (2019) doi: 10.2214/AJR.19.21512
    1. Meraj T., Hassan A., Zahoor S., Rauf H., Lali M., Ali L., et al. Lungs nodule detection using semantic segmentation and classification with optimal features. Preprints. (2019)
    1. Rajinikanth V., Kadry S., Damaševičius R., Taniar D. & Rauf H. Machine-Learning-Scheme to Detect Choroidal-Neovascularization in Retinal OCT Image. 2021 Seventh International Conference On Bio Signals, Images, And Instrumentation (ICBSII). pp. 1-5 (2021)
    1. Kadry S., Nam Y., Rauf H., Rajinikanth V. & Lawal I. Automated Detection of Brain Abnormality using Deep-Learning-Scheme: A Study. 2021 Seventh International Conference On Bio Signals, Images, And Instrumentation (ICBSII). pp. 1-5 (2021)
    1. Rajinikanth V., Kadry S., Taniar D., Damaševičius, R. & Rauf H. Breast-Cancer Detection using Thermal Images with Marine-Predators-Algorithm Selected Features. 2021 Seventh International Conference On Bio Signals, Images, And Instrumentation (ICBSII). pp. 1-6 (2021)
    1. Kundu R., Basak H., Singh P., Ahmadian A., Ferrara M. & Sarkar R. Fuzzy rank-based fusion of CNN models using Gompertz function for screening COVID-19 CT-scans. Scientific Reports. 11, 14133 (2021,July), doi: 10.1038/s41598-021-93658-y
    1. Manna A., Kundu R., Kaplun D., Sinitca A. & Sarkar R. A fuzzy rank-based ensemble of CNN models for classification of cervical cytology. Scientific Reports. 11, 1–18 (2021) doi: 10.1038/s41598-021-93783-8
    1. Wang X., Peng Y., Lu L., Lu Z., Bagheri M. & Summers R. Chestx-ray8: Hospital-scale chest x-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. Proceedings Of The IEEE Conference On Computer Vision And Pattern Recognition. pp. 2097-2106 (2017)
    1. Szegedy C., Liu W., Jia Y., Sermanet P., Reed S., Anguelov D., et al. Going deeper with convolutions. Proceedings Of The IEEE Conference On Computer Vision And Pattern Recognition. pp. 1-9 (2015)
    1. He K., Zhang X., Ren S. & Sun J. Deep residual learning for image recognition. Proceedings Of The IEEE Conference On Computer Vision And Pattern Recognition. pp. 770-778 (2016)
    1. Huang G., Liu Z., Van Der Maaten L. & Weinberger K. Densely connected convolutional networks. Proceedings Of The IEEE Conference On Computer Vision And Pattern Recognition. pp. 4700-4708 (2017)
    1. Lin M., Chen Q. & Yan S. Network in network. ArXiv Preprint ArXiv:1312.4400. (2013)
    1. Selvaraju R., Cogswell M., Das A., Vedantam R., Parikh D. & Batra D. Grad-cam: Visual explanations from deep networks via gradient-based localization. Proceedings Of The IEEE International Conference On Computer Vision. pp. 618-626 (2017)
    1. Mahmud T., Rahman M. & Fattah S. CovXNet: A multi-dilation convolutional neural network for automatic COVID-19 and other pneumonia detection from chest X-ray images with transferable multi-receptive feature optimization. Computers In Biology And Medicine. 122 pp. 103869 (2020) doi: 10.1016/j.compbiomed.2020.103869
    1. Antin B., Kravitz J. & Martayan E. Detecting pneumonia in chest X-Rays with supervised learning. Semanticscholar. Org. (2017)
    1. Zhou S., Zhang X. & Zhang R. Identifying cardiomegaly in ChestX-ray8 using transfer learning. MEDINFO 2019: Health And Wellbeing E-Networks For All. pp. 482–486 (2019)
    1. Yao L., Poblenz E., Dagunts D., Covington B., Bernard D. & Lyman K. Learning to diagnose from scratch by exploiting dependencies among labels. ArXiv Preprint ArXiv:1710.10501. (2017)
    1. Dietterich T. Approximate statistical tests for comparing supervised classification learning algorithms. Neural Computation. 10, 1895–1923 (1998) doi: 10.1162/089976698300017197
    1. Cuevas A., Febrero M. & Fraiman R. An anova test for functional data. Computational Statistics & Data Analysis. 47, 111–122 (2004) doi: 10.1016/j.csda.2003.10.021

Source: PubMed

3
Subscribe