Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
pipeline_tag: image-segmentation
|
6 |
+
tags:
|
7 |
+
- unet
|
8 |
+
- segmentation
|
9 |
+
- medical-imaging
|
10 |
+
- covid19
|
11 |
+
- ct-scans
|
12 |
+
---
|
13 |
+
|
14 |
+
# π©Ί UNet Model for COVID-19 CT Scan Segmentation
|
15 |
+
|
16 |
+
## π Model Overview
|
17 |
+
This UNet-based segmentation model is designed for **automated segmentation of COVID-19 infected lung regions** in **CT scans**. It enhances the classic **U-Net** with **attention mechanisms** to improve focus on infected regions.
|
18 |
+
|
19 |
+
- **Architecture:** UNet + Attention Gates
|
20 |
+
- **Dataset:** COVID-19 CT scans from **Coronacases.org, Radiopaedia.org, and Zenodo Repository**
|
21 |
+
- **Task:** Image Segmentation (Lung Infection)
|
22 |
+
- **Metrics:** Dice Coefficient, IoU, Hausdorff Distance, ASSD
|
23 |
+
|
24 |
+
---
|
25 |
+
|
26 |
+
## π Training Details
|
27 |
+
- **Dataset Size:** 20 CT scans (512 Γ 512 Γ 301 slices)
|
28 |
+
- **Preprocessing:**
|
29 |
+
- Normalization of pixel intensities `[0,1]`
|
30 |
+
- HU Thresholding: `[-1000, 1500]`
|
31 |
+
- Image resizing to `128 Γ 128 pixels`
|
32 |
+
- Binarization of masks (0 = background, 1 = infected regions)
|
33 |
+
- **Augmentation:**
|
34 |
+
- **Rotations**: Β±5 degrees
|
35 |
+
- **Elastic transformations, Gaussian blur**
|
36 |
+
- **Brightness/contrast variations**
|
37 |
+
- Final dataset: **2,252 CT slices**
|
38 |
+
- **Training:**
|
39 |
+
- **Optimizer:** Adam (`learning rate = 1e-4`)
|
40 |
+
- **Loss Function:** Weighted BCE-Dice Loss + Surface Loss
|
41 |
+
- **Batch Size:** 16
|
42 |
+
- **Epochs:** 25
|
43 |
+
- **Training Platform:** NVIDIA Tesla T4 (Google Colab Pro)
|
44 |
+
|
45 |
+
---
|
46 |
+
|
47 |
+
## π Model Performance
|
48 |
+
| Metric | Non-Augmented Model | Augmented Model |
|
49 |
+
|----------------------------|---------------------|-----------------|
|
50 |
+
| **Dice Coefficient** | 0.8502 | **0.8658** |
|
51 |
+
| **IoU (Mean)** | 0.7445 | **0.8316** |
|
52 |
+
| **ASSD (Symmetric Distance)** | 0.3907 | **0.3888** |
|
53 |
+
| **Hausdorff Distance** | 8.4853 | **9.8995** |
|
54 |
+
| **ROC AUC Score** | 0.91 | **1.00** |
|
55 |
+
|
56 |
+
π **Key Findings:**
|
57 |
+
β **Augmentation improved segmentation accuracy significantly**
|
58 |
+
β **Attention U-Net outperformed other segmentation models**
|
59 |
+
|
60 |
+
---
|
61 |
+
|
62 |
+
## π₯ **How to Use the Model**
|
63 |
+
### **1οΈβ£ Load the Model**
|
64 |
+
#### **TensorFlow/Keras**
|
65 |
+
```python
|
66 |
+
from huggingface_hub import hf_hub_download
|
67 |
+
from tensorflow.keras.models import load_model
|
68 |
+
|
69 |
+
model_path = hf_hub_download(repo_id="amal90888/unet-segmentation-model", filename="unet_model.keras")
|
70 |
+
unet = load_model(model_path)
|