Training-Free Medical Image Segmentation vs Trained Networks

A multi-domain data-efficiency study — frozen LLM polygon traces + a numpy genome + a gated SAM decoder, with zero gradient training.

4 modalitiesmeasured, from scratch GT-free at inferenceLLM-agnostic skills updated 2026-07-02

Results — best trained NN across N vs the LLM pipeline

Strongest trained NN per cell — max of SegFormer (mit_b2), pretrained U-Net (resnet34), and nnU-Net, 2-seed means — at matched budgets N = 10 / 25 / 50 / 100, against the LLM pipeline (re-measured from scratch via eval_all_domains.py). The LLM's only label-fit module is a ~5–8-param genome; localization and SAM are GT-free/frozen — so the LLM number is ~flat in N while the NN climbs. Bold = LLM ahead of the best NN at that budget.

Domainbest NN N=10N=25N=50N=100LLM pipeline
ISIC 2018 (derm)0.8150.8290.8320.8680.880
MSD Spleen (CT)0.6330.8020.8590.9070.903
Kvasir-SEG (endo)0.7560.8240.8330.8890.617
ChestXray (X-ray)0.9380.9480.9520.9530.914
The LLM pipeline wins the scarce-label regime where it has a cue — ISIC through N=100 (best NN needs N=189 to reach 0.887), Spleen through N=50 (crossover ~N=70, via a GT-free cross-slice prior) — and loses at every budget on Kvasir polyp (structural — no GT-free cue localizes it) and Chest X-ray, where a few-shot static lung box (N=10 labels) + a mask-bbox self-reprompt + a repair agent lift the LLM to 0.914 (localization, not architecture, was the gap) but box-prompted SAM still caps at a GT-box ~0.93 < 0.953. SegFormer is the strongest NN in 10 of 12 sweep cells.

Data-efficiency

Matched data-efficiency: LLM pipeline (genome fit per N) vs trained NN
LLM pipeline (dashed — genome re-fit per N; ~flat) vs trained NN (solid — matched N). Spleen is capped at N=25 (30 training draws) and Kvasir at N=50 (91 draws).

Qualitative examples — 3 best / 3 worst per dataset

Green = ground truth, red = prediction. Top row = 3 highest-Dice cases, bottom row = 3 lowest.

ISIC 2018 — skin lesion (pigment cue, LLM's best domain)

ISIC best/worst

MSD Spleen — CT (localizer + cross-slice priors + SAM re-prompt polish)

Spleen best/worst
The worst cases are localizer failures (prediction lands on stomach/liver, Dice≈0). A GT-free cross-slice prior (centroid trajectory + sibling-mask seed), a selective multi-prototype re-decode, and a SAM re-prompt boundary polish (kept only where it lands on stronger image edges) recover them, lifting the spleen pipeline to 0.903 (0.786→0.840→0.868→0.875→0.903 this session, zero regressions) — now level with the best trained NN at N=100.

Kvasir-SEG — polyp (AMG ranker localizer; the gap was localization)

Kvasir best/worst
Polyps share colour/texture with mucosa, so the heuristic box and coordinate draws mislocalize (~43/100 to Dice≈0) and a hand-crafted redness box was rejected. But SAM's automatic-mask generator proposes the polyp in every image (best-candidate oracle 0.798), and a few-shot ranker — standardized cosine-similarity of frozen SAM features to a polyp prototype + a train-fit size prior — picks it, lifting the pipeline 0.348→0.617 (median 0.202→0.765). The residual to the NN is the ~0.78–0.80 boundary oracle plus ranker error, not a perception ceiling. Note: the example gallery predates this localizer and shows the older box→SAM masks.

ChestXray — bilateral lungs (few-shot static box + self-reprompt → SAM)

CXR best/worst
Three GT-free skills: (1) a fixed few-shot lung box (mean of N=10 train GT boxes; box-IoU 0.545→0.67) replaces the heuristic box → 0.825→0.898; (2) a mask-bbox self-reprompt (box-IoU 0.67→0.83) → 0.898→0.911; (3) a repair agent that edits the mask pixels — trimming SAM's bright "out of lung" over-seg into the mediastinum (a decoder error a redraw loop can't reach), fire-gated + keep-best → 0.911→0.914 zero-regression. CXR's gap was box localization, not architecture — but a perfect GT box still caps SAM at ~0.93 < the U-Net's 0.953, so it stays capped at every budget; the residual is the frozen decoder.

What we learned

Honest-reporting note: earlier drafts carried optimistic hardcoded values (ISIC 0.885, Kvasir 0.860, CXR 0.855). This report uses numbers re-measured from scratch with the current pipeline: ISIC 0.880, Kvasir 0.617, CXR 0.914.