Blog

Validating Cell Segmentation in Multiplex Immunofluorescence

Validate multiplex IF cell segmentation with practical QuPath boundary checks, split/merge review, marker compartments, and held-out evaluation.

To validate cell segmentation in multiplex immunofluorescence, test three things separately: whether individual nuclei are detected, whether the assigned cell boundaries are defensible, and whether marker measurements belong to the intended cells. A convincing nuclear overlay does not establish that the surrounding membrane or cytoplasm has been segmented correctly. QuPath explicitly describes nucleus expansion as an approximation of cell area; the SITC image-analysis guidance also distinguishes nuclear detection from membrane-boundary identification.36

The practical workflow below is a proposed research-use validation plan, not an assay standard or a universal acceptance threshold. It combines documented QuPath controls with a review worksheet you can adapt to your tissue, panel, and endpoint. Menu paths refer to the QuPath 0.7 documentation; check the version and extensions installed in your own environment.2

Decision schematic separating nuclear detection, boundary estimation, and marker assignment before held-out review

Original workflow schematic, not microscopy data; no quantitative performance is depicted.

Define what the segmentation must support

Before changing parameters, write an intended-use statement. “Count nuclei in viable tumor” and “measure membrane-marker coexpression at a tumor–immune interface” are different validation tasks. The first asks mainly whether objects are present and separately identified. The second also asks whether the sampled signal belongs to the correct object. Published nuclear benchmarking evaluates detection and boundary agreement separately through object matching and overlap criteria; it does not turn a nuclear benchmark into whole-cell validation.4

Use the following planning table to choose what you will review. These are proposed checks, not requirements that every panel must satisfy.

Intended measurement Mask that needs evidence Review question
Nuclei per tissue area Nuclear instances Are nuclei missed, split, merged, or falsely detected?
Nuclear-marker positivity Nuclear instances and marker assignment Does the measured signal sit inside the intended nucleus?
Cytoplasmic-marker intensity Cytoplasmic region, with its definition recorded Does expansion capture relevant cytoplasm without collecting a neighbor?
Membrane-associated phenotype Boundary region used for the measurement Is a bright border assigned to the correct cell?
Cell-to-cell proximity Objects plus the coordinate or boundary definition Is the endpoint centroid distance, boundary distance, or another explicitly defined measure?

Keep the claim as narrow as the evidence. If your panel supports nuclear instances and a perinuclear measurement region, describe those outputs that way. Do not label the outer contour a verified biological membrane merely because the software calls the object a cell.

Build a reference set before tuning

For this workflow, create separate development and held-out evaluation lists before comparing settings. Keep regions from the same specimen together when dividing these lists, so that a nearby crop is not treated as an independent test of generalization. Record the grouping rule and any unavoidable overlap in specimen origin. This is a proposed safeguard for this plan, not a prescribed split ratio.

Choose fields that cover the conditions you expect to analyze: sparse and dense tissue, tumor and stroma, small and large nuclei, weak nuclear staining, bright neighboring marker expression, and relevant tissue interfaces. Include both routinely usable fields and known difficult fields; label their sampling purpose. A challenge set can expose failures, but should not silently replace the planned evaluation sample. The SITC guidance calls for representation of anticipated variation across distinct specimens and specialist visual verification.6

Write annotation rules before drawing reference masks:

  • Define the nuclear edge and how touching nuclei are separated.
  • State how partial objects at the review-window edge are handled.
  • Record how fragmented, damaged, or ambiguous objects are labeled.
  • Separate artifacts excluded from analysis from difficult but eligible cells.
  • Decide whether reference contours describe nuclei, whole cells, or only an interpretable boundary segment.

Have a trained reviewer examine the reference annotations. Where feasible, obtain an independent second reading and resolve disagreements without consulting which candidate algorithm performed better. Retain unresolved cases as ambiguous rather than forcing a precise contour. SITC recommends verification by more than one pathologist or trained specialist where possible.6

A nuclear reference is not a whole-cell reference. If no channel reveals a defensible outer border, record that limitation. A review can then support nuclear detection and selected marker assignments without claiming complete membrane accuracy.

Practical QuPath boundary checks

Confirm the image and detection inputs

Set the image type to fluorescence and confirm channel names before measuring cells. QuPath’s multiplex tutorial notes that the default detector requires a channel suitable for detecting the nuclei of interest and that compartment measurements use channel names.1

Record the image calibration, detection resolution, input channel, detector or model identity, and relevant preprocessing. With StarDist, QuPath’s documentation explains that pixelSize follows the image calibration units; absent calibration, these may be pixels rather than micrometers. Check the units rather than copying a parameter value from another project.3

Save the development configuration before testing. Do not rerun a destructive detection script on the only copy of reviewed annotations or measurements.

Inspect nuclei without outer-cell contours

In the documented interface, choose View → Cell display → Nuclei only. Use View → Show detections to alternate between the underlying image and the overlay, and turn off Fill detections when filled objects obscure edges. These are display controls; changing the view is not a new segmentation run.2

Review the nuclear channel first, without phenotype colors deciding what looks plausible. For each field, record missing objects, false objects, a single reference nucleus represented by several detections, and several reference nuclei represented by one detection. Use the same reference rules for every candidate configuration.

Check broad coverage at low zoom, then inspect individual boundaries at a readable scale. Save paired image-only and overlay views for important failures. An attractive selected field is useful for explanation, but the recorded review set should determine the evaluation.

Compare nuclear and outer-cell boundaries

Switch to View → Cell display → Nuclei & cell boundaries, then Cell boundaries only. QuPath documents both modes, with nuclear contours available only where the underlying objects contain them.2

Review the outer contour against channels that inform the intended measurement. At a crowded interface, ask whether the contour crosses a visible border, enters an adjacent bright cell, or reaches an acellular gap. For a large irregular cell, ask whether the estimated boundary omits relevant signal. Mark uncertainty where the image does not support an exact answer. Where the boundary stays unresolved, the H&E section of the same block is the steadier morphology reference, and our virtual multiplex IF guide covers bringing it beside the mIF section.

Do not infer a missing nucleus from a missing nuclear outline alone: check the detector output and object type. Likewise, a displayed outer contour can be an estimated measurement region rather than a membrane-derived boundary.

Inspect marker channels separately

Use View → Show channel viewer to compare individual channels, and inspect key channels in grayscale when color mixtures are distracting. These viewing options are documented in QuPath’s multiplex tutorial.1

For a suspicious positive object, alternate the marker-only view with the outlines. Identify the actual signal being sampled: inside the nucleus, around it, along a visible membrane, or in an adjacent cell. Capture the channel identity and display settings with the review image so another reviewer knows what they are looking at.

Use Measure → Show detection measurements to inspect the corresponding object measurements. Confirm the exact channel, compartment, and statistic used by the classifier rather than assuming a column labeled “mean” describes the intended compartment.2

Test expansion as an assumption, not a membrane measurement

QuPath’s StarDist documentation separates nuclear prediction from subsequent cell expansion. It describes distance-based expansion, a nucleus-size constraint, compartment measurements, and possible geometry-based expansion artifacts. These options belong to that implementation; do not assume identical behavior across all detectors.3

On the development set, compare a nucleus-only result with plausible expansion settings chosen for your application. There is no radius prescribed here. Keep the nuclear detection configuration unchanged when possible so that the comparison isolates boundary assignment. Record any detector that cannot vary expansion independently.

For each setting, inspect the same fields and ask:

  • Does the region collect signal from an adjacent bright cell?
  • Does it stop before the marker-bearing part of the intended cell?
  • Does it expand into tissue-free space or across an inappropriate compartment?
  • Does the conclusion change mainly for crowded cells or particular morphologies?
  • Are apparent failures caused by the outer contour, or by the original nuclear split or merge?

Then remeasure the marker outputs that depend on these regions. For the first sensitivity comparison, keep the marker rule fixed and log which objects change classification. If you subsequently retune the classifier, label that as a separate analysis; otherwise, changes to boundaries and changes to thresholds become difficult to disentangle.

The result need not be a single “best radius.” It may justify a restricted use case, a different boundary-aware method, or a decision that this panel cannot support a proposed membrane endpoint. SITC describes the limitations of nuclear-only approaches in morphologically diverse tissue and highlights challenges in densely packed cells.6

Separate split/merge errors from boundary errors

Use a failure taxonomy alongside aggregate scores. The following is a proposed review aid, not a mutually exclusive set of metric definitions.

Failure pattern What to check in the image What to log
Missed nucleus Eligible reference object with no corresponding detection Reference ID and reason, if interpretable
False object Detection on artifact, background, or another ineligible structure Detection ID and artifact category
Split Multiple detections assigned to one reference instance All involved IDs and the reference decision
Merge One detection covers multiple reference instances Involved reference IDs and crowding context
Boundary mismatch An identified instance has an unsupported contour Nuclear or outer-cell boundary, channel evidence
Signal borrowing A measurement region includes a neighbor’s marker signal Marker, compartment, neighboring object

Keep event counts distinct from false-positive and false-negative counts produced by the matching algorithm. A split or merge can contribute to those counts under a particular matching rule; do not add the categories together as if they were independent errors. Report the taxonomy and the matching procedure separately.

Stable total counts are not enough for this review. Inspect object correspondence: a missed object and an extra object elsewhere can leave the same total while assigning measurements to different locations. This is a logical reason for retaining instance-level review, not a claim about any dataset’s error rate.

Match marker measurements to their compartments

Create a marker-to-measurement map before accepting phenotype calls. Record the marker, expected localization for the assay, chosen object compartment, statistic, and review evidence. QuPath can measure channels in different compartments and permits classifiers based on selected measurements; the operator must choose which measurements are relevant.1

Do not treat a whole-cell average, a nuclear average, and a boundary-region statistic as interchangeable. For this validation plan, review nuclear-marker assignments against the nuclear contour and boundary-associated assignments against the actual region used to sample the border. Where the detector’s “cytoplasm” is derived from expansion, document that construction rather than presenting it as an independently observed anatomical compartment.

If a phenotype becomes implausible, check boundary assignment before adjusting positivity thresholds. Also inspect the raw channels: spatially displaced signal, spectral contamination, or staining artifacts require their own investigation. This article’s boundary checks do not replace upstream image or assay QC. SITC treats unmixing, segmentation, and phenotyping as separate stages requiring verification,6 and segmentation sits inside a wider chain of stages that our mIF image analysis workflow article sets out.

Evaluate the locked workflow on held-out specimens

Once the development decisions are complete, freeze the detector, model, preprocessing, expansion, marker-measurement map, and evaluation rules. Apply them to the held-out list without case-by-case tuning. If the test reveals a failure that leads to a revised workflow, record the revision and do not present the reused evaluation material as untouched evidence.

For nuclear instances, report object-level precision, recall, and F1 using an explicit reference-matching procedure. Specify the overlap criterion, assignment rule, edge-object handling, and eligible-reference denominator. The published mIF benchmark evaluates object-based scores at different intersection-over-union criteria, illustrating that evaluation depends on what counts as a match.4

Keep pixel-overlap summaries distinct from instance-detection scores. State whether results are pooled over objects, summarized across fields, or presented by specimen. Preserve results for difficult tissue or crowding categories rather than hiding them in one overall figure. The same benchmark reports tissue- and density-dependent differences; its findings are not a universal pass threshold for another panel.4

For outer-cell masks, use independently reviewed whole-cell references where the image supports them. Otherwise report the narrower boundary and marker-assignment checks actually performed. Add the downstream endpoint review relevant to your study, such as phenotype agreement or robustness of a specified spatial measurement. Agreement alone should not be relabeled complete boundary accuracy.

Set project-specific acceptance criteria before examining the final results. Document the rationale, required review strata, failure-handling policy, and intended-use limits. This guide supplies no universal IoU cutoff, F1 target, or minimum annotation count.

Keep an acceptance record that another analyst can use

The accompanying blank segmentation acceptance worksheet records one review unit per row. Its field guide explains identifiers, units, missing values, and the distinction between observations and acceptance decisions. It contains no example measurements or preapproved limits.

Retain the configuration, reference rules, field list, reviewed overlays, evaluation method, results, unresolved cases, and reviewer decision together. A versioned script and parameter set are what make that record re-runnable by someone else, and our guide to a reproducible mIF workflow covers that layer. If a new panel, scanner workflow, model, or tissue context changes the validated scope, document which checks need repeating rather than assuming the old decision transfers.

For a software evaluation, TerryDR’s mIF image analysis software page lists TR-Seg with nucleus, membrane, and dense-cell segmentation modes. Treat that as a manufacturer description, not evidence of performance on your panel.7

Bring your intended endpoint, representative difficult fields, reference annotations, and acceptance plan to that discussion. Ask which outputs can be inspected and exported, and verify those details during the evaluation. The same held-out review should apply to a commercial workflow as to an open-source one. Segmentation is one step of a qualified assay, not the whole of it; the analytical characteristics that sit upstream of it are covered in the mIF assay qualification guide.

Sources

[1] https://qupath.readthedocs.io/en/0.7/docs/tutorials/multiplex_analysis.html — QuPath 0.7: Multiplexed analysis

[2] https://qupath.readthedocs.io/en/0.7/docs/reference/commands.html — QuPath 0.7: Commands

[3] https://qupath.readthedocs.io/en/0.7/docs/deep/stardist.html — QuPath 0.7: StarDist

[4] https://pmc.ncbi.nlm.nih.gov/articles/PMC12125308 — Sankaranarayanan et al. (2025): Quantitative benchmarking of nuclear segmentation algorithms in multiplexed immunofluorescence imaging for translational studies

[6] https://pmc.ncbi.nlm.nih.gov/articles/PMC11749220 — SITC: Updates and best practices for multiplex IHC/IF image analysis and data sharing

[7] https://www.pathoaxis.com/software — TerryDR: mIF Image Analysis Software

Ready to run this on your own slides?

Send us a sample image or your panel design. A TerryDR specialist replies within one business day with a flat analysis plan or a product recommendation.

Talk to a TerryDR specialistSee the mIF analysis service →
✉ Contact Us