CoolFace
Modelpublic

einarolafsson/toxoplasma-pv-segmentation-cpsam-r6

sourceHugging Facecc-by-4.0updated 7d agoView on Hugging Face
0likes
Model Card

Toxoplasma PV segmentation — round 6 (Cellpose-SAM)

Segments Toxoplasma gondii parasitophorous vacuoles. Round 6 retrains round 5 on the same 556 curated fields with cellpose 4.2.1.1, now with a held-out validation set (per-epoch validation loss and accuracy) and a separate test set. Built for spaCR.

Data

setfieldsobjectsrole
train43715550fitted
validation1088959per-epoch validation; one source-grouped CV fold
test11683the 11 fixed NAS anchor wells, never trained on, used every round since r1

Per-field assignment: training/split.csv.

Results — test set (11 anchor wells)

modelF1 @ IoU 0.5precisionrecallmAPAJIDice
stock cpsam_v20.76480.75390.7760.3620.5050.6431
r60.86020.84680.87410.50610.80260.9059

Validation fold (r6): F1 0.8237, AJI 0.7927, Dice 0.8936.

5-fold cross-validation (same data, grouped by source): F1 0.8168 ± 0.028, AJI 0.7516, Dice 0.8424. Per-fold, per-image results and per-epoch histories are in cv/.

Training: 100 epochs; best validation loss 0.08639681519438185 at epoch 20; final train loss 0.0461, final validation loss 0.12872041770909468.

Contents

  • —weights/cpsam_v2_toxo_r6 — final weights
  • —training/epoch_history.csv — per-epoch train and validation loss, pixel accuracy, Dice, IoU, MCC
  • —training/split.csv, training/training_curves.png, training/report.json
  • —qc/ — per-image metrics for r6 and stock (*_perimage.csv), summary.json, comparison_vs_stock.csv
  • —cv/ — 5-fold CV: aggregate, per-fold per-image and per-IoU metrics, per-epoch histories

Pixel accuracy is foreground classification on the training crops; F1/AJI/Dice above are the segmentation-quality numbers.

Environment

cellpose4.2.1.1
torch2.10.0+cu128
GPUNVIDIA GeForce RTX 3090 Ti
base weightscpsam_v2

Use with spaCR

bash
pip install spacr   # or: conda install -c conda-forge spacr
python
from huggingface_hub import hf_hub_download
from spacr.core import preprocess_generate_masks
w = hf_hub_download("einarolafsson/toxoplasma-pv-segmentation-cpsam-r6", "weights/cpsam_v2_toxo_r6")
preprocess_generate_masks({"src": "/path/to/plate", "pathogen_channel": 2, "custom_model": w})

Source: <https://github.com/EinarOlafsson/spacr> · PyPI · conda-forge · Training data: einarolafsson/toxoplasma-pv-segmentation-dataset