# 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.

- Category: Agents
- Readiness level: II (Benchmarked) on Science Underway's four-step scale, as proposed
- Published: 2026-11-25
- Editor: Stefan Perdal
- URL: https://scienceunderway.com/articles/claude-code-and-codex-agents-build-medical-image-segmenters-near-nnu-net-level

## The study

Medical Image Segmentation Is Now Just Another Coding Task (preprint, not peer reviewed). arXiv 2611.31673. https://arxiv.org/abs/2611.31673

## At a glance

- What it shows: General-purpose AI coding agents, given only a task description, labelled images and an ordinary computer processor, wrote programs that outline structures in medical scans nearly as well as the standard specialist tool on flat 2D images. When told the true score of each attempt, they repaired their own mistakes and overtook it.
- What it does not show: It does not show a practical way for agents to judge their own output in real use, because the true score needs a correct answer that is not available on new scans. It says nothing about clinical safety or regulatory approval.
- Why it matters: Building a new medical image tool could shift from a specialist team with graphics cards to a few hours on a standard computer. The missing piece is a reliable way to check quality without a known answer.

## 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 the article (what it means, limits, what to watch) is free for members: https://scienceunderway.com/articles/claude-code-and-codex-agents-build-medical-image-segmenters-near-nnu-net-level

## 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.

---
Source: Science Underway, https://scienceunderway.com/. Please link to the article when you cite it.
