NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

BoxSnake: Polygonal Instance Segmentation with Box Supervision

Rui Yang, Lin Song, Yixiao Ge, Xiu Li

Introduction

Instance segmentation—the task of identifying and outlining every individual object in an image—usually requires expensive pixel-level masks or polygon annotations. Manually drawing these "ground truth" labels is incredibly time-consuming and costly. To lower this "annotation tax," researchers have developed box-supervised methods that train models using only simple bounding boxes.

While most existing work focuses on mask-based frameworks (predicting a grid of pixels), these methods often struggle with "leaking" into shadows or failing to capture the crisp, structural boundaries of rigid objects like cars or buildings. BoxSnake addresses this by introducing the first dedicated polygon-based approach for box-supervised learning. Polygons offer a better structural prior and are more computationally efficient, but they are traditionally harder to train with weak supervision because discrete coordinates are difficult to optimize via backpropagation.

Methodology

BoxSnake is an end-to-end training technique that can be integrated into standard detectors like Mask R-CNN. The framework relies on a novel combination of loss functions to guide polygon prediction using only bounding boxes.

Overview of the BoxSnake framework, illustrating the image flow and the three components of the supervision flow: Point Unary, Local Pairwise, and Global Pairwise losses.

Point-based Unary Loss ($L_u$)

This loss ensures the predicted polygon stays within the ground-truth boundaries. It calculates the bounding box of the predicted polygon vertices and uses a CIoU (Complete Intersection over Union) loss to match it to the ground-truth box. This prevents the polygon from collapsing into a single point or expanding to cover the entire image.

Distance-aware Pairwise Loss

To make the polygon differentiable and allow it to "stick" to object edges, the authors propose a Distance Relaxation strategy. They transform the 2D polygon into a 3D plane by calculating the distance from every pixel to the polygon boundary and passing it through a Sigmoid function. This creates a continuous "probability map" of the object's interior.

Visualization of the distance relaxation technique: (a) the 2D image, (b) the discrete interior/exterior mapping, and (c) the relaxed continuous probability map used for training.

This relaxation enables two key pairwise terms:

  • Local Pairwise Term ($L_{lp}$): This encourages neighboring pixels with similar colors to have the same "inside/outside" status. If two pixels look the same, the polygon boundary is discouraged from passing between them.
  • Global Pairwise Term ($L_{gp}$): Inspired by active contour models, this term minimizes color variance within the predicted object and the background, effectively seeking the most homogeneous regions to separate.

Key Results

The researchers evaluated BoxSnake on two major benchmarks, COCO 2017 and Cityscapes, with impressive results:

  • Cityscapes Superiority: BoxSnake achieved 26.3% Mask AP, outperforming the popular BoxInst method by 3.9%. It proved significantly better at distinguishing vehicle boundaries from road shadows.
  • COCO Performance: With a standard ResNet-50 backbone, BoxSnake reached 31.1% AP, surpassing previous state-of-the-art box-supervised methods like DiscoBox and BoxInst (both at 30.7%).
  • Scalability: When using a larger Swin-L backbone, the model reached 39.5% AP, demonstrating that the method scales effectively with more powerful architectures.

Limitations and Future Work

Despite its success, BoxSnake has some limitations. The pairwise loss tends to prefer shorter paths, which can make it difficult to fit highly concave shapes (like a "C" shaped object). Additionally, the model can struggle with color ambiguity when an object's color is nearly identical to its background. Future research may focus on incorporating high-level semantic features into the pairwise loss to improve reasoning in complex, overlapping scenes.

Summary updated

BibTeX
@inproceedings{yang2023boxsnake,
  author = {Rui Yang and Lin Song and Yixiao Ge and Xiu Li},
  title = {{BoxSnake: Polygonal Instance Segmentation with Box Supervision}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=yqlDInyD0o},
}
Figure