File size: 1,357 Bytes
9228dc0 7e97b02 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | ---
license: mit
pipeline_tag: image-segmentation
tags:
- medical
- biology
---
# CT Heart Segmentation Model
**Model Information:**
- **Architecture:** U-Net
- **Task:** Binary segmentation of heart in CT scans
- **Dataset:** [Heart CT Dataset](https://www.kaggle.com/datasets/nikhilroxtomar/ct-heart-segmentation)
- **Input Size:** 224×224 RGB images
**Performance Metrics:**
- **Best Dice Score:** 0.9479
- **Best IoU Score:** 0.9014
**Usage:**
```python
from shifaa.vision import VisionModelFactory
model = VisionModelFactory.create_model(
model_type="segmentation",
model_name="CT_Heart"
)
results = model.run("heart_ct.png", show_image=True)
image = results["image"]
mask = results["predicted_mask"]
```
**Sample Results:**

**Architecture Details:**
- Encoder: 4 downsampling blocks (Conv → BatchNorm → ReLU → Dropout)
- Bottleneck: Deepest convolutional block
- Decoder: 4 upsampling blocks with skip connections
- Output: 1 channel with sigmoid activation
**Preprocessing:**
- Random horizontal flip
- Random rotation ±15°
- Random brightness & contrast adjustment
- Normalize and convert to tensor
**Training Details:**
- **Loss Function:** Combined Dice Loss + BCE Loss
- **Optimizer:** Adam (lr=0.001, weight_decay=1e-5)
- **Batch Size:** 8
- **Epochs:** 100 (with early stopping)
--- |