AI Navigate

Towards High-Quality Image Segmentation: Improving Topology Accuracy by Penalizing Neighbor Pixels

arXiv cs.CV / 3/20/2026

📰 NewsModels & Research

Key Points

  • It introduces SCNP (SameClassNeighborPenalization), a method that improves topology accuracy in image segmentation by penalizing each pixel's logits with its poorest-classified neighbor.
  • The approach forces the model to refine neighboring pixels before improving a given pixel, aiding in preserving the correct number of components and structures.
  • It is designed to be efficient and easy to integrate, compatible with three segmentation frameworks and multiple loss functions across semantic and instance segmentation.
  • The authors validate SCNP on 13 datasets with diverse morphologies and modalities and provide code at https://jmlipman.github.io/SCNP-SameClassNeighborPenalization.

Abstract

Standard deep learning models for image segmentation cannot guarantee topology accuracy, failing to preserve the correct number of connected components or structures. This, in turn, affects the quality of the segmentations and compromises the reliability of the subsequent quantification analyses. Previous works have proposed to enhance topology accuracy with specialized frameworks, architectures, and loss functions. However, these methods are often cumbersome to integrate into existing training pipelines, they are computationally very expensive, or they are restricted to structures with tubular morphology. We present SCNP, an efficient method that improves topology accuracy by penalizing the logits with their poorest-classified neighbor, forcing the model to improve the prediction at the pixels' neighbors before allowing it to improve the pixels themselves. We show the effectiveness of SCNP across 13 datasets, covering different structure morphologies and image modalities, and integrate it into three frameworks for semantic and instance segmentation. Additionally, we show that SCNP can be integrated into several loss functions, making them improve topology accuracy. Our code can be found at https://jmlipman.github.io/SCNP-SameClassNeighborPenalization.