Downloads · 30 days
5
12% of all-time downloads
kaczmarj/gbmlgg-survival-porpoise.tcga
gbmlgg-survival-porpoise.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 predicts a patient's overall survival using an H&E-stained digital pathology image of GBMLGG. It was trained by Jakub Kaczmarzyk using PORPOISE. It is an attempt to reproduce the PORPOISE manuscript.
Downloads · 30 days
5
12% of all-time downloads
All-time downloads
43
Public
Parameters
659K
7.9 MB on disk
Likes
1
Public
Click a slice to open those files.
.pt2.7 MB · 33%
From the Hugging Face model README
This model predicts a patient's overall survival using an H&E-stained digital pathology image of GBMLGG. It was trained by Jakub Kaczmarzyk using PORPOISE. It is an attempt to reproduce the PORPOISE manuscript.
Original journal article: https://doi.org/10.1016/j.ccell.2022.07.004
If you find this model useful, please make sure you cite the original publication.
Inputs: Bag of patches with 128um edge length, embedded with CTransPath.
Output classes: logits of hazards at four timepoints
To calculate the arbitrary risk score given the model outputs logits, use the following:
hazards = torch.sigmoid(logits)
S = torch.cumprod(1 - hazards, dim=1)
risk = -torch.sum(S, dim=1)
TCGA-GBMLGG was 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).
The training and validation splits were provided by the original PORPOISE code. Here, we report the model in fold 3, because it had the highest c-index of the folds.
Samples sizes:
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})
# To get the risk score, implement the following:
# hazards = sigmoid(logits)
# S = cumprod(1 - hazards, dim=1)
# risk = -sum(S, dim=1)
The median risk score was -3.22, and this value was used to split patients into low risk and high risk.
The model achieves a c-index of 0.83 in the validation set.
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.