LSMA

LONDON SCHOOL OF MULTIOMICS & AI

Free course

Free course

0 of 11 lessons

Lesson 1 of 3

Module 1 · Foundations

What AI is, and what it is not

What AI is, and what it is not

What AI is, and what it is not

“AI” is used for everything from spell-checkers to robots. In healthcare it almost always means one thing: software that has learned patterns from examples, and uses them to make predictions.

⏱ 12 min readModule 1 · FoundationsFree
Lesson at a glance3 steps · about 12 min
  1. Three terms, one inside the other
  2. Rules written by people, or learned from data
  3. Three kinds of learning

This course is for anyone who works in or around healthcare and wants to judge AI tools with confidence, without needing to write code. It runs in three modules. Foundations explains what a model is and where its data comes from. Judging a model shows how performance and evidence are measured. AI in practice follows tools into real care, from deployment and regulation to everyday use. This first lesson sets out the vocabulary that the rest of the course relies on.

Three terms, one inside the other

Artificial intelligenceAny computer system doing a task we would call intelligent if a person did it.The umbrella
Machine learningAI that learns its rules from examples, instead of being given them by a programmer.Most medical AI
Deep learningMachine learning with large neural networks, which learn from images, sound and text directly.Imaging, ECG, language

Reading the three layers

Each layer sits inside the one above it. All deep learning is machine learning, and all machine learning is AI, but not the other way round. When a news story or a sales brochure says "AI", it is worth asking which layer is meant, because the answer tells you how the system got its rules.

The distinction matters in practice because the two kinds of system fail in different ways and are checked in different ways. A rule written by people can be read line by line: if an alert fires wrongly, someone can find the rule and see why. A learned model has no such list to inspect. Its behaviour has to be judged by testing it on many cases and measuring how often it is right, which is what Module 2 of this course is about.

  • Artificial intelligence includes systems whose rules were typed in by people. A prescribing system that warns when two named drugs are prescribed together is following a list someone wrote. It can be very useful, but it never learns anything new by itself.
  • Machine learning means the rules are found from data. You give the computer many past examples and their outcomes, and it works out which features of the examples go with which outcomes. A risk model built from thousands of past admissions is a typical case.
  • Deep learning uses a neural network: many layers of simple, connected calculations, each passing numbers to the next. Because there are so many adjustable numbers, a neural network can take raw pixels, sound or words as input and find its own useful features, such as the edge of a lesion on a retinal photo. Earlier methods needed a person to measure those features first.

A feature, sometimes called an input, variable or predictor, is one piece of information the model is given about each case: age, a blood result, a pixel value. In older machine learning, people chose and measured the features, for example the width of a blood vessel on a retinal photo. Deep learning finds its own, which is why it does so well on images and text, and also why it is harder to say exactly what it is looking at.

Rules written by people, or learned from data

A traditional clinical score is written by experts: two points if the patient is over 65, one point if they smoke. A machine learning model is given thousands of past patients and their outcomes, and finds the weights itself. Everything in this course follows from that: a model can only be as good, and as fair, as the examples it learned from.

A weight is the number that says how much one input counts towards the answer. In the expert score above, the weight for being over 65 is 2 and the weight for smoking is 1, because a committee decided so. In a machine learning model, the weights are whatever numbers make the model's predictions match the past outcomes most closely. The examples the model learns from are called its training data.

How are the weights found? Training starts with guesses, often zero or small random numbers. The model makes a prediction for every past patient, the predictions are compared with what actually happened, and the size of the error is added up. The weights are then nudged in whichever direction makes the total error smaller, and the process repeats until the error stops falling. This is called fitting the model to the data. For a three-weight model the computer can do it in a fraction of a second; for a large neural network it can take days on specialised hardware, but the idea is the same.

The two approaches also differ in what they need. An expert score needs agreement among experts and can be built with no data at all, but it reflects only what the experts already believed. A learned model needs a large, well-recorded set of past cases with known outcomes. In return, it can pick up patterns nobody thought to write down, such as a combination of several small changes in blood results that together signal trouble.

What AI is, and what it is not · LSMA free course Top row: experts choose the rules, two points if over 65 and one point if a smoker, and the points add up to a score. Bottom row: past patients and their outcomes go into training, which finds the weights minus 6 to start, 0.05 per year of age and 1.2 for smoking. 1 · RULES WRITTEN BY EXPERTS Experts choose the rules +2 points if over 65 +1 point if smoker Points add up to a score 2 · RULES LEARNED FROM DATA Past patients and their outcomes Training finds the weights −6 to start +0.05 per year of age +1.2 for smoking
Both rows end in a formula that adds up weighted inputs. The difference is where the weights come from: a committee (top) or past patients, where the coloured dots stand for patients who had the outcome (bottom). The learned weights are those of the worked example below. Schematic, not to scale.

The usual mistake is to assume that because the weights were learned from data, they must be right. They are only right for patients like those in the training data, recorded in the same way. If the training patients were all from one hospital, or one age group, the weights describe that group.

Go deeper: the asthma and pneumonia trap

A well-known warning comes from a 1990s project to predict which patients with pneumonia could safely go home. One model learned a rule that patients with asthma were less likely to die. The pattern was real in the data. The reason was not biology: people with asthma and pneumonia were usually sent straight to intensive care, and that extra care lowered their death rate.

A tool that followed the rule would have sent the very patients who needed the most care home early. Caruana and colleagues described the case in 2015 to argue for models whose workings can be read. The lesson is that a learned weight describes what happened to past patients under past care. It is not a statement about what would happen if care changed, and acting on the model changes care.

Three kinds of learning

  • Supervised learning learns from labelled examples: this X-ray shows pneumonia, this one does not. Most approved medical AI is supervised.
  • Self-supervised learning sits between the other two. The data supplies its own labels, for example by hiding one word in a sentence and asking the model to predict it. It lets a model learn from huge amounts of unlabelled text or images, and it is how large language models, covered in Module 3, are first trained.
  • Unsupervised learning finds structure without labels, such as groups of patients who look alike.

A label is the answer attached to each training example: the diagnosis, the outcome, or the finding a specialist recorded. In supervised learning the model is "supervised" in the sense that, for every example, it is told the right answer and corrected when its prediction is wrong. Labels are often the most expensive part of a project, because someone with expertise has to provide each one, for example a radiologist reading thousands of X-rays.

Labels are also less certain than they look. Two experienced radiologists reading the same chest X-ray do not always agree, and a diagnosis code taken from a record may have been entered on suspicion and never corrected. A common pitfall is to treat the label as the truth about the patient. It is better thought of as the best available answer, produced by a particular person or process, with its own error rate. A model trained on those labels will copy their mistakes as faithfully as their successes.

Unsupervised learning has no right answers to aim at. It groups examples by how similar their measurements are. For example, it could sort thousands of people with asthma into groups by their symptoms, blood tests and lung function. The computer can say that the groups exist; only people can decide whether a group means something clinically, such as a type of asthma that responds to a particular treatment, or whether it is an accident of how the data was collected.

For this reason, unsupervised results in medicine are usually a starting point rather than a finished tool. A group found this way has to be checked: does it appear again in data from another hospital, and do patients in it really differ in how their illness progresses or responds to treatment? Only then is it worth turning into something that changes care.

T cellsTumourMyeloidB cellsFibroblastsUMAP 1UMAP 2
Unsupervised learning: cells grouped by similarity, with no labels given to the algorithm. Illustrative data.

Reading the figure. Each dot is one cell, described by many measurements at once. A method such as UMAP squeezes those many measurements into two dimensions so they can be drawn on a page: dots that sit close together had similar measurements. The algorithm was never told what any cell was. The clusters appear because similar cells resemble each other, and a scientist then has to work out what each cluster represents.

Worked example · a model is a learned formula

Training on past patients found these numbers for a simple risk model: a starting value of −6, 0.05 per year of age, and 1.2 for smoking. The logistic function turns the total into a probability.

score = −6 + 0.05 × age + 1.2 × smoker
70-year-old smoker: −6 + 3.5 + 1.2 = −1.3 → risk 21%
70-year-old non-smoker: −6 + 3.5 + 0 = −2.5 → risk 8%

The model did not “understand” smoking. It found that smokers in its training data had the outcome more often. Deep learning works the same way, with millions of numbers instead of three.

Step by step. "Smoker" is coded as 1 for a smoker and 0 for a non-smoker, so the smoking term is either 1.2 or nothing. For a 70-year-old, the age term is 0.05 × 70 = 3.5. Adding the starting value gives −6 + 3.5 = −2.5. For the smoker, add 1.2: −2.5 + 1.2 = −1.3.

The score can be any number, positive or negative, so it is not yet a risk. The logistic function converts it: risk = 1 ÷ (1 + e−score), where e is a fixed mathematical constant, about 2.718. For the smoker, e1.3 is about 3.67, so risk = 1 ÷ 4.67 = 0.21, or 21%. For the non-smoker, e2.5 is about 12.18, so risk = 1 ÷ 13.18 = 0.076, which rounds to 8%. A score of 0 would give exactly 50%.

What the answer means. Smoking adds a fixed 1.2 to the score, but not a fixed amount to the risk: here it moves the risk from 8% to 21%, a rise of 13 percentage points. At a different age the same 1.2 would move the risk by a different amount, because the logistic curve is steeper in the middle than at the ends. This kind of model is called logistic regression, and it has been used in medicine for decades. It shows that "machine learning" can be a formula you could work out on paper.

What AI is, and what it is not · LSMA free course An S-shaped logistic curve turns a score on the horizontal axis into a risk from 0 to 100 percent. A 70-year-old non-smoker with a score of minus 2.5 sits at 8 percent; a 70-year-old smoker with a score of minus 1.3 sits at 21 percent. THE LOGISTIC FUNCTION TURNS A SCORE INTO A RISK risk 100%50%0% −6−4−2024 score risk = 1 ÷ (1 + e−score) 70, non-smoker score −2.5 → 8% 70, smoker score −1.3 → 21%
The same curve applies to every patient; only the score changes. A score of 0 gives 50%, and the curve is steepest there, so the same change in score moves the risk most for patients near the middle. The dashed lines read each patient's risk off the left axis.

The worked example uses logistic regression, and that is not just a teaching shortcut. A systematic review by Christodoulou and colleagues (Journal of Clinical Epidemiology, 2019) compared machine learning methods with logistic regression in clinical prediction studies and found no average performance benefit for machine learning when the comparison was fair. When citing it, note its scope: it covered prediction from structured, tabular data, not images or text, where deep learning clearly does better. The authors also judged many of the included studies to be poorly reported or at risk of bias, which limits firm conclusions either way.

Key point

AI finds patterns; it does not know why they exist. A pattern can be real biology, or an accident of how the data was collected. Telling the two apart is the human's job.

A second example: suppose a chest X-ray model learns that images taken with a portable machine more often show serious disease. The pattern is real in the data, because portable X-rays are taken at the bedside of patients too unwell to go to the X-ray department. But the model has learned something about how sick patients are imaged, not about their lungs. Moved to a hospital that uses portable machines for everyone, it would go wrong.

Telling the two apart usually means asking a plain question of every strong pattern: is there a route from this feature to the outcome that runs through the patient's body, or one that runs through how the patient was treated or recorded? If it is the second, the pattern may still be useful for some purposes, but it will not travel safely to a setting where care or recording is organised differently.

What to take from this lesson

  • "AI" in healthcare almost always means machine learning: rules learned from past examples.
  • A model is, at heart, a formula with learned weights. Deep learning has far more weights, but the principle is the same.
  • Supervised models need labels, and can only be as good as those labels. Unsupervised methods find groups that people must then interpret.
  • Whatever the model learns, it learns from its training data, including that data's gaps and accidents. The next lesson looks at where health data comes from.

Further reading · Module 1Rajkomar, Dean & Kohane 2019: a clear overview of machine learning in medicine, for clinicians. · All reading for this course

Check your understanding

1. What makes machine learning different from a traditional clinical score?

2. A model learns from chest X-rays labelled “pneumonia” or “no pneumonia”. What kind of learning is this?

3. In the formula above, what happens to the score for each extra year of age?

Up next

Lesson 2

Health data: the raw material

Ask BioTutor

Create a free website with Framer, the website builder loved by startups, designers and agencies.