ONNX Model Zoo

kaczmarj/breast-lymph-nodes-metastasis.camelyon16

By kaczmarj · ↓ 1 · ♥ 0 · Updated 2024-06-27

What's in this repo

This page lists the files in kaczmarj/breast-lymph-nodes-metastasis.camelyon16, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 9 files, including 3 .txt, 1 .md, 1 .json, 1 .onnx, 1 .safetensors, 1 .pt
  • Last updated 2024-06-27

ONNX files

File Size Download
model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

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.

Model info

transformers
transformers onnx safetensors license:cc-by-4.0 endpoints_compatible region:us
↓ 1 ♥ 0

Created: 2024-03-05

Updated: 2024-06-27

View on Hugging Face

Files (9)

.gitattributes
README.md
config.json
model.onnx ONNX
model.safetensors
slide_ids_test.txt
slide_ids_train.txt
slide_ids_val.txt
torchscript_model.pt

Related models