One of the most common respiratory infections that causes substantial morbidity and mortality worldwideis
pneumonia, particularly in poorer countries with poor medical infrastructure. Chest X-ray imaging is
essential for early diagnosis, although it can be difficult. In order to identify pneumonia from chest X-rays,
this study created an automated deep learning computer-aided diagnosis method. Three pre-trained
convolutional neural network models (ResNet-18, DenseNet-121), together with a newly developed
weighted average ensemble approach based on evaluation metric scores, were used in the ensemble. Tested
using five-fold cross-validation on two public X-ray datasets for pneumonia, the methodoutperformed stateof-the-art techniques with high accuracy (98.2%, 86.7%) and sensitivity (98.19%, 86.62%). Over 2.5
million fatalities globally are attributed to pneumonia each year. This precise automated model can help
radiologists diagnose patients in a timely manner, particularly in situations with limited resources. How it
is included into clinical decision assistance systems has the potential to improve pneumonia management
and outcomes significantly.