GleghornLab/lymph_node_segmentation
012
LNsegmentationsweep
A unet model for multilabel image segmentation trained with sliding window approach.
Model Description
- Architecture: unet
- Input Channels: 3
- Output Classes: 4
- Base Filters: 128
- Window Size: 128
- Downsample Factor: 1.0
Model-Specific Parameters
Training Configuration
Validation Performance Metrics (Pooled Pixel-Level)
Test Performance Metrics (Pooled Pixel-Level)
Usage
import numpy as np
from model import MODEL_REGISTRY, SegmentationConfig
# Load model
config = SegmentationConfig.from_pretrained("aholk/LN_segmentation_sweep")
model = MODEL_REGISTRY["unet"].from_pretrained("aholk/LN_segmentation_sweep")
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=128,
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)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}
}