SharpContour: A Contour-based Boundary Refinement Approach for Efficient and Accurate Instance Segmentation

Chenming Zhu, Xuanye Zhang, Yanran Li, Liangdong Qiu, Kai Han, Xiaoguang Han

Abstract

Excellent performance has been achieved on instance segmentation but the quality on the boundary area remains unsatisfactory, which leads to a rising attention on boundary refinement. For practical use, an ideal post-processing refinement scheme is required to be accurate, generic, and efficient. However, most existing approaches propose pixel-wise refinement, which either introduces a massive computation cost or is designed specifically for different backbone models. Contour-based models are efficient and generic to be incorporated with any existing segmentation methods, but they often generate over-smoothed contours and tend to fail on corner areas. In this paper, we propose an efficient contour-based boundary refinement approach, named SharpContour, to tackle the segmentation of boundary areas. We design a novel contour evolution process together with an Instance-aware Point Classifier. Our method deforms the contour iteratively by updating offsets in a discrete manner. Differing from existing contour evolution methods, SharpContour estimates each offset more independently so that it predicts much sharper and accurate contours. Notably, our method is generic to seamlessly work with diverse existing models with a small computational cost. Experiments show that SharpContour achieves competitive gains whilst preserving high efficiency.

Introduction

While modern instance segmentation models like Mask R-CNN are highly effective at identifying and localizing objects, they often struggle with the "fine print"—the exact boundaries. Masks generated by these models tend to be low-resolution and blurry, failing to capture the intricate details of real-world objects. The challenge lies in the trade-off between accuracy, efficiency, and generality. Pixel-wise refinement methods are often computationally heavy and tied to specific architectures. Meanwhile, previous contour-based methods often use techniques like circular convolutions that link all vertices together, which inadvertently "smooths out" the very details, such as sharp corners, that need preserving.

SharpContour addresses these limitations by introducing a method that takes a coarse initial contour and iteratively deforms it to match the object's true boundary. By focusing on independent vertex movement and instance-specific classification, it achieves significantly crisper boundaries with minimal computational overhead.

Methodology

The core of SharpContour is a novel evolution process that deforms an initial coarse contour into a precise boundary. The framework relies on three key innovations:

  1. Instance-aware Point Classifier (IPC): Instead of just looking at local pixels, the model uses a Multi-Layer Perceptron (MLP) whose parameters are generated "on-the-fly" for each specific object instance. This allows the classifier to distinguish between the target object and a neighboring object that might look identical but belongs to a different instance.
  2. Independent Vertex Evolution: Unlike previous methods that tie vertex movements together through global smoothing constraints, SharpContour estimates the offset for each vertex independently along its normal direction. This independence is the "secret sauce" for maintaining sharp corners that smoothing algorithms would otherwise round off.
  3. Discrete "Flipping Point" Search: To find the new position for a vertex, the model samples points along the normal line and uses the IPC to label them as "inner" or "outer." The boundary is identified as the "flipping point" where the label changes. The vertex then moves in discrete steps toward this point, with the step size dynamically adjusted based on the classifier's confidence.
The SharpContour architecture, illustrating the iterative evolution from an input contour to a refined boundary using the Instance-aware Point Classifier (IPC) and discrete offset estimation.

Experimental Results

The researchers evaluated SharpContour on two gold-standard benchmarks: Microsoft COCO and Cityscapes. On the COCO dataset, the method was tested using the Boundary AP metric, which is more sensitive to edge quality than standard Mask AP.

SharpContour consistently improved every base model it was paired with. When added to Mask R-CNN, it improved Boundary AP by 3.4 points and standard AP by 2.3 points. It outperformed or matched heavy-duty refinement models like RefineMask and PointRend while being significantly faster and more generic. Qualitatively, visual results show a marked improvement in "thin" structures and sharp corners, such as the legs of a chair or the intricate outlines of animals, where traditional masks usually fail.

Qualitative comparison showing SharpContour's ability to capture sharp corners and fine details (e.g., dog's mouth, zebra's legs) compared to initial coarse segmentations.

In terms of efficiency, SharpContour adds only about 9.6ms of latency, roughly half that of competing refinement methods. This makes it a highly practical post-processing step for real-time applications.

Conclusion

SharpContour offers a robust and efficient solution for boundary refinement in instance segmentation. By combining independent vertex movement with instance-aware classification, it achieves state-of-the-art accuracy and sharpness without sacrificing speed. While its performance is somewhat dependent on the quality of the initial coarse segmentation, it provides a powerful, model-agnostic tool for enhancing the precision of modern computer vision systems.

Summary updated

BibTeX
@inproceedings{zhu2022sharpcontour,
  author = {Chenming Zhu and Xuanye Zhang and Yanran Li and Liangdong Qiu and Kai Han and Xiaoguang Han},
  title = {{SharpContour: A Contour-based Boundary Refinement Approach for Efficient and Accurate Instance Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  url = {https://openreview.net/forum?id=3B3v2pi8cp2},
}
Figure