Vision Transformer Transfer Learning for Automated COVID-19 Pneumonia Detection in Chest Radiography Using Binary Classification
DOI:
https://doi.org/10.61255/decoding.v4i1.1277Keywords:
Binary Classification, COVID-19 Pneumonia, Chest Radiography, Transfer Learning, Vision TransformerAbstract
Purpose – Automated detection of COVID-19-associated pneumonia from chest radiography can support clinical decision-making when radiographic interpretation is challenged by limited data and image variability. This study evaluates a Vision Transformer (ViT) transfer learning model for binary classification of chest X-ray images into COVID with pneumonia and COVID without pneumonia classes.
Methods – A publicly accessible COVID-19 radiography dataset containing 513 chest X-ray images was used. Images were resized to 224 × 224 pixels, converted into tensors, and normalized using ImageNet parameters. A pre-trained ViT model from the timm library was fine-tuned for binary classification. The data were divided into stratified training, validation, and testing subsets, and performance was assessed using accuracy, precision, recall, F1-score, confusion matrix, and ROC-AUC.
Findings – The confusion matrix consisted of 43 true positives, 3 false positives, 35 true negatives, and 0 false negatives, representing 81 testing images. Based on these values, the model achieved an accuracy of 96.30%, precision of 0.93, recall of 1.00, F1-score of 0.97, and ROC-AUC of 1.00. These findings indicate that the ViT transfer learning model demonstrated high sensitivity in detecting COVID with pneumonia cases, although three false positive predictions were still observed in the COVID without pneumonia class.
Research implications – The study offers a cautious evaluation of ViT transfer learning for COVID-19 pneumonia classification using a limited dataset. Larger multi-site datasets, cross-validation, and CNN baseline comparisons are required to strengthen clinical generalizability.
Originality – This study is positioned as an evaluation of ViT transfer learning for COVID-19 pneumonia classification rather than as a ViT-based data augmentation method.
Abstract views: 2
,
PDF downloads: 1
Downloads
References
H. M. S. S. Herath, H. M. K. K. M. B. Herath, N. Madusanka, and B.-I. Lee, “A systematic review of medical image quality assessment,” Journal of Imaging, vol. 11, no. 4, Art. no. 100, 2025, doi: 10.3390/jimaging11040100
E. Goceri, “Medical image data augmentation: Techniques, comparisons and interpretations,” Artificial Intelligence Review, vol. 56, pp. 12561-12605, 2023, doi: 10.1007/s10462-023-10453-z
E. Khan, M. Z. U. Rehman, F. Ahmed, F. A. Alfouzan, N. M. Alzahrani, and J. Ahmad, “Chest X-ray classification for the detection of COVID-19 using deep learning techniques,” Sensors, vol. 22, no. 3, Art. no. 1211, 2022, doi: 10.3390/s22031211
A. Dosovitskiy et al., “An image is worth 16x16 words: Transformers for image recognition at scale,” in Proc. International Conference on Learning Representations, 2021, arXiv:2010.11929
F. Shamshad, S. Khan, S. W. Zamir, M. H. Khan, M. Hayat, F. S. Khan, and H. Fu, “Transformers in medical imaging: A survey,” Medical Image Analysis, vol. 88, Art. no. 102802, 2023, doi: 10.1016/j.media.2023.102802
M. Usman, T. Zia, and A. Tariq, “Analyzing transfer learning of vision transformers for interpreting chest radiography,” Journal of Digital Imaging, vol. 35, no. 6, pp. 1445-1462, 2022, doi: 10.1007/s10278-022-00666-z
S. Singh, M. Kumar, A. Kumar, B. K. Verma, K. Abhishek, and S. Selvarajan, “Efficient pneumonia detection using Vision Transformers on chest X-rays,” Scientific Reports, vol. 14, Art. no. 2487, 2024, doi: 10.1038/s41598-024-52703-2
A. S. Tejani et al., “Checklist for Artificial Intelligence in Medical Imaging (CLAIM): 2024 update,” Radiology: Artificial Intelligence, vol. 6, no. 4, Art. no. e240300, 2024, doi: 10.1148/ryai.240300
R. P. Rahman, “Covid w/wo Pneumonia Chest Xray,” Kaggle Dataset. [Online]. Available: https://www.kaggle.com/rashikrahmanpritom/covid-wwo-pneumonia-chest-xray. Accessed: Jul. 1, 2026
T. J. Bradshaw, Z. Huemann, J. Hu, and A. Rahmim, “A guide to cross-validation for artificial intelligence in medical imaging,” Radiology: Artificial Intelligence, vol. 5, no. 4, Art. no. e220232, 2023, doi: 10.1148/ryai.220232
R. Wightman et al., “rwightman/pytorch-image-models: v0.6.11 release,” Zenodo, 2022, doi: 10.5281/zenodo.7140899
F. S. Nahm, “Receiver operating characteristic curve: Overview and practical use for clinicians,” Korean Journal of Anesthesiology, vol. 75, no. 1, pp. 25-36, 2022, doi: 10.4097/kja.21209
H. R. Sofaer, J. A. Hoeting, and C. S. Jarnevich, “The area under the receiver operating characteristic curve as a performance metric for binary classifiers: A review and practical guidance,” Ecological Modelling, vol. 505, Art. no. 110878, 2024, doi: 10.1016/j.ecolmodel.2024.110878
S. Roumeliotis, K. Tsiakiris, and P. Dounousi, “ROC curve analysis: A useful statistic multi-tool in the research and clinical practice toolkit,” International Urology and Nephrology, vol. 56, pp. 3657-3667, 2024, doi: 10.1007/s11255-024-04022-8
J. Ko, S. Park, and H. G. Woo, “Optimization of vision transformer-based detection of lung diseases from chest X-ray images,” BMC Medical Informatics and Decision Making, vol. 24, Art. no. 191, 2024, doi: 10.1186/s12911-024-02591-3
T. Chen, I. Philippi, Q. B. Phan, L. Nguyen, N. T. Bui, C. daCunha, and T. T. Nguyen, “A vision transformer machine learning model for COVID-19 diagnosis using chest X-ray images,” Healthcare Analytics, vol. 5, Art. no. 100332, 2024, doi: 10.1016/j.health.2024.100332
F. Alshanketi, A. Alharbi, M. Kuruvilla, V. Mahzoon, S. T. Siddiqui, N. Rana, and A. Tahir, “Pneumonia detection from chest X-ray images using deep learning and transfer learning for imbalanced datasets,” Journal of Imaging Informatics in Medicine, vol. 38, no. 4, pp. 2021-2040, 2025, doi: 10.1007/s10278-024-01334-0
R. Siddiqi and S. Javaid, “Deep learning for pneumonia detection in chest X-ray images: A comprehensive survey,” Journal of Imaging, vol. 10, no. 8, Art. no. 176, 2024, doi: 10.3390/jimaging10080176
G. S. Collins et al., “TRIPOD+AI statement: Updated guidance for reporting clinical prediction models that use regression or machine learning methods,” BMJ, vol. 385, Art. no. e078378, 2024, doi: 10.1136/bmj-2023-078378
S. Sharma and K. Guleria, “A systematic literature review on deep learning approaches for pneumonia detection using chest X-ray images,” Multimedia Tools and Applications, vol. 83, no. 8, pp. 24101-24151, 2024, doi: 10.1007/s11042-023-16419-1
B. H. M. van der Velden, H. J. Kuijf, K. G. A. Gilhuijs, and M. A. Viergever, “Explainable artificial intelligence (XAI) in deep learning-based medical image analysis,” Medical Image Analysis, vol. 79, Art. no. 102470, 2022, doi: 10.1016/j.media.2022.102470
C. Patrício, J. C. Neves, and L. F. Teixeira, “Explainable deep learning methods in medical image classification: A survey,” ACM Computing Surveys, vol. 56, no. 4, Art. no. 85, pp. 1-41, 2023, doi: 10.1145/3625287
F. Garcea, A. Serra, F. Lamberti, and L. Morra, “Data augmentation for medical imaging: A systematic literature review,” Computers in Biology and Medicine, vol. 152, Art. no. 106391, 2023, doi: 10.1016/j.compbiomed.2022.106391
A. Kebaili, J. Lapuyade-Lahorgue, and S. Ruan, “Deep learning approaches for data augmentation in medical imaging: A review,” Journal of Imaging, vol. 9, no. 4, Art. no. 81, 2023, doi: 10.3390/jimaging9040081
K. Lekadir et al., “FUTURE-AI: International consensus guideline for trustworthy and deployable artificial intelligence in healthcare,” BMJ, vol. 388, Art. no. e081554, 2025, doi: 10.1136/bmj-2024-081554
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Vina Annisa Sofyan, Nur Amalia Ramadhan, Marwan Ramdhany Edy, Ardiansah, Andini Noviyanti Fitriani, Syahril Ramadhan

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
