Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- lung
|
| 4 |
+
- segmentation
|
| 5 |
+
- medical
|
| 6 |
+
- medical-imaging
|
| 7 |
+
- xray
|
| 8 |
+
- pytorch
|
| 9 |
+
---
|
| 10 |
+
# Model description
|
| 11 |
+
|
| 12 |
+
This model performs automatic lung segmentation on chest X-ray images.
|
| 13 |
+
It ouputs a binary lung mask that can be used as a preprocessing step before downstream tasks such as classification.
|
| 14 |
+
|
| 15 |
+
This model was designed to focus the classifier on the lung region only, reducing background bias and improving interpretability.
|
| 16 |
+
|
| 17 |
+
# Intended use
|
| 18 |
+
|
| 19 |
+
- Automatic lung masking for chest X-ray images
|
| 20 |
+
- Preprocessing step before a Covid-19 classification model
|
| 21 |
+
- Research and educational purposes
|
| 22 |
+
|
| 23 |
+
/!\ NOT intended for medical diagnosis or clinical use.
|
| 24 |
+
|
| 25 |
+
# Model details
|
| 26 |
+
- Framework : PyTorch
|
| 27 |
+
- Model format : TorchScript (.pt)
|
| 28 |
+
- Task : Image segmentation
|
| 29 |
+
- Input : RGB chest X-ray image
|
| 30 |
+
- Out put : Binary lung mask
|
| 31 |
+
|
| 32 |
+
# Input format
|
| 33 |
+
- Image size to 192x192 px
|
| 34 |
+
- 3 channels (RGB)
|
| 35 |
+
- Pixel values normalized to [0,1]
|
| 36 |
+
|
| 37 |
+
# Output format
|
| 38 |
+
- Single-channel binary mask
|
| 39 |
+
- Vlaues in {0,1}
|
| 40 |
+
- Can be resized back to original image size and applied as a mask
|
| 41 |
+
|
| 42 |
+
# Example usage
|
| 43 |
+
|
| 44 |
+
```python
|
| 45 |
+
import torch
|
| 46 |
+
|
| 47 |
+
model = torch.jit.load("mask_auto.pt", map_location="cpu")
|
| 48 |
+
model.eval()
|
| 49 |
+
|
| 50 |
+
with torch.no_grad():
|
| 51 |
+
mask = model(input_tensor)
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
# Training data
|
| 55 |
+
|
| 56 |
+
The model was trained in chest X-ray images with corresponding lung masks, from the public dataset :
|
| 57 |
+
|
| 58 |
+
**COVID-19 Radiography Dataset (Kaggle)**
|
| 59 |
+
|
| 60 |
+
https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database/data
|
| 61 |
+
|
| 62 |
+
The dataset contains chest X-ray images labeled as COVID, Normal, Lung-Opacity and Viral Pneumonia.
|
| 63 |
+
|
| 64 |
+
# Limitations
|
| 65 |
+
- Performance may degrade on low-quality or non-frontal X-ray images
|
| 66 |
+
- Trained on a specific data distribution; generalization is not guaranteed
|
| 67 |
+
- Should not be used for clinical decision-making
|
| 68 |
+
|
| 69 |
+
# Licence
|
| 70 |
+
|
| 71 |
+
This model is shared for research and educational purposes.
|
| 72 |
+
|
| 73 |
+
# Author
|
| 74 |
+
|
| 75 |
+
Asma Sima
|