BshapeNet: Object detection and instance segmentation with bounding shape masks

Ba Rom Kang, Hyunku Lee, Keunju Park, Hyunsurk Ryu, Ha Young Kim · DOI

Introduction

Traditional object detection frameworks, such as Faster R-CNN, typically rely on bounding box regression, where the model predicts four continuous coordinates (x, y, width, height). However, direct regression of these numerical values can be challenging for neural networks to learn from raw pixels. Furthermore, a simple rectangular box often fails to capture the intricate spatial details of an object's actual boundary, leading to localization errors, especially in cases of small objects or heavy occlusion.

BshapeNet addresses these limitations by reframing localization as a spatial segmentation task. Instead of predicting coordinates, the network is trained to generate "bounding shape masks." This approach leverages the inherent spatial reasoning capabilities of convolutional neural networks, providing a richer learning signal that emphasizes the object's boundary.

Methods

Mask Representations

The core innovation of BshapeNet lies in its mask-based targets. The authors propose two primary types: the Bbox Mask, which represents the standard rectangular bounding box, and the Bshape (Bounding Shape) Mask, which captures the actual contour of the object.

To address the class imbalance inherent in sparse boundary masks, two variants were introduced:

  • Thick Model: The boundary is expanded by k pixels to create a binary classification target.
  • Scored Model: A distance-based decay is applied, where the true boundary has a value of 1.0, and neighboring pixels receive decreasing scores. This "soft" target provides a smoother gradient for optimization, helping the network distinguish between near-misses and accurate predictions.
Visualizing different mask representations: (a-d) Bounding shape masks and (e-h) Bounding box masks, including thick and scored variants.

Architectural Frameworks

The BshapeNet architecture extends the Faster R-CNN framework by adding a dedicated mask branch. The most advanced version, BshapeNet+, integrates three parallel branches after the RoIAlign layer:

  1. Instance Mask Branch: Predicts the interior mask (as in Mask R-CNN).
  2. Bounding Shape Mask Branch: Predicts the object's boundary.
  3. Regressor & Classifier Branch: Performs standard box refinement and class prediction.
The BshapeNet+ architecture, featuring three parallel branches for instance masks, bounding shape masks, and standard regression/classification.

For training, the Scored models utilize a pixel-wise Euclidean loss, while Thick models use Binary Cross-Entropy. During inference for instance segmentation, a modified Prim’s algorithm is employed to connect predicted boundary points, which are then filled to generate the final instance mask.

Key Results

BshapeNet+ was evaluated on the MS COCO (2017) and Cityscapes datasets, demonstrating significant performance gains over established baselines.

  • Detection Accuracy: On the MS COCO test-dev set, BshapeNet+ achieved a detection Average Precision (AP) of 42.4%, a marked improvement over the 37.3% achieved by Faster R-CNN with RoIAlign.
  • Small Object Performance: The model excelled at detecting small objects, reaching 24.9% AP on COCO. This suggests that the dense signal provided by boundary masks is particularly effective for tiny targets where coordinate errors are most impactful.
  • Instance Segmentation: BshapeNet+ consistently outperformed Mask R-CNN, proving that boundary information serves as a powerful complementary signal to interior-mask segmentation.

Conclusion

BshapeNet demonstrates that spatial learning is often more efficient than numerical coordinate regression for object localization. By focusing on the boundary—the critical interface between foreground and background—the model achieves state-of-the-art results in detection and segmentation.

While the current implementation involves some post-processing overhead for boundary filling, future work could focus on integrating these steps directly into the network architecture. Additionally, automating the selection of boundary thickness (k) could further improve the model's adaptability across diverse datasets.

Summary updated

BibTeX
@article{kang2020bshapenet,
  author = {Ba Rom Kang and Hyunku Lee and Keunju Park and Hyunsurk Ryu and Ha Young Kim},
  title = {{BshapeNet: Object detection and instance segmentation with bounding shape masks}},
  journal = {Pattern Recognition Letters},
  year = {2020},
  doi = {10.1016/j.patrec.2020.01.024},
}
Figure