How sldgroup/mk-unet works
MK-UNet is a PyTorch polyp-image segmentation project. Its user workflow is to prepare ClinicDB or ColonDB images and masks, train a selected MK-UNet variant, save a best-validation checkpoint, and run testing to assess segmentation quality. The network implements multi-kernel encoder and attention-gated decoder stages; the dataset loader handles image/mask transforms and binary labels. Training and model internals are partially sampled; the testing entry point is documented in the README, but its source was not sampled, so detailed test wiring is omitted.
Main entry points: train_polyp.py Training loop · test_polyp.py Evaluation · mkunet_network.py MK-UNet variants · dataloader_polyp.py Dataset loader
Components 12
Segmentation workflow
- Training loop
train_polyp.py - Evaluation
test_polyp.py - Model checkpoint
- Segmentation metrics
train_polyp.py - Training helpers
utils/utils.py - Segmentation mask
MK-UNet model
- MK-UNet variants
mkunet_network.py - Multi-kernel encoder
mkunet_network.py - Attention decoder
mkunet_network.py
Image data
- Polyp datasets
- Dataset loader
utils/dataloader_polyp.py
Other components
- Researcher
Connections 14
- Researcher → Polyp datasets: prepares data
- Polyp datasets → Dataset loader: loads images
- Researcher → Training loop: starts training
- Training loop → Dataset loader: requests batches
- Dataset loader → Training loop: returns batches
- Training loop → MK-UNet variants: runs inference
- MK-UNet variants → Multi-kernel encoder: encodes features
- MK-UNet variants → Attention decoder: decodes features
- Training loop → Training helpers: uses utilities
- Training loop → Model checkpoint: saves best weights
- Researcher → Evaluation: starts testing
- Evaluation → Model checkpoint: loads weights
- Evaluation → Segmentation metrics: computes scores
- Evaluation → Segmentation mask: produces segmentation