Liver Tru-Cut — Tumour Origin AI
Inferring a liver core biopsy’s primary tumour from the slide alone — and the one project here with a finished comparison, in which twenty foundation models were run, every zero-shot model lost to always guessing “metastasis”, and only a supervised head beat the baseline.
Purpose
The metastasis-of-unknown-primary problem posed as slide-level classification: given a liver tru-cut biopsy, is this a primary liver tumour or a deposit from elsewhere, and if elsewhere, where from? Five classes — HCC, cholangiocarcinoma, metastatic colorectal, metastatic breast, metastatic other — with a collapsed binary of Primary_Liver versus Metastatic.
This page was previously written from Quarto chapters and recorded almost nothing concrete: no cohort size, no scanner, no validation strategy, no results. Reading the working tree on 2026-07-29 replaced all of that. It is now the most thoroughly evaluated project in this wiki, and the results are more interesting than a success story would have been.
Data used
509 extracted cases (ANON… pseudonymised), from Sectra ZIP exports, with clinical ground truth held in a FileMaker database (liver_tru_cut_tumor.fmp12) exported to metadata/clinical_labels.csv. Labelled subsets used in the reported comparisons are n = 508 and n = 374 depending on the task.
Two scanners, and they are used as the validation axis rather than ignored. The HPL leaderboard reports cross-scanner transfer — train on one scanner, test on the other — which is the closest thing to External Validation available inside one institution and is a markedly better design than a random split. ICC colour correction is applied before feature extraction, which puts this project directly into the argument on Colour Calibration and makes it the only project here doing something explicit about colour before embedding.
This closes the standing gap this page used to carry: scanner, cohort size and validation strategy are all now documented. Magnification for the HPL track is 10× at 224 px.
Note there are two different liver cohorts on the drive and they are easy to confuse: this one, and the four-case set described on Liver Tru-Cut Cohort which belongs to the hepatocyte-app morphometry pipeline.
Methods
Two tracks, run over roughly twenty encoders.
Unsupervised — Histomorphological Phenotype Learning, adapted from Quiros et al. (Nat Commun 2024): tile at 10×/224 px, embed, Leiden-cluster, then ask whether morphology clusters separate by tumour origin, whether they match a pathologist’s decision tree, and whether the choice of backbone matters. Tiles are cleaned first with GrandQC as a quality filter — tissue detection plus artefact segmentation — which is the same model behind GrandQC-QuPath used here for what it is actually good at.
Supervised and zero-shot comparison. Zero-shot vision-language models classify from text prompts with no training; a supervised ABMIL (attention-based multiple-instance learning) head is trained on tile features with 5-fold cross-validation.
The results, and the ordering is the point
Cross-scanner transfer AUC (HPL track, all ICC-corrected):
| Encoder | AUC |
|---|---|
| H-optimus-1 | 0.901 |
| MedSigLIP-448 | 0.882 |
| Hibou-B | 0.849 |
| UNI2-h | 0.838 |
| PathOrchestra | 0.837 |
Five-class zero-shot, top-1 accuracy (n = 374):
| Model | Top-1 |
|---|---|
| TITAN | 0.644 |
| MedSigLIP-448 | 0.262 |
| OpenAI CLIP-L | 0.182 |
| PLIP | 0.126 |
| CONCH v1 | 0.102 |
| QuiltNet | 0.102 |
| MedGemma | 0.102 |
Binary — and this is the finding that matters. The trivial baseline of always predicting “Metastatic” scores 0.862, because the cohort is heavily imbalanced. Against that:
- Supervised ABMIL on H-optimus-1 features: accuracy 0.895, κ 0.498, ROC-AUC 0.893 — the only approach that beats the baseline.
- Every zero-shot model underperforms the baseline, TITAN included at 0.728.
This page warned about exactly this before the numbers existed. Its previous version said that origin prediction is strongly imbalanced across primary sites, so headline accuracy would mislead, and pointed at Class Imbalance and Accuracy. The project’s own comparison confirms it in the sharpest possible way: a model that has learned nothing scores 0.862, and a well-known slide-level foundation model scores 0.728 — worse than nothing — while still looking respectable in isolation. The +3.3 point gain of ABMIL over the baseline is easy to dismiss until you read the κ of 0.498, which is the number showing real agreement beyond chance. Accuracy and kappa tell opposite-feeling stories about the same result, and kappa is the honest one.
MedGemma’s failure mode is worth recording on its own. It over-predicts HCC and primary-liver labels roughly 4.6× relative to ground truth, which the project’s own notes attribute to “anchoring on liver-biopsy organ context rather than reading metastatic morphology”. That is a general-purpose medical vision-language model reasoning from where the biopsy came from instead of from what the tissue looks like — a plausible-sounding answer generated from context rather than evidence, and a caution for anything built on LLM Report-Quality Checking style tooling.
Current state / open questions
The supervised pipeline is described in the project’s own notes as essentially finished and the recommended deployable baseline; the work has moved to comparator ablations and writing. Most recent entry 2026-06-07, concluding that zero-shot CLIP-family collapse is “a removable calibration artefact on an irreducibly weak zero-shot signal — symptom, not disease”.
- CHIEF is set up but was never run, and the stated reason contradicts the evidence. A dedicated environment exists,
run_chief_inference.pyis fully written, and a smoke test successfully loaded both the CTransPath encoder and CHIEF’s public 18-class tumour-origin head — which is exactly this project’s task. Yet the project’s owncurrent_state.mdandTODO.mddefer CHIEF on the grounds that “no public tumour-origin head” exists. Nochief_predictions.csvwas produced.[unverified]whether the deferral reasoning is simply stale or reflects a limitation discovered after the smoke test — but this is the single cheapest experiment left on the table, because the one published model built for this exact question is installed and untried. - No external cohort. Cross-scanner transfer is a good internal proxy and it is not the same thing; see External Validation.
- The zero-shot result deserves publishing more than the supervised one. “Seven vision-language models all lose to the majority class on a real clinical task, and the best of them is 13 points below a trivial baseline” is a more useful contribution to the field than another 0.89 classifier, and this project has the receipts.
- Whether the HPL clusters actually correspond to a pathologist’s decision tree — goal (B) of that track — is not recorded as answered.
[unverified]
Related: Liver Working Tree — where this runs, what else is on the drive, and the deploy target for its documentation. Related: Liver Tru-Cut Cohort — the other, four-case liver folder, easily confused with this one. Related: Class Imbalance and Accuracy — the warning this page made and its own results confirmed; the baseline of 0.862 is the worked example. Related: Foundation Models in Pathology — twenty encoders compared on one cohort, which is the most direct evidence in this wiki about what a foundation model buys. Related: Foundation Model Cache — every model used here is on that drive; this project is the answer to that page’s question about which have actually been run. Related: Colour Calibration — ICC correction is applied before embedding, and the corrected features are the ones that win. Related: GrandQC-QuPath — GrandQC is used here as a tile quality filter, which is the role it is genuinely good at. Related: External Validation — cross-scanner transfer is the internal substitute; no outside cohort exists. Related: Weakly Supervised Learning — ABMIL is the winning method, so the MIL head is not yet beaten by anything pretrained.
Derived from: working tree read 2026-07-29 — dataPreperation/CLAUDE.md, README.md, ABOUT.md, docs/current_state.md, docs/TODO.md, docs/setup_chief_venv.md, outputs/eda/comparator_report.md and comparator_report_binary.md (2026-06-02), outputs/eda/cluster_diagnostic_*.md, outputs/csv/comparator_master.csv, hpl/README.md, hpl/02_feature_extraction.py, hpl/utils/models.py, and the python/run_*_.py inference scripts. Earlier framing from patoloji-ai/livertrucutprimary.qmd, now superseded.