Views
No views yet
| Parameter | Value |
|---|---|
| Batch Size | 64 |
| Learning Rate | 0.0003 |
| Weight Decay | 0.01 |
| Epochs | 100 |
| Patience | 10 |
| Dataset | GleghornLab/Semi-Automated_LN_Segmentation_10_11_2025 |
| Metric | Mean | Class 0 | Class 1 | Class 2 | Class 3 |
|---|---|---|---|---|---|
| Dice | 0.5196 | 0.1800 | 0.2978 | 0.7189 | 0.8819 |
| IoU | 0.4059 | 0.0989 | 0.1749 | 0.5612 | 0.7887 |
| F1 | 0.5196 | 0.1800 | 0.2978 | 0.7189 | 0.8819 |
| MCC | 0.5044 | 0.1730 | 0.2861 | 0.7032 | 0.8554 |
| ROC AUC | 0.8338 | 0.6482 | 0.7772 | 0.9252 | 0.9847 |
| PR AUC | 0.4846 | 0.0767 | 0.1807 | 0.7583 | 0.9227 |
1import numpy as np
2from model import MODEL_REGISTRY, SegmentationConfig
3
4# Load model
5config = SegmentationConfig.from_pretrained("aholk/LN_segmentation")
6model = MODEL_REGISTRY["unet"].from_pretrained("aholk/LN_segmentation")
7model.eval()
8
9# Run inference on a full image with sliding window
10image = np.random.rand(2048, 2048, 3).astype(np.float32) # Your image here
11probs = model.predict_full_image(
12 image,
13 dim=256,
14 batch_size=16,
15 device="cuda" # or "cpu"
16)
17# probs shape: (num_classes, H, W) with values in [0, 1]
18
19# Threshold to get binary masks
20masks = (probs > 0.5).astype(np.uint8)



1@software{windowz_segmentation,
2 title={Multilabel Image Segmentation with Sliding Window U-Net},
3 author={Gleghorn Lab},
4 year={2025},
5 url={https://github.com/GleghornLab/ComputerVision2}
6}