Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 Jun:48:191-211.
doi: 10.1016/j.jare.2022.08.021. Epub 2022 Sep 7.

A hybrid explainable ensemble transformer encoder for pneumonia identification from chest X-ray images

Affiliations

A hybrid explainable ensemble transformer encoder for pneumonia identification from chest X-ray images

Chiagoziem C Ukwuoma et al. J Adv Res. 2023 Jun.

Abstract

Introduction: Pneumonia is a microorganism infection that causes chronic inflammation of the human lung cells. Chest X-ray imaging is the most well-known screening approach used for detecting pneumonia in the early stages. While chest-Xray images are mostly blurry with low illumination, a strong feature extraction approach is required for promising identification performance.

Objectives: A new hybrid explainable deep learning framework is proposed for accurate pneumonia disease identification using chest X-ray images.

Methods: The proposed hybrid workflow is developed by fusing the capabilities of both ensemble convolutional networks and the Transformer Encoder mechanism. The ensemble learning backbone is used to extract strong features from the raw input X-ray images in two different scenarios: ensemble A (i.e., DenseNet201, VGG16, and GoogleNet) and ensemble B (i.e., DenseNet201, InceptionResNetV2, and Xception). Whereas, the Transformer Encoder is built based on the self-attention mechanism with multilayer perceptron (MLP) for accurate disease identification. The visual explainable saliency maps are derived to emphasize the crucial predicted regions on the input X-ray images. The end-to-end training process of the proposed deep learning models over all scenarios is performed for binary and multi-class classification scenarios.

Results: The proposed hybrid deep learning model recorded 99.21% classification performance in terms of overall accuracy and F1-score for the binary classification task, while it achieved 98.19% accuracy and 97.29% F1-score for multi-classification task. For the ensemble binary identification scenario, ensemble A recorded 97.22% accuracy and 97.14% F1-score, while ensemble B achieved 96.44% for both accuracy and F1-score. For the ensemble multiclass identification scenario, ensemble A recorded 97.2% accuracy and 95.8% F1-score, while ensemble B recorded 96.4% accuracy and 94.9% F1-score.

Conclusion: The proposed hybrid deep learning framework could provide promising and encouraging explainable identification performance comparing with the individual, ensemble models, or even the latest AI models in the literature. The code is available here: https://github.com/chiagoziemchima/Pneumonia_Identificaton.

Keywords: Chest X-ray imaging; Explainable artificial intelligence (XAI); Pneumonia identification; Self-attention network; Transfer ensemble learning; Transformer encoder (TE).

PubMed Disclaimer

Conflict of interest statement

Declaration of Competing Interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Figures

None
Graphical abstract
Fig. 1
Fig. 1
The abstract organizational structure of the proposed hybrid deep learning framework for pneumonia identification from chest X-ray images. The pre-trained ensemble deep learning models serve as deep feature extractors, while the transformer encoder based on the self-attention mechanism and perceptron multilayer (MLP Block) is used for pneumonia accurate identification.
Fig. 2
Fig. 2
Some samples of the deployed chest X-ray datasets. The first row depicts some images from the Mendeley dataset, while the second row depicts some images from the chest X-ray dataset.
Fig. 3
Fig. 3
Diagrammatical illustration of the proposed Ensemble architecture.
Fig. 4
Fig. 4
Visualization of a Multi-head self-attention Network and MLP blocks.
Fig. 5
Fig. 5
Evaluation results of the proposed hybrid deep learning model in terms of ROC and PR curves for the binary classification scenario. Class 0 and 1 reflect the normal and pneumonia classes from Mendeley Dataset, respectively.
Fig. 6
Fig. 6
Evaluation results of the proposed hybrid deep learning model in terms of ROC and PR curves for the multiclass identification scenario. Class 0, 1, and 2 reflect the bacteria pneumonia, normal, and viral pneumonia classes from Chest X-ray Dataset, respectively.
Fig. 7
Fig. 7
The identification evaluation performance of the binary and multicalssification scenarios in terms of confusion matrices. (a), and (b) represent the binary classification confusion matrices of the Ensemble A model and the proposed hybrid deep learning model, respectively. Whereas, the (c) and (d) depict the multiclassifcation confusion matrices of the Ensemble A model and the proposed hybrid deep learning model, respectively.
Fig. 8
Fig. 8
The visualization steps of the proposed transformer encoder model: (a) depicts the input chest X-ray image, (b) illustrates the divided input image into equal size non-overlapping patches, (c) shows learnable position embeddings of the input image patches, and (d) demonstrates the corresponding attention matrix.
Fig. 9
Fig. 9
The transformer Encoder visualization based on the attention mechanism via the input chest X-ray image.
Fig. 10
Fig. 10
Visual explainable heat maps (i.e., saliency maps) of the chest X-ray pneumonia image: (A) Depicts the heat maps of the pre-train DenseNet201and VGG16 models, (B) shows the heat map of the ensemble A deep learning model, and (C) illustrates the saliency map for the proposed hybrid deep learning framework.

References

    1. Al-antari M.A., Al-masni M.A., Choi M.T., Han S.M., Kim T.S. A fully integrated computer-aided diagnosis system for digital X-ray mammograms via deep learning detection, segmentation, and classification. Int J Med Inform. 2018;117(May):44–54. doi: 10.1016/j.ijmedinf.2018.06.003. - DOI - PubMed
    1. Al-antari M.A., Han S.M., Kim T.S. Evaluation of deep learning detection and classification towards computer-aided diagnosis of breast lesions in digital X-ray mammograms. Comput Methods Programs Biomed. 2020;196 doi: 10.1016/j.cmpb.2020.105584. - DOI - PubMed
    1. UNICEF. A child dies of pneumonia every 39 seconds; 2018. [Online]. Available from: https://data.unicef.org/topic/child-health/pneumonia.
    1. Ayan E, Ünver HM. Diagnosis of pneumonia from chest X-ray images using deep learning; 2019. doi: 10.1109/EBBT.2019.8741582.
    1. Akhtar F, Bin Heyat MB, Li JP, Patel PK, Rishipal Guragai B. Role of machine learning in human stress: a review. In: 2020 17th international computer conference on wavelet active media technology and information processing, ICCWAMTIP 2020; Dec. 2020. p. 170–4. doi: 10.1109/ICCWAMTIP51612.2020.9317396.

Publication types