GlioTRUST

Research use only. Not a medical device. Not for diagnosis or treatment decisions.

GlioTRUST predicts the molecular type of an adult diffuse glioma from four routine pre-operative MRI sequences (T1, T1c, T2, FLAIR), age and sex: IDH status, 1p/19q codeletion and the WHO CNS5 type (glioblastoma IDH-wildtype, astrocytoma IDH-mutant, oligodendroglioma IDH-mutant and 1p/19q-codeleted). It answers a case or refers it to a clinician with a conformal rule, and shows a HiResCAM heat map of its image network.

This repository holds the frozen leave-TCGA-out model: the exact model that was tested once on a locked cohort of 70 further TCGA patients after it was frozen. Demo: three example patients on the project website, and a Gradio app that runs the full pipeline on your own scans on your own computer (demo/ of the GitHub repository).

Model

Part What it is Files
Automatic segmenter DenseNet-121 encoder + U-Net decoder (whole tumour, core, enhancing), sliding windows with mirror averaging; trained without any TCGA or UCSD scan segmenter/seg_dnunet_xtcga.safetensors
Image network 3-D DenseNet-121 (MONAI) on the 96 mm cube around the tumour, 5 channels (4 sequences + whole-tumour mask), plus age and sex; heads for IDH, 1p/19q given IDH-mutant, grade; left-right mirror averaging; 3 seeds cnn/dn121v2_locotcga_s{0,1,2}.safetensors
Radiomics branch, IDH and grade TabPFN v2 (8 estimators) on the 500 ANOVA-best of 3,959 features (PyRadiomics 3.1.0 features of 5 sub-regions x 4 sequences, original and LoG; VASARI-style concepts; intensity profiles in shells across the tumour margin); one context per seed radiomics/tabpfn_expert_s{seed}.npz (column filter, medians, clip limits, selected columns, context table), tabpfn/ (Prior Labs checkpoint and licence)
Radiomics branch, 1p/19q L2 logistic regression (C = 0.005) on 3,804 sub-region features radiomics/logistic_codel_s{seed}.npz
Fusion per seed, logit p = (1 - w) logit p_image + w logit p_radiomics; w = 0.50 IDH, 0.75 1p/19q, 0.25 grade; CNS5 type from the fused IDH and 1p/19q probabilities; mean of 3 seeds config.json
Answer or refer LAC conformal sets, alpha = 0.1, thresholds from each seed's inner-validation patients (training hospitals only); the demo uses the mean threshold on the 3-seed mean: one class -> answer, none -> refer config.json
Distilled TabPFN (CPU demo only) TabPFN-GlioTRUST-distilled: one small network per seed and task trained to reproduce the exact TabPFN probabilities (see below) radiomics/tabpfn_distilled_s{seed}_{task}.safetensors

Training data of this fold: UCSF-PDGM, UPENN-GBM and UTSW-Glioma (development hospitals) plus auxiliary BraTS 2021 scans from other hospitals; 15 % of the development patients of each seed were kept for early stopping and the conformal thresholds. No TCGA patient was used for training, early stopping, feature selection, the TabPFN context or the thresholds.

Results (from the paper)

Leave-one-hospital-out testing on 1,898 patients from four public cohorts, against eleven baselines trained on the same patients and folds (the released fold is the one with TCGA held out):

Setting IDH AUROC CNS5-type AUROC 1p/19q AUROC (IDH-mutant)
Held-out hospitals, pooled (4 folds) 0.966 (0.956-0.975) 0.930 (0.915-0.944) 0.743
TCGA held out (this fold, 167 development patients) 0.927 0.897 -
Locked TCGA test, 70 patients, scored once (this model) 0.951 0.924 -

Answering only the 80 % most confident patients gave an IDH accuracy of 97.8 % at held-out hospitals. Plain conformal sets covered 0.86 (IDH) and 0.87 (type) at held-out hospitals, below the 90 % target: the refer rule is a safeguard, not a guarantee. HiResCAM pointed inside the tumour for 89 % of held-out patients. 1p/19q, and therefore oligodendroglioma, is the weakest output.

Reproducibility checks (this release)

Equivalence with the locked test (prediction level only; no label was read). The package in this release was run from the raw NIfTI files of the first 12 locked-test patients (automatic segmentation, as in the test) and compared with the stored predictions of the test. Maximum absolute differences of the 3-seed mean probabilities:

Output Lab GPU (paper set-up, exact TabPFN) CPU, 2 threads, distilled TabPFN (demo set-up)
Image network, P(IDH-mutant) 3.2e-05 4.9e-05
Image network, CNS5 type (max over classes) 3.9e-05 5.3e-05
TabPFN branch, P(IDH-mutant) 0.0004 0.0304
TabPFN branch, P(grade 4) 0.0032 0.0435
Logistic branch, P(1p/19q codeleted) 0.0006 0.0015
Fused, P(IDH-mutant) 0.0003 0.0133
Fused, P(1p/19q codeleted given IDH-mutant) 0.0010 0.0011
Fused, P(grade 4) 0.0004 0.0054
Fused, CNS5 type (max over classes) 0.0003 0.0133

Lab GPU: automatic masks identical in 12/12 patients, model-input crops identical in 12/12, same CNS5 call in 12/12; CPU: same CNS5 call in 12/12. Remaining differences come from GPU half-precision arithmetic (TabPFN, image network), from the batch composition of TabPFN, and, for one patient (tcgafresh-00141), from radiomic features: the test's PyRadiomics run (Kaggle, Linux) used an image crop that differed from the lab's by one grey level in 754 voxels (a deviation logged before scoring), whereas this package reproduces the lab crop exactly. PyRadiomics must run with numpy 1.26 (numpy 2 changes some texture features by up to 30 %); TabPFN v2 reproduces the stored values exactly (|dp| < 1e-7) only with numpy 2.x.

TabPFN-GlioTRUST-distilled (CPU demo only). Exact TabPFN v2 needs about an hour per scan on two CPU cores, so the free demo replaces it by an ensemble of three small networks per seed and task, trained on the exact TabPFN probabilities of real scans outside its context and of synthetic scans around them. On the 76 locked-test scans (never used for distillation), the agreement with exact TabPFN was:

Seed, task mean abs. diff. 95th percentile max
s0, idh 0.017 0.066 0.141
s0, g4 0.028 0.118 0.239
s1, idh 0.013 0.050 0.114
s1, g4 0.030 0.133 0.284
s2, idh 0.015 0.078 0.167
s2, g4 0.027 0.093 0.164

The precomputed example results and the paper's numbers use the exact TabPFN v2.

Example cases. Re-running the three development TCGA examples from their raw files with their BraTS masks reproduced the paper's stored leave-TCGA-out predictions: TCGA-06-0142: image |dp| 3.4e-21, TabPFN 5.2e-06, fused CNS5 1.9e-07; TCGA-FG-6691: image |dp| 4.8e-06, TabPFN 0.0013, fused CNS5 3.4e-05; TCGA-CS-6668: image |dp| 5.6e-17, TabPFN 0.0003, fused CNS5 6.9e-05. All three are correct and answered.

Run time on two CPUs (the size of a small free cloud server): measured with this package restricted to 2 logical CPUs (one core with SMT) of the lab PC (AMD Ryzen 7 9700X), 12 locked-test scans: median 65 s per scan with automatic segmentation (max 75 s; segmentation 50 s, PyRadiomics features 12 s, image network 1.5 s, HiResCAM 0.8 s, everything else < 1 s); with an uploaded mask the segmentation step is skipped (about 15-25 s). Shared cloud vCPUs are usually slower than this desktop core.

Usage

# pip install -r requirements.txt  (Python 3.11; see demo/requirements.txt; numpy 1.26.x is required for PyRadiomics)
from gliotrust_infer import GlioTRUST
model = GlioTRUST.from_hub("ABRUBAB/GlioTRUST")             # CPU, distilled TabPFN
res = model.run({"T1": "t1.nii.gz", "T1c": "t1ce.nii.gz", "T2": "t2.nii.gz", "FLAIR": "flair.nii.gz"},
                age=63, sex="F", mask_path=None)               # None -> automatic segmentation
print(res["cns5"], res["decision"])

The inference package (gliotrust_infer) is in demo/ of the project's GitHub repository. Inputs must be BraTS-format NIfTI: skull-stripped, co-registered on one 1 mm grid (e.g. SRI24). Exact TabPFN (engine="exact") needs tabpfn==2.1.3, the checkpoint in tabpfn/, numpy 2.x (the paper's TabPFN environment) and preferably a GPU.

Example cases

examples/ holds three development TCGA patients (never seen by these leave-TCGA-out models) with their four sequences, BraTS tumour mask, reference diagnosis and the precomputed result of the exact model: a glioblastoma IDH-wildtype (TCGA-06-0142), an astrocytoma IDH-mutant (TCGA-FG-6691) and an oligodendroglioma (TCGA-CS-6668). Source: TCGA-GBM / TCGA-LGG collections of The Cancer Imaging Archive (data generated by the TCGA Research Network), pre-processed and segmented by Bakas et al. (Sci Data 2017, doi:10.1038/sdata.2017.117; TCIA analysis results doi:10.7937/K9/TCIA.2017.KLXWJJ1Q and doi:10.7937/K9/TCIA.2017.GJQ7R0EF, CC BY 3.0) as distributed in BraTS 2021 (Baid et al., arXiv:2107.02314). TCIA: Clark et al., J Digit Imaging 2013 (doi:10.1007/s10278-013-9622-7).

Limitations

Adult, pre-operative, untreated diffuse gliomas only; BraTS-format inputs only. Other tumour types, children, post-operative scans and poor-quality scans are out of scope. Calibration and conformal coverage vary between hospitals. The model was developed on public research cohorts and has not been evaluated prospectively.

Licences and attribution

  • GlioTRUST weights, radiomics-branch arrays and code in this repository: CC BY-NC 4.0 (non-commercial use with attribution); see LICENSE.md.
  • Built with PriorLabs-TabPFN. tabpfn/tabpfn-v2-classifier-finetuned-zk73skhh.ckpt is the unmodified TabPFN v2 classifier checkpoint of Prior Labs (Prior-Labs/TabPFN-v2-clf, SHA-256 cf8c519c01eaf1613ee91239006d57b1c806ff5f23ac1aeb1315ba1015210e49), redistributed under the Prior Labs License 1.1 (copy in tabpfn/LICENSE.txt). The distilled networks are derived from TabPFN outputs and therefore carry "TabPFN" at the start of their name, as that licence requires. Hollmann et al., Nature 2025 (doi:10.1038/s41586-024-08328-6).
  • PyRadiomics (BSD-3-Clause), MONAI (Apache-2.0).

Citation

@article{gliotrust2026,
  title   = {GlioTRUST: Uncertainty-aware deep learning and peritumoral radiomics for molecular classification of
             glioma on pre-operative MRI with leave-one-hospital-out evaluation},
  author  = {AUTHORS},
  journal = {JOURNAL},
  year    = {2026},
  note    = {citation placeholder; to be updated on publication}
}
Downloads last month
29
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Paper for ABRUBAB/GlioTRUST