SAVRN
Search Contact SAVRN

Open-weight model · Image segmentation

toxoplasma-pv-segmentation-cpsam-r5

by Einar Olafsson einarolafsson/toxoplasma-pv-segmentation-cpsam-r5

Segments Toxoplasma gondii parasitophorous vacuoles from a parasite stain (anti-Toxoplasma-biotin, or DsRed in the PV lumen). Round 5 — the current promoted PV model, superseding round 2 (Toxoplasma PV v1).

Parameters
Context
Weights1.2 GB
Licensemit
AccessOpen weights
Monthly Downloads

Model Card

By Einar Olafsson, published under mit, revision 51b2ca074242.

Segments Toxoplasma gondii parasitophorous vacuoles from a parasite stain (anti-Toxoplasma-biotin, or DsRed in the PV lumen). Round 5 — the current promoted PV model, superseding round 2 (Toxoplasma PV v1). 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. Launch the GUI and open the Model Zoo: Find Toxoplasma PV v2 (round 5) 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. Point spaCR's mask generation at the downloaded checkpoint: In the GUI the same thing…

Read Einar Olafsson's full model card

Toxoplasma PV v2 (round 5)

Segments Toxoplasma gondii parasitophorous vacuoles from a parasite stain (anti-Toxoplasma-biotin, or DsRed in the PV lumen). Round 5 — the current promoted PV model, superseding round 2 (Toxoplasma PV v1).

  • Architecture: Cellpose-SAM (cpsam_v2)
  • Model Zoo key: toxoplasma_pv_v2
  • Checkpoint: cpsam_v2_toxo_r5
  • 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 PV v2 (round 5) 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_pv_v2")
path  = model_zoo.install(entry, dest="~/spacr_models")
print(path)   # verified local checkpoint

Mask generation

Point spaCR's mask generation at the downloaded checkpoint:

from spacr.core import preprocess_generate_masks

settings = {
    "src": "/path/to/images",
    "pathogen": "cellpose",
    "pathogen_model": str(path),     # the checkpoint fetched above
    "pathogen_diameter": 12,
}
preprocess_generate_masks(settings)

In the GUI the same thing is under Make masks — choose the downloaded model in the Cellpose model field for the relevant object.

API: :func:spacr.core.preprocess_generate_masks, :func:spacr.spacr_cellpose.generate_masks_from_imgs

Performance

model train train obj. test test obj. CV F1 @ IoU 0.5 AJI Dice final train loss final val loss val - train best epoch
stock cpsam_v2 (no fine-tuning) 11 0.7130 0.4260
this model (round 5) 556 not recorded 619 not recorded 5-fold 0.8170 ± 0.036 0.7144 ± 0.107 0.8024 ± 0.118 0.0424 not recorded 100 / 100

The CV column is the point of this model: scores are the mean ± SD over 5 cross-validation folds covering 619 curated pairs, not a single split, so the spread is a measured quantity rather than an assumption. The stock row is stock Cellpose-SAM on the 11 in-house held-out wells (evaluation/baseline_scores.csv).

metric mean SD
f1 0.8170 0.0360
precision 0.8291 0.0528
recall 0.8091 0.0569
aji 0.7144 0.1069
dice 0.8024 0.1176
mAP 0.5562 0.0855

Cross-validation replaces a train/validation loss gap as the overfitting check: a model that had memorised its training data would not hold F1 0.817 ± 0.036 across five folds. Only training loss was recorded for this run, so there is no validation loss curve to plot.

Training data

556 curated training images of Toxoplasma tachyzoite parasitophorous vacuoles, stained with goat anti-Toxoplasma-biotin or expressing DsRed in the PV lumen (RH and ME49), accumulated over five rounds of curation. 100 epochs from stock cpsam_v2, AdamW, lr 1e-5, weight decay 0.1. Cross-validation folds are in training/folds.csv.

Files in this repository

path what
cpsam_v2_toxo_r5 the checkpoint
training/final_report.json run configuration and summary
training/final_losses.csv per-epoch losses
training/folds.csv the 5 cross-validation folds
training/train.log full training log
evaluation/cv_aggregate.json 5-fold aggregate, overall and per dataset
evaluation/cv_final_holdout.csv per-fold held-out scores
evaluation/baseline_scores.csv scores against stock cpsam and earlier rounds

Limitations

  • Accuracy falls above IoU 0.8 — suited to counting and area rather than precise morphometry.
  • Per-dataset variance is real: F1 ranges from ~0.74 to ~0.93 depending on the screen.
  • Trained on RH and ME49 tachyzoites; other strains and bradyzoites are untested.

Links

  • spaCR on GitHub: https://github.com/EinarOlafsson/spacr
  • Model Zoo API: spacr.model_zoocatalogue(), install(), fetch(), verify()
  • Mask generation API: spacr.core.preprocess_generate_masks
  • Issues and questions: https://github.com/EinarOlafsson/spacr/issues

Identity and Version

Repository
einarolafsson/toxoplasma-pv-segmentation-cpsam-r5
Publisher
Einar Olafsson
Task
Image segmentation
Modality
Image
Library
spacr
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
51b2ca0742428ca6118f358b096ef5d389b1e1cd
First published
2026-09-18
Last updated
2026-09-18

Files and Weights

10 files, 1.2 GB in total.

Configuration2 files · 4.9 KB
Documentation1 file · 4.7 KB
Other6 files · 1.2 GB
Repository1 file · 1.6 KB
Every file
FileTypeSizeSHA-256
evaluation/cv_aggregate.jsonConfiguration4.6 KB
training/final_report.jsonConfiguration264 B
README.mdDocumentation4.7 KB
cpsam_v2_toxo_r5Other1.2 GB 17c689e3b117
evaluation/baseline_scores.csvOther395 B
evaluation/cv_final_holdout.csvOther278 B
training/final_losses.csvOther1.3 KB
training/folds.csvOther54.0 KB
training/train.logOther6.0 KB
.gitattributesRepository1.6 KB

License and Download

License
mit
Access
Open weights, no gate
Download from Einar Olafsson

Released by Einar Olafsson through its official repository on Hugging Face. Read the license.

Questions About toxoplasma-pv-segmentation-cpsam-r5

Can I use toxoplasma-pv-segmentation-cpsam-r5 commercially?

Yes. toxoplasma-pv-segmentation-cpsam-r5 is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

Similar Models

Model · Image segmentation

segformer-b2-finetuned-ade-512-512

NVIDIA

SegFormer model fine-tuned on ADE20k at resolution 512x512. It was introduced in the paper SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers by Xie et al. and first released in this repository. Disclaimer: The team releasing SegFormer did not write a model card for this model so this model card has been written by the Hugging Face team. SegFormer consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to achieve great results on semantic segmentation benchmarks such as ADE20K and Cityscapes. The hierarchical Transformer is first pre-trained on ImageNet-1k, after which a decode head is added and fine-tuned altogether on a…

Open weights other transformers

Model · Image segmentation

segformer-b3-finetuned-ade-512-512

NVIDIA

SegFormer model fine-tuned on ADE20k at resolution 512x512. It was introduced in the paper SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers by Xie et al. and first released in this repository. Disclaimer: The team releasing SegFormer did not write a model card for this model so this model card has been written by the Hugging Face team. SegFormer consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to achieve great results on semantic segmentation benchmarks such as ADE20K and Cityscapes. The hierarchical Transformer is first pre-trained on ImageNet-1k, after which a decode head is added and fine-tuned altogether on a…

Open weights other transformers

Model · Image segmentation

oneformer_ade20k_swin_large

SHI Labs

OneFormer model trained on the ADE20k dataset (large-sized version, Swin backbone). It was introduced in the paper OneFormer: One Transformer to Rule Universal Image Segmentation by Jain et al. and first released in this repository. OneFormer is the first multi-task universal image segmentation framework. It needs to be trained only once with a single universal architecture, a single model, and on a single dataset, to outperform existing specialized models across semantic, instance, and panoptic segmentation tasks. OneFormer uses a task token to condition the model on the task in focus, making the architecture task-guided for training, and task-dynamic for inference, all with a single…

Open weights mit transformers

Model · Image segmentation

segformer-b1-finetuned-ade-512-512

NVIDIA

SegFormer model fine-tuned on ADE20k at resolution 512x512. It was introduced in the paper SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers by Xie et al. and first released in this repository. Disclaimer: The team releasing SegFormer did not write a model card for this model so this model card has been written by the Hugging Face team. SegFormer consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to achieve great results on semantic segmentation benchmarks such as ADE20K and Cityscapes. The hierarchical Transformer is first pre-trained on ImageNet-1k, after which a decode head is added and fine-tuned altogether on a…

Open weights other transformers

Model · Image segmentation

segformer-b0-finetuned-ade-512-512

Joshua

https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: Example: Image segmentation with Xenova/segformer-b0-finetuned-ade-512-512. You can visualize the outputs with: Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights transformers.js

Model · Image segmentation

DelineateAnything

Mykola Lavreniuk

Delineate Anything v2 extends Delineate Anything into a globally representative, resolution-agnostic foundation model that scales agricultural field boundary detection to a planetary level from any imagery source. Trained on FBIS-73M, a massive 73-million-instance dataset spanning 61 countries with diverse imagery sources ranging from 0.25m to 10m resolution, built through a resolution-specific curation pipeline that solves the parcel-versus-field mismatch, Delineate Anything v2 sets a new state-of-the-art in global zero-shot delineation. It delivers a +103.3% relative gain in [email protected] over Delineate Anything while maintaining extreme efficiency, mapping all of Ukraine (603,000 km²) in 5.4…

Open weights agpl-3.0 ultralytics