Image Segmentation
Transformers
PyTorch
medical
vision-transformer
segformer
isic
skin-lesion
healthcare
Instructions to use mahnoor-2722/isic-segformer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mahnoor-2722/isic-segformer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="mahnoor-2722/isic-segformer")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mahnoor-2722/isic-segformer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
ISIC Skin Lesion Segmentation โ SegFormer (MiT-B0)
Pixel-level skin lesion segmentation model fine-tuned on ISIC 2018 Task 1.
Model Details
- Architecture: SegFormer (NVIDIA MiT-B0)
- Task: Binary medical image segmentation (lesion vs background)
- Framework: PyTorch + Hugging Face Transformers
- Input size: 256 ร 256
- Output: Lesion probability mask
- Parameters: ~3.7M
Performance (ISIC 2018)
| Metric | Score |
|---|---|
| Test Dice | 90.32% |
| Test IoU | 82.50% |
Compared against a from-scratch U-Net baseline (85.26% Dice).
Files
best_segformer_isic2018.pthโ fine-tuned weights
How to Load
from transformers import SegformerForSemanticSegmentation
from huggingface_hub import hf_hub_download
import torch
model = SegformerForSemanticSegmentation.from_pretrained(
"nvidia/mit-b0",
num_labels=1,
ignore_mismatched_sizes=True
)
path = hf_hub_download(
"mahnoor-2722/isic-segformer",
"best_segformer_isic2018.pth"
)
model.load_state_dict(torch.load(path, map_location="cpu"))
model.eval()