Dragonscypher commited on
Commit
2b2e13e
·
verified ·
1 Parent(s): 4c40ad0

Upload EfficientNet_B0_best_93.44.pth

Browse files

# 🩺 AI-Powered Chest X-ray Analysis Model-Rayz

## 🌟 **Overview**
This model is designed to **analyze chest X-rays and detect potential lung conditions** using **EfficientNet_B0**. It was trained on the **NIH Chest X-ray Dataset** and **NLMCXR Dataset** to provide **multi-class classification across 14 conditions**.

This model was developed to **bridge the gap in accessibility** for those awaiting X-ray reports, helping provide **fast, AI-powered insights** while awaiting a professional diagnosis.

---

## 🏗 **Model Details**
- **Model Architecture**: `EfficientNet_B0`
- **Training Data**: `NIH Chest X-ray Dataset`, `NLMCXR Dataset`
- **Classes**:
- **14 lung conditions detected**, including:
- Atelectasis, Cardiomegaly, Consolidation, Edema, Effusion, Emphysema, Fibrosis, Hernia, Infiltration, Mass, Nodule, Pleural Thickening, Pneumonia, Pneumothorax, and "No Finding" for normal scans.
- **Optimization**:
- Model optimized with **pruning**, **quantization**, and **TensorRT acceleration** for faster inference.
- **Performance**:
- AUROC scores range from **0.72 to 0.93**, with **best results on the NLMCXR dataset**.
- The **EfficientNet_B0_best_93.44** variant was chosen after benchmarking against **DenseNet121, ViT, and other EfficientNet variants**.

---

## 🚀 **How to Use**
You can use this model for **X-ray classification** in PyTorch:

```python
import torch
from torchvision import transforms
from PIL import Image
from transformers import AutoModel, AutoTokenizer

# Load model
model = AutoModel.from_pretrained("your_model_name")
model.eval()

# Define preprocessing
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])

# Load and preprocess an image
image = Image.open("example_xray.jpg").convert("RGB")
input_tensor = transform(image).unsqueeze(0)

# Run prediction
with torch.no_grad():
output = model(input_tensor)

print("Predicted probabilities:", output)

Files changed (1) hide show
  1. EfficientNet_B0_best_93.44.pth +3 -0
EfficientNet_B0_best_93.44.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7cdb9ade471e74794a948386ae4970cf63c631d7481e0b8acfc4ea799830b634
3
+ size 16411791