supervised adptive threshold network for instance segmentation

Kuikun Liu, Jie Yang, Cai Sun, Haoyuan Chi

Abstract

Instance segmentation typically relies on a fixed threshold (e.g., 0.5) to binarize probability maps into final masks. However, fixed thresholding often fails at object boundaries where pixel distributions are complex. This paper introduces ATMask R-CNN, which replaces the fixed threshold with a learned, per-pixel adaptive threshold map. By utilizing a differentiable binarization function, the threshold map is optimized jointly with the network. Experimental results on the MS COCO dataset demonstrate that ATMask R-CNN significantly improves boundary quality and achieves a +1.7 AP gain over the baseline Mask R-CNN.

Introduction

In traditional instance segmentation frameworks like Mask R-CNN, the mask head generates a probability map where each pixel value represents the likelihood of belonging to the foreground. To produce the final binary mask, a global fixed threshold is applied. This approach assumes that a single value is optimal for all pixels across diverse object geometries and lighting conditions.

The authors identify a critical flaw in this assumption: pixels at object boundaries exhibit much more "erratic" probability distributions compared to central pixels. A rigid threshold often leads to coarse, fuzzy boundaries and illogical overlaps between adjacent instances. To address this, the proposed Supervised Adaptive Threshold Network (ATMask R-CNN) enables the model to dynamically determine the optimal threshold for every pixel.

Methods

ATMask R-CNN introduces a dedicated branch for threshold prediction and a differentiable mechanism to integrate thresholding into the end-to-end training process.

Architecture of ATMask R-CNN featuring the parallel probability and threshold branches.

Adaptive Threshold Branch

A parallel branch is added to the mask head to predict a threshold map ($T$) with the same resolution as the probability map ($P$). Unlike the probability branch, the threshold branch specifically leverages high-resolution features from the P2 level of the Feature Pyramid Network (FPN) to capture fine-grained spatial details essential for precise boundary localization.

Differentiable Binarization

Standard thresholding is a non-differentiable step function, which prevents backpropagation. ATMask R-CNN employs a sigmoid-based approximation: $$B_{i,j} = \frac{1}{1 + e^{-k(P_{i,j} - T_{i,j})}}$$ where $k$ is a scaling factor (set to 2 in experiments). This formulation allows the threshold map to be supervised and optimized alongside the rest of the network.

Feature Fusion (P2T and T2P)

To enhance the representation, the model incorporates "Probability-to-Threshold" (P2T) and "Threshold-to-Probability" (T2P) fusion blocks. These modules allow the probability features to inform threshold prediction and vice-versa, ensuring that the two branches work synergistically to refine the final mask.

Key Results

The model was evaluated on the MS COCO dataset, the benchmark for instance segmentation. ATMask R-CNN consistently outperformed the baseline Mask R-CNN across various backbones.

Qualitative comparison between baseline Mask R-CNN (top) and ATMask R-CNN (bottom).

Accuracy and Boundary Quality

On the COCO val2017 set, ATMask R-CNN achieved a 37.8 AP, representing a 1.7 AP improvement over the baseline Mask R-CNN (36.1 AP) using a ResNet-101 backbone. Qualitative visualizations reveal that the adaptive thresholding leads to significantly sharper edges and fewer artifacts, particularly in scenes with overlapping or complex-shaped objects.

Ablation Studies

Ablation experiments confirmed that while the threshold branch alone provides a performance boost, the combination of feature fusion modules and the high-resolution P2 feature strategy yields the maximum accuracy gains.

Discussion and Conclusion

The core innovation of ATMask R-CNN is treating the binarization threshold as a learnable spatial feature rather than a static hyperparameter. By making the network "boundary-aware" through high-resolution features and mutual information fusion, the model achieves superior segmentation precision.

While the method demonstrates clear improvements, future work may explore the integration of adaptive thresholding into transformer-based architectures like Mask2Former. Additionally, further investigation into the sensitivity of the scaling factor $k$ and the computational overhead of the additional branches could provide deeper insights into the efficiency-accuracy trade-offs of the method.

Summary updated

BibTeX
@misc{liu2021supervised,
  author = {Kuikun Liu and Jie Yang and Cai Sun and Haoyuan Chi},
  title = {{supervised adptive threshold network for instance segmentation}},
  year = {2021},
  eprint = {2106.03450},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.03450},
}
Figure