An Efficient AI-Driven Tool for Pediatric Pneumonia Detection

CWSF · 2026 Disease & Illness Bronze Medal

Thumbnail supplied by the source for An Efficient AI-Driven Tool for Pediatric Pneumonia Detection

Overview

Pediatric Pneumonia is the leading infectious cause of death for children worldwide [1], largely due to slow or incorrect diagnosis [2]. Even with advancements in machine learning, modern AI systems struggle to detect it as they are trained on adult-only datasets. Overcoming challenges like limited data, class imbalance, and constrained hardware capabilities, I developed and optimized a deep learning model that can accurately classify pediatric pneumonia. Additionally, I created a saliency map that highlights what the model considered for its final prediction and a web interface that allows for easy upload of chest X-ray images. In comparison to modern benchmarks, this project demonstrates efficiency and reliability. If implemented in areas such as South Asia or Sub-Saharan Africa, it could save lives through faster and more accurate diagnosis.

Video

Why?

Pneumonia is a respiratory infectious disease that affects the alveoli within the lungs, causing them to fill with pus and fluid (Fig. 1), appearing as consolidation in chest X-rays (Fig. 2). Children are especially vulnerable to this illness, accounting for 22% of all deaths in youth aged 1 to 5 [1]. Although Pneumonia is everywhere, it is greatly prevalent in sub-Saharan Africa and Southern Asia (Fig. 3), largely due to delayed or incorrect diagnosis [2].

In recent years, the integration of AI with healthcare has accelerated rapidly, and many hospitals have begun adopting deep learning models that can identify illnesses through CT scans and X-rays [3]. However, pediatric disease detection is underrepresented in the machine learning space. Their images for training AI models account for less than 1% of public medical datasets despite making up a large portion of the world population, which has discouraged AI advancements in child disease classification [4].

Currently, there are very few models for pediatric pneumonia, as most are trained on datasets comprised solely of older patients. This has resulted in a significant decrease in accuracy when testing adult-only models on pediatric cases [5], since the disease appears differently under chest X-rays [6]. This implies that separate models must be made for the accurate detection of pediatric pneumonia, which would improve diagnosis and save lives.

How?

To train the deep learning model, I collected 5,863 images from a publicly available Kaggle dataset. The dataset is from the Guangzhou Women and Children’s Medical Center, containing chest X-rays of patients aged 1 to 5 years old. The dataset is split between train, validation, and test folders, with each containing directories for Normal and Pneumonia images [7].

The images are then preprocessed with data augmentations such as resizing, normalization, gaussian blur, slight rotations and contrast jitter. This ensures the model performs calculations with an expected input [8] while also simulating a variety of X-ray images for generalization.

The Convolutional Neural Network (CNN) (Fig. 4) model chosen was EfficientNet-B3 due to its low parameter count while maintaining high accuracy (Fig. 5), which allows the model to be trained with limited hardware resources [9]. Using transfer learning, the EfficientNet-B3 model begins with a pretrained backbone from the ImageNet library, letting it update convolutional weights for feature extraction [10]. This requires the backbone to be initially frozen to train the classifier, before being unfrozen so the entire model’s weights can be fine-tuned.

Since there are three times more pneumonia images than normal, I implemented weighted cross-entropy loss and a weighted random sampler, which allows the model to focus more on the normal class [11]. Alongside this, I conducted experiments with various hyperparameters such as dropout, weight decay, and learning rate, aiming to find optimal values for each.

After training the model, values were computed for accuracy, F1-score, recall, precision, the confusion matrix, the accuracy over epochs graph, and ROC/AUC, which provides a representation of model performance on unseen data. Then I decided to implement a Grad-CAM visualization to highlight the regions the model focused on when making its final prediction, along with a web interface to upload images.

What?

To validate the results of my model, I calculated crucial metrics on the test dataset:

Accuracy (percentage of all predictions that the model correctly identified): 91.84%

Recall (percentage of positive cases correctly identified): 95.4%

Precision (percentage of predicted positive cases that were correct): 91.9%

F1 Score (harmonic mean of precision and recall): 93.6%

AUC (the probability that the model will rank a random positive case higher than a random negative one): 96.17%

Alongside these metrics, I generated a confusion matrix (Fig. 6) that highlights the number of true positives, true negatives, false positives, and false negatives when testing. These results showed that my model has higher accuracy for pneumonia detection compared to negative cases, which is intentionally done to minimize false negatives. Additionally, an accuracy graph (Fig. 7) was created to show validation and training accuracy over 20 epochs, and a Receiver Operating Characteristic (ROC) graph (Fig. 8) was made to visualize the AUC score.

The Graphical User Interface (Fig. 9) is simple and responsive, producing both the prediction output and Grad-CAM visualization (Fig. 10) with minimal latency. The saliency map enables radiologists to verify the model’s outputs against their own diagnoses. Altogether, the pipeline provides reliability and user-friendliness for those using the model.

To benchmark the model performance of my CNN, I compared my results with a 2025 study using the same dataset but a different methodology. While Manaf and Mughal utilized a standard custom CNN structure and Generative Adversarial Networks (GANs) to address the dataset limitations [12], my method focused on implementing a pretrained CNN structure that presents efficiency with high accuracy. Using this strategy, my model outperforms the benchmark across all evaluated metrics, including F1 score (+4.6%), accuracy (+5.84%), recall (+0.4%), and precision (+7.9%). This comparison suggests that utilizing a well-established architecture with training configurations, such as weighted cross-entropy loss, can be a more effective alternative to a GAN without a refined architecture when tasked with X-ray disease classification.

Overall, my model’s results indicate an accurate CNN for pediatric pneumonia detection. With all primary metrics surpassing 90%, as well as modern benchmarks, this neural network could be used for consistent and precise diagnosis.

So What?

This model is designed to improve the diagnosis of pneumonia in pediatric patients. It provides fast and consistent predictions that reduce human error, assisting radiologists in correctly identifying the disease with minimal delays. This is critical when treating children, as the median duration of illness before death is only 8 days [13], creating urgency for treatment. Especially in developing regions, where pediatric pneumonia rates are high, it is often difficult to make a confident diagnosis.

With an interface that enables the easy uploading of chest X-rays, this tool provides accessibility when used by radiologists. Additionally, the use of a saliency map improves trust and reliability for doctors as they can verify the model’s result with their own judgment. Overall, if deployed, this tool could help a substantial number of pediatric patients receive their treatment sooner and improve survival outcomes.

What's Next?

Using a diverse private dataset, such as the PERCH (Pneumonia Etiology Research for Child Health) dataset, would enhance generalization and accuracy (Fig. 11). This would enable the model to distinguish between viral, bacterial, and fungal pneumonia, all of which require different medications.

A stronger GPU would provide greater computational power and allow for the use of a larger model, such as EfficientNet-V2-L. This would likely present better results, especially when paired with a larger training dataset.

Implementing a hyperparameter optimization tool, such as gridsearch, as well as testing different architectures like ResNet, would help find optimal conditions for improved metrics.

Thanks

First, I would like to thank the Thames Valley Science and Engineering Fair delegates for their support and organization throughout this journey to CWSF.

I also wish to acknowledge the Guangzhou Women and Children’s Medical Center for making the pediatric chest X-ray dataset publicly available. Access to these high-quality images provided the data necessary to train and validate my model.

Finally, I would like to thank my parents for their encouragement throughout this project.

References

References

[1] World Health Organization. (2022, November 11). Pneumonia in children. World Health Organization. https://www.who.int/news-room/fact-sheets/detail/pneumonia

[2] Porter, P., Brisbane, J., Tan, J., Bear, N., Choveaux, J., Della, P., & Abeyratne, U. (2021). Diagnostic errors are common in acute pediatric respiratory disease: A prospective, single-blinded Multicenter Diagnostic Accuracy Study in Australian emergency departments. Frontiers in Pediatrics, 9. https://doi.org/10.3389/fped.2021.736018

[3] Al-masni, M. A., & Ryu, K. (2025). AI advancements in Healthcare: Medical imaging and Sensing Technologies. Bioengineering, 12(10), 1026. https://doi.org/10.3390/bioengineering12101026

[4] Hua, S. B., Heller, N., He, P., Towbin, A. J., Chen, I. Y., Lu, A. X., & Erdman, L. (2025). Lack of Children in Public Medical Imaging Data Points to Growing Age Bias in Biomedical AI. medRxiv. https://doi.org/10.1101/2025.06.06.25328913

[5] Rollan-Martinez-Herrera, M., Díaz, A. A., Estépar, R. S., Sanchez-Ferrero, G. V., Ross, J. C., Estépar, R. S., & Nardelli, P. (2024). CNNS trained with adult data are useful in pediatrics. A pneumonia classification example. PLOS ONE, 19(7). https://doi.org/10.1371/journal.pone.0306703

[6] Border Radiology Specialists. (2024, December 3). Interpreting paediatric chest X-rays: What key structures and common variants should you know?. Border Radiology Specialists. https://borderradiology.com.au/interpreting-paediatric-chest-x-rays-what-key-structures-and-common-variants-should-you-know/

[7] Mooney, P. (2018, March 24). Chest X-ray images (pneumonia). Kaggle. https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia

[8] EITCA. (2023, August 8). Why is it necessary to resize the images to a square shape?. EITCA Academy. https://bit.ly/4cNgTJO

[9] Tan, M., & Le, Q. V. (2020, September 11). EfficientNet: Rethinking model scaling for Convolutional Neural Networks. arXiv.org. https://arxiv.org/abs/1905.11946

[10] Fu, Y. (2023, July 10). Keras documentation: Image Classification via fine-tuning with EfficientNet. Keras. https://keras.io/examples/vision/image_classification_efficientnet_fine_tuning/

[11] Mishra, D. (2021, July 27). Class imbalance. Towards Data Science. https://towardsdatascience.com/class-imbalance-d90f985c681e/

[12] Manaf, A., & Mughal, N. (2025, July 13). AI-Enhanced Pediatric Pneumonia Detection: A CNN-based approach using data augmentation and generative adversarial networks (Gans). arXiv.org. https://arxiv.org/abs/2507.09759

[13] Ferdous, F., Ahmed, S., Das, S. K., Chisti, M. J., Nasrin, D., Kotloff, K. L., Levine, M. M., Nataro, J. P., Ma, E., Muhsen, K., Wagatsuma, Y., Ahmed, T., & Faruque, A. S. (2018). Pneumonia mortality and healthcare utilization in young children in rural Bangladesh: A prospective verbal autopsy study. Tropical Medicine and Health, 46(1). https://doi.org/10.1186/s41182-018-0099-4

Images

[14] Jones, J. (n.d.). [Pediatric pneumonia X-ray with upper right consolidation] [X-ray]. Radiopedia. https://radiopaedia.org/cases/paediatric-pneumonia?lang=us

[15] Asthma and Respiratory Foundation NZ. (n.d.). [Diagram comparing normal alveoli and pneumonia-infected alveoli] [Diagram]. [https://www.asthmafoundation.org.nz/your-health/living-with-childhood-pneumonia

[16] Pediatric Radiology. (n.d.) [Chest X-ray highlighting pneumonia consolidation] [X-ray]. Pediatric radiology. https://introductiontoradiology.net/courses/rad/peds/chest_webpages/ch9.2bacti.html

[17] Our World in Data. (2026, February 7). Death rate from pneumonia and other lower respiratory infections in children [Map]. Our World in Data. https://ourworldindata.org/grapher/pneumonia-death-rates-in-children-under-5

[18] Nadargi, S. (2025, September 20). [Simplified CNN architecture] [Diagram]. Medium. https://medium.com/@sanket.nadargi1/convolutional-neural-networks-cnns-1c55997a6c5a

[19] Tan, M., & Le, Q. V. (2020, September 11). [Comparison of efficiency between various CNN models] [Graph]. arXiv.org. https://arxiv.org/abs/1905.11946

[20] Davidian, M., Lahav, A., Joshua, B.-Z., Wand, O., Lurie, Y., & Mark, S. (2024). As the training set size progressively increases, there is a corresponding improvement in the level of accuracy [Graph]. Diagnostics, 14(16), 1727. https://doi.org/10.3390/diagnostics14161727

Images (19)

Awards (2)

  • Bronze Medal
  • Selected for CWSF 2026

Competition history

Related projects

Closest projects by meaning, across every fair and year in the corpus.

Browse more like this

Source: ProjectBoard / Youth Science Canada

Save projects to your library

Sign in with Google to keep track of projects you find interesting, organized into folders. An account also raises your daily allowance for “Has this been done?”, and lets you create a key for the MCP server with a much higher limit than anonymous use. Browsing stays public.

Continue with Google