Pneumonia, a lung infection causing inflammation, remains a leading cause of global mortality, resulting in an estimated annual fatality rate of approximately 4 million individuals according to the World Health Organization. Accurate and timely diagnosis of pneumonia in its early stages is crucial for effective patient care. Given the criticality of this issue, our study introduces an automated approach utilizing convolutional neural networks and transfer learning to detect pneumonia in chest X-ray images of children aged 1 to 5 years. We employed two pretrained ResNet-50 models trained on different datasets: ImageNet, containing 14 million natural images, and RadImageNet, consisting of 1.4 million medical images. Our results show that RadImageNet outperformed ImageNet, demonstrating superior performance in pneumonia detection. Evaluation using six key performance metrics revealed that the ResNet-50 model pretrained on RadImageNet achieved superior performance compared to the ImageNet-based model, further emphasizing the efficacy and interpretability of RadImageNet for binary classification tasks in medical image datasets. These findings underscore the importance of RadImageNet as a valuable source of pretrained models, particularly for small medical image datasets. 1