公开预览版:仅展示平台目录与原作者卡片,不提供下载;院内智能体通过内网实例申请使用。

🔒 MahmoodLab/madeleine

以下为作者原文,图片与外部链接在院内网络不可用。

Checkpoint for Multistain Pretraining for Slide Representation Learning in Pathology (ECCV'24)

Welcome to the official HuggingFace repository of the ECCV 2024 paper, "Multistain Pretraining for Slide Representation Learning in Pathology". This project was developed at the Mahmood Lab at Harvard Medical School and Brigham and Women's Hospital.

Model loging

from huggingface_hub import login
login()

You can refer HuggingFace documentation for more details.

Preprocessing: tissue segmentation, patching, and patch feature extraction

We are extracting CONCH features at 10x magnification on 256x256-pixel patches. Please refer to Madeleine public implementation to extract patch embeddings from a WSI.

Extracting MADELEINE slide encoding

You can obtain and run MADELEINE slide encoding (trained on Acrobat breast samples at 10x magnification) using:

from core.models.factory import create_model_from_pretrained

model, precision = create_model_from_pretrained('./models/')

feats = load_h5('your_path_to_conch_patch_embeddings/XXX.h5')

with torch.no_grad():
  with torch.amp.autocast(device_type="cuda", dtype=precision):
      wsi_embed = model.encode_he(feats=feats, device='cuda')