Downloads · 30 days
0
ayushirathour/chest-xray-pneumonia-detection
chest-xray-pneumonia-detection is a machine learning model from ayushirathour. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for tensorflow. The card lists the license as mit.
Binary classification model for pneumonia detection in pediatric chest X-rays (ages 1-5). Built with TensorFlow and MobileNetV2, validated on independent operator cohort with 86% accuracy and 96.4% sensitivity.
Downloads · 30 days
0
Access
Public
Updated Aug 19, 2025
Repo size
12.4 MB
Likes
1
Public
Click a slice to open those files.
.h511.4 MB · 91%
From the Hugging Face model README
Binary classification model for pneumonia detection in pediatric chest X-rays (ages 1-5). Built with TensorFlow and MobileNetV2, validated on independent operator cohort with 86% accuracy and 96.4% sensitivity.
Author: Ayushi Rathour
Contact: [email protected]
Framework: TensorFlow 2.19
Model Size: ~14 MB
PneumoDetectAI is a deep learning model designed to detect pneumonia in chest X-rays of pediatric patients aged 1 to 5 years. The model uses transfer learning from MobileNetV2 for efficient inference while maintaining clinically relevant performance.
| Property | Value |
|---|---|
| Architecture | MobileNetV2 (ImageNet pretrained) + custom head |
| Input Shape | 224 × 224 × 3 (RGB) |
| Output | Binary classification (NORMAL/PNEUMONIA) |
| File Format | TensorFlow SavedModel (.h5) |
| Model Size | ~14 MB |
| Inference Time | 0.46 seconds on CPU |
| Target Population | Pediatric patients (1-5 years) |
| Validation Type | Dataset | Samples | Accuracy | Sensitivity | Specificity |
|---|---|---|---|---|---|
| Internal | Mooney 2018 | 269 | 94.8% | 89.6% | 100% |
| Cross-Operator | Radiography 2024 | 485 | 86.0% | 96.4% | 74.8% |
from huggingface_hub import hf_hub_download
import tensorflow as tf
import numpy as np
from PIL import Image
# Download and load model
model_path = hf_hub_download(
repo_id="ayushirathour/chest-xray-pneumonia-detection",
filename="best_chest_xray_model.h5"
)
model = tf.keras.models.load_model(model_path)
# Preprocess image
def preprocess_xray(image_path):
img = Image.open(image_path).convert("RGB").resize((224, 224))
img_array = np.array(img) / 255.0
return np.expand_dims(img_array, axis=0)
# Make prediction
image_array = preprocess_xray("chest_xray.jpg")
probability = model.predict(image_array)[0][0]
diagnosis = "PNEUMONIA" if probability >= 0.5 else "NORMAL"
confidence = probability * 100 if probability >= 0.5 else (1 - probability) * 100
print(f"Diagnosis: {diagnosis}")
print(f"Confidence: {confidence:.1f}%")
Training Data: Chest X-Ray Images (Pneumonia) by Paul Timothy Mooney
External Validation: Pneumonia Radiography Dataset by Tanmay Shukla
@misc{rathour2025pneumodetectai,
title={PneumoDetectAI: Pediatric Chest X-Ray Pneumonia Detection with Cross-Operator Validation},
author={Rathour, Ayushi},
year={2025},
note={Cross-operator validation on 485 independent samples},
url={https://huggingface.co/ayushirathour/chest-xray-pneumonia-detection}
}
Disclaimer: This model is for research and educational purposes only. It is not a medical device and should not be used for clinical diagnosis without appropriate medical supervision.