Stain Normalisation

Computationally mapping H&E images onto a common colour appearance — with benchmark evidence that the simplest method often wins, and that no method fixes both over- and under-staining.

Computationally mapping H&E images onto a common colour appearance — with benchmark evidence that the simplest method often wins, and that no method fixes both over- and under-staining.

What it is

Scanner and Stain Variability describes the problem. This page is the technique.

A normalisation method takes a source image and a reference image and transfers the reference’s colour characteristics onto the source while leaving morphology intact. The families in current use:

  • Histogram matching — match each colour channel’s histogram to the reference. The simplest thing that could work, and no training required.
  • Reinhard — match the mean and standard deviation of each channel in a decorrelated colour space. Also purely statistical and global.
  • Macenko — estimate stain vectors by singular value decomposition of optical density, then recombine using the reference’s stain concentrations.
  • Vahadane — sparse non-negative matrix factorisation of stain concentrations; the most sophisticated of the classical family.
  • GAN-based — CycleGAN (unpaired) or Pix2pix (paired) learn the mapping. Requires training, and hallucinates when under-trained.

The first two adjust global image statistics; the middle two attempt to model the physical stains; the last learns whatever mapping the data implies.

What the benchmark evidence actually says

Khan et al. 2026 (sources/papers/khan-2026-stain-normalisation-benchmark.md) is the strongest available comparison because of its design: sections of the same tissue blocks stained by 66 laboratories in 11 countries, then digitised on one scanner. Scanner and biological variation are removed by construction, leaving close to pure staining variation.

Four findings worth carrying:

1. Histogram matching beat all seven other methods on colour-agreement metrics across skin, kidney and colon — including four GAN variants. Reinhard was the other consistently sound performer.

2. Sophistication did not help; Vahadane was the worst. It pushed pink across the whole image and overrode the hematoxylin component entirely. Macenko turned erythrocytes blue. The GAN methods hallucinated — invented content in adipose tissue, tile artefacts at tissue borders, smooth-muscle nuclei recoloured. Only histogram matching and Reinhard produced no artefacts at all.

3. No method fixes both failure directions. Histogram matching rescued heavily over-stained slides but pushed under-stained ones toward pink. Macenko and Reinhard did the opposite. This is the practically important result: the right method depends on how the slide failed, which argues for detecting the failure mode first rather than applying one method blindly to a whole cohort.

4. SSIM must never be the selection metric. Vahadane scored the highest structural similarity in all three tissues while being the worst normaliser, because SSIM is measured against the original and a method that changes little scores well. Read SSIM as a safety check that structure survived — never as evidence of quality.

The caveat that governs all of it

Every section in that study came from one block, so tissue content was near-identical across images — which is exactly the condition global statistical methods exploit. On the most morphologically varied tissue (colon), histogram matching lost the feature-level comparison. Real cohorts have different tissue on every slide, where a global histogram match risks shifting colour in response to tissue composition rather than stain. And the GAN methods were trained on a single slide pair, so their poor showing is not a fair test of the approach.

The authors’ own framing: a benchmark for the range of staining variation, not a conclusive ranking of methods.

Why it matters for my work

There is no house standard. Scanner and Stain Variability records that no normalisation method is documented as the group’s default, though the shared QuPath script utilities mention normalisation. [unverified] This page now gives a defensible starting point — histogram matching or Reinhard, both artefact-free, both free of training cost — to be validated on the group’s own morphologically varied material rather than adopted on trust.

Consultation material is the in-house version of this problem. Konsultasyon handles cases referred in from other laboratories, whose slides were stained elsewhere. The 66-laboratory spread is a direct measurement of what that looks like, so this is a live condition here and not a hypothetical drawn from public cohorts.

Detect the failure mode first. Because no method corrects both over- and under-staining, routing matters more than method choice. WSI Quality Control already runs HistoQC over slides, which is the natural place to classify a slide as over- or under-stained and pick the method accordingly.

How it connects

Scanner and Stain Variability — the problem this method addresses; that page covers why the variation exists and what it does to models, this one covers what to do about it.

WSI Quality Control — runs upstream and can classify the staining failure mode, which is what decides the method.

Foundation Models in Pathology — normalisation is not made redundant by them: UNI-2 embeddings shifted substantially under all eight methods, so a foundation-model pipeline still has to decide what to do about stain.

Konsultasyon — referred-in slides are stained in outside laboratories, making inter-laboratory variation a routine in-house condition.

External Validation — normalisation is one of the levers that decides whether a model survives a move to another institution, and it belongs in the methods section for that reason.

Labquality EQA Staining Dataset — the public 66-laboratory dataset behind the evidence above, free to download.

QuPath Annotation Workflow — the pipeline where a normalisation step would sit in practice.

Khan 2026 — Stain Normalisation Benchmark on a 66-Laboratory Multicentre Dataset — the benchmark behind this page’s method ranking: the same blocks stained by 66 laboratories on one scanner, eight methods compared, the simplest one winning, and the foundation model failing to be robust to any of them.

Colour Calibration — the intervention that can make some of this unnecessary. Normalisation corrects appearance after the fact; calibration fixes it at acquisition, with a different cost profile and a different failure mode. Worth choosing between deliberately rather than defaulting to the software route because it needs no hardware.

Open questions

  • Is any normalisation currently applied in the group’s pipelines, and if so which? Answered for one project. PinkKidney ran Macenko, grayscale, grayscale + z-score, Macenko + grayscale, Macenko + grayscale + z-score, and ComBat batch correction as parallel arms on the same folds. No house standard follows from it, for the reason immediately below.
  • A comparison can be run and still answer nothing — watch for a saturated metric. This is the most transferable lesson from that project and it is a design warning, not a result. All six normalisation variants scored exactly AUC 1.0000, at slide and patient level, on both MIL heads. When the metric is at ceiling it has no resolution left, and the ranking that the experiment existed to produce cannot be extracted at any significance level. Before running a preprocessing comparison, check that the baseline leaves headroom: pick a weaker encoder (the same project’s ResNet50 arm does move, 0.908 raw against 0.891 with ComBat), a harder split such as held-out-scanner, or a metric with more range than AUC — calibration error or tile-level agreement. A saturated comparison is worse than no comparison, because it looks like evidence of equivalence when it is only evidence of ceiling.
  • Grayscale is worth taking seriously as a diagnostic, separately from its merits as a method. In that project, converting to grayscale and losing all colour changed downstream accuracy not at all, which is what established that the result was not riding a stain shortcut. That is a cheap ablation that any colour-confounded pipeline can run, and it answers a different question than normalisation does.
  • Would histogram matching hold up on the group’s material, where slides carry different tissue rather than sections of one block? This is the transfer question and it needs a local test, not an adoption decision.
  • Is the over-/under-staining split detectable automatically from HistoQC output? If so, method routing is close to free. Partial evidence now exists: PinkKidney drives a colour-effect analysis off 39 HistoQC brightness, contrast and deconvolved-stain descriptors and recovers the scanner group from them at kNN accuracy 0.863, so HistoQC output is certainly rich enough to separate acquisition classes. Whether the same descriptors separate over- from under-staining specifically is untested. [unverified]
  • Normalisation versus colour augmentation: Scanner and Stain Variability notes augmentation often works better and composes with normalisation, but nothing here compares them on the same data. Khan et al. did not test augmentation.