Computer vision answers · Microscopy
How do I count cells or microorganisms in microscope images with computer vision?
Without clicking through every field of view by hand.
Short answer
Train an object detection model to find each cell in an image with Roboflow for free, then count the detections. Give each cell type or life stage its own class, and you get a separate count for each. Labeling touching cells one by one, and splitting large images into tiles, is what keeps counts accurate in crowded fields.
Skip the setup. Describe your images.
Describe your images and what you need to find. The agent sets up labeling, training and deployment with you.
Key facts
- What you need
- Microscope images and a detection model trained on your cells
- What you get
- A count per image and per class, with every cell marked
- Image sources
- Microscope camera captures, slide scans and exported files
- Runs on
- Cloud API, or a lab workstation running Docker

How to build cell counting, step by step
Five steps from a folder of microscope images to a count you can record.
Collect images that match how you will run it
Label every cell, with one class per type
Train a detection model for small objects
Count the detections in each class
Pythonimport supervision as sv from collections import Counter from inference import get_model model = get_model("your-project/1") result = model.infer("slide_001.png", confidence=0.4)[0] detections = sv.Detections.from_inference(result) print(Counter(detections.data["class_name"])) # Counter({'active': 37, 'cyst': 12})Rather not write code? Ask the Roboflow agent to set this up for you
Run every image and record the counts
Why 2 million engineers build on Roboflow
Label faster
Auto-label with SAM 3 or your own model, then fix the misses instead of drawing every box.
RF-DETR
Roboflow’s open-source real-time detection model, built for accuracy (opens in a new tab) on small objects.
Logic built in
Counting, zones, tracking and alerts are ready-made Workflow blocks, so there is less code to write.
Your model, your weights
Use your trained weights on every plan, including free, through the open-source Inference package.
Run it anywhere
Self-host on a workstation, Docker, an on-prem GPU or an edge device, or call the cloud API.