Zebrafish Cellpose-SAM Fine-Tunes

Experimental Cellpose-SAM fine-tunes for zebrafish microscopy cell segmentation.

What Is Included

This model repository contains two Cellpose model files:

File Target cells Training pairs Validation pairs Size SHA-256
zebrafish_macrophage_cpsam Macrophages 28 7 1,218,639,667 bytes 2c71c9ba9b6a41d39b02027721bd3edbb0e5a9fff969f58fa774aedd09760fcc
zebrafish_fibroblast_cpsam Fibroblasts 46 12 1,218,639,667 bytes 321056e7687254189529e8a424b59c8a84cd42560c03b3b677c9ee601bc368e3

The source microscopy data were 3D zebrafish stacks. The fine-tunes were trained from extracted 2D z-slices with Cellpose-style instance masks.

Intended Use

Use these weights for exploratory segmentation of similar zebrafish microscopy data. Performance should be checked on representative images from your own acquisition conditions before using the masks for quantitative biological analysis.

Training Data

  • Base model: Cellpose-SAM cpsam.
  • Training software: Cellpose 4.1.1.
  • Training hardware: CPU-only cluster nodes.
  • Labels: initial Cellpose output followed by manual correction/segmentation.

Data Scope

  • Trained on extracted 2D z-slices from one 3D zebrafish time point/source context.
  • Validation examples are held-out z-slices from the same imaging context.
  • Labels were initialized with Cellpose and manually corrected/segmented.
  • Best suited to similar zebrafish microscopy acquisitions; check a few representative images before quantitative use.

Example Usage

Download a model file and pass its local path to Cellpose:

hf download SDu90/zebrafish-cellpose-finetunes \
  zebrafish_fibroblast_cpsam \
  --local-dir models
from cellpose import models
import tifffile as tiff

image = tiff.imread("input_stack.tif")
model = models.CellposeModel(
    gpu=False,
    pretrained_model="models/zebrafish_fibroblast_cpsam",
)

masks, flows, styles = model.eval(
    image,
    do_3D=False,
    z_axis=0,
    stitch_threshold=0.4,
    diameter=15,
    cellprob_threshold=0.0,
    min_size=100,
)

For GPU inference, initialize Cellpose with gpu=True and an appropriate torch device.

License

The model weights are released under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). The companion GitHub code, notebooks, and documentation are licensed separately under BSD 3-Clause.

Citation

If you use these weights, please cite this Hugging Face repository and the relevant Cellpose papers:

Pachitariu, M., Rariden, M., & Stringer, C. (2025). Cellpose-SAM: superhuman generalization for cellular segmentation. bioRxiv.

Stringer, C., Wang, T., Michaelos, M., & Pachitariu, M. (2021). Cellpose: a generalist algorithm for cellular segmentation. Nature Methods, 18(1), 100-106.

Pachitariu, M. & Stringer, C. (2022). Cellpose 2.0: how to train your own model. Nature Methods, 1-8.

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

Model tree for SDu90/zebrafish-cellpose-finetunes

Finetuned
(6)
this model