Toxoplasma PV v1
Cellpose-SAM (cpsam) fine-tune that segments Toxoplasma gondii parasitophorous
vacuoles (PVs) in fluorescence microscopy fields.
Trained on images of Toxoplasma tachyzoite PVs stained with goat anti-Toxoplasma-biotin, and on Toxoplasma tachyzoites expressing DsRed in the PV lumen.
Use in spaCR
Select Toxoplasma PV v1 as the pathogen model in the Mask module. spaCR
downloads the checkpoint on first use. Equivalent to passing the checkpoint
path as pathogen_model.
from spacr.core import preprocess_generate_masks
preprocess_generate_masks({..., "pathogen_model": "<path to cpsam_v2_toxo_r2>"})
Performance
Held-out NAS set (n=11 fields, 624 objects), against the stock cpsam weights:
| metric | vanilla cpsam | this model |
|---|---|---|
| F1 @ IoU 0.5 | 0.713 | 0.867 |
| mAP (0.5โ0.9) | 0.322 | 0.595 |
| Aggregated Jaccard | 0.426 | 0.808 |
Per-IoU on the round-2 held-out set:
| IoU | precision | recall | F1 | AP |
|---|---|---|---|---|
| 0.5 | 0.843 | 0.886 | 0.864 | 0.802 |
| 0.7 | 0.768 | 0.808 | 0.788 | 0.658 |
| 0.9 | 0.311 | 0.327 | 0.319 | 0.170 |
Round 2 vs round 1 โ round 2 bought generalisation, not in-domain accuracy:
| set | n | round 1 F1 | round 2 F1 | ฮ |
|---|---|---|---|---|
| NAS held-out (in-domain) | 11 | 0.8668 | 0.8641 | โ0.003 |
| curated-new (cross-condition) | 40 | 0.8625 | 0.8848 | +0.022 |
The in-domain set is 11 fields, so that โ0.003 is inside noise. The cross-condition gain is the real result (AJI 0.784 โ 0.920).
Training
115 image/mask pairs (104 train / 11 test), 100 epochs, base cpsam_v2.
Limitations
Accuracy falls sharply above IoU 0.8 โ boundaries are approximate, so this is suited to counting and area rather than precise morphometry. Trained on the two stains named above; other labels are untested.