Request access to this research model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
By requesting access to this model, you acknowledge and agree that the model is provided solely for research and educational purposes. This model is not intended for clinical, diagnostic, prognostic, therapeutic, or other medical decision-making use. The model has not been validated for use in patient care and must not be used to guide, support, or replace the judgment of qualified healthcare professionals. You agree not to use this model for clinical diagnosis, treatment selection, patient risk stratification, or any other activity that could directly or indirectly affect patient care. The model is provided as is, without warranties of any kind. You are solely responsible for ensuring that your use complies with all applicable laws, regulations, institutional policies, ethical standards, and data-use agreements.
Log in or Sign Up to review the conditions and access this model content.
CTransPath-based ABMIL models for metastasis detection
These are weakly-supervised, attention-based multiple instance learning models for binary metastasis detection (normal versus metastasis). The models were trained on the CAMELYON16 dataset using CTransPath embeddings.
Data
- Training set consisted of 243 whole slide images (WSIs).
- 143 negative
- 100 positive
- 52 macrometastases
- 48 micrometastases
- Validation set consisted of 27 WSIs.
- 16 negative
- 11 positive
- 6 macrometastases
- 5 micrometastases
- Test set consisted of 129 WSIs.
- 80 negative
- 49 positive
- 22 macrometastases
- 27 micrometastases
Evaluation
Below are the classification results on the test set.
| Seed | Sensitivity | Specificity | BA | Precision | F1 |
|---|---|---|---|---|---|
| 0 | 0.776 | 0.912 | 0.844 | 0.844 | 0.809 |
| 1 | 0.857 | 0.912 | 0.885 | 0.857 | 0.857 |
| 2 | 0.735 | 0.963 | 0.849 | 0.923 | 0.818 |
| 3 | 0.776 | 0.925 | 0.850 | 0.864 | 0.817 |
| 4 | 0.776 | 0.950 | 0.863 | 0.905 | 0.835 |
How to reuse the model
The model expects 128 x 128 micrometer patches, embedded with the CTransPath model.
import torch
from abmil import AttentionMILModel
model = AttentionMILModel(in_features=768, L=512, D=384, num_classes=2, gated_attention=True)
model.eval()
state_dict = torch.load("seed1/model_best.pt", map_location="cpu", weights_only=True)
model.load_state_dict(state_dict)
# Load a bag of features
bag = torch.ones(1000, 768)
with torch.inference_mode():
logits, attention = model(bag)