Refinement Strategies#
After detection, the raw binary mask and labeled object map often contain artifacts. Refiners clean up these artifacts without re-running detection.
Common Artifacts#
Artifact |
Cause |
Refiner |
|---|---|---|
Border objects |
Partial colonies at image edges |
|
Small fragments |
Noise, agar texture |
|
Holes in masks |
Uneven colony interior intensity |
|
Jagged edges |
Threshold quantization |
|
Touching colonies merged |
Threshold too low |
|
One colony fragmented |
Threshold too high |
|
Multiple detections per well |
Over-segmentation in grid plates |
|
Oversized objects |
Merged colonies spanning wells |
|
Refinement Order#
The recommended refinement sequence:
BorderObjectRemover — remove partial edge colonies first
SmallObjectRemover — remove noise fragments
MaskOpener — smooth boundaries and break thin bridges
MaskFill — fill interior holes
Grid-specific refiners — align, reduce multiples, remove oversized
This order ensures that each refiner operates on progressively cleaner masks.
Morphological Refiners#
Morphological operations use a structuring element (footprint) to reshape mask boundaries.
MaskOpener (erosion → dilation) — removes small protrusions, breaks thin bridges between touching colonies
MaskCloser (dilation → erosion) — fills small gaps, bridges narrow breaks in fragmented colonies
MaskDilator — expands mask boundaries outward
MaskEroder — shrinks mask boundaries inward
MaskFill — fills enclosed holes using binary flood fill
The width parameter controls the footprint size. Larger footprints
produce more aggressive changes.
Grid-Specific Refiners#
These refiners use grid position information and are only available
for GridImage:
GridAligner — rotates the image to align the grid
GridOversizedObjectRemover — removes objects larger than expected for a single well
ReduceMultipleGridObjects — when multiple objects are in one grid section, keeps only the most prominent
MergeGridObj — merges all objects within a grid section into one
Tuning Strategy#
Start with the default refiner chain in a prefab pipeline. If the results are not satisfactory:
Check the overlay — identify which artifact type persists
Add or adjust the corresponding refiner
Adjust
min_size,width, orborder_sizeparametersRe-run and compare