A YOLO11s instance segmentation model fine-tuned to detect and count individual Pseudo-nitzschia cells within chain colonies in Imaging FlowCytobot (IFCB) images.
Model source
Source description
A YOLO11s instance segmentation model fine-tuned to detect and count individual Pseudo-nitzschia cells within chain colonies in Imaging FlowCytobot (IFCB) images.
Try it out: Interactive demo on HF Spaces
Sources
1 sourceVerified Sep 15
Model artifacts
1 artifactSource excerpts
2 excerpts| Metric | Box | Mask |
|---|
| Precision | 0.983 | 0.983 |
| Recall | 0.965 | 0.965 |
| mAP50 | 0.976 | 0.973 |
| mAP50-95 | 0.706 | 0.659 |
Trained for 100 epochs on Apple MPS (M-series GPU). Training time: ~1.5 hours.
Training Results
Confusion Matrix
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
# Download model
model_path = hf_hub_download("patcdaniel/pseudo-nitzschia-yolo11s-seg", "best.pt")
model = YOLO(model_path)
# Run inference
results = model("image.png", conf=0.25)
# Count cells
for r in results:
n_cells = len(r.masks) if r.masks is not None else 0
print(f"Detected {n_cells} cells")
huggingface-cli download patcdaniel/pseudo-nitzschia-cell-segmentation \
--repo-type dataset --local-dir ./dataset
python scripts/train_yolo.py \
--config configs/cell_seg.yaml \
--model yolo11s-seg.pt \
--epochs 100 \
--batch 24 \
--name pn_cell_seg_yolo11s
python scripts/inference.py \
--weights runs/segment/pn_cell_seg_yolo11s/weights/best.pt \
--source dataset/data/images/ \
--conf 0.25 \
--save_viz
yolo11s-seg.pt (COCO pre-trained)Pseudo_nitzschia_cell)| Parameter | Value |
|---|---|
| Epochs | 100 |
| Batch size | 24 |
| Image size | 640 |
| Optimizer | auto (SGD) |
| Initial LR | 0.01 |
| Final LR factor | 0.01 |
| Weight decay | 0.0005 |
| Warmup epochs | 3.0 |
| Patience (early stopping) | 30 |
| IoU threshold (NMS) | 0.7 |
| Augmentation | hsv, translate, scale, fliplr, erasing |
├── best.pt # Model weights
├── configs/
│ └── cell_seg.yaml # Dataset config (relative paths)
├── scripts/
│ ├── train_yolo.py # Training script
│ ├── inference.py # Inference & cell counting
│ ├── prepare_dataset.py
│ ├── coco_to_yolo_seg.py
│ ├── utils.py
│ ├── sample_inference.py
│ └── run_inference_on_dataset.py
├── results/ # Training metrics & curves
├── args.yaml # Full training arguments
└── requirements.txt
Trained on patcdaniel/pseudo-nitzschia-cell-segmentation — 302 annotated IFCB images from IFCB104 (Santa Cruz Municipal Wharf).
@model{pseudo_nitzschia_yolo11s_seg,
author = {Daniel, Patrick C.},
title = {Pseudo-nitzschia Cell Counter — YOLO11s-seg},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/patcdaniel/pseudo-nitzschia-yolo11s-seg}
}
--- license: mit tags: - yolo - ultralytics - instance-segmentation - object-detection - phytoplankton - pseudo-nitzschia - ifcb - cell-counting - marine-biology pipeline_tag: image-segmentation datasets: - patcdaniel/pseudo-nitzschia-cell-segmentation --- # Pseudo-nitzschia Cell Counter — YOLO11s-seg A YOLO11s instance segmentation model fine-tuned to detect and count individual *Pseudo-nitzschia* cells within chain colonies in Imaging FlowCytobot (IFCB) images. **Try it out:** [Interactive demo on HF Spaces](https://huggingface.co/spaces/patcdaniel/pseudo-nitzschia-counter) ## Performance | Metric | Box | Mask | |--------|-----|------| | Precision | 0.983 | 0.983 | | Recall | 0.965 | 0.965 | | mAP50 | 0.976 | 0.973 | | mAP50-95 | 0.706 | 0.659 | Trained for 100 epochs on Apple MPS (M-series GPU). Training time: ~1.5 hours. ### Training Curves  ### Confusion Matrix  ## Quick Start ```python from ultralytics import YOLO from huggingface_hub import hf_hub_download # Download model model_path = hf_hub_download("patcdaniel/pseudo-nitzschia-yolo11s-seg", "best.pt") model = YOLO(model_path) # Run inference results = model("image.png", conf=0.25) # Count cells for r in results: n_cells = len(r.masks) if r.masks is not None else 0 print(f"Detected {n_cells} cells") ``` ## Training ### 1. Download the dataset ```bash huggingface-cli download patcdaniel/pseudo-nitzschia-cell-segmentation \ --repo-type dataset --local-dir ./dataset ``` ### 2. Train ```bash python scripts/train_yolo.py \ --config configs/cell_seg.yaml \ --model yolo11s-seg.pt \ --epochs 100 \ --batch 24 \ --name pn_cell_seg_yolo11s ``` ### 3. Evaluate ```bash python scripts/inference.py \ --weights runs/segment/pn_cell_seg_yolo11s/weights/best.pt \ --source dataset/data/images/ \ --conf 0.25 \ --save_viz ``` ## Model Details - **Architecture:** YOLO11s-seg (Ultralytics) - **Base weights:** `yolo11s-seg.pt` (COCO pre-trained) - **Input size:** 640x640 - **Classes:** 1 (`Pseudo_nitzschia_cell`) - **Parameters:** ~11.8M - **Model size:** 20 MB ### Training Hyperparameters | Parameter | Value | |-----------|-------| | Epochs | 100 | | Batch size | 24 | | Image size | 640 | | Optimizer | auto (SGD) | | Initial LR | 0.01 | | Final LR factor | 0.01 | | Weight decay | 0.00...
Source context: 16 downloads · 0 likes · Pipeline image-segmentation · Library ultralytics · Repo patcdaniel/pseudo-nitzschia-yolo11s-seg