Why Data Quality Matters More Than Model Complexity

The single most important lesson in applied AI: a simple model on excellent data will outperform a complex model on poor data. What "data quality" means in practice.


When a model underperforms, the instinct is to reach for a better model. A newer architecture, more layers, whatever won the last challenge. It feels like progress, and it is much more fun than opening a spreadsheet of labels and checking them one at a time.

It probably won't help much though. In medical imaging the architectures have converged: give three competent teams the same dataset and they will land within a point or two of each other whatever network they choose. The differentiator nowadays is the dataset, and it is where most of the achievable improvement is.

The evidence that the model is the smaller lever

In 2021 Fabian Isensee and colleagues published nnU-Net, a segmentation method with no new architecture in it at all. It takes a plain U-Net, a design from 2015, and configures the preprocessing and training settings automatically from the properties of the dataset. It matched or beat most of the specialized architectures that had been published, across 23 public datasets from segmentation competitions. The lesson people took from it was a little embarrassing for the field: a lot of"novel architecture" papers had actually been reporting the effect of careful data handling, then crediting the network architecture for the result.

Around the same time Andrew Ng started making the argument in public under the name data-centric AI. His version: hold the model fixed and improve the data, because for most applied problems that will be the faster way to a better result. And a Google research team led by Nithya Sambasivan interviewed practitioners working on high-stakes AI and published the results under the title "Everyone wants to do the model work, not the data work." They described "data cascades," where a data problem introduced early goes unnoticed and surfaces months later as a model failure that is expensive to trace back.

Then there is what happens when the data is actively bad. In 2021 Michael Roberts and colleagues reviewed the machine learning models that had been published for detecting or prognosing COVID-19 from chest radiographs and CT. Of the 62 that passed their initial quality screen, they judged that none was fit for clinical use. Almost every reason was a data reason. Several studies had used a public set of pediatric pneumonia films as their non-COVID controls, so the model could score well by telling children from adults. Others had combined public datasets that overlapped, so the same images turned up in both training and test sets. No architecture fixes that.

What "quality" means

"Good data" means something different to a clinician and to a model. To a clinician a good scan is a clean one: well positioned, no motion, an unambiguous finding. But a dataset made only of those is a poor dataset, because they don't represent what the model will see in real life. These are the properties of a "good dataset" from the perspective of an AI model.

The labels are right

A supervised model learns to reproduce its labels, so label error is copied straight into the model. Rule number one, then, is to know where your labels came from and how accurate they are.

Label error comes in two kinds. Random error (a slip of the mouse or a momentary brain hiccup for the reader) averages out as you add data, at some cost in efficiency. Systematic error does not. If your annotator always draws the tumor margin generously, or the reports you mined always under-call small effusions, more data teaches the model the same bias more confidently.

Even famous datasets are worse than you would think. Curtis Northcutt and colleagues went through the test sets of ten of the most used benchmarks in machine learning and estimated in 2021 that on average at least 3% of the labels were wrong, and at least 6% in the ImageNet validation set. Those are datasets of everyday objects, where a person off the street can tell you if the picture shows a dog. Labels mined from radiology reports, which is how several large public chest X-ray datasets were labeled, are much noisier than that. 2.3 Data Annotation and Labeling for Clinical AI covers how to produce labels you can have some confidence in.

The cases look like the ones the model will meet

A dataset is representative if it covers the range of patients, disease severity, scanners and image quality that the model will see in use. This might be counterintuitive for some clinicians, whose instincts could be to exclude the poor-quality scans, the post-surgical anatomy and the borderline cases to make a "clean" dataset. If those cases will reach the model, though, they belong in the data.

Nothing else predicts the label

A model will use anything that separates the classes, including artifacts from specific scanners or firmware versions. The chest drain and the hospital-specific film marker in 1.6 What AI Cannot Do are examples of the same thing.

No patient is in two places

If images from one patient land in both the training set and the test set, even if from different dates, the model is partly being tested on patients it has already seen, and the result is inflated. This happens more easily than you'd expect: patients have repeat studies, one CT becomes three hundred slices, two public datasets turn out to share a source, etc. Splitting has to be done by patient, and duplicates have to be hunted down before the split (see 3.2 Training, Validation, and Test Sets).

A made-up example

The numbers here are invented to show the mechanism.

Suppose you have 2,000 CT studies labeled for a finding, and two experts reading the same studies agree with each other 85% of the time. Your model scores 0.86 against one expert's labels. You are, roughly, at the ceiling. The model agrees with the expert about as often as another expert would, and there is no headroom left in those labels for a better architecture to find.

You have two options. Collect 2,000 more studies labeled the same way, and you get a model that reproduces the same disagreements with more confidence. Or take the few hundred cases where the experts disagreed, have them adjudicated, write down the rules that came out of the argument, and relabel. Now the ceiling has moved, and the same simple model has somewhere to go.

Our blog post on annotation quality versus quantity works through this argument in more detail.

The test set is where quality counts most

Errors in the training set are annoying because they cap what the model can learn. Errors in the test set are worse, because they corrupt your ability to measure anything. A perfect model scored against labels that are 10% wrong gets 90%. Worse, a model that has learned the labelers' mistakes will outscore a model that is correct, and you will choose it.

So if the budget for careful labeling is limited (which it always is), prefer to spend it on the test set. Use your most reliable reference standard there, multiple readers, adjudication of disagreements. The training set can tolerate rougher labels(see 5.7 Reference Standards and Ground Truth in Medical AI).

What to do before anyone trains anything

Most data problems can be found with tools no fancier than a spreadsheet and an image viewer. Somebody just needs to look.

Look at the images. Open a few hundred at random, positives and negatives side by side. It is remarkable how many projects skip this. You are looking for anything that differs between the classes other than the disease: markers, burned-in text, cropping, orientation, image size, a different scanner.

Tabulate the label against everything else you know. Site, scanner model, year, age, sex, inpatient or outpatient. If any of them predicts the label strongly, you have a confounder to deal with.

Check for duplicates and for patients who appear more than once.

Have a second reader relabel a random sample of a hundred or two and measure the agreement. This tells you the ceiling before you spend money on training.

And once a first model exists, look at its worst errors, the cases where it was confidently wrong. A good share of them usually turn out to be label errors, which makes this a pretty cheap label audit.

When the model does matter

We claimed earlier that you're not going to get much bang for your buck messing with the models, but that's a half truth. If your data is in good order and the learning curve has flattened, a better architecture or a pretrained starting point can buy a few points (see 3.3 Transfer Learning). Some tasks need a particular kind of model: you will not segment a 3D volume with a tabular method. And quantity counts too, especially for covering more sites and rarer presentations (see 2.2 How Much Data Do You Need?).

The argument is about the order of operations and the priority. Check the data first, because that is where the problem usually is, and because a week spent tuning a model against flawed labels is a week spent fitting the flaws. Mucking with the model is an optimization after this work is done.

Key takeaways

  • Modern architectures perform similarly on the same data. The dataset is what differs between projects.
  • Quality means correct labels, cases that look like real use, no variable other than disease that predicts the label, no patient on both sides of the split, and metadata for every case.
  • Systematic label error does not average out with more data. The model learns it.
  • Agreement between experts sets a ceiling on measurable performance. Raising the ceiling means adjudicating the cases they disagree on.
  • Spend the careful labeling on the test set first. A flawed test set rewards the wrong model.
  • Before training, look at the images, cross-tabulate the label against site and scanner, remove duplicates and measure agreement on a sample.

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