What it does¶
InstanSeg draws an outline around every cell, or every nucleus, using all the markers of a multiplex panel at once, however many there are.
Parameters¶
use_instanseg: turns InstanSeg on.pixel_size, required: your image’s pixel size in µm. InstanSeg rescales the image to its model’s resolution with it; without it, a run could finish with few or no cells, so the pipeline stops at startup instead.instanseg_channels: the markers it reads. By default, from the marker sheet:dnaandmarkerchannels for cells,dnaonly for nuclei. Required for a stitched image you bring yourself, which has no marker sheet.segment_cellsandsegment_nuclei: cells, nuclei or both.instanseg_model_typeandinstanseg_kwargsfor other models and options.patch_width_pixel: memory grows with patch area times the number of markers; see Patch size.
More in Methods and targets.
How it works¶
For every pixel the network predicts a seed map, the distance to the nearest object boundary, and an embedding, a short vector describing where the pixel sits within its object. Seeds are the local maxima of the seed map. For each seed, a small network compares every nearby pixel’s embedding with the seed’s and outputs the probability that the pixel belongs to that object. Seeds in the same object are merged, and each pixel goes to its most probable object. The authors report at least 60 % less processing time than the most widely used methods Goldsborough et al., 2024.
For multiplexed fluorescence, a front end called ChannelNet treats the markers as an unordered set. Each marker passes through the same network, their features are pooled, and the result is a fixed three-channel image, whatever the number or order of markers. Two branches then predict nuclei and whole cells. Training images were resized to 0.5 µm per pixel Goldsborough et al., 2024.

(a) ChannelNet: each channel passes through the same network, and features are shared across channels by max pooling, so the number and order of channels do not matter. (b) Two multiplexed images: eight input channels, the three-channel representation, and the predicted nuclei and cells. Reproduced from Goldsborough et al., 2024, CC BY 4.0.
The model is fluorescence_nuclei_and_cells unless you name another. Through sopa, InstanSeg
returns one target at a time, so nuclei and cells are two passes over every patch.
Autofluorescence, blank and removed channels are left out, and the image is not smoothed or
contrast-enhanced first.
Inputs and outputs. In: one patch of the full image, with the selected markers (never the
projection). Out: polygons in the store, instanseg_cells and with nuclei
instanseg_nuclei, then a table instanseg_table after quantification. See
The SpatialData store.
Similar tools¶
Cellpose and Mesmer (Greenwald et al. 2022) take one or two input images, so a multiplex panel must be reduced to a nuclear and a membrane image first.
InstanSeg reads every marker the sheet lists as a nuclear stain or marker, without picking two by hand. Next to Cellpose it gives a second opinion on the same image: each method gets its own table, and when both segment cells the QC compares them.
Read more¶
InstanSeg: Goldsborough et al., 2024.
InstanSeg for multiplexed images: Goldsborough et al., 2024.
Version used:
| Module | Tool | Version | Container | Paper |
|---|---|---|---|---|
| SEGMENT_PATCH | InstanSeg | docker.io/josenimo/sopa:2.3.0-1 | Goldsborough et al. (2024) |
- Goldsborough, T., Philps, B., O’Callaghan, A., Inglis, F., Leplat, L., Filby, A., Bilen, H., & Bankhead, P. (2024). InstanSeg: an embedding-based instance segmentation algorithm optimized for accurate, efficient and portable cell segmentation. arXiv. 10.48550/ARXIV.2408.15954
- Goldsborough, T., O’Callaghan, A., Inglis, F., Leplat, L., Filby, A., Bilen, H., & Bankhead, P. (2024). A novel channel invariant architecture for the segmentation of cells and nuclei in multiplexed images using InstanSeg. 10.1101/2024.09.04.611150
- Greenwald, N. F., Miller, G., Moen, E., Kong, A., Kagel, A., Dougherty, T., Fullaway, C. C., McIntosh, B. J., Leow, K. X., Schwartz, M. S., Pavelchek, C., Cui, S., Camplisson, I., Bar-Tal, O., Singh, J., Fong, M., Chaudhry, G., Abraham, Z., Moseley, J., … Van Valen, D. (2021). Whole-cell segmentation of tissue images with human-level performance using large-scale data annotation and deep learning. Nature Biotechnology, 40(4), 555–565. 10.1038/s41587-021-01094-0