Skip to content

Description

This curriculum teaches a radiologist how to build, train, and evaluate a deep learning model for medical images. It assumes you have zero prior background in programming, machine learning, or AI. By the end you will have:

  • Loaded a real medical-imaging dataset into memory
  • Trained four different models on it (three convolutional networks and one transformer)
  • Fine-tuned a foundation model (DINOv2) for your task
  • Evaluated everything with the clinical metrics that actually matter (calibration, subgroup analysis, confidence intervals)
  • Read GradCAM heatmaps and learned when to trust them and when not to

Everything runs in your browser on a free Google Colab T4 GPU. 60-90 minutes end-to-end. No software to install.

What an imaging dataset actually is

Most radiology workflows think about images one patient at a time. A machine learning model thinks about them in batches: thousands or tens of thousands of labelled examples at once, packed into multi-dimensional arrays of pixel intensities.

Chapter 1 of the curriculum starts here. You will:

  • Download a real dataset (MedNIST — 58,954 medical images across six anatomical classes: AbdomenCT, BreastMRI, CXR, ChestCT, Hand, HeadCT).
  • Inspect the class balance — is the dataset roughly equal across classes, or is one class over-represented? An imbalanced dataset will make your model accurate but biased.
  • Visualise individual samples — what does an image actually look like as a NumPy array? Why is it 64×64 and not 1024×1024?
  • Split into train / validation / test sets — why three splits, and why stratified by class?

Chapter 2 then walks you through transforms and augmentation: every image goes through a small pipeline that normalises pixel intensities, resizes to a fixed shape, and optionally applies random perturbations (small rotations, flips) during training. Augmentation is how you teach a model that a HeadCT viewed from a slightly different angle is still a HeadCT.

These two chapters are the unglamorous foundation. Everything that follows depends on having a clean, well-prepared dataset with honest train/val/test splits.

How to train a model

Chapters 3 through 5 walk you through training, layer by layer:

  • Chapter 3 — CNN transfer learning. What is a convolutional neural network (CNN)? Why does it work on images? You will load three popular CNNs (DenseNet121, ResNet50, EfficientNet) that have already been trained on millions of natural-image examples, then fine-tune them on your medical dataset. Transfer learning is the reason this works in minutes, not weeks: the lower layers already know about edges, textures, and contours; you just need to teach the upper layers about anatomy.
  • Chapter 4 — Vision Transformers (ViT). A newer architecture that treats the image as a sequence of patches rather than a hierarchy of filters. You will train a ViT-Small on the same data and compare it to the CNNs.
  • Chapter 5 — Training, validation, hyperparameter tuning. What is the training loop actually doing on each step? What are loss, optimizer, learning rate, epoch, batch size? You will build a reusable train() function, then use it to explore how each choice affects the final model.

Chapter 8 returns to training with one of the most consequential developments in modern AI: foundation models. You will load DINOv2-Small, a model self-supervised-pretrained on 142 million natural images, then adapt it to MedNIST in two phases (linear probe → partial unfreeze). The result reaches near-perfect in-distribution accuracy in 8 epochs.

How to evaluate a model

This is where the curriculum spends the most time, because evaluation is where most clinical AI mistakes are made.

  • Chapter 6 — Evaluation and clinical metrics. Why is accuracy not enough? When does a model with 99% accuracy still cause patient harm? You will compute:

    • AUC (the standard for binary clinical decisions)
    • Confusion matrices (per-class accuracy, false positives, false negatives)
    • Calibration curves and Expected Calibration Error (ECE) — a model that says "0.9 probability of cancer" should be right 90% of the time at that confidence level. When it is not, the probability number is misleading.
    • Bootstrap confidence intervals — a single AUC is a point estimate. The 95% CI tells you how seriously to take the difference between two models.
    • Subgroup analysis and fairness — does the model perform equally well on under-represented patient groups? Performance gaps are where deployment harms hide.
  • Chapter 7 — Explainability. Even a well-evaluated model can be wrong on individual cases. How can you tell? You will generate GradCAM heatmaps (for CNNs) and attention rollout maps (for transformers) to see where the model looked when it made each prediction.

Building diagnostic intuition for AI

Most clinical AI tutorials show the model getting things right and stop there. This one doesn't. The companion artifacts — the live Gradio demo, the published DINOv2 model card, and the multi-architecture comparison cell in Chapter 7 — are organised around the cases where the model is confidently wrong.

Why this matters: radiologists already have well-developed diagnostic intuition for images. You do not yet have well-developed intuition for the failure modes of a statistical pattern-recognizer operating on those images. The clinical AI products that will land in your practice over the next decade will sometimes be wrong, sometimes confidently wrong, and the explanations they surface (heatmaps, confidence scores) will sometimes mislead. The point of this curriculum is to give you the working knowledge to recognise that before it affects a patient.

Three concrete tools you will be able to use:

Tool Where you learn it What it lets you do
Calibration (ECE) + reliability diagrams Chapter 6, demo's "raw vs calibrated" probability bars Decide whether a model's confidence number is worth anything
GradCAM + attention rollout Chapter 7, demo's main inference output, model card failure gallery Check where the model "looked" before trusting its answer
Subgroup analysis + bootstrap CIs Chapter 6 Notice the performance gaps that hurt minority patient populations

What is not in scope

This is a one-day workshop on a free T4 GPU, not a graduate degree:

  • Adversarial robustness. We use clinically-recognisable perturbations (rotated film, narrow window, noisy acquisition), not mathematical adversarial attacks.
  • Federated learning, differential privacy, OOD detection. All worthy. Reasonable Chapter 11 directions for forks of this repo.
  • Real-world clinical deployment. Chapter 6 gestures at the FDA / CE regulatory pathway, but this is a research lab, not a 510(k) submission.
  • PHI handling beyond demos. The companion Space rejects DICOM uploads and strips EXIF for a reason. Real deployment requires institutional review and safeguards beyond this curriculum's scope.

How to start

Click the Colab badge in Getting started. Pick T4. Run all cells. Read the markdown cell before each code cell — that's where the clinical analogies live.

Where this comes from

The curriculum is adapted from material taught at two prior workshops:

  • Clinical AI Summer School at the Alan Turing Institute, 2023. The original framing, the focus on clinical applicability over abstract theory, and the choice of MedNIST + PCam as teaching datasets all trace to this course.
  • Clinical radiologist cohort at the University of Southampton, April 2026. The version in this repository is the one taught to that cohort. The 2026 refresh added Vision Transformers, DINOv2 fine-tuning, calibration metrics, augmentation-induced failure galleries, the companion Gradio demo, and the published Hugging Face model card.

If you adapt the curriculum for your own cohort, please open an issue on the repo. A list of institutional adaptations is being collected.