A-Z of AI in Healthcare

Overfitting

An error that occurs when an algorithm becomes too familiar with training data.

What is overfitting?

Overfitting occurs when an algorithm becomes overly familiar with the data it's shown during training and memorises everything about it, including irrelevant details. This over-familiarity means that when the algorithm is exposed to new data, for example, new patients in a new hospital, it becomes confused if that new data doesn't contain all the same details, including those irrelevant ones.

How does overfitting relate to generalisability?

Overfitting is a concept closely related to generalisability. An algorithm is described as generalisable if it works equally well in more than one setting, such as two or more different hospitals. If an algorithm fails to generalise, meaning it fails to work in any setting other than the one it was trained in, this is most likely because it "fits" so closely to its training data that it begins to learn noise and irrelevant details that may not be present in new data.

What's a well-known example of overfitting?

A famous example involves an algorithm trained to tell the difference between huskies and wolves. During training, it could always correctly identify the animal it was shown. But when given a new dataset, it often got the answer wrong.

When researchers investigated, they found that every image of a wolf shown during training also featured snow in the background. So when the algorithm was later shown images of wolves on grass, it failed to recognise them, having effectively learned that "wolf" meant "animal standing in snow," rather than learning the actual features of a wolf.

How does overfitting show up in a healthcare setting?

Something similar can happen if an algorithm trained to recognise breast cancer only ever sees scans taken by one particular model of scanner during training. It might "learn" that breast cancer equals scans taken by that specific model. When the algorithm is later used in a different hospital with a different scanner, it can no longer recognise breast cancer, because crucial elements, such as the colour pattern or image resolution generated by that particular scanner, are missing.

Why does overfitting matter for patient safety?

An overfit algorithm may perform well when tested "in the lab" but underperform "in the clinic," when presented with new, real-world data that differs from what it was trained on. For example, if an algorithm was trained solely on imaging data from one model of CT scanner and then deployed in a hospital using a different model, its performance is likely to drop significantly. Unless issues like this are identified, they can present serious threats to patient safety.

How can the risk of overfitting be mitigated?

There are several methods for reducing the risk of overfitting:

  • Increasing the size and diversity of the training dataset — either by aggregating more datasets, or via federated learning.
  • Data augmentation — adding new data, or noise, to a training dataset at pre-agreed intervals.
  • Feature selection — identifying the most important features within the training dataset and eliminating those that are irrelevant or redundant (for example, removing the "snow" feature in the wolves-vs-huskies example).
  • Regularisation — sometimes overfitting occurs because an algorithm becomes too complex. Regularisation refers to identifying and reducing noise within the data when feature selection isn't possible, for example, when it's not known in advance which features are most relevant.
Does mitigating overfitting upfront solve the problem for good?

Not entirely. These methods will improve a model's generalisability upfront, but it's always possible, due to issues like dataset drift, that generalisability will degrade over time. This is why it's important to continuously monitor an algorithm's performance after deployment, so that generalisability errors can be identified and addressed as they arise.

In Practice

Curious how these principles are being put into practice?

Owkin is building agentic AI and biological reasoning models to better understand biology and advance biological superintelligence.

K Pro

Owkin's agentic AI co-pilot, applying biological reasoning to real biopharma research and decision-making.

Discover K Pro