Skip to content

How do you evaluate image segmentation when small objects matter?

A mask can overlap nearly all foreground pixels while missing half the objects. Evaluate the unit that your next decision depends on.

Evaluate image segmentation with both pixel overlap and object-level outcomes, broken out by object size. A high foreground intersection over union (IoU) can coexist with poor recovery of small objects because a large region contributes more pixels. If the next step counts items, flags defects or measures individual regions, test whether each relevant object is found, separated and usable, not only whether the combined mask looks right.

For your own comparisons, Nodus Jobs can execute an evaluation and make saved reports downloadable. The scoring plan still belongs to you. Decide what counts as a usable object before spending compute on a larger comparison.

IoU is the area of overlap between a prediction and its reference divided by the area covered by either. It answers a useful question about masks. It does not, on its own, answer how many separate objects were recovered.

The aggregation matters. Pooled foreground IoU counts all foreground pixels together. Averaging class scores gives classes more equal influence, but a rare small object can still disappear inside a class dominated by larger instances. Averaging image scores gives images equal influence, not objects.

Write down which average you report. The label “mean IoU” is not enough to establish that every object size has been tested fairly. A metric can be correct while answering the wrong operational question.

A worked example: 99% overlap, half the objects missed

Section titled “A worked example: 99% overlap, half the objects missed”

This example is fictional and illustrative, not a measured model result. Consider an image containing two separate objects of the same class. Their reference masks do not overlap.

Object Reference area Predicted area Correct overlap
Large object 9,900 pixels 9,900 pixels 9,900 pixels
Small object 100 pixels 0 pixels 0 pixels

Assume the prediction covers the large object exactly, misses the small object entirely and adds no false foreground pixels. Pooled foreground IoU is 9,900 divided by 10,000, or 99%.

But only one of the two objects was found. Under an illustrative object-matching rule requiring at least 0.5 IoU, with each prediction matched to at most one reference, object recall is one divided by two, or 50%. Object precision is 100% because the only predicted object is correct. Neither precision nor pixel overlap reveals the missing item alone.

These numbers describe different properties, not contradictory evaluations. The 99% figure can support a claim about total foreground area in this example. It cannot support a claim that nearly every object is recovered. A counting or inspection process needs the second question answered explicitly.

Start with what consumes the mask.

  • Total coverage or area: pixel overlap and area error may be central, but check whether localized misses matter independently.
  • Counting or finding items: object recall, false positives and duplicate detections matter, alongside correct separation.
  • Measuring each item: include per-object area or dimension error under a documented measurement convention.
  • Tracing outlines: assess boundary quality at a tolerance appropriate to image resolution and the intended task.

Semantic segmentation assigns classes to pixels; it does not necessarily identify individual objects. If counting matters, instance annotations and an agreed separation rule are needed. Do not silently turn connected regions into ground-truth objects: touching items can form one region, while a single item can appear in disconnected pieces.

Keep the decision consistent across candidates. Otherwise, one model can seem better simply because its outputs are interpreted more generously.

Compare size slices without hiding the denominator

Section titled “Compare size slices without hiding the denominator”

Define size groups from reference annotations before examining the final comparison. Use units that match the decision. Pixel area is helpful for a fixed imaging setup. When image resolution or capture distance varies, relative image area or a calibrated physical measure may be more meaningful.

For each group, report the number of reference objects, matched objects and missed objects. Show precision or false-positive counts too. Recall alone can reward a model that marks many irrelevant regions.

Attach a false-positive denominator that reflects review effort, such as false alarms per image. Unmatched predictions have no reference size, so do not assign them to a reference-size group by guesswork. Report them separately, or state a prediction-size grouping explicitly.

Keep all size groups visible even if one has few examples. A sparse group means limited evidence, not demonstrated reliability. Many pixels from a few large images do not substitute for many independently captured small objects.

For instance-level evaluation, define when a predicted object and a reference count as a match. State the overlap threshold, class agreement and one-to-one matching convention. Established instance-segmentation benchmarks evaluate across overlap thresholds; a single chosen threshold should not be presented as universally correct.

Then inspect failures that summary scores can obscure:

  • A miss has no acceptable corresponding prediction.
  • A split represents one reference object as multiple predicted objects.
  • A merge represents several reference objects as one predicted object.
  • A false positive predicts an object that should not be there.

One-to-one matching prevents duplicate predictions from all receiving credit for the same reference. It does not make every split or merge harmless. If the downstream task needs correct counts, review those cases directly and record their effect on the count.

Keep a fixed matching convention for the comparison, rather than changing it to favor whichever candidate looks better.

Separate boundary sensitivity from an actual miss

Section titled “Separate boundary sensitivity from an actual miss”

Small objects have fewer pixels, so a similar outline displacement can have a larger effect on their IoU than on a large region. Before rejecting a candidate on small-object overlap, inspect whether it omitted the object, confused its class or drew a slightly different boundary.

Review annotation conventions with the same care. Do outlines include faint edges? Are partly visible objects included? How are uncertain regions marked? Disagreement in references can otherwise look like model instability.

A boundary-tolerant score can supplement overlap when the tolerance matches the real measurement task. Report the tolerance and original results together. Increasing tolerance until a model passes changes the question; it does not establish better segmentation.

Before the final run, define the failures that would block adoption. For an item-counting application, that may mean rejecting a candidate that improves pooled overlap while increasing small-object misses or merges. An area-estimation task may make a different tradeoff.

Save a compact comparison report containing the mask scores, size-slice counts, false alarms, split and merge examples, annotation limitations and the intended acceptance decision. Review representative failures, not only attractive overlays. Keep final decision images separate from the images used to choose settings.

Nodus’s Jobs guide describes running and monitoring your own programs. The outputs guide explains retrieving files your program saves. Those capabilities can support a repeatable comparison with saved evaluation reports; they do not supply segmentation labels, a managed evaluator or an accuracy guarantee. You remain responsible for model compatibility, image permissions, references and acceptance criteria.

If you want to discuss compute for your own segmentation comparisons, book a conversation with Nodus.

Is mean IoU enough for small-object segmentation?

Section titled “Is mean IoU enough for small-object segmentation?”

Not if the decision depends on finding individual objects. Specify the averaging convention, then add reference-size slices and object-level outcomes appropriate to the task.

No. Recall reveals misses but can hide false alarms, poor boundaries and inaccurate areas. Use complementary measures tied to the downstream decision.

What IoU threshold should define a detected object?

Section titled “What IoU threshold should define a detected object?”

There is no universal threshold. Use a documented benchmark convention when comparing benchmark results, and separately justify the threshold for your own task. Keep it fixed across candidates.

Can I evaluate counting from semantic masks alone?

Section titled “Can I evaluate counting from semantic masks alone?”

Only with an explicit, validated object-separation convention and suitable references. A semantic foreground region is not automatically one countable object.

More from the blog