Skip to content

AI Models

EVAnalyzer can run pretrained deep-learning models as a segmentation step in a pipeline, in builds with the ai Cargo feature enabled (via tch-rs/libtorch). Models are supplied by you as a TorchScript export (.pt/.pth) - EVAnalyzer does not bundle or download any models itself.

Looking for the opposite direction - a model built from your own annotations rather than one you supply? See Training a Classifier, which trains a Random Forest, k-Nearest Neighbors, or neural-network pixel/object classifier from examples you paint directly on your images.

Four architectures are currently implemented as pipeline commands:

ModelPredictsSeparates touching objects?
StardistStar-convex polygon per object instanceYes, directly
UNetPer-pixel foreground/background maskNo - requires a follow-up step
CellposeFlow field (dY/dX) + cell-probability map, via a Cellpose-SAM modelYes, directly (via flow dynamics)
YOLOv5Box, class and (for -seg models) mask per objectYes, directly

Stardist represents each detected object as a star-convex polygon: a set of radial distances from the object centroid to its boundary, sampled at fixed angles. Because the model predicts complete object instances directly, EVAnalyzer’s Stardist command needs no follow-up splitting step - touching, non-overlapping objects (e.g. nuclei) come out already separated.

When to use it: objects that are roughly convex and don’t overlap - stained nuclei are the classic case.

See the Stardist command reference for parameters and model output requirements.


U-Net is a convolutional encoder–decoder network with skip connections between matching encoder/decoder levels, which preserve fine spatial detail lost during downsampling. EVAnalyzer’s UNet command only extracts a semantic foreground mask - it has no concept of individual object instances, so touching objects come out as one merged blob unless you address it explicitly:

  • Boundary-aware models (mask + boundary channels) - use the boundary channel to carve gaps between objects, then a plain Connected Components step.
  • Mask-only models - chain Connected Components → Watershed to split blobs that still have a “waist”.

When to use it: irregular or elongated shapes, or any model trained for pixel-level semantic segmentation rather than instance detection.

See the UNet command reference for the full parameter list and both splitting strategies.


Cellpose-SAM predicts a flow field: a vector at every pixel pointing toward the centre of the object it belongs to, plus a cell-probability map. It pairs Cellpose’s original flow-field dynamics with a transformer image encoder from Meta’s Segment Anything Model (SAM) for improved generalization over earlier, convolutional Cellpose versions. EVAnalyzer’s Cellpose command follows these flows pixel by pixel until they converge to a sink, then groups pixels that converge to the same sink into one instance - recovering individual objects directly, including ones with irregular or overlapping shapes that defeat star-convex polygons. Ready-made model exports are on the Downloads page.

When to use it: whole cells (cytoplasm), irregular morphology, or any case where objects aren’t well approximated by convex polygons.

See the Cellpose command reference for parameters, the download/setup workflow, and model output requirements.


YOLOv5 is a fast single-pass object detector. For every object it predicts a bounding box, a confidence and a class; segmentation models (yolov5*-seg) additionally predict the object’s mask. EVAnalyzer’s YOLOv5 command runs the model in overlapping 640×640 windows, merges duplicates with non-maximum suppression and maps each model class to a project segmentation class.

When to use it: models trained with the YOLOv5 tooling, objects of several types that one model should tell apart, or when only bounding-box detection is needed.

See the YOLOv5 command reference for parameters and export instructions.


Does the model predict individual object instances directly?
├─ Star-convex polygon export (probability + ray distances) → Stardist
├─ Flow field + cell-probability export (dY, dX, cellprob) → Cellpose
├─ YOLOv5 export (boxes + classes, optionally masks) → YOLOv5
└─ No, it's a semantic mask (foreground vs. background, optionally + boundary)
└─ UNet, with Connected Components (+ Watershed or boundary carving)