How a CNN Learns to Spot a Tumour on a Brain MRI Scan

An accessible walkthrough of binary tumour-vs-no-tumour classification on brain MRI images, why recall matters more than raw accuracy in this setting, and how such a model could support NHS radiology triage.

▶ Open the simulation

A high-stakes yes-or-no question

Around 11,000 people are diagnosed with a primary brain tumour in the UK each year, and how quickly that diagnosis happens has a direct bearing on treatment options and outcomes. One of the simplest computer vision tasks in medical imaging, in principle, is deciding whether an MRI slice of the brain shows a tumour at all. It sounds straightforward next to something like grading how advanced a tumour is, but even this binary yes/no decision is a genuinely useful building block: a system that can quickly and reliably triage incoming MRI scans into "likely normal" and "needs a closer look" could help radiology departments prioritise their reading lists, something that matters when NHS imaging waiting lists are under pressure.

Why MRI is different from a photograph

An MRI image is a greyscale slice through soft tissue built from radio-frequency signals rather than reflected light, and tumour tissue typically shows up as a region with different signal intensity and texture from healthy brain matter — sometimes brighter, sometimes darker, often with an irregular, poorly defined edge compared with normal anatomical structures. A CNN designed to spot this does not need to understand any of that physics; it only needs to be shown enough labelled examples of "tumour present" and "tumour absent" images that its convolutional filters gradually learn to respond to the textures and shapes typical of abnormal tissue, regardless of exactly where in the image they appear.

A workable binary classifier for this task can be built as a fairly compact CNN: three convolution-and-pooling blocks that progressively shrink the image while extracting increasingly abstract features, followed by a dense classification head ending in a single sigmoid output — a number between 0 and 1 read as the model's estimated probability that a tumour is present. Images are typically resized down to something like 128x128 pixels and normalised to a 0–1 pixel value range before being fed to the network, which keeps training fast enough to run on a single GPU.

Why recall matters more than accuracy in this setting

Once trained, the natural instinct is to check overall accuracy — the percentage of test images classified correctly. But in a screening context this is the wrong headline number to optimise for. Consider a dataset where 60% of images show no tumour: a model that simply predicted "no tumour" every single time would already be 60% accurate while being clinically useless, because it would miss every real case. This is exactly why recall (also called sensitivity) — the proportion of actual tumour cases the model successfully flags — is the metric that matters most for a screening tool. A false negative, where a real tumour is missed, is a far more serious error than a false positive that simply results in a normal scan being double-checked by a radiologist. Reporting both accuracy and recall side by side, and examining the confusion matrix rather than a single summary number, gives a much more honest picture of how the model would actually behave in a clinical workflow.

What the confusion matrix reveals

A confusion matrix for this binary task breaks predictions into four buckets: true negatives (correctly identified as normal), true positives (correctly flagged tumours), false positives (normal scans wrongly flagged), and false negatives (missed tumours). Plotting this as a small heatmap makes the trade-off visible at a glance, and is far more informative for a clinical audience than a single accuracy percentage, because it directly shows how many real tumours the model would let through undetected — the number any radiology department would care about most before trusting the tool even as a first-pass filter.

The gap between a portfolio project and a clinical tool

A dataset of a few hundred MRI images, however carefully labelled, is nowhere near large or diverse enough to certify a tool for clinical use. Real brain MRI scans vary hugely by scanner manufacturer, field strength, imaging sequence (T1, T2, FLAIR and so on), and patient positioning, and a model trained on one narrow dataset can perform far worse when it meets scans it has not effectively seen the equivalent of during training. A genuinely useful NHS radiology tool would also need to move well beyond a simple present/absent classification towards localising exactly where a tumour is (segmentation), estimating its likely type or grade, and being validated prospectively against expert neuroradiologists across multiple hospital trusts — plus formal regulatory approval as a medical device before it could touch a real patient pathway.

Frequently Asked Questions

Can an AI model diagnose a brain tumour on its own?

No. Even a highly accurate classifier only flags the likely presence of an abnormality on an image. Diagnosis, grading and treatment planning require a neuroradiologist and often further tests such as biopsy, and remains a clinical decision, not an automated one.

Why is recall more important than accuracy for this kind of screening task?

Because the cost of missing a real tumour (a false negative) is far higher than the cost of double-checking a normal scan (a false positive). A model can post a high accuracy score while still missing a dangerous share of real cases if the dataset is imbalanced, so recall is tracked separately to catch that failure mode.

What does it mean for MRI to be greyscale rather than colour?

MRI scanners measure the response of tissue to radio waves in a magnetic field rather than capturing reflected light, producing a single intensity value per pixel that reflects tissue properties like water content, rather than red-green-blue colour information.

How many brain tumour cases are diagnosed in the UK each year?

Roughly 11,000 people are diagnosed with a primary brain tumour annually in the UK, according to figures cited by the NHS and charities such as The Brain Tumour Charity.

What did you find?

Add reproduction steps (optional)