Claude Code and Codex agents build medical image segmenters near nnU-Net level
Off-the-shelf coding agents, working on a CPU, wrote programs that outline organs and tumours almost as well as a GPU-trained specialist tool. They could not tell, though, whether their own fixes made things better or worse.
scienceunderway.com/articles/claude-code-and-codex-agents-build-medical-image-segmenters-near-nnu-net-level


What the study shows
Medical image segmentation means drawing an exact outline around something in a scan, such as a heart chamber or a tumour. For years, each new task has needed an expert and a dedicated framework. The usual reference is nnU-Net, a tool that configures and trains a neural network for each task on a graphics card (GPU).
The authors gave four coding agents a short task description, labelled training data and a CPU, an ordinary computer processor. The agents were Claude Opus 5.5 and Claude Fable 5.1 running in Claude Code, and GPT-6 Astra and GPT-6.1 Sol running in Codex CLI. They had no segmentation framework, no pretrained weights and no human help. They covered 13 tasks across X-ray, MRI, ultrasound and CT, in 91 runs.
Quality was scored mainly with Dice, an overlap score from 0 to 1 between the agent's outline and the expert's. The authors report that on nine 2D tasks the best agent program per task reached 99% of nnU-Net's average Dice. The median run reached 95%. On four 3D tasks, the agents reached about 85% to 88% of nnU-Net, with more failed outlines.
A typical build took under six hours on a CPU and cost roughly $2.70 in API fees per Claude session. The nnU-Net reference took a median of about 19 hours of GPU training per task.
The agents then reviewed their own outlines on unseen scans by looking at pictures of them. This lifted the worst tenth of cases noticeably and cut boundary error by about a quarter. Gains stopped after the first round.
In a second test, the agents were told the true Dice score after each revision. This is only possible in an experiment, because it needs the expert's answer. With that signal, all 14 tested program and task pairs improved. The share of failed outlines that were rescued rose from 30% to 85%, and average quality passed nnU-Net on the same scans.
Three practical substitutes for that score all failed. The agents' own visual ratings said a revision helped in 91% of cases, but it truly helped in only half. Extra rounds without a score added almost nothing. A quality estimator the agents trained themselves closed none of the gap at the median. The authors call this the 'quality blind spot'. The paper is a preprint and has not been peer reviewed.
Our reading
In our reading, the build result is the more solid half. Agents from two vendors wrote working segmenters across four imaging types, and even the weakest run on 2D tasks reached 92% of nnU-Net. Eight of the 13 tasks used datasets published after the agents' training cutoff, which argues against simple memorisation. That claim rests on the authors' statement.
The 99% headline needs care. It compares the best program per task against one nnU-Net run, and average Dice on 2D tasks is only about 0.6 for both. Several tasks, such as finding narrowed arteries, are hard for everyone. Parity at a modest level is still parity, but it is not the same as clinical readiness.
The more useful finding may be the blind spot. An agent that grades its own work by eye is confident far more often than it is right. A hospital team could plausibly have a new ultrasound segmenter running by the end of an afternoon. They would still need a separate check to know which of its outlines to trust. On our Readiness Scale this is level II, benchmarked: public datasets and a standard comparison, but no released code.
The rest of this story is for members. Membership is free: read it at scienceunderway.com/articles/claude-code-and-codex-agents-build-medical-image-segmenters-near-nnu-net-level
Read the rest of this story
Membership is free. You get every article in full, and can save stories and follow topics.
We send a sign-in link, no password needed. Already a member? Sign inReadiness assessment
| Level | Status | Evidence |
|---|---|---|
| I Lab only | Met | Controlled experiments with agents building and repairing segmenters in a sandbox. |
| II Benchmarked | Met | Results on 13 tasks from 9 public datasets (CAMUS, MSD BrainTumour, ARCADE and others), compared with nnU-Net v2.8.1 on the same test sets. |
| III Open source | Not yet | The paper gives no link to code, agent-written programs, prompts or logs. Only third-party datasets are cited. |
| IV In production | Not yet | No named organisation uses this in production. The study is a research benchmark. |
What would move it up
Release the prompts, agent-written programs and evaluation code to reach level 3. For level 4, show a named hospital or company using agent-built segmenters, with a deployable reference-free quality signal that closes a real share of the Self-review-to-True-Dice gap.
The study
Shuheng Cao, Ruiqi Chen, Qizhen Lan et al.. Medical Image Segmentation Is Now Just Another Coding Task. arXiv, 23 November 2026. Read the paper
Notes
- Cao, Chen et al., 'Medical Image Segmentation Is Now Just Another Coding Task', arXiv preprint, 23 November 2026, CC BY 4.0. Source
- No code, prompts or agent-written programs are linked in the paper.
- Reference model: nnU-Net v2.8.1 (Isensee et al., Nature Methods, 2021), trained from scratch on a GPU for each task.
- Exact figures: 2D best Dice 0.602 vs nnU-Net 0.605; median run 0.574 (95%); weakest 0.558 (92%). 3D: 85% (Setting 2 best) and 88% (Setting 1 best) of nnU-Net. Self-review: worst-10% Dice 0.173 to 0.264, HD95 34.2 to 26.1, failure rate 32.3% to 28.8%. True-Dice: mean Dice 0.659 (frozen), 0.689 (self-review), 0.790 vs nnU-Net 0.765; rescue 30% to 85%; failure 4.1% vs 11.9%.
- Readiness: level II, Benchmarked. Public datasets and nnU-Net comparison; no released code or production use.
Edited and signed by
Stefan PerdalEditor and publisher142 stories editedStefan read the study, set the readiness level and approved this story. An AI system found the paper and wrote the first draft.
How this was made
An AI model read the study and wrote this article in the structure Science Underway uses. An editor reviewed it and approved it for publication. Check the original study before you rely on the details.
How we workNo corrections


