Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
## Model Overview
|
| 6 |
+
|
| 7 |
+
* **Model Name:** ImprovedUNet3D
|
| 8 |
+
* **Architecture:** 3D U-Net with residual-style encoder-decoder blocks, instance normalization, LeakyReLU activations, and dropout
|
| 9 |
+
* **Framework:** PyTorch
|
| 10 |
+
* **Input Channels:** 4 (e.g., multimodal MRI inputs)
|
| 11 |
+
* **Output Channels:** 4 (segmentation classes)
|
| 12 |
+
* **Base Filters:** 16 (scalable by multiplier in constructor)
|
| 13 |
+
|
| 14 |
+
## Intended Use
|
| 15 |
+
|
| 16 |
+
* **Primary Application:** Brain tumor segmentation on 3D MRI volumes using the BraTS 2020 dataset.
|
| 17 |
+
* **Users:** Medical imaging researchers, AI practitioners in healthcare.
|
| 18 |
+
* **Out-of-Scope:** Medical diagnosis without expert oversight. Not for real-time intraoperative use.
|
| 19 |
+
|
| 20 |
+
## Training Data
|
| 21 |
+
|
| 22 |
+
* **Dataset:** Medical Segmentation Decathlon / BraTS 2020 training and validation sets
|
| 23 |
+
* **Source:** `awsaf49/brats20-dataset-training-validation` on Kaggle
|
| 24 |
+
* **Data Volume:** \~369 cases (training + validation)
|
| 25 |
+
* **Preprocessing:**
|
| 26 |
+
|
| 27 |
+
* Skull stripping
|
| 28 |
+
* Intensity normalization per modality
|
| 29 |
+
* Resampling to uniform voxel size
|
| 30 |
+
* Patching or cropping to fixed volume shape
|
| 31 |
+
|
| 32 |
+
## Performance
|
| 33 |
+
|
| 34 |
+
| Metric | Whole Tumor | Tumor Core | Enhancing Tumor |
|
| 35 |
+
| ---------------- | ----------- | ---------- | --------------- |
|
| 36 |
+
| Dice Coefficient | 0.x | 0.x | 0.x |
|
| 37 |
+
| Hausdorff95 (mm) | x | x | x |
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
## Limitations and Risks
|
| 41 |
+
|
| 42 |
+
* **Overfitting:** Model may not generalize to scanners or protocols outside BraTS.
|
| 43 |
+
* **Data Imbalance:** Rare tumor subregions may have lower performance.
|
| 44 |
+
* **Clinical Use:** Intended for research only; does not replace expert radiologist interpretation.
|
| 45 |
+
|
| 46 |
+
## How to Use
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
from improved_unet3d import ImprovedUNet3D
|
| 50 |
+
import torch
|
| 51 |
+
|
| 52 |
+
# Instantiate model
|
| 53 |
+
model = ImprovedUNet3D(in_channels=4, out_channels=4, base_filters=16)
|
| 54 |
+
# Load pretrained weights (if available)
|
| 55 |
+
model.load_state_dict(torch.load("path/to/checkpoint.pth"))
|
| 56 |
+
model.eval()
|
| 57 |
+
|
| 58 |
+
# Inference on a single 3D volume
|
| 59 |
+
input_volume = torch.randn(1, 4, 128, 128, 128) # example shape
|
| 60 |
+
with torch.no_grad():
|
| 61 |
+
output = model(input_volume)
|
| 62 |
+
# output shape: [1, 4, 128, 128, 128]
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Training Details
|
| 66 |
+
|
| 67 |
+
* **Optimizer:** Adam
|
| 68 |
+
* **Learning Rate:** 1e-4
|
| 69 |
+
* **Batch Size:** 2
|
| 70 |
+
* **Loss Function:** Combined Dice + Cross-Entropy
|
| 71 |
+
* **Epochs:** 200
|
| 72 |
+
* **Scheduler:** Cosine annealing or Step LR
|
| 73 |
+
|
| 74 |
+
## Ethical Considerations
|
| 75 |
+
|
| 76 |
+
* **Bias:** Trained on a specific dataset; demographic coverage may be limited.
|
| 77 |
+
* **Privacy:** Data must be anonymized. Users should ensure HIPAA/GDPR compliance.
|
| 78 |
+
|
| 79 |
+
## Citation
|
| 80 |
+
|
| 81 |
+
If you use this model, please cite:
|
| 82 |
+
|
| 83 |
+
|