Data Annotation and Labeling for Clinical AI
Best practices for creating labeled datasets: annotation protocols, adjudication of disagreements, inter-annotator variability as a performance ceiling, and tools for efficient labeling.
A supervised model learns from labels, and in medicine somebody qualified has to make each one. Annotation is usually the slowest and most expensive part of a project. It's critical to the entire project, so it's weird that it's often organized in such an ad-hoc manner: three residents, a shared folder and a verbal instruction to "outline the tumor."
The labels that come out of that process will be inconsistent in ways you won't see until the model's performance stalls. Fortunately doing it properly is not complicated. It mostly means writing things down and measuring agreement before you scale up.
Where labels come from
Sources of labels differ a lot in how much you can trust them. Roughly in descending order of awesomeness:
- An independent, more definitive test, for example a biopsy for a lesion seen on imaging, a culture for an infection, an angiography for a stenosis suspected on CT.
- Clinical outcome or follow-up. measurements of a nodule that grew over two years, records from a patient who was readmitted.
- Expert review of the same data the model sees, by several readers with disagreements measured and resolved.
- A single expert's read.
- Labels extracted automatically from reports, billing codes or other records.
The higher sources are better and rarer. Biopsy results exist only for patients somebody decided to biopsy, which skews the dataset toward suspicious cases. Follow-up takes years. So most projects end up at level 3 or 4 for training, and that is fine, as long as the test set sits as high up the list as you can afford (see 5.7 Reference Standards and Ground Truth in Medical AI).
Level 5 can work but one should be pretty cautious. Running a text-mining program over radiology reports is pretty seductive - it yields hundreds of thousands of labels for free. But the labels include every hedge in the report ("cannot exclude"), every finding the radiologist saw on the prior film and didn't mention again, and every mistake of the program. They are useful for pretraining but you probably shouldn't use them for testing.
What kind of label
The task decides the type of label, which then dictates the cost.
| Label | Used for | Typical effort per case |
|---|---|---|
| Study-level category | Classification | Seconds to a minute |
| Bounding box or point | Detection | Under a minute per finding |
| Pixel or voxel outline | Segmentation | Minutes to an hour or more for a 3D structure |
| Measurement | Regression | About a minute |
Don't pay for more label than the question needs. If the clinical question is "is there a bleed?", outlining every bleed voxel by voxel costs fifty times as much as a yes or no and may not give you a better classifier. On the other hand an outline can be collapsed into a box or a category later, and the reverse is impossible, so if a segmentation model is on the roadmap, decide before annotation starts.
Write the protocol down
An annotation protocol is a document that tells an annotator exactly what to do. Without one, every annotator invents their own rules, and each one's rules drift over the months the project takes. Furthermore, if you rely on verbal or emailed instructions, you are guaranteed to find that each annotator chooses slightly different names for segmentations, uses different units for measurements, or other annoyances that cost you hours of rework. Ideally use a tool that enforces standardization (like your humble hosts Datamint) but at least document every detail.
A usable protocol has:
- The definition of each label, in terms of what is visible. "Consolidation" means what, exactly, as opposed to atelectasis?
- Boundary rules. Does the tumor outline include surrounding edema? The vessel wall or only the lumen? Where does the structure stop on the last slice?
- What to do when uncertain. Give the annotator an "indeterminate" option or a confidence rating. If you force a yes or no, the borderline cases get labeled by coin toss.
- What to do with unusable images. A category for "not gradable," ideally with reasons.
- Viewing conditions. Window settings, which series, whether priors and clinical history are available.
- Worked examples, including hard ones, with the right answer and the reason.
The viewing conditions are easy to forget and they change the labels. A reader who has seen the report or the pathology result is producing a different kind of label from one who hasn't.
Version the protocol - it will change, and you need to know which cases were labeled under which version. This is both for your own sanity and for regulatory approvals should they be a part of your future.
Pilot before you scale
Before anyone labels two thousand cases, have every annotator label the same twenty. Then measure how well they agree and look at the cases where they don't.
This is the cheapest insurance in the whole project. The disagreements in a pilot are almost never random, rather they cluster around a few ambiguities the protocol didn't settle. Get the annotators in a room, go through those cases, agree a rule for each and add it to the protocol. Then pilot again. Two or three rounds usually bring agreement up a good deal, and each round takes an afternoon at most.
Measuring agreement
Raw percent agreement will give you false confidence when one category dominates. If 95% of cases are normal, two readers who both say "normal" to everything agree 95% of the time while agreeing on nothing that counts.
For categories, you can use Cohen's kappa (two readers) or Fleiss' kappa (more than two), which correct for the agreement expected by chance. Kappa runs from 0, meaning chance-level, to 1. The usual interpretive bands come from a 1977 paper by Landis and Koch, who called 0.61 to 0.80 "substantial" and above 0.80 "almost perfect," and who were candid that the cut-offs were arbitrary. For ordered grades, use weighted kappa, which counts a one-grade disagreement as less serious than a three-grade one.
For outlines, use the Dice coefficient between two readers' segmentations: 0 for no overlap, 1 for identical. Agreement between experts in the range of 0.75 to 0.85 is common for tumors and other structures with soft edges, and higher for organs with crisp ones. For continuous measurements, use the intraclass correlation coefficient or a Bland-Altman plot.
Measure agreement between readers and their future selves too. Slip a sample of repeat cases into each annotator's queue a few weeks apart. Readers disagree with their past selves more often than they expect.
Agreement is a ceiling
Whatever number you get is the upper limit on what you can measure. If two experts reach a Dice of 0.82 against each other, a model that reaches 0.82 against one of them is performing like an expert, and a model that reaches 0.90 against that one reader has probably learned that reader's habits. It has not become better than the experts.
Resolving disagreements
When several readers label the same case and disagree, there are a few ways to settle on one label.
Majority vote is simple and needs an odd number of readers. It handles random slips well but doesn't help you in the situation where a majority of readers share a bias..
Arbitration sends the disagreements to a more senior reader, who decides. It is efficient and it makes that one person's opinion the reference standard for all the hard cases.
Consensus discussion has the readers review the case together until they agree. It takes the most time and gives the best labels, with the known risk that the loudest or most senior person in the room wins. In 2018 Jonathan Krause and colleagues at Google compared approaches for grading diabetic retinopathy and found that adjudication by a panel of retina specialists caught disease that majority voting had missed, and that a model tuned against a small adjudicated set did better than one tuned against majority-vote labels.
For segmentations there are algorithms that merge several outlines into one. The best known is STAPLE, published by Simon Warfield and colleagues in 2004, which estimates each reader's reliability and weights them accordingly.
Whichever you use, keep the individual labels as well as the final one. They tell you which cases are ambiguous, they let you report reader agreement, and some training methods can use the disagreement directly instead of throwing it away.
You don't need multiple readers on everything. A common and sensible arrangement is one reader per case for the training set, with a random sample double-read to monitor quality, and two or three readers with adjudication on every case in the test set.
Tools, and letting the model help
For 3D medical images the long-standing free tools are 3D Slicer and ITK-SNAP, and there are many commercial and open-source annotation platforms. What to look for: proper DICOM handling with window and level controls, 3D navigation, multiple readers working blind to one another, a record of who labeled what and when, and export in a format your engineers can read.
Most tools now offer model-assisted annotation. A model proposes an outline and the annotator corrects it. This can be a general-purpose model that segments whatever you click on, of the kind that followed Meta's Segment Anything in 2023, or your own model retrained as labels accumulate. It can cut segmentation time severalfold.
It has a tradeoff, like everything. Annotators anchor on the proposal. A suggested outline that is roughly right tends to get accepted with its errors, especially after several hours of annotation, and the labels drift toward whatever the assisting model believes. That is tolerable in a training set if you audit a sample against unassisted labels. In a test set it is not acceptable, because you would be scoring a model against labels a model helped to make. Label the test set without assistance.
Who annotates, and what it costs
Match the annotator to the difficulty. Organ outlines can be done by trained technologists or students with expert review of a sample. Subtle diagnostic calls need the specialist. A tiered arrangement is common: juniors do the first pass, a senior reviews and corrects.
Train the annotators on the protocol, test them on cases with known answers before they start, and keep the test cases coming at intervals. Fatigue is real, so cap session length.
Then budget for it. Take the minutes per case from your pilot, multiply by the number of cases and by the number of readers, add adjudication time for the fraction that will disagree, and convert to hours of specialist time. The total is often the largest line in the project, and it is far better to find that out from a spreadsheet than from a half-finished dataset.
Key takeaways
- Rank your label sources. Independent tests and outcomes beat expert review, which beats a single read, which beats labels mined from reports. Put the best source on the test set.
- Choose the cheapest label type that answers the question, keeping in mind that outlines can be simplified later and categories can't be upgraded.
- Write an annotation protocol with definitions, boundary rules, an option for uncertainty and worked examples. Version it.
- Pilot on a small shared set, discuss the disagreements, fix the protocol and repeat before labeling at scale.
- Measure agreement with kappa for categories and Dice for outlines, between readers and within them, and report it beside the model's performance. It is the ceiling.
- Adjudicate disagreements on the test set and keep every individual label.
- Model-assisted annotation saves time and biases labels toward the assisting model. Keep it out of the test set.
What to read next
- 2.1 Why Data Quality Matters More Than Model Complexity: why the labels are the bigger lever
- 2.4 Class Imbalance: When Rare Conditions Dominate Your Research Question: what to do when few of your labels are positive
- 4.3 Segmentation Metrics: Dice, IoU, and Volumetric Measures: the measures used for outlines
- 5.7 Reference Standards and Ground Truth in Medical AI: what counts as truth in a validation study
- 7.1 Sources of Bias in Medical AI: labeling bias among the others
This article is part of the AI in Clinical Research Knowledge Base.