Downloads · 30 days
1.4K
51% of all-time downloads
kaczmarj/breast-lymph-nodes-metastasis.camelyon16
breast-lymph-nodes-metastasis.camelyon16 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 of axillary lymph nodes as not containing metastasis or containing metastasis. It was trained by Jakub Kaczmarzyk.
Downloads · 30 days
1.4K
51% of all-time downloads
All-time downloads
2.7K
Public
Parameters
329K
5.3 MB on disk
Likes
0
Public
Click a slice to open those files.
.pt1.3 MB · 34%
From the Hugging Face model README
This model classifies an H&E-stained digital pathology image of axillary lymph nodes as not containing metastasis or containing metastasis. It was trained by Jakub Kaczmarzyk.
Inputs: Bag of patches with 128um edge length, embedded with CTransPath.
Output classes: no-metastasis, metastasis
CAMELYON16 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).
Train and validation splits were stratified by metastasis status. The test set is pre-defined in the CAMELYON16 dataset.
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})
The model achieves an AUC of 0.91 in the test set of CAMELYON16. Below, please find a confusion matrix, where predicted classes are columns, and true values are rows.
| No-Met | Met | |
|---|---|---|
| No-Met | 77 | 3 |
| Met | 12 | 37 |
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.