02

Learning/AI Basics/Chapter 2

Chapter 2 · Foundations

How machines learn

A machine learning model is the product of its data. To judge a model you do not need the mathematics, but you do need to know where its examples came from, how they were labelled, and how it was tested on cases it had never seen.

⏱ 4 min read⚡ Takeaways: 30 s❓ Self-check includedinShare on LinkedIn
In a hurry? The takeaways30-second read
  1. Data and labels set the ceiling: ask who labelled what, and how.
  2. Only performance on unseen cases counts; external validation is the minimum for a new hospital.
  3. Deployed medical models are usually frozen; updates are controlled releases.
  4. Overfitting, shortcut learning and leakage make models look better than they are.

Got these four points? You have the essentials. Read on for the explanations, examples and traps.

The four steps of building a model

1. Datacollect, clean, label
→
2. Trainingfit parameters
→
3. Testingunseen cases
→
4. Deploymentfrozen, monitored

↻ Monitoring feeds new data for controlled updates

The life of a model. Each step can introduce errors that only show up in routine use.

1. Data

Developers gather examples: images, records, recordings, documents. Each example has inputs (what the model sees) and, for most medical tools, a label: the right answer (“fracture”, “sepsis within 12 hours”, “malignant”). Labels come from clinicians, from later outcomes in the record, or from a reference test such as biopsy.

The quality of labels sets a ceiling on the quality of the model. If two radiologists disagree on 15% of cases, a model trained on one radiologist's labels inherits that radiologist's habits.

2. Training

The model starts with random internal settings, called parameters or weights. It guesses an answer for each example, measures its error, and adjusts its parameters slightly to reduce that error. This loop repeats millions of times. A small risk model may have a few dozen parameters; an image model millions; a large language model hundreds of billions.

3. Testing

The model is then measured on examples kept aside and never used for training. This is the only honest estimate of performance. Three levels exist, from weakest to strongest:

Test typeWhat it meansHow much to trust it
Internal validationTest cases from the same hospitals and period as the training data.Optimistic. Tells you the model learned something.
Temporal validationSame sites, but a later period.Better: shows the model survives changes over time.
External validationOther hospitals, ideally other countries and equipment.The minimum before trusting a model in a new hospital.

4. Deployment

The model is “frozen” and put into service. Most medical AI does not keep learning on its own: changes are released as new versions, tested and, for regulated devices, controlled by the manufacturer under its quality system. Regulators now allow pre-agreed update plans, for example the FDA's predetermined change control plans.

Three ways of learning

TypeHow it learnsHospital examples
SupervisedFrom labelled examples: input plus right answer. By far the most common in medical AI.Detecting fractures, predicting deterioration, classifying skin lesions
UnsupervisedFinds structure in unlabelled data: groups, anomalies.Finding patient subgroups, spotting unusual billing or access patterns
ReinforcementLearns by trial and error from rewards.Mostly research (dosing strategies); also used to fine-tune language models from human feedback

Self-supervised learning deserves a mention: the model creates its own labels from the data, for example by hiding a word in a sentence and predicting it. This is how large language models and many imaging “foundation models” are pre-trained on huge unlabelled datasets before being adapted to specific tasks.

Overfitting: learning the exam by heart

A model can perform brilliantly on its training data and poorly on new patients. It has memorised details and noise rather than general patterns, like a student who memorises last year's exam answers. This is overfitting. It is detected by testing on unseen data, which is why a performance figure without a clear test set means very little.

🏥In the hospital

A well-known study found that a pneumonia model trained on chest X-rays from several hospitals partly learned to recognise which hospital an image came from, through markers and image characteristics. Because pneumonia rates differed between hospitals, recognising the hospital helped its score. Performance dropped on images from a new hospital (Zech et al., PLOS Medicine, 2018). This is shortcut learning (Chapter 9).

Data types and why they matter

Data typeExamplesTypical issues
Structured (tabular)Vital signs, lab results, diagnosis codes, medicationsMissing values, coding habits, timing (was the value available at prediction time?)
ImagesX-ray, CT, MRI, retinal photos, pathology slides, dermatology photosDifferent scanners and protocols, image quality, rare findings
SignalsECG, EEG, continuous monitoringNoise, artefacts, device differences
TextClinical notes, letters, reportsAbbreviations, language, copy-paste, negation (“no sign of…”)
AudioConsultation recordings, dictationAccents, background noise, several speakers, consent
⚠Watch out: data leakage

A prediction model must only use information that would really be available at the moment of prediction. A sepsis model that, by accident, uses the time antibiotics were started is using the clinicians' own suspicion of sepsis. It will look excellent on paper and be useless in practice. Leakage is one of the most common flaws in published models.

Self-check 2

A study reports 97% accuracy for a model tested on patients from the same hospital and year as its training data. What two pieces of information are missing before you believe it would work in your hospital?

Show the answer

External validation on other hospitals (ideally like yours), and the clinically relevant metrics with prevalence (sensitivity, specificity, PPV), not just accuracy. A temporal test and subgroup results would also help.

If you can answer out loud in a minute, you have understood the chapter.

Found this useful?Share it with your team or your network.
inShare on LinkedIn

Adapted from AI Basics for Hospital Professionals, edition 1, November 2026. Educational content only: not legal, regulatory or clinical advice, and no product recommendation. Facts and dates checked as of November 2026; verify regulatory dates at the official sources.