Downloads · 30 days
13
18% of all-time downloads
kaczmarj/pancancer-tp53-mut.tcga
pancancer-tp53-mut.tcga is a machine learning model from kaczmarj. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-4.0.
This model classifies an H&E-stained digital pathology image as TP53 wildtype or mutant. It was trained by Jakub Kaczmarzyk using CLAM.
Downloads · 30 days
13
18% of all-time downloads
All-time downloads
71
Public
Parameters
658K
13.2 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors5.3 MB · 47%
From the Hugging Face model README
This model classifies an H&E-stained digital pathology image as TP53 wildtype or mutant. It was trained by Jakub Kaczmarzyk using CLAM.
Inputs: Bag of patches with 128um edge length, embedded with CTransPath.
Output classes: wildtype, mutant
Diagnostic slides in TCGA (e.g., DX) were used to train the model. The whole slide images were tiled into 128x128um patches, and each patch was encoded using CTransPath (this produces 768-dimensional embeddings).
Train, validation, and test splits were stratified by TCGA study and TP53 status, and patients did not cross split boundaries.
Samples sizes:
The TP53 status for each sample was downloaded from CBioPortal.
TCGA studies with fewer than 100 samples of mutated TP53 were excluded from training.
The following TCGA studies were used in training: ACC, BLCA, BRCA, CESC, COADREAD, ESCA, GBM, HNSC, KIRC, KIRP, LGG, LIHC, LUAD, LUSC, OV, PAAD, PCPG, PRAD, SARC, SKCM, STAD, TGCT, THCA, THYM, UCEC.
The following TCGA studies were not used in training: CHOL, UVM, UCS, KICH, MESO, DLBC.
To use this model on the command line, see WSInfer-MIL.
Alternatively, you may use PyTorch on ONNX to run the model. First, embed 128um x 128um patches using CTransPath. Then pass the bag of embeddings to the model.
import onnxruntime as ort
import numpy as np
embedding = np.ones((1_000, 768), dtype="float32")
ort_sess = ort.InferenceSession("model.onnx")
logits, attention = ort_sess.run(["logits", "attention"], {'input': embedding})
The model achieved an AUROC of 0.85 on the full test set.
Here are the AUROC values per TCGA study. NaN values are present wherever there was only a single class present in the ground truth labels.
This model is ONLY intended for research purposes.
This model may not be used for clinical purposes. This model is distributed without warranties, either express or implied.