Lab Note · updated 2026-06-20
Choosing a Bioimage Analysis Pipeline — Off-the-Shelf vs Custom
Most microscopy questions are answered by composing existing, validated tools — and a custom pipeline is justified only when off-the-shelf options fail on a specific, identifiable axis. This note gives the decision criteria and the signals that you have genuinely crossed into custom territory.
The problem — Two opposite mistakes are equally common. One team rebuilds from scratch what a pre-trained model and a batch runner would have solved in an afternoon; another bolts mismatched off-the-shelf tools together past the point where they fit the data, and ships a number nobody can defend. The decision — compose existing tools or build custom — should be made deliberately, against criteria, not by reflex or résumé.
The default is composition. Most pipelines should be assembled from validated parts: a segmenter (Cellpose for irregular cells, StarDist for star-convex nuclei), a feature/measurement platform (CellProfiler for screening, QuPath for tissue), and a reproducible runner (Snakemake) to make it re-executable. Start here — the ecosystem map tells you which cell each part belongs to. Composition wins because each part is already peer-reviewed and community-validated; you inherit that evidence instead of generating it.
Decision criteria — go custom only when an off-the-shelf axis fails.
- Accuracy gap that matters. A generalist model underperforms on your morphology and the gap changes the biological readout — judged with a task-appropriate metric, not a convenient one (Metrics Reloaded). A custom-trained nnU-Net is justified here — but only with 50+ annotated cases and GPU access.
- Modality or task with no tool. A novel acquisition, an unusual sample, or a measurement nothing in the ecosystem produces.
- Scale or integration constraints. Throughput, latency, or instrument-loop coupling that no GUI tool can meet.
- A hard interoperability seam. Tools that can't hand off cleanly — see interoperability.
If none of these holds, custom code is liability, not progress — every bespoke stage is unvalidated surface area and future maintenance, the hidden technical debt you now own.
Where it breaks — Premature custom-building fails the same way across platforms. In Cell Painting, a hand-rolled segmenter forfeits the community benchmarking a stock model carries, so its errors are unaudited. In digital pathology, a custom slide reader re-implements gigapixel tiling that QuPath already validated. In light-sheet, bespoke stitching diverges from BigStitcher's tested geometry. In spatial omics, a one-off transcript-assignment step has no reference to validate against. The discipline is to treat "custom" as a decision with a cost, gated by a failed criterion and paid for with validation evidence — because the model isn't the system and a custom stage must be verifiable like any other.
References
- Stringer et al. (2021). Cellpose: a generalist algorithm for cellular segmentation. Nature Methods.
- Isensee et al. (2021). nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation. Nature Methods.
- Mölder et al. (2021). Sustainable data analysis with Snakemake. F1000Research.
- Maier-Hein, Reinke et al. (2024). Metrics Reloaded: Recommendations for Image Analysis Validation. Nature Methods.
- Sculley et al. (2015). Hidden Technical Debt in Machine Learning Systems. NeurIPS.
References
- Stringer et al., Cellpose: a generalist algorithm for cellular segmentation (Nature Methods, 2021)
- Isensee et al., nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation (Nature Methods, 2021)
- Mölder et al., Sustainable data analysis with Snakemake (F1000Research, 2021)
- Maier-Hein, Reinke et al., Metrics Reloaded: Recommendations for Image Analysis Validation (Nature Methods, 2024)
- Sculley et al., Hidden Technical Debt in Machine Learning Systems (NeurIPS, 2015)