Light-microscopy cell segmentation (Cellpose-SAM fine-tune, epoch 37)

Cellpose-SAM cpsam_v2 fine-tuned on transmitted-light microscopy -- phase contrast, brightfield, DIC and quantitative phase -- from 14 public datasets. Built for spaCR.

Read this first

It does not beat stock cpsam_v2 overall, and it missed the bar set before it was scored.

stock cpsam_v2 this model
test F1 @ IoU 0.5, all 2,199 fields 0.738 0.694 -0.044
test F1, only datasets stock was not trained on 0.885 0.960 +0.075

Both are true because of LIVECell: it is 1020 of the 2,199 test fields and the densest by far, so it dominates the pooled score -- and it is the one large dataset stock Cellpose-SAM was itself trained on (5% of its samples, per the Cellpose-SAM paper's Methods; see training/WHAT_STOCK_CPSAM_HAS_SEEN.md). Stock's LIVECell score is partly memorisation, and this model loses 0.053 there.

Use it for brightfield, DIC, quantitative phase, and phase contrast from instruments other than the Incucyte. Do not use it in place of stock on LIVECell-style Incucyte phase contrast, where stock is better.

The pre-registered bar, and the result

Fixed at 11:47 on 2026-09-21, before any test score existed (training/PROMOTION_BAR.md): overall F1 +0.02 over stock; no modality losing more than 0.02; no dataset losing more than 0.05. All three were missed -- overall -0.044, phase -0.046, LIVECell -0.053. Published anyway, as the bar said it would be.

Test set, by modality

modality fields stock this model delta
brightfield 288 0.912 0.964 +0.051
dic 23 0.641 0.667 +0.026
phase 1888 0.735 0.689 -0.046
ALL 2199 0.738 0.694 -0.044

Test set, by dataset

dataset fields stock this model delta stock trained on it?
bbbc009_dic 2 0.370 0.397 +0.026
bbbc030_dic 12 0.872 0.913 +0.042
ctc_bf_hsc_brightfield 8 0.936 1.000 +0.064
ctc_bf_musc_brightfield 50 0.752 0.802 +0.050
ctc_dic_hela 9 0.923 0.950 +0.027
ctc_phc_psc 2 0.873 0.883 +0.010
ctc_phc_u373 15 0.948 0.935 -0.013
deepsea_phase 740 0.913 0.980 +0.067
livecell_phase 1020 0.724 0.671 -0.053 yes
qpi_phase_adherent 31 0.714 0.837 +0.124
revvity_brightfield 22 0.000 0.799 +0.799
yeast_microstructures_brightfield 148 0.984 0.993 +0.009
yeaz_brightfield 60 0.995 0.995 -0.000 yes
yeaz_phase 80 0.986 0.988 +0.001 yes

Revvity is not a real +0.80. Stock scores 0.000 on all 22 Revvity fields, which are the only RGB images in the set; stock almost certainly mishandles the three-channel input. Both models were given identical input, but that row should not be read as a finding.

Train, valid and test

split fields scored F1 @ 0.5
train (a 1,000-field sample spread across every source) 1000 0.865
valid 2030 0.696
test 2199 0.694

The train figure is higher, but the samples differ in make-up -- valid and test are about half LIVECell, the train sample is spread evenly -- so the gap is not purely overfitting.

There is no per-epoch loss curve. The trainer writes losses when a run ends and neither run ended: the first was stopped at epoch 30 to free the GPU, the second was ended by a machine reboot. Epoch 37 is the last checkpoint written. This is stated rather than reconstructed.

Data

einarolafsson/live-cell-segmentation-dataset -- 11,007 fields, 6,778 train / 2,030 valid / 2,199 test, split by acquisition so no well, dish or time-lapse spans two sets.

Contents

  • weights/live_cell_v1 -- epoch-37 weights
  • training/ -- splits, manifest, run records, the pre-registered bar and its addenda
  • qc/ -- per-field test scores for this model and stock, side-by-side by dataset and modality

Use with spaCR

from huggingface_hub import hf_hub_download
from spacr.core import preprocess_generate_masks
w = hf_hub_download("einarolafsson/live-cell-segmentation-cpsam", "weights/live_cell_v1")
preprocess_generate_masks({"src": "/path/to/plate", "custom_model": w})

Recipe: base cpsam_v2, lr 1e-5, batch 4, bsize 256, min_train_masks 1, weight decay 0.1, cellpose 4.2.1.1, RTX 3090. Non-commercial: LIVECell and Revvity-25 are CC BY-NC.

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