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()
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support