Getting started¶
The curriculum is designed to be run, not read. Open the notebook in Google Colab and execute the cells in order. The whole thing fits inside a single free T4 GPU session.
Run the notebook (the primary path)¶
-
Click the badge below or open
notebook/Clinical_AI_2026.ipynbon GitHub and use the "Open in Colab" link. -
Runtime > Change runtime type > T4 GPU. The T4 is free; CPU runtime will work but training cells become unusably slow.
- Runtime > Run all. The first cell installs dependencies (~2 minutes). The full notebook runs end-to-end in 60-90 minutes.
- Read the markdown cell before each code cell. The pedagogical pattern is: clinical analogy first, then code, then discussion of the output. Skipping the markdown turns the lab into a programming exercise; reading it turns it into a clinical AI lesson.
What if my Colab session times out?¶
The DINOv2 fine-tune in Chapter 8 is the longest single training step (around 5 minutes on T4). If your session disconnects, the notebook has a sidebar cell that loads the pre-trained checkpoint directly from Hugging Face:
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
import timm
ckpt = hf_hub_download("t22000t/dinov2-small-mednist", "model.safetensors")
model = timm.create_model("vit_small_patch14_dinov2.lvd142m",
pretrained=False, in_chans=1, num_classes=6, img_size=224)
model.load_state_dict(load_file(ckpt))
model.eval()
You can skip the linear-probe and fine-tune cells above and continue from there.
Try the demo without running anything¶
The companion Gradio Space loads in a browser. Try one of the bundled MedNIST examples or scroll to the "Known failure modes" panel to see four cases where the model is confidently wrong, with GradCAM heatmaps visibly drifting off the anatomy.
The Space is also a faithful reference implementation of Chapters 3 and 7: DenseNet121 fine-tune + GradCAM on model.features.denseblock4, plus temperature scaling for calibration. If you want to read the code, see demo/app.py.
For instructors running the curriculum live¶
- The glossary (
glossary/CNN_Med_Imaging_Glossary_2026.docx, also browsable here) defines every term in plain clinical language. - Warm up the Gradio Space by hitting its URL roughly 5 minutes before you direct learners to it. Free-tier HF Spaces sleep after 48h of inactivity and cold-start in 30-60s; warming avoids that pause during the workshop.
Prerequisites¶
- A modern web browser. That is the only hard requirement; everything runs in Colab.
- A free Google account to use Colab.
- A free Hugging Face account is optional: it lets you re-deploy the Space or push your own model variants, but the curriculum itself does not require an HF login.
No local Python installation is needed to take the course.