Sources of Bias in Medical AI

Where bias enters the pipeline: historical bias in clinical data, selection bias in datasets, measurement bias across devices, labeling bias from annotators, and algorithmic amplification.


"Bias" has two meanings that get mixed up in this field. To a statistician it is any systematic error, an estimate that is off in a consistent direction. In everyday use it means unfairness to a group of people. In medical AI the two usually arrive together: a model that is systematically wrong is nearly always more wrong for some patients than for others.

We find it helpful to think of bias as something that enters at particular stages of a project, because each stage has its own checks. The stages below roughly follow a framework published by Harini Suresh and John Guttag, adapted to clinical data. Most real cases involve more than one of them.

Historical bias: the data records what happened

Clinical data is a record of how patients were treated, and how they were treated wasn't always right or equal. A model trained on that record learns the practice along with the medicine.

The best-known example is the study Ziad Obermeyer and colleagues published in Science in 2019. They examined a commercial algorithm that US health systems used to pick patients for extra care management. The algorithm predicted future healthcare costs, on the reasonable-sounding theory that sicker patients cost more. But at the same level of illness, less money had historically been spent on Black patients than on white patients. So at any given risk score, the Black patients were considerably sicker. The authors estimated that correcting this would raise the share of Black patients flagged for extra help from about 18% to about 47%.

Nobody put race into that model. The bias was in the choice of what to predict. Cost was a proxy for need, and the proxy carried the history with it.

Check for this by asking what your label really measures. "Was admitted," "was referred," "received the diagnosis" and "was billed for" are all decisions somebody made, and decisions can differ by group for reasons that have nothing to do with disease. A label that comes from an independent test or an outcome is safer than one that comes from a clinical decision (see 5.7 Reference Standards and Ground Truth in Medical AI).

Selection bias: who is in the dataset

A model learns about the patients it was shown. If some groups are scarce in the training data, the model has had less practice on them, and it will probably do worse.

This is very common, because datasets are built from whatever is convenient. In 2020 Amit Kaushal and colleagues looked at where the patient cohorts in US deep learning studies came from. Of the studies where the location could be identified, 71% used a cohort from one of three states: California, Massachusetts or New York. Thirty-four states contributed nothing at all. Dermatology is another well-documented case. Image collections and textbooks have long under-represented dark skin, and when Roxana Daneshjou and colleagues tested published dermatology models in 2022 on a set of images deliberately balanced across skin tones, performance dropped, and dropped most on the darkest skin.

Agostina Larrazabal and colleagues ran the cleanest experiment we know of on this. In a 2020 paper they trained chest X-ray classifiers on datasets with different proportions of men and women. Models trained mostly on one sex consistently did worse on the other. That is about as direct a demonstration as you could ask for.

Selection also happens through the route by which patients reach the dataset. Patients with a biopsy result are the ones somebody chose to biopsy. Patients at an academic center were referred there. Patients with complete records are the ones who kept coming back.

The check is a table. Count your cases by age band, sex, race or ethnicity where you have it, site, and disease severity, and compare the counts with the population the model is meant for. The table often shows gaps that nobody had noticed (see 2.1 Why Data Quality Matters More Than Model Complexity).

Measurement bias: the instrument works differently for different people

Sometimes the input itself is less accurate for some patients.

The pulse oximeter is the standard example. In 2020 Michael Sjoding and colleagues compared pulse oximetry readings with arterial blood gas measurements taken at the same time. When the oximeter read 92 to 96%, the arterial saturation was below 88% in about 12% of the measurements from Black patients, against about 4% of those from white patients. Any model that takes oxygen saturation as an input inherits that error, and it will tend to underestimate how sick the darker-skinned patients are.

In imaging, measurement differences come mostly from equipment. A portable radiograph taken in the ICU is a worse image than a departmental film, and the patients who get portable films are sicker. Older scanners, lower-resolution detectors and hand-held ultrasound are more common in hospitals with less money, and those hospitals serve different populations. So a difference in image quality can line up with a difference in who the patients are (see 2.6 Multi-Site and Multi-Device Data).

A related problem is that a variable can mean different things in different groups. Until 2021 the standard equations for estimating kidney function included a coefficient for Black race, which raised the estimate and could delay referral for transplant. A model that used that eGFR value as an input would have absorbed the adjustment without anyone deciding it should.

Labeling bias: the annotators bring their own

Labels made by clinicians reflect how those clinicians practice. If a condition is under-diagnosed in women, labels taken from the chart will under-call it in women, and the model will learn to do the same. If every label came from one reader, the model learns that reader's thresholds (see 2.3 Data Annotation and Labeling for Clinical AI).

Labels mined from reports have their own version. A report is written for the referring doctor, and what gets mentioned depends on the clinical question, the patient's age and the radiologist's habits. An incidental finding in an 85-year-old may go unmentioned where the same finding in a 30-year-old would be reported.

Laleh Seyyed-Kalantari and colleagues looked at the downstream effect in a 2021 paper in Nature Medicine. They trained chest X-ray classifiers on three large public datasets and examined how often the models called a film "no finding" when there was one. The models under-diagnosed more often in female patients, Black and Hispanic patients, patients under 20, and patients on Medicaid, and the effect was larger for patients in more than one of those groups. Several of the sources in this article probably contributed. We can't cleanly separate them, and that is pretty typical.

One check is to measure agreement between annotators separately for subgroups, and to compare label rates across groups against what epidemiology would predict.

Algorithmic amplification: training makes it worse

A model is trained to reduce its average error. If 90% of the training cases come from one group, getting that group right is worth nine times as much to the average as getting the other group right. Where the two groups need slightly different handling, the model sides with the majority. The result can be a gap in performance that is larger than the gap in representation.

Shortcuts add to this. A model uses whatever predicts the label, and demographic information is surprisingly available to it. In 2022 Judy Gichoya and colleagues showed that standard deep learning models could predict a patient's self-reported race from chest radiographs, CT and mammograms with high accuracy, and could still do it when the images were blurred or filtered until radiologists could see almost nothing in them. Radiologists can't do this at all, and nobody has fully explained how the models do. What this means for us is that removing the race field from your dataset does not make the model unaware of race. If race is correlated with the label in your data, for historical or selection reasons, the model has a way to use it.

Deployment can then feed the result back in. A model that under-flags a group leads to fewer workups in that group, fewer confirmed diagnoses, and so fewer positive labels in the next round of training data.

Evaluation bias: the test set has the same gaps

If the test set was drawn from the same place as the training set, it shares the same under-representation, and it will not show the problem. A model can report 94% sensitivity overall with 80% in a group that makes up 5% of the test set, and the overall figure will hardly move.

Published benchmarks have the same weakness. A model that tops a leaderboard has been shown to do well on that dataset's population, which is frequently one hospital system's patients.

The remedy is to report performance by subgroup and to make the test set large enough in each subgroup that the estimate means something (see 7.2 Demographic Fairness).

Deployment bias: the model is used somewhere else, or for something else

A model built for one purpose and population gets used for another. A tool validated on adults is run on adolescents. A triage aid meant to reorder a worklist starts to be treated as a rule-out test. A model trained at a referral center is installed in a community clinic. Each of these is a mismatch between the evidence and the use, and none of them shows up in the original paper (see 7.3 Generalization Across Devices, Sites, and Geographies).

How people respond to the output is part of this as well. If clinicians trust the tool more for some patients than for others, or override it more in some settings, equal model performance won't produce equal care.

An audit you can run on your own project

Here is a made-up project to show how the questions apply. Suppose we are building a model to detect hip fractures on pelvic radiographs, using five years of films from one hospital with labels taken from the radiology reports.

What does the label measure? The radiologist's call at the time. Occult fractures that were only found later on MRI are labeled negative, and those are probably more common in older, osteoporotic patients.

Who is in the data? Mostly older women, since that is who breaks hips. Younger patients with high-energy trauma are few and were mostly imaged on the trauma bay's portable unit.

Is the input equally good for everyone? No. Portable films are worse, and they go with a particular group of patients.

Is anything other than the fracture correlated with the label? Scanner, time of day and whether the film was ordered from the emergency department probably are.

Does the test set have the same gaps? Yes, unless we do something about it.

None of these questions needs special software, just a spreadsheet and somebody who knows how the hospital works. We'd suggest writing down the answers before training starts, and again before publication. Regulators now expect an analysis along these lines (see 6.7 Good Machine Learning Practice).

Key takeaways

  • Bias enters at identifiable stages: the history recorded in the data, who was selected into it, how inputs were measured, how labels were made, how the model was trained, how it was tested and how it is used.
  • A label that records a clinical decision or a cost carries past practice with it. The Obermeyer study is the standard example.
  • Under-represented groups get worse performance, and convenience datasets under-represent by geography, skin tone, sex and care setting.
  • Instruments such as pulse oximeters can be less accurate for some patients, and a model inherits that.
  • Removing demographic fields does not hide demographics from a model. Models can infer race from images.
  • A test set drawn from the same source as the training set hides the same gaps, so performance has to be reported by subgroup.
  • A written audit of label, population, inputs, confounders and test set, done before training, finds most of this.

This article is part of the AI in Clinical Research Knowledge Base.