Small Slither worm segmenter with soft priors
3,719,075 parameters. SegFormer B0 plus a small full-resolution refinement head. Predicts worm-body pixels, excluding food and exterior glow. Semantic masks, not separate instances; no prompting required.
Selected prior run: priors-lr0.00003-s17, epoch94, threshold0.50. Priors are learned through solid smooth tubes with slowly changing width, exact synthetic body masks excluding glow/orbs, paired nuisance consistency and weak image-boundary affinity. Original draft masks are preserved; teacher probabilities provide fallible soft supervision on training images only.
Eight runs compare plain labels, teacher-guided labels and the full prior recipe. Selection uses validation only. The requested prior model is exported; it is not assumed to beat the other variants. Fresh test images come from30 additional source videos, unused during training/selection, but their labels remain inaccurate drafts.
| Variant | Parameters | Fresh draft IoU | Fresh draft Dice | Synthetic bright-exterior FP rate |
|---|---|---|---|---|
| priors | 3.72M | 0.5369 | 0.6987 | 0.0392 |
| plain_b0 | 3.72M | 0.5311 | 0.6937 | 0.1187 |
| robust_b0 | 3.72M | 0.5306 | 0.6933 | 0.1470 |
| previous_b2 | 27.35M | 0.5345 | 0.6967 | 0.1235 |
Synthetic diagnostic:32 unseen seeds of the same renderer, not proof of real-video robustness. Qualitative clips in videos/ use validation sources. Full masks need review before claiming reliable absolute accuracy. No test-driven tuning was performed.
model.pt is the inference export; training/best.pt and training/latest.pt preserve the winning run's training state. All run metrics, settings, fresh held-out overlays, code, priors and data provenance are retained. The snapshot contains original200 labels/images and30 fresh evaluation images. Synthetic pairs regenerate from included code and seeds0–799. The fixed teacher is available from mundoamundo/slither-worm-segmentation-200-20261004 revision622f89a2c9db205c7dff50b524c4a90f59ab2e51.
from huggingface_hub import snapshot_download
root = snapshot_download('mundoamundo/slither-worm-small-priors-20261004')
# Install worm_segmentation/requirements.txt, then run from root:
# python -m worm_segmentation.predict model.pt image.jpg mask.png
Input float RGB[B,3,H,W] in[0,1], output foreground logits[B,H,W]. The helper applies the saved threshold and writes0/255PNG. See worm_segmentation/priors/README.md for exact loss, augmentation, limitations and experiment setup.
Derived from NVIDIA SegFormer, with original license retained: noncommercial research/evaluation only. Source gameplay retains its original rights.