Edit model card

Metastasis classification (CAMELYON16)

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

Data

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:

  • Train: 243 slides
  • Validation: 27 slides
  • Test: 129 slides

Reusing this model

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})

Model performance

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

Intended uses

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.

Downloads last month
7
Safetensors
Model size
329k params
Tensor type
F32
·
Inference API
Unable to determine this model’s pipeline type. Check the docs .

Collection including kaczmarj/breast-lymph-nodes-metastasis.camelyon16