π License and Usage Restrictions
This model is provided for research visibility only. You may not reuse, redistribute, or modify the code or model checkpoints without explicit written permission from the author.
If you'd like to use this model in your own work, please contact me.
π§ BCC detection for MOHS surgery
This repository contains multiple PyTorch checkpoints for models trained on paraffin-embedded biopsy whole slide images (WSIs) and freshfrozen section WSIs for predicting basal cell carcinoma (BCC) in mohs micrographic surgery. All models use the same architecture and differ in pretraining or dataset normalization.
Note: The provided checkpoints are for the MIL (Multiple Instance Learning) models and thus only contain the MIL model that is executed downstream of feature extraction. Feature extraction for all models was performed using the UNI model; the checkpoints do not include the feature extractor.
𧬠Training Data
Biopsies: Paraffin-embedded biopsies from Radboudumc, scanned at 40x (0.24 ΞΌm/pixel). Slides were processed by tissue mask delineation and then packed (tissue tightly arranged). Training data was prepared at 1.0 mpp (10x).
- Number of slides: 5,148
Mohs: Fresh frozen sections from MOHS surgery at Radboudumc and Maastrichtumc, scanned at 40x (0.24 ΞΌm/pixel), also packed after tissue mask delineation. Training data was prepared at 1.0 mpp (10x).
- Number of slides: 1,501
Normalized Data: Fresh frozen section data normalized using CycleGAN-based color normalization. To account for staining differences between Radboudumc and Maastrichtumc.
π Available Models
Each subdirectory contains:
s_0_*.pt: the checkpoint file for best and last epochsettings.txt: training configuration details
| Subdirectory | Description |
|---|---|
addmil_train_biop/ |
Additive MIL attention model trained on paraffin-embedded biopsy data |
addmil_train_biop_tune_frozen/ |
Additive MIL model pretrained on biopsy data and fine-tuned on fresh frozen sections |
addmil_train_frozen/ |
Additive MIL model trained from scratch on fresh frozen sections |
clamsb_train_biop |
CLAM model with single branch trained on biopsy data |
addmil_train_biop_tune_frozen_cyclegan/ |
Additive MIL model pretrained on biopsy data and fine-tuned on fresh frozen sections. Fresh frozen section data was normalized with cyclegan |
addmil_train_frozen_cyclegan |
Additive MIL model trained from scratch on fresh frozen sections normalized with cyclegan |
π Loading a Model
Use the Hugging Face Hub to download and load a checkpoint:
from huggingface_hub import hf_hub_download
import torch
from your_model_def import YourModelClass # replace with actual import
# Example: Load the MOHS pretrained + finetuned model
ckpt_path = hf_hub_download(repo_id="ivansl/bcc-frozen-section", filename="addmil_train_biop_tune_frozen/s_0_last.pt")
model = YourModelClass()
checkpoint = torch.load(ckpt_path, map_location="cpu")
model.load_state_dict(checkpoint['model_state_dict'])