Pneumonia Detection in Chest X-Rays using Neural Networks

Narayana Darapaneni, Ashish Ranjan, Dany Bright, Devendra Trivedi, Ketul Kumar, Vivek Kumar, Anwesh Reddy Paduri

TL;DR

This paper explores efficient deep learning strategies for detecting and localizing pneumonia in chest X-rays using the RSNA dataset. By leveraging transfer learning and object detection frameworks like YOLOv3, the authors achieved a mean Average Precision (mAP) of 0.32—surpassing the RSNA benchmark of 0.25—while operating under significant computational constraints.

What Problem Does This Paper Address?

Pneumonia remains a leading cause of mortality worldwide, particularly in children under five. While chest X-rays (CXRs) are the standard diagnostic tool, interpreting them is a bottleneck: it requires highly skilled radiologists to distinguish pneumonia-related "opacities" from similar-looking conditions like lung cancer or pulmonary edema.

The authors identify a dual challenge: the need for automated, accurate screening to assist over-burdened clinicians, and the practical hurdle of training these complex models without massive industrial-grade computing clusters. They specifically set out to see if benchmark-level performance could be reached using limited resources through smart sampling and architectural choices.

Methods

The researchers took a multi-staged approach, moving from simple classification to complex object detection:

  1. Base CNN: A custom 5-layer Convolutional Neural Network built from scratch to establish a performance baseline.
  2. Transfer Learning: The authors utilized pre-trained weights from ImageNet to fine-tune several state-of-the-art architectures, including ResNet50, InceptionV3/V4, Xception, and EfficientNetB7/B0.
  3. Object Detection & Segmentation: To move beyond simple "yes/no" classification, they implemented:
  4. Mask R-CNN: Used for simultaneous localization (bounding boxes) and segmentation (identifying the specific pixels of the infection).
  5. YOLOv3 (You Only Look Once): A real-time object detection system using a Darknet-53 backbone, chosen for its speed and efficiency.
  6. Pre-processing: Techniques included CLAHE (Contrast Limited Adaptive Histogram Equalization) to improve image clarity, image resizing (down to 224x224 or 256x256), and heavy data augmentation (rotation, zooming, and shifting) to combat overfitting.

Datasets

The primary data source was the RSNA Pneumonia Detection Challenge dataset (via Kaggle).

  • Size: ~30,000 CXR images in DICOM format.
  • Classes: The data is split into three categories: Lung Opacity (Pneumonia), No Lung Opacity/Not Normal, and Normal.
  • Imbalance: Only about 31.6% of the images represent positive pneumonia cases. To handle this, the authors used stratified sampling based on Cochran’s formula to ensure training sets remained representative.

Key Insights and Ideas

  • YOLOv3 is a "Low-Hanging Fruit": Surprisingly, YOLOv3 achieved the best results (0.32 mAP) without any hyperparameter tuning. This suggests that for medical object detection, the architecture's inherent ability to divide images into regions is highly effective for spotting localized opacities.
  • The "Smaller is Better" Paradox: In their literature review and experiments, the authors noted that larger image resolutions didn't always yield better scores. Reducing images to 200x200 or 224x224 allowed for faster training and better generalization on limited hardware without a significant loss in diagnostic accuracy.
  • Metadata Matters: The study found that the "View Position" (AP vs. PA—whether the X-ray was taken from the front or back) is a strong feature. Patients imaged in the AP (Anterior-Posterior) position are often more ill and unable to stand, making them statistically more likely to have pneumonia.
  • CLAHE's Selective Utility: While CLAHE (histogram equalization) improved the detection of positive pneumonia cases by enhancing contrast, it actually decreased accuracy for "normal" lungs, suggesting that over-processing can introduce artifacts that confuse the model.

Key Results

  • Detection Performance: The YOLOv3 model reached a mAP of 0.32, significantly higher than the RSNA benchmark of 0.25.
  • Classification Accuracy: The InceptionV4 model achieved a validation score of 94%, while a specialized model for identifying the X-ray view position (AP vs. PA) reached 98.4% accuracy.
  • Mask R-CNN: While powerful, it achieved a lower mAP of 0.15 on a smaller stratified sample, likely due to the complexity of the mask prediction task compared to simple bounding boxes.
  • Efficiency: The YOLOv3 model was trained in just 6 hours on a modest 6GB GPU, proving that high-end results are possible on consumer-grade hardware.

Limitations and Future Work

The authors acknowledge several hurdles:

  • Computational Power: The study was strictly limited by hardware, preventing the use of larger batch sizes or more iterations which likely would have improved the YOLOv3 score further.
  • Class Imbalance: Despite stratified sampling, the "Not Normal/No Lung Opacity" class remains difficult for models to distinguish from actual pneumonia.
  • Model Specificity: The AP-PA view position model, while accurate, is not yet effectively integrated into the primary pneumonia detection pipeline.

Future Directions: The authors suggest that further iterations of YOLOv3, combined with more sophisticated image pre-processing and scaling down the size of predicted bounding boxes, could push accuracies even higher.

Summary updated

Abstract

With the advancement in AI, deep learning techniques are widely used to design robust classification models in several areas such as medical diagnosis tasks in which it achieves good performance. In this paper, we have proposed the CNN model (Convolutional Neural Network) for the classification of Chest X-ray images for Radiological Society of North America Pneumonia (RSNA) datasets. The study also tries to achieve the same RSNA benchmark results using the limited computational resources by trying out various approaches to the methodologies that have been implemented in recent years. The proposed method is based on a non-complex CNN and the use of transfer learning algorithms like Xception, InceptionV3/V4, EfficientNetB7. Along with this, the study also tries to achieve the same RSNA benchmark results using the limited computational resources by trying out various approaches to the methodologies that have been implemented in recent years. The RSNA benchmark MAP score is 0.25, but using the Mask RCNN model on a stratified sample of 3017 along with image augmentation gave a MAP score of 0.15. Meanwhile, the YoloV3 without any hyperparameter tuning gave the MAP score of 0.32 but still, the loss keeps decreasing. Running the model for a greater number of iterations can give better results.
BibTeX
@misc{darapaneni2022pneumonia,
  author = {Narayana Darapaneni and Ashish Ranjan and Dany Bright and Devendra Trivedi and Ketul Kumar and Vivek Kumar and Anwesh Reddy Paduri},
  title = {{Pneumonia Detection in Chest X-Rays using Neural Networks}},
  year = {2022},
  eprint = {2204.03618},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.03618},
}
Figure