Look Closer To Segment Better: Boundary Patch Refinement for Instance Segmentation

Chufeng Tang, Hang Chen, Xiao Li, Jianmin Li, Zhaoxiang Zhang, Xiaolin Hu

Introduction

Despite the rapid advancement of instance segmentation models, the quality of predicted masks often falls short upon close inspection. Boundaries typically appear coarse, jagged, or misaligned with actual object edges. This "boundary problem" stems from two primary issues: low spatial resolution in standard segmentation heads (e.g., the 28x28 pixel maps in Mask R-CNN) and the pixel imbalance problem, where boundary pixels constitute less than 1% of the image, leading networks to prioritize the easier interior regions.

Comparison of Mask R-CNN and the proposed BPR framework, showing significantly crisper boundaries on the car's edges.

The Boundary Patch Refinement (BPR) Framework

The authors propose Boundary Patch Refinement (BPR), a model-agnostic post-processing framework designed to "zoom in" on boundaries to recover fine details. BPR follows a three-step "crop-then-refine" strategy:

  1. Boundary Patch Extraction: Using a coarse mask from a base model, BPR identifies boundary pixels and extracts overlapping 64x64 patches centered on these edges.
  2. Refinement Network: These patches, paired with their corresponding RGB data, are processed by a high-resolution refinement network (HRNetV2). By focusing on a small area, the network operates at a much higher effective resolution than the original model.
  3. Reassembling: The refined patches are stitched back together to replace the original coarse boundaries, resulting in a high-quality final mask.
The BPR pipeline: (a) initial mask, (b-c) patch extraction and filtering, (d-f) refinement via HRNetV2 with mask guidance, and (g) final reassembled mask.

Key Insights

The Boundary Bottleneck

An upper-bound experiment revealed that perfectly correcting pixels within just 3 pixels of the boundary on Mask R-CNN outputs would increase Mask AP by 17.8 points. This confirms that boundary misalignment is the primary bottleneck for mask quality.

The Role of Mask Guidance

A critical component of the refinement network is the inclusion of the coarse mask as an input alongside the RGB patch. This "mask guidance" prevents the network from becoming confused in crowded scenes (e.g., overlapping cars), ensuring it refines the specific object intended by the base detector.

Model Agnosticism

BPR is highly flexible. A refinement model trained on Mask R-CNN outputs can be applied to improve results from entirely different architectures, such as PointRend or PolyTransform, without further training.

Experimental Results

The framework was evaluated on Cityscapes, COCO, and LVIS datasets:

  • Cityscapes Performance: Adding BPR to a Mask R-CNN baseline improved Mask AP by 4.3% (from 36.4 to 40.7). On boundary-specific metrics (AF score), the boost was a significant 11.9%.
  • Leaderboard Success: By integrating BPR with a "PolyTransform + SegFix" baseline, the authors achieved 1st place on the Cityscapes instance segmentation leaderboard at the time of publication (42.7% AP).
  • Efficiency: The pipeline is relatively efficient, processing an image in approximately 211ms on a single GPU, which is faster than several competing refinement methods.

Conclusion

Boundary Patch Refinement offers a simple yet powerful way to enhance the mask quality of any instance segmentation model. By shifting the focus from global image processing to local, high-resolution boundary refinement, BPR effectively addresses the resolution and imbalance issues that plague standard architectures. While it remains a post-processing step with some latency overhead, its ability to produce crisp, accurate boundaries sets a new standard for high-quality instance segmentation.

Summary updated

BibTeX
@inproceedings{tang2021look,
  author = {Chufeng Tang and Hang Chen and Xiao Li and Jianmin Li and Zhaoxiang Zhang and Xiaolin Hu},
  title = {{Look Closer To Segment Better: Boundary Patch Refinement for Instance Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01371},
}
Figure