GuideHow to evaluate a clinical LLM: accuracy, safety and red-teaming
deeplabel

Healthcare AI data strategy: taxonomy, curation, bias and distribution shift.

Most healthcare AI datasets are planned from the labelling outward: decide what to annotate, then work out what it is for. That order hides the decisions that actually determine whether the data is any good. This guide works the other way, from the clinical decision back to the reference standard, the sampling and the splits.

DeepLabel · · 9 min read

A healthcare AI data strategy starts from the clinical decision your model will inform and works backwards to what must be labelled, how good those labels have to be, and how you will know. Get that order right and the dataset, the evaluation and the training data all fall out of one set of definitions; get it wrong and you spend months labelling the wrong thing precisely. DeepLabel approaches this as a design problem first: specialist clinicians from the BiteLabs network of 30,000+ UK and US clinicians set what counts as correct, and PhD data scientists turn that into a taxonomy, a sampling plan and reliability targets you can defend.

Start from the clinical decision, not the label

Before you annotate anything, write down the decision the model exists to support, who acts on it, and what a wrong answer costs in each direction. A triage tool that flags possible intracranial haemorrhage for urgent review has very different error economics from a scribe that drafts a note a clinician will edit. One cannot miss a bleed; the other has to be faithful but can tolerate a phrasing a human will fix.

That intended use fixes three things at once. It fixes the label you need (a per-study flag, a pixel-level segmentation, a structured field extracted from text). It fixes the reference standard you can accept (is a single expert read enough, or do you need follow-up or a definitive test). And it fixes which errors you will report on, because sensitivity on the dangerous class usually matters more than overall accuracy. Teams that skip this step tend to label whatever is easy to label, then discover the metric that matters was never estimable from the data they bought.

Designing the label taxonomy

The taxonomy is where most of the reliability of a dataset is won or lost. The central tension is granularity against agreement: the finer you cut the classes, the more boundary cases you create, and the lower your inter-rater agreement falls. A three-way severity scale that clinicians apply consistently is worth more than a ten-point scale they each read differently, even though the ten-point scale looks more informative on paper.

A few design choices tend to pay off:

  • Make uncertainty a first-class label. Give reviewers explicit "uncertain" and "ungradable" options rather than forcing a call. An image that is too degraded to read is a real and important category; folding it into "negative" quietly poisons both training and evaluation.
  • Build the taxonomy as a hierarchy. Collect at the finest level clinicians can apply reliably, then roll up to coarser classes for any decision that does not need the fine distinction. You keep the detail without paying the agreement penalty everywhere.
  • Map to a clinical ontology where it helps. Anchoring classes to SNOMED CT for findings and diagnoses, or RadLex for imaging terms, makes the labels interoperable and forces you to be precise about definitions. Do it where it adds clarity, not as a box to tick; a bespoke, well-defined local taxonomy that maps to an ontology beats a sprawling ontology subset no one applies the same way twice.

Whatever the structure, the test is reliability. Measure agreement per class with a chance-corrected statistic (Cohen's or Fleiss' kappa, Krippendorff's alpha for mixed data), and watch for the kappa paradox, where a very common or very rare class produces a low kappa despite high raw agreement. Gwet's AC1 or PABAK are more stable in that situation. If a class cannot be applied consistently, the fix is usually the definition, not the reviewers.

Choosing a reference standard

Every label rests on an assumption about what counts as truth, and different levels of truth cost very different amounts. The question is not "what is the best reference standard" but "what is the least demanding standard that is good enough for this decision".

Reference standardHow truth is setRelative cost and effort
Single expert readOne qualified clinician labels each caseLowest, but no measure of its own reliability
Independent reads plus adjudicationTwo or more clinicians read blind; a senior reviewer resolves disagreementsHigher, and gives you an agreement measure
Panel consensusA group reasons to an agreed labelHigher still; strong for hard cases, harder to audit
Clinical follow-up or outcomeLater events confirm the labelHigh, and takes time to accrue
Definitive testA gold-standard test, for example histopathologyHighest where it exists, and not always available

You can mix levels within one dataset: a definitive test where it exists, adjudicated reads elsewhere, follow-up for the cases that have it. When labels come from several independent reads without a definitive test, a latent-class approach such as the Dawid-Skene model can estimate each reviewer's reliability and infer a consensus label, rather than treating a simple majority vote as truth. For segmentation, STAPLE plays a similar role, combining several expert contours into a probabilistic reference. What matters is that you record which level of truth each label carries, because an evaluation against single-read labels is measuring agreement with one clinician, not accuracy against ground truth, and the write-up should say so.

Sampling, curation and splits

A dataset is a sample, and the sampling decides what the metrics can tell you. Start with prevalence. A sample drawn at the real-world rate gives representative predictive values but may contain too few positives to estimate sensitivity on a rare finding. Enriching for positives fixes the precision problem, but it changes what the sample can tell you: predictive values depend on prevalence, and a reader working through an enriched set may behave differently from one in clinical practice. The FDA's guidance on computer-assisted detection devices makes this point about enriched retrospective reader studies, noting that the artificial prevalence will likely alter reader performance compared with clinical practice. The usual answer is to do both: a prevalence-representative set for predictive values and an enriched set for sensitivity, reported separately.

Beyond prevalence, curation is where quality is defended:

  • Hard-case mining. Deliberately seek the ambiguous, atypical and edge presentations. Models fail at the margins, and a dataset of easy cases will tell you everything except what you need to know.
  • Patient-level deduplication. Near-duplicate images and repeated encounters inflate your numbers and leak information. Deduplicate before you split, at the patient level.
  • Patient-level splits. No patient should appear in more than one split. Two scans of the same person are not independent, and splitting by image is one of the most common ways to report a result you cannot reproduce in deployment.
  • Temporal and site hold-outs. Train on earlier data and test on later; hold out whole sites or scanners the model never saw. These tell you whether the model generalises or has learnt the quirks of your sample.

Subgroup performance and label bias

An aggregate metric is an average, and averages hide the subgroups that matter. You have to decide the subgroups in advance (age bands, sex, site, scanner, skin tone, comorbidity, acuity), make sure each is large enough to estimate with a useful interval, and report per-subgroup performance, not just the headline.

Here is how a good overall number hides a bad one. Suppose an evaluation set has 1,000 cases where the finding is present. Of those, 900 come from a majority subgroup and 100 from a minority subgroup you care about. The model detects 846 of the 900 majority positives and 54 of the 100 minority positives:

  • Majority sensitivity: 846 / 900 = 94%.
  • Minority sensitivity: 54 / 100 = 54%.
  • Overall sensitivity: (846 + 54) / 1,000 = 900 / 1,000 = 90%.

A 90% headline looks strong, and the minority group is being missed almost half the time. Because that group is only a tenth of the positives, it barely moves the average, so the aggregate is exactly where the failure is easiest to overlook. Note too that 100 positives is near the floor for a usable estimate: 54% sensitivity on 100 cases carries a 95% confidence interval of roughly 44% to 64%. At natural prevalence you might have had only 20 positives in that subgroup, where a result of 11 of 20 (55%) carries an interval of roughly 34% to 74%, wide enough to be useless. That is the argument for enriching important subgroups on purpose rather than trusting a representative sample to supply them.

There is a subtler problem than sampling: label bias. If the reference standard itself reflects unequal care, for example a condition that is historically under-diagnosed in one group, then a model that reproduces that gap will score well against a reference that shares the same blind spot. No agreement statistic catches this, because the reviewers may agree with each other and with the record while all inheriting the same bias. The guard is to look outside the labels: compare against outcomes or a stronger reference standard for a subset, and have clinicians scrutinise the cases where subgroup performance diverges.

A taxonomy of distribution shift

Models degrade when the data they meet in deployment differs from the data they were built on. It helps to name the kind of shift, because each one calls for a different test.

ShiftWhat changesTypical causes in healthcare
Covariate shiftThe inputs change; the input-to-label relationship holdsNew scanner or manufacturer, acquisition protocol, imaging site, a different population mix
Label or prior shiftThe prevalence of the outcome changesScreening versus referral setting, a different care pathway or point in it
Concept shiftThe mapping from inputs to label changesCoding practice, a revised guideline or diagnostic definition, differences in clinical practice between the UK and US

The practical consequence is that you cannot assume a model validated on one site, scanner or country transfers to another. Test for it before deployment with the site and temporal hold-outs above, and with slices by scanner, protocol and source. After deployment, monitor the input distribution and the prediction distribution over time, so you see covariate and prior shift as they happen, and keep a route to re-checking labels when a definition or coding practice changes under you. FDA's final guidance on predetermined change control plans for AI-enabled device software functions (August 2025) covers how planned modifications are described, validated and implemented, and its draft guidance on AI-enabled device software functions lifecycle management (January 2025) also addresses performance monitoring. The regulatory strategy itself sits with the manufacturer and their regulatory advisers.

Documentation, provenance and versioning

A dataset you cannot describe is a dataset you cannot trust in a year. Document it in the style of a datasheet for datasets or a data card: where each case came from, how it was selected, what was excluded, which reference standard applies, and what is known about the people in it. Version everything that can change, including the annotation guidelines, because a label only means something alongside the guideline version in force when it was made. When guidelines are revised, a label created under v1 and one under v3 may disagree for reasons that have nothing to do with the case.

The reporting guidelines are a useful backbone here even if you are not publishing. STARD and QUADAS-2 for diagnostic accuracy, TRIPOD+AI for prediction models and CLAIM for medical imaging AI set out what a credible description of a dataset and its evaluation contains. Treat them as a checklist for what to record while you build, not a form to fill in at the end.

A staged plan, and one taxonomy end to end

The most expensive place to discover a taxonomy problem is at scale. Run a pilot first: a small, deliberately varied set labelled by several clinicians, scored for agreement per class, with the disagreements read back to refine the definitions and the guidelines. Only when the taxonomy is applied reliably do you commit the main volume. A pilot that exposes a class no two reviewers read the same way has paid for itself several times over.

The last principle ties the rest together: evaluation data, training data and validation data should be separate samples but share one taxonomy and one reference-standard definition. If your training labels, your rubric for grading model outputs and your reader-study endpoint all mean slightly different things, your metrics measure that drift as much as the model. One set of definitions, applied consistently, is what lets a training set, an evaluation and a reader study speak to each other.

This is the work DeepLabel is built for: specialist clinicians and PhD data scientists designing the taxonomy, reference standard, sampling and reliability targets together, so your clinical training data, your evaluation and your ground truth rest on the same foundation. If you are planning a dataset and evaluation programme and want a thinking partner on the design, we can help. Book a scoping call to talk through your setup.

Common questions

Data strategy, answered.

Anything else, just ask on a scoping call.

How many classes should our taxonomy have?

As few as the clinical decision allows, and no fewer. Each extra class you split out tends to lower inter-rater agreement, because the boundary cases multiply, so a very fine taxonomy can produce labels that look precise but are unreliable. A good compromise is a hierarchy: collect at the finest level you can label consistently, then roll up to coarser classes for training and reporting where the fine distinction is not acting on a decision.

Should we label at natural prevalence or enrich for positives?

It depends on what the data is for. To estimate how the model behaves in deployment, a sample at natural prevalence gives you representative positive and negative predictive values. To estimate sensitivity on a rare finding, or to compare two models, you often have to enrich for positives, because a natural sample will not contain enough. The trade-off, noted in the FDA CADe guidance, is that enrichment changes the predictive values and can change how a reader behaves relative to practice, so you report enriched and prevalence-adjusted numbers separately and are explicit about which is which.

How do we stop data leaking between training and evaluation?

Split at the patient level, never the image or record level, so that no patient appears on both sides. For longitudinal or multi-image data this matters a lot: two scans of the same patient are not independent. Add temporal hold-outs (train on earlier data, test on later) and site hold-outs (test on a site the model never trained on) to get an honest read on how it generalises, rather than how well it memorises your sample.

How large does a subgroup need to be?

Large enough that the metric you care about has a confidence interval you can act on. Work backwards from the precision you need: a sensitivity estimate from 20 positives in a subgroup can carry an interval 40 points wide, which tells you almost nothing. If a subgroup is clinically important but rare, you usually have to enrich it deliberately rather than hope a representative sample supplies enough cases.

Can the same dataset serve training, validation and evaluation?

The splits must be disjoint, but they should share one taxonomy, one set of annotation guidelines and one reference-standard definition. If your training labels and your evaluation labels mean subtly different things, your metrics measure that drift as much as model quality. Separate the data; unify the definitions.

Let's solve your next clinical AI challenge.

Tell us what you're developing and we'll reply the same working day.

Discuss your project