Skip to content
DAH

Medical image segmentation

Labelling organs, lesions and structures in CT, MRI, ultrasound and pathology images with U-Nets, self-configuring pipelines and promptable foundation models.

On this page16 sections
Why other work relies on it

Radiotherapy planning, volumetry, surgical planning, radiomics and quantitative imaging biomarkers all depend on segmentations whose reliability must be known.

Teaching computers to outline organs and tumours in medical scans.

  1. 1Scan from CT or MRI
  2. 2Network labels each voxel
  3. 3Compare with expert outline
  4. 4Check on unseen hospitals
  5. 5Flag cases where it fails

The task. Assign a class to every pixel (2D) or voxel (3D). The loss is typically cross-entropy plus a Dice term. The Dice score between predicted region AA and reference BB is 2∣A∩B∣/(∣A∣+∣B∣)2|A\cap B|/(|A|+|B|); for boundary quality one also uses surface distances. Small lesions make Dice unstable, so metric choice matters (the Metrics Reloaded recommendations).

Architectures. U-Net: an encoder reduces resolution while increasing feature channels; a decoder upsamples, with skip connections passing fine detail across. nnU-Net automatically configures preprocessing, patch size, network depth and post-processing from dataset statistics and won many challenges. The 2024 "nnU-Net Revisited" study concluded that scaled CNN U-Nets still beat transformer and Mamba-based alternatives in 3D when validated rigorously.

Foundation models. SAM shows that a promptable model can segment anything in natural images; MedSAM and relatives fine-tune it on medical images with box, click or text prompts. Results are mixed: strong in 2D and for prompted tumours, weaker than nnU-Net in several 3D tasks, and they need accurate prompts.

Evaluation traps. Patients appearing in both training and test sets; different scanners; annotators who disagree; models that confidently fail on unseen conditions. Reliable per-case failure detection, using uncertainty and calibration, is as important as average accuracy.

Skills. Convolutional and transformer networks, class imbalance, augmentation, domain shift, calibration, clinical validation.

Try it. Run the free TotalSegmentator tool on a public CT scan, then compare its organ outlines with a second tool using the Dice score; you will see that agreement is high for large organs and much lower for thin or small structures.

Go deeper

The full technical text.

What it is

Assign a class to every pixel or voxel of a medical image. Targets range from organs (CT multi-organ) to tumours and sub-structures (MRI brain), to cells in histology. Quality is measured against human reference annotations, which themselves differ between annotators (inter-rater variability), so the practical ceiling is not 100 percent overlap.

The core machinery

U-Net (Ronneberger et al. 2015): an encoder-decoder with skip connections and a per-pixel loss, typically Dice plus cross-entropy, where Dice=2∣A∩B∣/(∣A∣+∣B∣)\text{Dice}=2|A\cap B|/(|A|+|B|). nnU-Net (Isensee et al. 2021) automates the pipeline (preprocessing, patch size, architecture, training, post-processing) from dataset statistics and has won or tied most public challenges; the 2024 "nnU-Net Revisited" study found that newer transformer and Mamba architectures did not beat a well-tuned, scaled CNN U-Net in 3D.

Foundation models. SAM (2023) introduced promptable segmentation; MedSAM, SAM-Med3D, MedSAM2, BiomedParse and nnInteractive adapt this to medical data with box, click or text prompts, aiming at a single model that works across modalities and anatomies. Whole-body CT labelling (TotalSegmentator) is the best-established general-purpose product.

Evaluation is half the field

Overlap (Dice) and boundary metrics (Hausdorff, NSD) behave differently for small lesions; Metrics Reloaded (Maier-Hein et al. 2024) gives principles for metric choice. Leakage across patients, scanners and sites, annotation drift and prevalence shift produce optimistic results. Reliable systems also need per-case quality estimates and out-of-distribution detection.

Techniques to master

Convolutional and transformer segmentation networks, loss design for class imbalance, data augmentation, domain adaptation, uncertainty quantification and calibration, conformal prediction for set-valued segmentations, and clinical endpoint validation (e.g. dose planning impact).

Where it bites

One open problem: a single model that, on previously unseen anatomies, pathologies, scanners and modalities, performs within the range of expert inter-rater variability, with reliable detection of its own failures.

Words on this page (8)
Words on this page
image segmentation
Labelling every pixel or voxel of an image, for example marking which ones belong to a tumour.
Dice score
A number from 0 to 1 measuring how much two outlined regions overlap; 1 means identical.
U-Net
A neural network shaped like the letter U that shrinks an image to understand it and then expands it to label each pixel.
neural network
A computer program made of many adjustable numbers that learns patterns from examples instead of following hand-written rules.
inter-rater variability
The disagreement between two experts who label the same image; it sets a ceiling on how accurate any model can look.
transformer
A neural network design that lets every part of its input look at every other part; it underlies modern language and structure models.
calibration
When a model says 80 percent, it is right about 80 percent of the time.
benchmark
A fixed test set and scoring rule that lets different methods be compared fairly.
New to this? Read first (3)
New to this? Read first
AI-reviewedAn AI drafted this explanation. Check it against the technical text.

Understanding map

map of the whole wiki →

What to read before Medical image segmentation (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.

  1. Start with
  2. Step 2
  3. Step 3
  4. Then

Open problems & questions

Progress timeline

  1. May 2, 2025
    Lung CT tumour benchmark of foundation models
    Related to: Segmentation foundation models matching inter-rater variability on unseen anatomies, pathologies and scanners

    Reports MedSAM 2 outperforming conventional models on tumour delineation (preprint).

    source
  2. Apr 15, 2024
    nnU-Net Revisited
    Related to: Segmentation foundation models matching inter-rater variability on unseen anatomies, pathologies and scanners

    Scaled CNN U-Nets beat newer architectures in 3D when validated rigorously.

    source
  3. Apr 15, 2024
    nnU-Net Revisited

    Rigorous comparison finds that scaled CNN U-Nets beat transformer and Mamba variants in 3D medical segmentation.

    source
  4. Jan 22, 2024
    MedSAM
    Related to: Segmentation foundation models matching inter-rater variability on unseen anatomies, pathologies and scanners

    Foundation model trained on 1.57 million image-mask pairs, evaluated on 146 tasks.

    source
  5. Jan 22, 2024
    MedSAM

    SAM fine-tuned on about 1.57 million image-mask pairs across 10 modalities, evaluated on 86 internal and 60 external tasks.

    source
  6. Feb 2, 2021
    nnU-Net
    Related to: Segmentation foundation models matching inter-rater variability on unseen anatomies, pathologies and scanners

    Self-configuring segmentation sets state of the art across many public datasets.

    source
  7. Feb 2, 2021
    nnU-Net

    Self-configuring segmentation pipeline outperforms bespoke methods across 23 public datasets.

    source
  8. May 18, 2015
    U-Net

    Skip-connected encoder-decoder trained with heavy augmentation on very few annotated images.

    source