unet_jan_26
A attention_unet model for multilabel image segmentation trained with sliding window approach.
Model Description
- Architecture: attention_unet
- Input Channels: 3
- Output Classes: 4
- Base Filters: 32
- Window Size: 256
Model-Specific Parameters
Training Configuration
| Parameter | Value |
|---|---|
| Batch Size | 24 |
| Learning Rate | 0.0005 |
| Weight Decay | 0.01 |
| Epochs | 100 |
| Patience | 10 |
| Dataset | GleghornLab/Semi-Automated_LN_Segmentation_10_11_2025 |
Performance Metrics
| Metric | Mean | Class 0 | Class 1 | Class 2 | Class 3 |
|---|---|---|---|---|---|
| Dice | 0.5073 | 0.1429 | 0.2764 | 0.7188 | 0.8913 |
| IoU | 0.4006 | 0.0769 | 0.1604 | 0.5610 | 0.8040 |
| F1 | 0.5073 | 0.1429 | 0.2764 | 0.7188 | 0.8913 |
| MCC | 0.4915 | 0.1366 | 0.2626 | 0.7029 | 0.8640 |
| ROC AUC | 0.7766 | 0.5246 | 0.7228 | 0.9121 | 0.9468 |
| PR AUC | 0.4789 | 0.0502 | 0.1668 | 0.7692 | 0.9294 |
Usage
import numpy as np
from model import MODEL_REGISTRY, SegmentationConfig
# Load model
config = SegmentationConfig.from_pretrained("lhallee/unet_jan_26")
model = MODEL_REGISTRY["attention_unet"].from_pretrained("lhallee/unet_jan_26")
model.eval()
# Run inference on a full image with sliding window
image = np.random.rand(2048, 2048, 3).astype(np.float32) # Your image here
probs = model.predict_full_image(
image,
dim=256,
batch_size=16,
device="cuda" # or "cpu"
)
# probs shape: (num_classes, H, W) with values in [0, 1]
# Threshold to get binary masks
masks = (probs > 0.5).astype(np.uint8)
Training Plots
Citation
If you use this model, please cite:
@software{windowz_segmentation,
title={Multilabel Image Segmentation with Sliding Window U-Net},
author={Gleghorn Lab},
year={2025},
url={https://github.com/GleghornLab/ComputerVision2}
}
- Downloads last month
- -



