Toxoplasma Plaque v1
Segments Toxoplasma gondii plaques in crystal violet plaque assays. Round 3. Use it through spaCR's plaque module.
- Architecture: Cellpose-SAM (cpsam)
- Model Zoo key:
toxoplasma_plaque_v1
- Checkpoint:
cpsam_plaque_r3
- Trained by: einarolafsson
Use it in spaCR
This model is distributed through the spaCR Model Zoo. spaCR is an open-source
package for spatial phenotype analysis of CRISPR screens and microscopy images.
pip install spacr
Model Zoo (GUI)
Launch the GUI and open the Model Zoo:
spacr
Find Toxoplasma Plaque v1 in the model list and press Download. The Model Zoo verifies
the checkpoint's SHA-256 after download, so a truncated or substituted file is
rejected rather than silently used.
Model Zoo (Python)
from spacr import model_zoo
entry = next(e for e in model_zoo.catalogue() if e.key == "toxoplasma_plaque_v1")
path = model_zoo.install(entry, dest="~/spacr_models")
print(path) # verified local checkpoint
Mask generation
This is a plaque-assay model and is driven by spaCR's plaque module rather than
the general cell/nucleus mask pipeline:
from spacr import plaque
plaque.analyze_plaques(src="/path/to/plate_images", model=str(path))
In the GUI the same thing is under Make masks in the plaque workflow.
API: :mod:spacr.plaque, :func:spacr.core.preprocess_generate_masks
Performance
3-fold cross-validated.
| set |
F1 |
| in-domain (in-house) |
0.856 |
| literature generalisation set |
0.806 (SD 0.020) |
| round 1, for reference |
0.718 |
Round 3 trades precision (0.939 down to 0.858) for recall (0.631 up to 0.811) on the
literature set, which is the right direction for a counting assay.
Training data
184 wells from 3 datasets — 95 in-house and 89 from the literature — of crystal
violet Toxoplasma plaque assays.
Files in this repository
| path |
what |
cpsam_plaque_r3 |
the checkpoint |
final_metrics.csv |
the checkpoint |
metadata.txt |
the checkpoint |
model.db |
the checkpoint |
model_report.pdf |
the checkpoint |
Limitations
- Segments plaques, not wells — pair it with the Toxoplasma Plaque Well Detector to locate wells first.
- Tuned toward recall, which suits counting more than precise plaque morphometry.
Links
- spaCR on GitHub: https://github.com/EinarOlafsson/spacr
- Model Zoo API:
spacr.model_zoo — catalogue(), install(), fetch(), verify()
- Mask generation API:
spacr.core.preprocess_generate_masks, plaque API: spacr.plaque
- Issues and questions: https://github.com/EinarOlafsson/spacr/issues