Downloads · 30 days
0
einarolafsson/cross-channel-cell-from-hoechst-cpsam
cross-channel-cell-from-hoechst-cpsam is a image segmentation model from einarolafsson. 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 cc-by-4.0.
Fine-tuned from stock cpsamv2 (CellposeSAM), 100 epochs, file-mode training. Built for use with spaCR.
Downloads · 30 days
0
Access
Public
Updated Sep 18, 2026
Repo size
12.2 GB
Likes
0
Public
Click a slice to open those files.
Other14.6 GB · 100%
From the Hugging Face model README
Fine-tuned from stock cpsam_v2 (CellposeSAM), 100 epochs, file-mode training.
Built for use with spaCR.
2578 training fields (237957 annotated objects), 451 held-out test fields
(45098 objects); 451 test fields contained objects and were scored.
Split by well, so no well appears on both sides. Per-field split and counts: training/fields.csv.
| model | F1 | precision | recall | mAP | AJI | Dice |
|---|---|---|---|---|---|---|
| stock cpsam_v2 | 0.3012 | 0.3086 | 0.2942 | 0.0575 | 0.3506 | 0.5235 |
| best | 0.8697 | 0.9437 | 0.8064 | 0.5591 | 0.7991 | 0.8948 |
| final | 0.8667 | 0.9429 | 0.8018 | 0.552 | 0.7929 | 0.8904 |
F1 improves 0.5685 over stock (2.89x). The mAP ratio is inflated by a near-zero stock denominator (0.0575) - quote the delta, not the ratio.
This model is trained and used with spaCR, a toolkit for spatial phenotype analysis of high-content microscopy screens.
pip install spacr # https://pypi.org/project/spacr/
conda install -c conda-forge spacr # https://anaconda.org/conda-forge/spacr
from huggingface_hub import hf_hub_download
w = hf_hub_download("einarolafsson/cross-channel-cell-from-hoechst-cpsam", "weights/cell_from_hoechst")
spaCR takes a path to a custom Cellpose model via the custom_model setting, so point it at the
file downloaded above:
from spacr.core import preprocess_generate_masks
settings = {
"src": "/path/to/your/plate",
"cell_channel": 0, # the cell-mask channel this model reads
"nucleus_channel": 1,
"custom_model": w, # path from hf_hub_download above
"preprocess": True,
"masks": True,
}
preprocess_generate_masks(settings)
One caveat worth knowing: pathogen_model is not a free-form path. spaCR validates it against a
fixed list (['toxo_pv_lumen', 'toxo_cyto']), so a custom model on disk goes through custom_model,
not pathogen_model. See spacr/settings.py and spacr/core.py.
from cellpose import models
m = models.CellposeModel(gpu=True, pretrained_model=w)
masks = m.eval(img, normalize=True)[0]
Always pass a real path. Cellpose silently substitutes its own default model for an unrecognised bare name, which would quietly give you the wrong weights.
| cellpose (training) | 4.0.9 |
| cellpose (scoring) | 4.0.9 |
| GPU | NVIDIA GeForce RTX 3090 Ti |
| base weights | cpsam_v2 |
weights/ - final and bestcheckpoints/ - epoch snapshotsqc/ - per-image and per-IoU metrics, per-tag summaries, comparison_vs_stock.csvtraining/ - loss_per_epoch.csv (per-epoch train and validation loss), metrics.csv
(per-checkpoint F1/precision/recall/mAP/AJI/Dice), curves, fields.csv, report.jsonMetrics are at IoU 0.50-0.95 in 0.05 steps; every model is scored against stock cpsam_v2 on the
identical holdout so "better than stock" is always answerable.
Training data: einarolafsson/cross-channel-cell-from-hoechst