Skip to content
2000
Volume 21, Issue 1
  • ISSN: 1573-4056
  • E-ISSN: 1875-6603

Abstract

Objective

The objective of this research is to enhance pneumonia detection in chest X-rays by leveraging a novel hybrid deep learning model that combines Convolutional Neural Networks (CNNs) with modified Swin Transformer blocks. This study aims to significantly improve diagnostic accuracy, reduce misclassifications, and provide a robust, deployable solution for underdeveloped regions where access to conventional diagnostics and treatment is limited.

Methods

The study developed a hybrid model architecture integrating CNNs with modified Swin Transformer blocks to work seamlessly within the same model. The CNN layers perform initial feature extraction, capturing local patterns within the images. At the same time, the modified Swin Transformer blocks handle long-range dependencies and global context through window-based self-attention mechanisms. Preprocessing steps included resizing images to 224x224 pixels and applying Contrast Limited Adaptive Histogram Equalization (CLAHE) to enhance image features. Data augmentation techniques, such as horizontal flipping, rotation, and zooming, were utilized to prevent overfitting and ensure model robustness. Hyperparameter optimization was conducted using Optuna, employing Bayesian optimization (Tree-structured Parzen Estimator) to fine-tune key parameters of both the CNN and Swin Transformer components, ensuring optimal model performance.

Results

The proposed hybrid model was trained and validated on a dataset provided by the Guangzhou Women and Children’s Medical Center. The model achieved an overall accuracy of 98.72% and a loss of 0.064 on an unseen dataset, significantly outperforming a baseline CNN model. Detailed performance metrics indicated a precision of 0.9738 for the normal class and 1.0000 for the pneumonia class, with an overall F1-score of 0.9872. The hybrid model consistently outperformed the CNN model across all performance metrics, demonstrating higher accuracy, precision, recall, and F1-score. Confusion matrices revealed high sensitivity and specificity with minimal misclassifications.

Conclusion

The proposed hybrid CNN-ViT model, which integrates modified Swin Transformer blocks within the CNN architecture, provides a significant advancement in pneumonia detection by effectively capturing both local and global features within chest X-ray images. The modifications to the Swin Transformer blocks enable them to work seamlessly with the CNN layers, enhancing the model’s ability to understand complex visual patterns and dependencies. This results in superior classification performance. The lightweight design of the model eliminates the need for extensive hardware, facilitating easy deployment in resource-constrained settings. This innovative approach not only improves pneumonia diagnosis but also has the potential to enhance patient outcomes and support healthcare providers in underdeveloped regions. Future research will focus on further refining the model architecture, incorporating more advanced image processing techniques, and exploring explainable AI methods to provide deeper insights into the model's decision-making process.

This is an open access article distributed under the terms of the Creative Commons Attribution 4.0 International Public License (CC-BY 4.0), a copy of which is available at: https://creativecommons.org/licenses/by/4.0/legalcode. This license permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Loading

Article metrics loading...

/content/journals/cmir/10.2174/0115734056326685250101113959
2025-01-09
2025-07-10
The full text of this item is not currently available.

References

  1. Pneumonia in children.2023Available from: https://www.who.int/news-room/fact-sheets/detail/pneumonia
  2. CampbellH. el ArifeenS. HazirT. O’KellyJ. BryceJ. RudanI. QaziS.A. Measuring coverage in MNCH: Challenges in monitoring the proportion of young children with pneumonia who receive antibiotic treatment.PLoS Med.2013105e100142110.1371/journal.pmed.100142123667338
    [Google Scholar]
  3. Bio-remediation.2023Available from: https://www.researchgate.net/publication/327932092_Bio-remediation?channel=doi&linkId=5badf0f645851574f7ec1452&showFulltext=true
  4. WoottonD. FeldmanC. The diagnosis of pneumonia requires a chest radiograph (x-ray)—yes, no or sometimes? Pneumonia.2014Available from: https://pneumonia.biomedcentral.com/articles/10.15172/pneu.2014.5/464
  5. PrendkiV. SchefflerM. HuttnerB. GarinN. HerrmannF. JanssensJ.P. MartiC. CarballoS. RouxX. SerratriceC. SerratriceJ. AgoritsasT. BeckerC.D. KaiserL. Rosset-ZuffereyS. SoulierV. PerrierA. RenyJ.L. MontetX. StirnemannJ. Low-dose computed tomography for the diagnosis of pneumonia in elderly patients: A prospective, interventional cohort study.Eur. Respir. J.2018515170237510.1183/13993003.02375‑201729650558
    [Google Scholar]
  6. PearceM.S. SalottiJ.A. LittleM.P. McHughK. LeeC. KimK.P. HoweN.L. RonckersC.M. RajaramanP. CraftA.W. ParkerL. Berrington de GonzálezA. Radiation exposure from CT scans in childhood and subsequent risk of leukaemia and brain tumours: A retrospective cohort study.Lancet2012380984049950510.1016/S0140‑6736(12)60815‑022681860
    [Google Scholar]
  7. ResnickP. VarianH.R. Recommender systems.Commun. ACM1997403565810.1145/245108.245121
    [Google Scholar]
  8. EstevaA. KuprelB. NovoaR.A. KoJ. SwetterS.M. BlauH.M. FGF23 and Fetuin-A interaction in the liver and in the circulation.Int. J. Biol. Sci.20171458659810.1038/nature21056
    [Google Scholar]
  9. LitjensG. KooiT. BejnordiB.E. SetioA.A.A. CiompiF. GhafoorianM. van der LaakJ.A.W.M. van GinnekenB. SánchezC.I. A survey on deep learning in medical image analysis.Med. Image Anal.201742608810.1016/j.media.2017.07.00528778026
    [Google Scholar]
  10. ShenD. WuG. SukH.I. Deep Learning in Medical Image Analysis Il.Annu. Rev. Biomed. Eng.201719122124810.1146/annurev‑bioeng‑071516‑04444228301734
    [Google Scholar]
  11. Cires¸ancires¸anD.C. GiustiA. GambardellaL.M. SchmidhuberJ. Mitosis detection in breast cancer histology images with deep neural networks.Med Image Comput Comput Assist Interv201316Pt 2411418
    [Google Scholar]
  12. EstevaA. KuprelB. NovoaR.A. KoJ. SwetterS.M. BlauH.M. Dermatologist-level classification of skin cancer with deep neural networks.Nature2017542763911511810.1038/nature21056
    [Google Scholar]
  13. HeK. ZhangX. RenS. SunJ. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification.arXiv:1502.01852201510.1109/ICCV.2015.123
    [Google Scholar]
  14. HuangL. QinJ. ZhouY. ZhuF. LiuL. ShaoL. Normalization techniques in training DNNs: Methodology, analysis and application.arXiv:2009.128362020
    [Google Scholar]
  15. IoffeS. SzegedyC. Batch normalization: Accelerating deep network training by reducing internal covariate shift.ICML'15: Proceedings of the 32nd International Conference on International Conference on Machine Learning372015448456
    [Google Scholar]
  16. BuadesA. CollB. MorelJ.M. A non-local algorithm for image denoising.2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05)San Diego, CA, USA, 20-25 June 2005, pp. 60-6510.1109/CVPR.2005.38
    [Google Scholar]
  17. DabovK. FoiA. KatkovnikV. EgiazarianK. Image denoising by sparse 3-D transform-domain collaborative filtering.IEEE Trans. Image Process.20071682080209510.1109/TIP.2007.90123817688213
    [Google Scholar]
  18. UlyanovD. VedaldiA. LempitskyV. Instance normalization: The missing ingredient for fast stylization.arXiv:1607.080222016http://arxiv.org/abs/1607.08022
    [Google Scholar]
  19. ShinH.C. RothH.R. GaoM. LuL. XuZ. NoguesI. YaoJ. MolluraD. SummersR.M. Deep convolutional neural networks for computer-aided detection: CNN architectures, dataset characteristics and transfer learning.IEEE Trans. Med. Imaging20163551285129810.1109/TMI.2016.252816226886976
    [Google Scholar]
  20. VaswaniA. BrainG. ShazeerN. ParmarN. UszkoreitJ. JonesL. Attention is All you Need.Adv. Neural Inf. Process. Syst.201730
    [Google Scholar]
  21. ChenLC ZhuY PapandreouG SchroffF AdamH Encoder-decoder with atrous separable convolution for semantic image segmentation.arXiv:1802.02611201810.1007/978‑3‑030‑01234‑2_49
    [Google Scholar]
  22. BobowiczM. RygusikM. BulerJ. BulerR. FerlinM. KwasigrochA. SzurowskaE. GrochowskiM. Attention-based deep learning system for classification of breast lesions—multimodal, weakly supervised approach.Cancers20231510270410.3390/cancers1510270437345041
    [Google Scholar]
  23. OktayO. SchlemperJ. Le FolgocL. LeeM. HeinrichM. MisawaK. Attention U-Net: Learning where to look for the pancreas.arXiv:1804.039992018https://arxiv.org/abs/1804.03999v3
    [Google Scholar]
  24. FuJ. LiuJ. TianH. LiY. BaoY. FangZ. Dual Attention Network for Scene Segmentation.2019https://arxiv.org/abs/1809.02983v410.1109/CVPR.2019.00326
    [Google Scholar]
  25. StephenO SainM MaduhUJ JeongDU An efficient deep learning approach to pneumonia classification in healthcare.J Healthc Eng2019201941809494180949
    [Google Scholar]
  26. YueH. YuQ. LiuC. HuangY. JiangZ. ShaoC. ZhangH. MaB. WangY. XieG. ZhangH. LiX. KangN. MengX. HuangS. XuD. LeiJ. HuangH. YangJ. JiJ. PanH. ZouS. JuS. QiX. Machine learning-based CT radiomics method for predicting hospital stay in patients with pneumonia associated with SARS-CoV-2 infection: a multicenter study.Ann. Transl. Med.202081485985910.21037/atm‑20‑302632793703
    [Google Scholar]
  27. LiangG. ZhengL. A transfer learning method with deep residual network for pediatric pneumonia diagnosis.Comput. Methods Programs Biomed.202018710496410.1016/j.cmpb.2019.06.02331262537
    [Google Scholar]
  28. YadavS.S. JadhavS.M. Deep convolutional neural network based medical image classification for disease diagnosis.J. Big Data20196111310.1186/s40537‑019‑0276‑2
    [Google Scholar]
  29. BhattH. ShahM. A Convolutional Neural Network ensemble model for Pneumonia Detection using chest X-ray images.Healthc. Anal.2023310017610.1016/j.health.2023.100176
    [Google Scholar]
  30. EERDEM. Detection of pneumonia with a novel CNN-based approach.Sakarya Univ. J. Comput. Inf. Sci.2021412634
    [Google Scholar]
  31. SaulC.J. UreyD.Y. TaktakogluC.D. Early diagnosis of pneumonia with deep learning.arXiv:1904.009372019https://arxiv.org/abs/1904.00937v1
    [Google Scholar]
  32. ZhangJ. XieY. PangG. LiaoZ. VerjansJ. LiW. SunZ. HeJ. LiY. ShenC. XiaY. Viral pneumonia screening on chest X-Rays using confidence-aware anomaly detection.IEEE Trans. Med. Imaging202140387989010.1109/TMI.2020.304095033245693
    [Google Scholar]
  33. ChouhanV. SinghS.K. KhampariaA. GuptaD. TiwariP. MoreiraC. A novel transfer learning based approach for pneumonia detection in chest X-ray images.Appl. Sci2020102559
    [Google Scholar]
  34. RajpurkarP. IrvinJ. ZhuK. YangB. MehtaH. DuanT. CheXNet: Radiologist-level pneumonia detection on chest X-rays with deep learning.arXiv:1711.052252017
    [Google Scholar]
  35. JainR. NagrathP. KatariaG. Sirish KaushikV. Jude HemanthD. Pneumonia detection in chest X-ray images using convolutional neural networks and transfer learning.Measurement202016510804610.1016/j.measurement.2020.108046
    [Google Scholar]
  36. El AsnaouiK. ChawkiY. IdriA. Automated methods for detection and classification pneumonia based on X-Ray images using deep learning.arXiv:2003.14363202110.1007/978‑3‑030‑74575‑2_14
    [Google Scholar]
  37. MittalA. KumarD. MittalM. SabaT. AbunadiI. RehmanA. Detecting pneumonia using convolutions and dynamic capsule routing for chest X-ray images.Sensors20202041068
    [Google Scholar]
  38. AyanE. ÜnverH.M. Diagnosis of pneumonia from chest X-ray images using deep learning.2019 Scientific Meeting on Electrical-Electronics & Biomedical Engineering and Computer Science (EBBT) Istanbul, Turkey, 24-26 April 2019, pp. 1-510.1109/EBBT.2019.8741582
    [Google Scholar]
  39. KunduR. DasR. GeemZ.W. HanG.T. SarkarR. Pneumonia detection in chest X-ray images using an ensemble of deep learning models.PLoS One2021169e025663010.1371/journal.pone.025663034492046
    [Google Scholar]
  40. O’QuinnW. HaddadR.J. MooreD.L. Pneumonia radiograph diagnosis utilizing deep learning network.2019 IEEE 2nd International Conference on Electronic Information and Communication Technology (ICEICT)Harbin, China, 20-22 January 2019, pp. 763-76710.1109/ICEICT.2019.8846438
    [Google Scholar]
  41. TaloM. Pneumonia detection from radiography images using convolutional neural networks.2019 27th Signal Processing and Communications Applications Conference (SIU)Sivas, Turkey, 24-26 April 2019, pp. 1-410.1109/SIU.2019.8806614
    [Google Scholar]
  42. VarshniD. ThakralK. AgarwalL. NijhawanR. MittalA. Pneumonia Detection Using CNN based Feature Extraction.201910.1109/ICECCT.2019.8869364
    [Google Scholar]
  43. LiL. XuM. LiuH. LiY. WangX. JiangL. WangZ. FanX. WangN. A Large-Scale Database and a CNN Model for Attention-Based Glaucoma Detection.IEEE Trans. Med. Imaging202039241342410.1109/TMI.2019.292722631283476
    [Google Scholar]
  44. FuJ. LiW. DuJ. HuangY. A multiscale residual pyramid attention network for medical image fusion.Biomed. Signal Process. Control20216610248810.1016/j.bspc.2021.102488
    [Google Scholar]
  45. GuR. WangG. SongT. HuangR. AertsenM. DeprestJ. OurselinS. VercauterenT. ZhangS. CA-Net: Comprehensive attention convolutional neural networks for explainable medical image segmentation.IEEE Trans. Med. Imaging202140269971110.1109/TMI.2020.303525333136540
    [Google Scholar]
  46. GuoX. YuanY. Triple ANet: Adaptive Abnormal-aware Attention Network for WCE Image ClassificationMedical Image Computing and Computer Assisted Intervention – MICCAI 2019, 22nd International ConferenceShenzhen, China, October 13–17, 2019, Proceedings, Part I (pp.293-301)
    [Google Scholar]
  47. ShamshadF. KhanS. ZamirS.W. KhanM.H. HayatM. KhanF.S. FuH. Transformers in medical imaging: A survey.Med. Image Anal.20238810280210.1016/j.media.2023.10280237315483
    [Google Scholar]
  48. KhanS. NaseerM. HayatM. ZamirS.W. KhanF.S. ShahM. Transformers in vision: A survey.ACM Comput. Surv.20225410
    [Google Scholar]
  49. DosovitskiyA. BeyerL. KolesnikovA. WeissenbornD. ZhaiX. UnterthinerT. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv:2010.119292020
    [Google Scholar]
  50. SinghS. KumarM. KumarA. VermaB.K. AbhishekK. SelvarajanS. Efficient pneumonia detection using vision transformers on chest X-rays.Scientific Reports2024142487
    [Google Scholar]
  51. UsmanM. ZiaT. TariqA. Analyzing transfer learning of vision transformers for interpreting chest radiography.J. Digit. Imaging20223561445146210.1007/s10278‑022‑00666‑z35819537
    [Google Scholar]
  52. KermanyD. ZhangK. GoldbaumM. Large dataset of labeled optical coherence tomography (oct) and chest x-ray images.Mendeley Data201810.17632
    [Google Scholar]
  53. ShortenC. KhoshgoftaarT.M. A survey on image data augmentation for deep learning.J. Big Data2019616010.1186/s40537‑019‑0197‑0
    [Google Scholar]
  54. ZhuX. LyuS. WangX. ZhaoQ. TPH-YOLOv5: Improved YOLOv5 Based on Transformer Prediction Head for Object Detection on Drone-captured Scenarios.2021 IEEE/CVF International Conference on Computer Vision Workshops (ICCVW)Montreal, BC, Canada, 11-17 October 2021, pp. 2778-2788
    [Google Scholar]
  55. LiuZ. LinY. CaoY. HuH. WeiY. ZhangZ. Swin transformer: Hierarchical vision transformer using shifted windows.arXiv:2103.140302021https://arxiv.org/abs/2103.14030v2
    [Google Scholar]
  56. DariciM.B. DokurZ. OlmezT. Pneumonia detection and classification using deep learning on chest x-ray images.Int. J. Intell. Syst. Appl. Eng.20208417718310.18201/ijisae.2020466310
    [Google Scholar]
  57. HashmiMF KatiyarS HashmiAW KeskarAG Pneumonia detection in chest X-ray images using compound scaled deep learning model.J. Control Meas. Electron. Comput. Commun.2021623-4397406
    [Google Scholar]
  58. Luján-GarcíaJ.E. Yáñez-MárquezC. Villuendas-ReyY. Camacho-NietoO. A transfer learning method for pneumonia classification and visualization.Appl. Sci2020108290810.3390/app10082908
    [Google Scholar]
/content/journals/cmir/10.2174/0115734056326685250101113959
Loading
/content/journals/cmir/10.2174/0115734056326685250101113959
Loading

Data & Media loading...

This is a required field
Please enter a valid email address
Approval was a Success
Invalid data
An Error Occurred
Approval was partially successful, following selected items could not be processed due to error
Please enter a valid_number test