A Fine-Tuned Transfer Learning Vision Transformer Framework for Lungs X-Ray Image Classification
DOI:
https://doi.org/10.30871/jaic.v10i1.11865Keywords:
Artificial Intelligence, Fine-Tuning, Transfer Learning, Vision Transformer, X-rayAbstract
Lung diseases constitute a significant source of morbidity and therefore require diagnostic frameworks that provide both high accuracy and operational efficiency. This study proposes the development of a Vision Transformer (ViT)-based classification model for lung X-ray images, employing transfer learning and fine-tuning techniques to improve detection performance across five disease categories. Experimental results demonstrate stable and effective model convergence, as reflected by the consistent decrease in loss metrics throughout the learning process. Evaluation on an independent test dataset shows that the proposed approach achieves an accuracy of 0.958, indicating strong and balanced generalization performance. Further analysis using a confusion matrix reveals that the ViT model is capable of recognizing subtle and complex radiographic patterns with low misclassification rates, particularly achieving high recall for major pathological classes, which is critical for minimizing false negatives in clinical screening scenarios. Overall, this study demonstrates that the application of transfer learning with fine-tuning on a Vision Transformer architecture yields competitive performance for multi-class lung X-ray classification when trained on a balanced dataset. These findings are consistent with prior evidence highlighting the effectiveness of ViT in capturing global contextual information in medical imaging tasks.
Downloads
References
[1] E. Bhattacharya and D. Bhattacharya, “A Review of Recent Deep Learning Models in COVID-19 Diagnosis,” European Journal of Engineering and Technology Research, vol. 6, no. 5, 2021.
[2] E. Prompetchara, C. Ketloy, and T. Palaga, “Allergy and Immunology Immune responses in COVID-19 and potential vaccines: Lessons learned from SARS and MERS epidemic,” Asian Pasific Journal of Allergy and Immunology, 2020, doi: 10.12932/AP-200220-0772.
[3] A. S. Simbirtsev, “Immunopathogenesis and perspectives for immunotherapy of coronavirus infection,” HIV Infection and Immunosuppressive Disorders, vol. 12, no. 4, pp. 7–22, 2020, doi: 10.22328/2077-9828-2020-12-4-7-22.
[4] G. Li et al., “Coronavirus infections and immune responses,” J Med Virol, vol. 92, no. 4, pp. 424–432, Apr. 2020, doi: 10.1002/JMV.25685.
[5] H. Mary Shyni and E. Chitra, “A comparative study of X-ray and CT images in COVID-19 detection using image processing and deep learning techniques,” Computer Methods and Programs in Biomedicine Update, vol. 2, p. 100054, Jan. 2022, doi: 10.1016/J.CMPBUP.2022.100054.
[6] H. Mohammad-Rahimi, M. Nadimi, A. Ghalyanchi-Langeroudi, M. Taheri, and S. Ghafouri-Fard, “Application of Machine Learning in Diagnosis of COVID-19 Through X-Ray and CT Images: A Scoping Review,” Front Cardiovasc Med, vol. 8, Mar. 2021, doi: 10.3389/FCVM.2021.638011/FULL.
[7] A. U. Haq, J. P. Li, S. Ahmad, S. Khan, M. A. Alshara, and R. M. Alotaibi, “Diagnostic Approach for Accurate Diagnosis of COVID-19 Employing Deep Learning and Transfer Learning Techniques through Chest X-ray Images Clinical Data in E-Healthcare,” Sensors 2021, Vol. 21, Page 8219, vol. 21, no. 24, p. 8219, Dec. 2021, doi: 10.3390/S21248219.
[8] S. Hassantabar, M. Ahmadi, and A. Sharifi, “Diagnosis and detection of infected tissue of COVID-19 patients based on lung x-ray image using convolutional neural network approaches,” Chaos Solitons Fractals, vol. 140, p. 110170, Nov. 2020, doi: 10.1016/J.CHAOS.2020.110170.
[9] L. Huang, J. Ma, H. Yang, and Y. Wang, “Research and implementation of multi-disease diagnosis on chest X-ray based on vision transformer,” Quant Imaging Med Surg, vol. 14, no. 3, pp. 2539–2555, Mar. 2024, doi: 10.21037/QIMS-23-1280/COIF.
[10] S. Singh, M. Kumar, A. Kumar, B. K. Verma, K. Abhishek, and S. Selvarajan, “Efficient pneumonia detection using Vision Transformers on chest X-rays,” Sci Rep, vol. 14, no. 1, p. 2487, Dec. 2024, doi: 10.1038/S41598-024-52703-2.
[11] Ş. Öztürk, M. Y. Turalı, and T. Çukur, “HydraViT: Adaptive Multi-Branch Transformer for Multi-Label Disease Classification from Chest X-ray Images,” Biomed Signal Process Control, vol. 100, Oct. 2023, doi: 10.1016/j.bspc.2024.106959.
[12] S. Ghosh, A. Bandyopadhyay, M. Bose, and K. C. Santosh, “Vision Transformers Excel in Chest X-Ray Analysis,” Proceedings - 2025 IEEE Conference on Artificial Intelligence, CAI 2025, pp. 495–500, 2025, doi: 10.1109/CAI64502.2025.00090.
[13] S. Regmi, A. Subedi, U. Bagci, D. Jha, and P. Campus, “Vision Transformer for Efficient Chest X-ray and Gastrointestinal Image Classification,” p. 111, Apr. 2023, doi: 10.1117/12.3045810.
[14] O. Uparkar, J. Bharti, R. K. Pateriya, R. K. Gupta, and A. Sharma, “Vision Transformer Outperforms Deep Convolutional Neural Network-based Model in Classifying X-ray Images,” Procedia Comput Sci, vol. 218, pp. 2338–2349, Jan. 2023, doi: 10.1016/J.PROCS.2023.01.209.
[15] Y. Shen et al., “MoViT: Memorizing Vision Transformers for Medical Image Analysis,” Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), vol. 14349 LNCS, pp. 205–213, Mar. 2023, doi: 10.1007/978-3-031-45676-3_21.
[16] B. Zhang and Y. Zhang, “MSCViT: A Small-size ViT architecture with Multi-Scale Self-Attention Mechanism for Tiny Datasets,” Jan. 2025, Accessed: Nov. 26, 2025. [Online]. Available: https://arxiv.org/pdf/2501.06040
[17] A. Dosovitskiy et al., “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale,” ICLR 2021 - 9th International Conference on Learning Representations, Oct. 2020, Accessed: Nov. 26, 2025. [Online]. Available: https://arxiv.org/pdf/2010.11929
[18] M. J. Horry, S. Chakraborty, B. Pradhan, N. Shulka, and M. Almazroui, “Two-Speed Deep-Learning Ensemble for Classification of Incremental Land-Cover Satellite Image Patches,” Earth Systems and Environment 2023 7:2, vol. 7, no. 2, pp. 525–540, Mar. 2023, doi: 10.1007/S41748-023-00343-3.
[19] K. S. Charan, O. V. Krishna, P. V. Sai, and A. K. Ilavarasi, “Transfer Learning Based Multi-Class Lung Disease Prediction Using Textural Features Derived From Fusion Data,” IEEE Access, vol. 12, pp. 108248–108262, 2024, doi: 10.1109/ACCESS.2024.3435680.
[20] P. Misra, N. Panigrahi, S. Gopal Krishna Patro, A. O. Salau, and S. S. Aravinth, “PETLFC: Parallel ensemble transfer learning based framework for COVID-19 differentiation and prediction using deep convolutional neural network models,” Multimedia Tools and Applications 2023 83:5, vol. 83, no. 5, pp. 14211–14233, Jul. 2023, doi: 10.1007/S11042-023-16084-4.
[21] K. Rajagopalan and S. Babu, “The detection of lung cancer using massive artificial neural network based on soft tissue technique,” BMC Medical Informatics and Decision Making 2020 20:1, vol. 20, no. 1, pp. 282-, Oct. 2020, doi: 10.1186/S12911-020-01220-Z.
[22] A. Victor Ikechukwu and S. Murali, “CX-Net: an efficient ensemble semantic deep neural network for ROI identification from chest-x-ray images for COPD diagnosis,” Mach Learn Sci Technol, vol. 4, no. 2, p. 025021, May 2023, doi: 10.1088/2632-2153/ACD2A5.
[23] K. Wang, X. Zhang, S. Huang, F. Chen, X. Zhang, and L. Huangfu, “Learning to Recognize Thoracic Disease in Chest X-Rays with Knowledge-Guided Deep Zoom Neural Networks,” IEEE Access, vol. 8, pp. 159790–159805, 2020, doi: 10.1109/ACCESS.2020.3020579.
[24] M. Liu, L. Dong, Q. Jiao, C. Gu, and M. Lee, “Deep Transfer Learning Using Real-World Image Features for Medical Image Classification, with a Case Study on Pneumonia X-ray Images,” Bioengineering 2024, Vol. 11, Page 406, vol. 11, no. 4, p. 406, Apr. 2024, doi: 10.3390/BIOENGINEERING11040406.
[25] S. Suganyadevi, V. Seethalakshmi, and K. Balasamy, “A review on deep learning in medical image analysis,” International Journal of Multimedia Information Retrieval 2021 11:1, vol. 11, no. 1, pp. 19–38, Sep. 2021, doi: 10.1007/S13735-021-00218-1.
[26] A. Abbas, M. M. Abdelsamea, and M. M. Gaber, “DeTrac: Transfer Learning of Class Decomposed Medical Images in Convolutional Neural Networks,” IEEE Access, vol. 8, pp. 74901–74913, 2020, doi: 10.1109/ACCESS.2020.2989273.
[27] G. H. Huang, Q. J. Fu, M. Z. Gu, N. H. Lu, K. Y. Liu, and T. B. Chen, “Deep Transfer Learning for the Multilabel Classification of Chest X-ray Images,” Diagnostics, vol. 12, no. 6, p. 1457, Jun. 2022, doi: 10.3390/DIAGNOSTICS12061457/S1.
[28] Z. Alammar, L. Alzubaidi, J. Zhang, Y. Li, W. Lafta, and Y. Gu, “Deep Transfer Learning with Enhanced Feature Fusion for Detection of Abnormalities in X-ray Images,” Cancers 2023, Vol. 15, Page 4007, vol. 15, no. 15, p. 4007, Aug. 2023, doi: 10.3390/CANCERS15154007.
[29] M. A. Sufian et al., “AI-Driven Thoracic X-ray Diagnostics: Transformative Transfer Learning for Clinical Validation in Pulmonary Radiography,” Journal of Personalized Medicine 2024, Vol. 14, Page 856, vol. 14, no. 8, p. 856, Aug. 2024, doi: 10.3390/JPM14080856.
[30] R. Fan and S. Bu, “Transfer-Learning-Based Approach for the Diagnosis of Lung Diseases from Chest X-ray Images,” Entropy 2022, Vol. 24, Page 313, vol. 24, no. 3, p. 313, Feb. 2022, doi: 10.3390/E24030313.
[31] P. K. Pagadala, S. L. Pinapatruni, C. R. Kumar, S. Katakam, L. S. K. Peri, and D. A. Reddy, “Enhancing Lung Cancer Detection from Lung CT Scan Using Image Processing and Deep Neural Networks,” Revue d’Intelligence Artificielle, vol. 37, no. 6, pp. 1597–1605, Dec. 2023, doi: 10.18280/RIA.370624.
[32] S. Sharma and K. Guleria, “A Deep Learning based model for the Detection of Pneumonia from Chest X-Ray Images using VGG-16 and Neural Networks,” Procedia Comput Sci, vol. 218, pp. 357–366, Jan. 2023, doi: 10.1016/J.PROCS.2023.01.018.
[33] M. Nishio et al., “Deep learning model for the automatic classification of COVID-19 pneumonia, non-COVID-19 pneumonia, and the healthy: a multi-center retrospective study,” Sci Rep, vol. 12, no. 1, p. 8214, Dec. 2022, doi: 10.1038/S41598-022-11990-3.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 I Gusti Ngurah Lanang Wijayakusuma, Made Sudarma, Ni Putu Dian Astutik

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License (Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) ) that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).








