COMPARISON OF PERFORMANCE AND COMPUTATIONAL COMPLEXITY OF CNN AND RESNET50 FOR PNEUMONIA CLASSIFICATION
Abstract
Pneumonia is an acute infection of the lung tissue and the leading cause of death among children under five years of age worldwide. Diagnosis based on chest X-ray images is considered prone to misinterpretation, particularly in mild cases that appear similar to normal lung conditions. CNN is one of the most widely used deep learning models in medical image analysis; however, selecting the appropriate architecture between scratch-built models and transfer learning requires further evaluation, particularly regarding the trade-off between classification performance and computational complexity, an aspect that remains largely unaddressed in prior studies on medical image classification. This study aims to compare the classification performance and computational complexity of a CNN and a pre-trained ResNet50 model using transfer learning for binary pneumonia classification on chest X-ray images. The dataset used is the Chest X-Ray Images (Pneumonia) from Kaggle (Mooney, 2018), comprising 5,856 images: 1,583 in the NORMAL class and 4,273 in the PNEUMONIA class. Both models were trained under the same conditions and evaluated using the metrics accuracy, precision, recall, F1-score, ROC-AUC, and computational complexity, measured by model size, number of parameters, training time, and memory consumption. The results show that the CNN outperforms the ResNet50 across all classification metrics, achieving 98,81% accuracy, 99,07% precision, 99,30% recall, 99,18% F1-score, and 0,9978 AUC. In terms of computational complexity, the CNN has a smaller model size, shorter training time, and lower memory consumption