A multi-domain data-efficiency study — frozen-foundation-model assembly (an LLM polygon drawer in the deployed path on 1/6 domains, else SAM / op_sam / SegGPT) + a numpy genome, zero gradient training on the target task.
Dice vs. label budget for the training-free LLM and the strongest trained net, regenerated from the same baselines_dataeff.json grid as the detailed CI figure below (so they agree). Where the lines cross is where enough labels make the net worth training.
▬ LLM training-free · ▬ strongest trained net (best of nnU-Net / SegFormer / U-Net) · large dot = N=100 endpoint
CI completing — the 3-seed CI sweep is still running (prostate + kvasir N=50 nnU-Net in progress). Prostate N=100 is contested: the old best-NN was 0.786 (LLM-leading), but a fresh 3-seed first-N nnU-Net scores 0.845 — which flips Prostate to NN-leading at N=100 (LLM 0.801). The robust story is the scarce regime (N≤10).
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. Caveat: the N=100 column is a set of within-noise near-ties — best-NN@100 sits inside the LLM bootstrap 95% CI on 5/6 domains (stats.md), and 0/4 apparent N=100 leads survive as significant. The honest, CI-separated lead is at N≤25. Amber = within-CI near-tie; a green cell reflects the point estimate only, not significance.
| Domain | best NN N=10 | N=25 | N=50 | N=100 | training-free LLM | few-shot decoder N=100 (oracle) |
|---|---|---|---|---|---|---|
| ISIC 2018 (derm) | 0.815 | 0.829 | 0.832 | 0.868 | 0.880 | 0.911 |
| MSD Spleen (CT) | 0.633 | 0.802 | 0.859 | 0.907 | 0.920 | 0.953 |
| Kvasir-SEG (endo) | 0.756 | 0.824 | 0.833 | 0.889 | 0.8646 | 0.944 |
| ChestXray (X-ray) | 0.938 | 0.948 | 0.952 | 0.9546 | 0.9497 SegGPT in-context; fs-deploy 0.9488 | 0.9535 |
| HC18 Fetal-Head (US) ·new | 0.923 | 0.958 | 0.965 | 0.970 | 0.9667 retrieval SegGPT; was 0.9328 fs / 0.9225 tf | 0.9665 tuned-decoder oracle |
| MSD Prostate (MRI) ·new | 0.679 | 0.720 | 0.772 | 0.815 | 0.7877 SegGPT⊕op_sam ensemble; was 0.760 | 0.938 |
fewshot_matched.md); at N=100 the numbers below (ISIC 0.880 vs 0.868, Spleen 0.920 vs 0.907) are within-CI near-ties, not significant leads (stats.md) — and on Kvasir polyp a frozen-DINOv2 dense-correspondence localizer (OP-SAM CPG + peak-CC box) lifts it 0.659→0.8646 — the gap was localization (frozen GT-box oracle 0.914 > NN), and this closes 89% of it; the median 0.9484 now beats the NN mean, though the mean stays just below best-NN 0.889. On Chest X-ray the deployed training-free path is now a swapped 4th frozen drawer — the SegGPT in-context drawer (K=8 support pairs, zero gradient) — reaching 0.9497 ≈ NN 0.9546 (−0.005, a near-tie), superseding the earlier box-SAM 0.922 and the separate few-shot-tuned decoder 0.9488 lane; the old "frozen-decoder cap ~0.93" was specific to SAM, not to architecture. On HC18 fetal-head the same story now plays out training-free: a swapped retrieval-prompted SegGPT drawer (K=8 query-retrieved DINOv2-similar in-context supports, zero gradient, SAM-free) reaches 0.9667 ≈ NN 0.9703 (−0.004, a near-tie), superseding the op_sam+SAM 0.9225 and the few-shot decoder 0.9328 — so FetalHead is no longer a few-shot lane. Honest headline: at N=100 these are within-CI near-ties — 0/4 apparent leads survive bootstrap 95% CIs (stats.md), and the Spleen "+0.019" is a seed-averaging artifact (best single U-Net seed 0.9323 > LLM 0.9262). The defensible lead is at N≤25 on localizable targets (ISIC / Kvasir / Spleen / Prostate), budget-matched and CI-separated. All 6 deployed paths are gradient-free frozen-model assembly, but the LLM drawer is out of the mask-producing path on 5/6 (llm_ablation.md) — Prostate, the last domain lifted off its floor, is a complementary 2nd frozen drawer (a SegGPT⊕op_sam edge-gated keep-best ensemble). SegFormer is the strongest NN in 10 of 12 sweep cells.Per-case GT-vs-prediction overlays for the deployed pipeline on every test image (all 465, sorted worst-Dice first) — open the 6-domain gallery hub → (ISIC · Kvasir · Spleen · Prostate · CXR · FetalHead). Green = ground truth, red = deployed prediction; overlays rendered from the committed mask_cache/.
Is the residual to the trained NN a decoder limit or a localization limit? MedSAM (SAM fine-tuned on ~1M medical masks) beats box-prompted SAM — but it is data-leaky (its training set likely includes these test distributions), so it is really "import a trained medical net." The fair, leak-free counterpart of the same operation: init from the generic SAM (no medical data), freeze the image + prompt encoders, and fine-tune only the ~4M-param mask decoder on our own N-label train split — GT never touches test. Given a good box (the GT-box oracle, which isolates the decoder), this few-shot-tuned decoder beats the from-scratch NN at every budget on 4 of 6 domains (ISIC/Spleen/Kvasir/Prostate — Prostate by +0.12) and ties on the other two (CXR, HC18 — both near-ceiling NNs at ~0.95–0.96), and it saturates at N=10 (pretrained features + a tiny adapted head), so its curve is flat-high while the NN climbs:
| Domain (tuned decoder, oracle) | N=10 | N=25 | N=50 | N=100 | best NN N=100 |
|---|---|---|---|---|---|
| ISIC 2018 (derm) | 0.905 | 0.904 | 0.907 | 0.911 | 0.868 |
| MSD Spleen (CT) | 0.957 | 0.960 | 0.960 | 0.953 | 0.907 |
| Kvasir-SEG (endo) | 0.936 | 0.934 | 0.937 | 0.944 | 0.889 |
| ChestXray (X-ray) | 0.933 | 0.946 | 0.955 | 0.9535 | 0.9546 |
| HC18 Fetal-Head (US) ·new | 0.918 | 0.954 | 0.957 | 0.9665 | 0.970 |
| MSD Prostate (MRI) ·new | 0.906 | 0.931 | 0.932 | 0.938 | 0.815 |
MedSAM is SAM already fine-tuned on ~1M medical masks — a leaky upper reference (its training likely saw these test distributions). Arch-matched (both vit_b, GT-box oracle, N=100), few-shot tuning of the GENERIC SAM matches or beats the leaky MedSAM on 3 of 6 domains, and stays within 0.015 on the other 3 — its own pretraining distributions (derm/US/MRI). Medical pretraining buys no consistent edge once the decoder is adapted, and where generic SAM is already strong (Kvasir/Spleen) it starts above MedSAM even frozen. Bold = better of the two few-shot columns.
| Domain (N=100 oracle, vit_b) | from-scratch NN | generic frozen | generic few-shot (fair) | MedSAM frozen (leaky) | MedSAM few-shot (leaky) |
|---|---|---|---|---|---|
| ISIC 2018 (derm) | 0.868 | 0.870 | 0.915 | 0.921 | 0.943 |
| MSD Spleen (CT) | 0.907 | 0.941 | 0.956 | 0.909 | 0.946 |
| Kvasir-SEG (endo) | 0.889 | 0.917 | 0.936 | 0.888 | 0.918 |
| ChestXray (X-ray) | 0.9546 | 0.925 | 0.954 | 0.935 | 0.952 |
| HC18 Fetal-Head (US) ·new | 0.970 | 0.769 | 0.965 | 0.904 | 0.972 |
| MSD Prostate (MRI) ·new | 0.815 | 0.895 | 0.928 | 0.807 | 0.941 |
ood_medsam.md). The oracle-box column above is a leaky upper reference. Give MedSAM a fair box (learned from N GT, not the oracle) and it drops +0.16..+0.59 Dice below the deployed pipeline in-distribution; take it out-of-distribution (DRIVE retinal vessels — a distribution MedSAM never trained on) and the gap widens to +0.51 while MedSAM collapses to 0.220 even handed the ORACLE box (vs ~0.90 in-distribution). MedSAM's in-distribution edge was its decoder recognizing box-shaped targets it had trained on — memorization that does not transfer; the pipeline's few-shot-refit GT-free localization is distribution-robust.Each domain has a distinct setup — so can it be a single domain-agnostic pipeline that few-shot-fits per domain WITHOUT tuning SAM? We test the transferable skill — a frozen-SAM-feature localizer prototype fit from N labeled images — with identical code across all six domains, SAM never touched.
route.py), not SAM tuning. So onboarding a new domain is ~10 labels + a routing decision, zero gradient training. Robust localizer skill: the deployed default is now the op_sam frozen-DINOv2 dense-correspondence localizer (kvasir/HC18/prostate) — it transfers 10-shot support masks through the full patch cross-correlation, and superseded the earlier SAM+DINOv2 AMG-ranker ensemble on Kvasir (0.655→0.8646). The lesson holds and is now stronger: the polyp/fold and faint-skull walls yield to the right frozen feature space — dense correspondence, plus feature-diverse supports — not to distractor-verification tricks. The AMG-ranker ensemble (at/near the best single feature space on all three, Kvasir 0.65 / Spleen 0.64 / ISIC 0.67, never catastrophic where SAM-alone fails the isodense spleen 0.40) remains the LLM-agnostic fallback where a support set is too small for correspondence.