Interactive simulations — the series

Each simulation shows one method together with one failure mode

Small networks trained in the browser for the AI methods of digital pathology: which simulations are ready, which are planned, and the lesson each one carries.

🧩 Format: three steps (Slides · Train · Test), hand-written backpropagation, training in seconds in the browser 🔬 Data: always synthetic; the truth of every patch and cell is known, which a real dataset never gives you 🎓 Inspiration: Nucleus Net (teaching neural networks on blood counts and nuclei)

Three conditions for the format

A method enters this series when three things hold: (1) a model small enough to train in the browser in seconds, (2) synthetic data in which the truth of every element is known, (3) a pathology-specific failure mode the simulation makes visible. Without the third, a simulation is only a demo; every simulation in this series has a “trap” switch.

Ready

Planned — direct extensions

These reuse Slide Bag Net’s data and shell; the first is next in line.

Simulation 3 · planned
Foundation-model pretraining (self-supervised)
Method: contrastive pretraining on 2,000 unlabelled patches, then freeze and train MIL on 80 slides. Trap: if the pretraining data come from one lab, the embedding encodes the stain. Lesson: why UNI, Virchow and Prov-GigaPath matter, and why they are frozen.
Simulation 4 · planned
Transformer MIL (self-attention across patches)
Method: one self-attention layer over the 16 patches before pooling. Trap: contextual rules such as "mutant pattern next to necrosis" that ABMIL cannot learn. Lesson: attention matrices do not read like an ABMIL map.

Planned — cell level

Simulation 5 · planned
Nucleus segmentation (U-Net / HoVer-Net)
Trap: touching nuclei merge under semantic segmentation and separate once the horizontal-vertical distance-map head is added. Lesson: Dice versus PQ.
Simulation 6 · planned
Cell detection and classification (Ki-67 / PD-L1 scoring)
Trap: lymphocytes counted as tumour cells inflate the index; the same slide scores differently at two labs. Lesson: the score depends on which cells you count.
Simulation 7 · planned
Spatial statistics (tumour microenvironment)
Method: no trained network; TIL density, nearest-neighbour distance, Ripley's K. Trap: the same TIL count reads as "inflamed" or "excluded" depending on where the invasive margin is drawn.

Planned — the clinical layer

Simulation 8 · planned
Survival prediction (Cox / DeepSurv)
Method: Cox partial likelihood on the slide embedding; censoring comes from the generator. Trap: overfitting on 80 patients with 60% censoring. Lesson: C-index, Kaplan–Meier by predicted risk.
Simulation 9 · planned
Calibration and clinical thresholds
Method: reliability diagram, temperature scaling. Trap: a threshold chosen for sensitivity 0.99 collapses at a different prevalence. Lesson: AUROC is not a clinical performance metric.
Simulation 10 · planned
Active learning and the annotation budget
Method: the network asks the pathologist "which patch should I label next"; random, uncertainty and diversity sampling. Lesson: how to spend 200 annotations.
Simulation 11 · planned
Validation study design
Method: no training; a simulator for reader studies, non-inferiority margins, site stratification, prevalence shift and drift monitoring. Lesson: why a locked algorithm validated at one site fails the intended-use question.

What does not fit this format

Generative language models that write reports (Nucleus Net has a small one), whole-slide registration, and anything that depends on real tissue appearance rather than a measurable abstraction. For those, a narrated walkthrough with real figures beats a simulation.

Back to top