polyp-unet-r34-baseline
U-Net with a ResNet34 encoder, trained for polyp segmentation on the
standard benchmark (900 Kvasir-SEG + 550 CVC-ClinicDB) and evaluated on
five centres across three countries.
Training recipe: baseline. Random seed: 3.
This is the median seed, not the best
5 models were trained with this recipe, differing only in random seed.
Their scores on ETIS-Larib ranged from 0.6258 to 0.6979. This checkpoint is the
median of those 5, deliberately.
Publishing the best of 5 would contradict the finding the project
reports: that seed variance on this benchmark is large enough to
manufacture apparent improvements. A model card showing a cherry-picked
run would be an example of the problem, not a result.
Performance
| test set | centre | this checkpoint | 5-seed mean ± std |
|---|
| Kvasir | seen | 0.8832 | 0.9014 ± 0.0132 |
| CVC-ClinicDB | seen | 0.8836 | 0.8996 ± 0.0103 |
| CVC-ColonDB | unseen | 0.7134 | 0.7291 ± 0.0155 |
| CVC-300 | unseen | 0.8665 | 0.8768 ± 0.0179 |
| ETIS-LaribPolypDB | unseen | 0.6839 | 0.6661 ± 0.0355 |
Dice, computed per image and averaged. "Seen" means the centre
contributed images to training. Evaluation is at 352×352 rather than
native resolution, which caps achievable Dice at roughly 0.97 and makes
these numbers not exactly comparable to published results.
Usage
1import torch
2import segmentation_models_pytorch as smp
3from huggingface_hub import hf_hub_download
4from safetensors.torch import load_file
5
6path = hf_hub_download("saadaamir14/polyp-unet-r34-baseline", "model.safetensors")
7model = smp.Unet("resnet34", encoder_weights=None, in_channels=3, classes=1)
8model.load_state_dict(load_file(path))
9model.eval()
10
11# input: RGB, resized to 352x352, normalised with ImageNet statistics
12# output: one logit per pixel; sigmoid then threshold at 0.5
Limitations
This model is a research artifact. It is not a medical device and must
not be used for clinical decisions.
- Trained on 1,305 images from two centres. Performance at a new hospital
is not predictable from these numbers.
- Drops roughly 0.2 Dice moving from centres seen in training to an
unseen centre in another country.
- Small polyps are the dominant failure mode. At 352×352 the smallest
ETIS polyp occupies 133 pixels, and the network downsamples 32×.
- CVC-ClinicDB scores are optimistic; that dataset's train and test
frames come from overlapping colonoscopy videos.
Full protocol, statistics and the complete limitations list:
https://github.com/saad-aamir/polyp-segmentation
Citation
Datasets belong to their original authors. Please cite Kvasir-SEG,
CVC-ClinicDB, CVC-ColonDB, CVC-300 and ETIS-Larib if you use them.