Explainable hybrid transformer for multi-classification of lung disease using chest X-rays

Abstract Lung disease is an infection that causes chronic inflammation of the human lung cells, which is one of the major causes of death around the world. Thoracic X-ray medical image is a well-known cheap screening approach used for lung disease detection. Deep learning networks, which are used to...

Full description

Saved in:
Bibliographic Details
Main Authors: Xiaoyang Fu, Rongbin Lin, Wei Du, Adriano Tavares, Yanchun Liang
Format: Article
Language:English
Published: Nature Portfolio 2025-02-01
Series:Scientific Reports
Online Access:https://doi.org/10.1038/s41598-025-90607-x
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1850185249662697472
author Xiaoyang Fu
Rongbin Lin
Wei Du
Adriano Tavares
Yanchun Liang
author_facet Xiaoyang Fu
Rongbin Lin
Wei Du
Adriano Tavares
Yanchun Liang
author_sort Xiaoyang Fu
collection DOAJ
description Abstract Lung disease is an infection that causes chronic inflammation of the human lung cells, which is one of the major causes of death around the world. Thoracic X-ray medical image is a well-known cheap screening approach used for lung disease detection. Deep learning networks, which are used to identify disease features in X-rays medical images, diagnosing a variety of lung diseases, are playing an increasingly important role in assisting clinical diagnosis. This paper proposes an explainable transformer with a hybrid network structure (LungMaxViT) combining CNN initial stage block with SE block to improve feature recognition for predicting Chest X-ray images for multiple lung disease classification. We contrast four classical pre-training models (ResNet50, MobileNetV2, ViT and MaxViT) through transfer learning based on two public datasets. The LungMaxVit, based on maxvit pre-trained with ImageNet 1K datasets, is a hybrid transformer with fine-tuning hyperparameters on the both X-ray datasets. The LungMaxVit outperforms all the four mentioned models, achieving a classification accuracy of 96.8%, AUC scores of 98.3%, and F1 scores of 96.7% on the COVID-19 dataset, while AUC scores of 93.2% and F1 scores of 70.7% on the Chest X-ray 14 dataset. The LungMaxVit distinguishes by its superior performance in terms of Accuracy, AUC and F1-score compared with other hybrids Networks. Several enhancement techniques, such as CLAHE, flipping and denoising, are employed to improve the classification performance of our study. The Grad-CAM visual technique is leveraged to represent the heat map of disease detection, explaining the consistency among clinical doctors and neural network models in the treatment of lung disease from Chest X-ray. The LungMaxVit shows the robust results and generalization in detecting multiple lung lesions and COVID-19 on Chest X-ray images.
format Article
id doaj-art-37a378bac23d4ea9895013ddff6dcfd2
institution OA Journals
issn 2045-2322
language English
publishDate 2025-02-01
publisher Nature Portfolio
record_format Article
series Scientific Reports
spelling doaj-art-37a378bac23d4ea9895013ddff6dcfd22025-08-20T02:16:48ZengNature PortfolioScientific Reports2045-23222025-02-0115111910.1038/s41598-025-90607-xExplainable hybrid transformer for multi-classification of lung disease using chest X-raysXiaoyang Fu0Rongbin Lin1Wei Du2Adriano Tavares3Yanchun Liang4School of Computer Science, Zhuhai College of Science and TechnologySchool of Computer Science, Zhuhai College of Science and TechnologySchool of Computer Science and Technology, Jilin UniversityDepartment of Industrial Electronics, University of MinhoSchool of Computer Science, Zhuhai College of Science and TechnologyAbstract Lung disease is an infection that causes chronic inflammation of the human lung cells, which is one of the major causes of death around the world. Thoracic X-ray medical image is a well-known cheap screening approach used for lung disease detection. Deep learning networks, which are used to identify disease features in X-rays medical images, diagnosing a variety of lung diseases, are playing an increasingly important role in assisting clinical diagnosis. This paper proposes an explainable transformer with a hybrid network structure (LungMaxViT) combining CNN initial stage block with SE block to improve feature recognition for predicting Chest X-ray images for multiple lung disease classification. We contrast four classical pre-training models (ResNet50, MobileNetV2, ViT and MaxViT) through transfer learning based on two public datasets. The LungMaxVit, based on maxvit pre-trained with ImageNet 1K datasets, is a hybrid transformer with fine-tuning hyperparameters on the both X-ray datasets. The LungMaxVit outperforms all the four mentioned models, achieving a classification accuracy of 96.8%, AUC scores of 98.3%, and F1 scores of 96.7% on the COVID-19 dataset, while AUC scores of 93.2% and F1 scores of 70.7% on the Chest X-ray 14 dataset. The LungMaxVit distinguishes by its superior performance in terms of Accuracy, AUC and F1-score compared with other hybrids Networks. Several enhancement techniques, such as CLAHE, flipping and denoising, are employed to improve the classification performance of our study. The Grad-CAM visual technique is leveraged to represent the heat map of disease detection, explaining the consistency among clinical doctors and neural network models in the treatment of lung disease from Chest X-ray. The LungMaxVit shows the robust results and generalization in detecting multiple lung lesions and COVID-19 on Chest X-ray images.https://doi.org/10.1038/s41598-025-90607-x
spellingShingle Xiaoyang Fu
Rongbin Lin
Wei Du
Adriano Tavares
Yanchun Liang
Explainable hybrid transformer for multi-classification of lung disease using chest X-rays
Scientific Reports
title Explainable hybrid transformer for multi-classification of lung disease using chest X-rays
title_full Explainable hybrid transformer for multi-classification of lung disease using chest X-rays
title_fullStr Explainable hybrid transformer for multi-classification of lung disease using chest X-rays
title_full_unstemmed Explainable hybrid transformer for multi-classification of lung disease using chest X-rays
title_short Explainable hybrid transformer for multi-classification of lung disease using chest X-rays
title_sort explainable hybrid transformer for multi classification of lung disease using chest x rays
url https://doi.org/10.1038/s41598-025-90607-x
work_keys_str_mv AT xiaoyangfu explainablehybridtransformerformulticlassificationoflungdiseaseusingchestxrays
AT rongbinlin explainablehybridtransformerformulticlassificationoflungdiseaseusingchestxrays
AT weidu explainablehybridtransformerformulticlassificationoflungdiseaseusingchestxrays
AT adrianotavares explainablehybridtransformerformulticlassificationoflungdiseaseusingchestxrays
AT yanchunliang explainablehybridtransformerformulticlassificationoflungdiseaseusingchestxrays