Classification, learned models and evaluation

Learned models and image-result evaluation live both inside and outside ops. Their public APIs belong in the catalog even though they do not all have a BlockOp wrapper. Feature flags enable specific adapters; they do not imply that a GPU is available on the machine.

Available operations

classify

Source.

Entry points: ForestPredictor, predict_workflow, sample_workflow, train_workflow.

Predict pixel classes from named feature stacks, gather labeled training samples and fit the native random forest. Keep feature channel names/order and class mapping fixed between training and prediction.

Execution: Planned inference/sample workflows plus resident training through the top-level forest module; training sample memory is separate from block inference.

Prediction support comes from the features. Once a feature vector exists, forest prediction is pointwise. Creating its Gaussian, derivative, Hessian or tensor channels introduces the union of those image dependencies and can dominate both halo size and memory. A zero-reach classifier is therefore not evidence that its entire image pipeline is pointwise.

Training samples have a separate lifetime from inference blocks. Label sampling policy, class imbalance, random seed and feature schema determine the learned model. Store them with the forest and test held-out images, including seam locations. A model serialized successfully can still be scientifically invalid if inference uses another feature order or intensity calibration.

Image APIs outside ops

Module Available capability Execution and features
forest Serializable random forests, sample representation and training specification. Resident model fitting/prediction primitives; ops::classify supplies image workflows.
classical_centers Candidate responses, Otsu-based selection, physical-distance suppression and seed painting. Planned candidate/selection phases; global candidate state can grow. Zarr finalization uses zarr.
model_segment InstanceSegment, SegmentBackend, 2D/3D instance row/label publication and Cellpose flow utilities. model-segment; actual backends require cellpose or stardist. Tile geometry and model context define seams.
sam / sam_training Prompted SAM-family inference and native training integration. sam; optional sam-cuda. Prompt/model limits remain explicit.
yolo / yolo3d Detection/annotation and volumetric model workflows. yolo or yolo3d; backend-specific CUDA variants are separate features.
model_registry / model_training / model_worker Immutable model bundles, class schemas, annotation/training contracts and bounded worker protocol. Integration infrastructure; not evidence that every model runs on every backend.
gpu Accelerated selects supported device kernels beside CPU references. gpu-cuda or gpu-wgpu for device execution; no blanket acceleration of every catalog operation.
segmentation_metrics VOI, adapted Rand, edit counts, boundary F1, skeleton recall and ERL/NERL. Resident score kernels and contingency-table score construction. Explicit background and physical tolerance conventions matter.
agreement Overlap-based matched, split, merged, missed and spurious region comparisons. Label IDs may differ; comparison is by overlap, not numeric identity.
track Frame linking, sparse assignment, gap closing, lineage graphs, matching and evaluation. Operates on per-frame detections; time is a collection axis, not an extra image-block dimension.
synthetic / synthetic_tissue Seeded image/label fixtures, dense tissue and image-formation models. Region rendering for tests and examples; preserve the declared ground truth and seed.

Model execution checks

Normalize and resize inputs according to the model’s own contract. A model’s inference context, output crop and object ownership need independent verification at tile seams. Compare output geometry and labels on multiple block grids rather than inferring correctness from an attractive preview.

Use cargo run --release and cargo test --release for runnable examples and checks. CUDA feature names and dependencies differ between models; consult the manifest and the particular example instead of enabling every backend together.