Downloads · 30 days
0
0% of all-time downloads
idso-fa1-pathology/TMEsegBreastTCGA
TMEsegBreastTCGA is a image segmentation model from idso-fa1-pathology. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
TMEsegBreastTCGA is a TensorFlow SegFormer semantic segmentation model for breast cancer histology images. The model was fine-tuned to segment tissue compartments in H&E-stained breast cancer image regions using TCGA…
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
23
Public
Repo size
380 MB
Likes
0
Public
Click a slice to open those files.
.h5380 MB · 100%
From the Hugging Face model README
TMEsegBreastTCGA is a TensorFlow SegFormer semantic segmentation model for breast cancer histology images. The model was fine-tuned to segment tissue compartments in H&E-stained breast cancer image regions using TCGA breast cancer data from the Breast Cancer Semantic Segmentation (BCSS) resource.
This repository contains the TensorFlow checkpoint files needed to load the model with the Hugging Face transformers library.
The exact class mapping is stored in config.json and can be inspected with:
from transformers import AutoConfig
repo_id = "idso-fa1-pathology/TMEsegBreastTCGA"
config = AutoConfig.from_pretrained(repo_id, subfolder="checkpoint8class") # subfolder="checkpoint9class"
print(config.num_labels)
print(config.id2label)
README.md # model card
checkpoint9class/
├── config.json # model configuration, including label mapping
└── tf_model.h5 # TensorFlow model weights
checkpoint8class/
├── config.json # model configuration, including label mapping
└── tf_model.h5 # TensorFlow model weights
Download the checkpoint to the local for downsream finetuning or inference.
Install the Hugging Face Hub client if needed:
pip install -U huggingface_hub
from pathlib import Path
import shutil
from huggingface_hub import hf_hub_download
repo_id = "idso-fa1-pathology/TMEsegBreastTCGA"
subfolder = "checkpoint9class"
output_dir = Path("./tmeseg-infer/model/mit-b3-finetuned-TCGAbcss9class")
output_dir.mkdir(parents=True, exist_ok=True)
for filename in ["config.json", "tf_model.h5"]:
downloaded_file = hf_hub_download(
repo_id=repo_id,
filename=filename,
subfolder=subfolder,
repo_type="model",
)
shutil.copy(downloaded_file, output_dir / filename)
print(f"Checkpoint saved to: {output_dir}")
This model is intended for research use in computational pathology, including:
This model is not intended for:
The model was trained using TCGA breast cancer histology data from the Breast Cancer Semantic Segmentation (BCSS) dataset. The BCSS resource is associated with the paper:
Amgad M, Elfandy H, et al. Structured crowdsourcing enables convolutional segmentation of histology images. Bioinformatics. 2019. doi: 10.1093/bioinformatics/btz083.
The BCSS GitHub repository provides dataset download instructions, metadata, masks, RGB image extraction utilities, and label-code information:
https://github.com/PathologyDataScience/BCSS
config.id2label before downstream use.