Pneumonia Diagnosis from Chest X-ray Images Using Transfer Learning and ResNet50 Architecture

Pneumonia Diagnosis from Chest X-ray Images Using Transfer Learning and ResNet50 Architecture

Zahra Mahmoudi Anzabi1 Maryam Najafi2 Tahmineh Amiri3

1) M.Sc. Student in Biomedical Engineering (Biomechanics), University of Tabriz, Tabriz, Iran. Email:
2) B.Sc. Graduate in Biomedical Engineering, Islamic Azad University, Allameh Tabataba’i Branch, Tabriz, Iran. Email:
3) M.Sc. Graduate in E-Business, Payame Noor University, Tehran, Iran; Instructor at Tehran Technical Complex. Email:

IOI Code : AAHD-ABCGCC
Publication : National Conference on Information Technology, Nanotechnology, Artificial Intelligence and Technological Futures Studies(itnaf.ir)
Abstract :
    Pneumonia is one of the most common causes of mortality from respiratory infections worldwide, and achieving rapid and accurate diagnosis from chest radiographs remains a major challenge for healthcare systems. In this study, a transfer learning–based approach using the ResNet50 architecture is proposed for the automatic detection of pneumonia from chest X-ray images. The dataset comprises 5,863 images from the Kaggle repository, categorized into two classes: “Normal” and “Pneumonia.” Given the class imbalance (approximately 1:2.7), class weighting was incorporated into the cross-entropy loss function. Model training was conducted in two stages: in the first stage, only the final classification layer was trained; in the second stage, deeper layers of the network were selectively fine-tuned. To improve generalization, data augmentation techniques were applied, including random rotations up to 7 degrees and random horizontal flipping. Optimization was performed using AdamW, together with a ReduceLROnPlateau learning-rate scheduler. Evaluation on the test set showed that the proposed model achieved an accuracy of 91.03%, with an Average Precision of 0.972 on the Precision–Recall curve, indicating strong performance in detecting pneumonia cases, particularly under class-imbalanced conditions.

Keywords :