Glossary · 4 min read

Overfitting

What overfitting is, why clinical prediction models are prone to it, the pneumonia study that shows how a strong internal score can fall at a new hospital, and what to ask before trusting a headline number. As of September 2026.

The short version

  • Overfitting is when a model learns the particulars of its training data, noise and quirks included, so it performs well on the data it was built on and worse on new patients.
  • It is common in clinical ML: of 152 prediction models reviewed, 56% were developed with too few outcome events per candidate predictor and 39% assessed overfitting improperly.
  • A pneumonia model reached an AUC of 0.931 on internal data and 0.815 at an external hospital; the networks could also identify the source hospital of nearly every radiograph.
  • The tell is the gap between internal and external performance. Only 6% of 516 imaging AI studies in one review tested at an external site.
On this page

Overfitting is when a model learns the particulars of its training data, noise and quirks included, instead of the pattern that generalizes. It performs well on the data it was built on and worse on new patients. A statistician's framing is parsimony: an overfit model includes more terms, or uses a more complicated approach, than the problem needs 1.

Why does overfitting matter in healthcare?

Clinical datasets are often small relative to model complexity, and the outcomes that matter are often rare. That combination invites overfitting, and the literature shows it. A systematic review of 152 machine-learning prediction models published in 2018 and 2019 found that 56% were developed with an inadequate number of events per candidate predictor and 39% assessed overfitting improperly. Of 171 analyses, 87% were rated at high risk of bias 2.

The consequence reaches the bedside. An overfit model's reported accuracy describes its development data. At your hospital it will usually do worse, and nobody finds out until someone measures.

What does it look like in a real study?

Zech and colleagues trained pneumonia-detection networks on 158,323 chest radiographs from three hospital systems 3. A model trained and tested on pooled data from two of them reached an AUC of 0.931 internally. At the third system, it scored 0.815.

Part of what the models had learned was the hospital itself. The networks identified the source hospital system for 99.95% and 99.98% of radiographs from the two main sites. Because pneumonia prevalence was 34.2% at one site and 1.2% at the other, sorting images by hospital alone produced an AUC of 0.861. The authors warned that site signals like these, which track large differences in disease burden, can confound predictions 3.

Large datasets offer no automatic protection. This one had more than 150,000 images.

How is it prevented and detected?

  • Enough data for the model's complexity. Riley and colleagues set out how to calculate the minimum sample size for developing a clinical prediction model, with limiting overfitting as a central aim 5.
  • Honest testing. Test data kept apart from every development decision, then external validation on a different site or period. Only 6% of 516 imaging AI studies in one review performed external validation 4.
  • Regulatory expectations. The FDA, Health Canada, and MHRA's good machine learning practice principles expect controls to manage the risks of overfitting, unintended bias, and model degradation 6.

Common misunderstandings

A high test-set score rules it out. Only if the test set was truly held out and resembles the population where the model will run. The ten red flags guide lists the common ways test data leak into development.

More complex models are always better. Extra flexibility fits noise as readily as signal 1.

Overfitting and drift are the same problem. Overfitting is present at launch. Model drift develops later, as care and populations change.

What to ask a vendor

  • How many patients and outcome events were used for development, and how many candidate predictors?
  • Was the test set split by patient, by site, or by time, and was it touched during tuning?
  • What is performance at an external site, and how large is the drop from internal results?
  • Is the model calibrated at that external site?

Questions and answers

  • What is overfitting in clinical AI?

    Overfitting is when a model learns the specifics of its training data, including noise and site-specific quirks, instead of the pattern that generalizes. It scores well where it was built and worse on patients from a new site, scanner, or time period.

  • How can you tell if a clinical model is overfit?

    Compare its performance on the data it was developed with against its performance on truly external data. A large drop is the usual sign. Also check how many outcome events were available for each candidate predictor, and whether the test data were kept apart from every development decision.

  • Is overfitting the same as model drift?

    No. Overfitting is built in at development, so the model underperforms on new data from day one. Drift develops after deployment, as patients, practice, or data systems change around a model that once fit well.

Sources

  1. Hawkins DM. The problem of overfitting. Journal of Chemical Information and Computer Sciences. 2004;44(1):1-12. doi.org/10.1021/ci0342472
  2. Andaur Navarro CL, Damen JAA, Takada T, et al. Risk of bias in studies on prediction models developed using supervised machine learning techniques: systematic review. BMJ. 2021;375:n2281. doi.org/10.1136/bmj.n2281
  3. Zech JR, Badgeley MA, Liu M, Costa AB, Titano JJ, Oermann EK. Variable generalization performance of a deep learning model to detect pneumonia in chest radiographs: a cross-sectional study. PLoS Medicine. 2018;15(11):e1002683. doi.org/10.1371/journal.pmed.1002683
  4. Kim DW, Jang HY, Kim KW, Shin Y, Park SH. Design Characteristics of Studies Reporting the Performance of Artificial Intelligence Algorithms for Diagnostic Analysis of Medical Images. Korean Journal of Radiology. 2019;20(3):405-410. doi.org/10.3348/kjr.2019.0025
  5. Riley RD, Ensor J, Snell KIE, et al. Calculating the sample size required for developing a clinical prediction model. BMJ. 2020;368:m441. doi.org/10.1136/bmj.m441
  6. US FDA, Health Canada, MHRA. Good Machine Learning Practice for Medical Device Development: Guiding Principles. October 2021. www.fda.gov/medical-devices/software-medical-device-samd/good-machine-learning-practice-medical-device-development-guiding-principles

Every claim on this page is tied to a numbered primary source above. Read how we source and review at our editorial policy.