SegFix: Model-Agnostic Boundary Refinement for Segmentation

Yuhui Yuan, Jingyi Xie, Xilin Chen, Jingdong Wang

Abstract

SegFix is a model-agnostic post-processing framework designed to sharpen the often-blurry boundaries produced by semantic and instance segmentation models. By learning to map unreliable boundary pixels to more reliable interior pixels, it consistently improves the performance of state-of-the-art models across major benchmarks with nearly real-time efficiency.

The Problem: Boundary Anxiety in Segmentation

In the world of computer vision, semantic segmentation—the task of assigning a category label to every single pixel in an image—has seen massive improvements. However, even the most advanced models struggle with "boundary anxiety." While they are excellent at identifying the centers of objects, their predictions often become "fuzzy" or inaccurate at the edges.

The authors observe a consistent trend: the number of error pixels decreases significantly as you move further away from object boundaries. In other words, interior pixels are much more reliable than boundary pixels.

Error distribution across different models (DeepLabv3, HRNet, Gated-SCNN) shows that the vast majority of errors are concentrated at the object boundaries.

Most existing solutions try to fix this by increasing feature resolution or adding complex boundary-aware loss functions during training. These methods are often computationally expensive and tied to specific model architectures. SegFix seeks a "universal" fix that can be applied to any model's output without needing to retrain the original model.

The SegFix Framework

SegFix operates on a simple but clever intuition: if a boundary pixel is likely wrong, let’s just "borrow" the label from a nearby interior pixel that is likely right.

The framework consists of two main branches that process the input image:

  1. Boundary Branch: This predicts a binary mask to localize which pixels are "boundaries" and which are "interiors."
  2. Direction Branch: For every pixel, this branch predicts a direction (an angle) pointing away from the nearest boundary toward the interior of the object.

Instead of using standard regression to predict a continuous angle, the authors treat direction as a classification task. They divide the 360-degree range into $m$ discrete bins (e.g., 8 directions like North, North-East, etc.). They found that this categorical approach is more robust and yields better results than regression.

During the Testing/Inference stage, SegFix generates an "offset map" from these directions. For any pixel identified as a boundary, the system follows the predicted direction to a coordinate in the interior and replaces the boundary pixel's label with the interior pixel's label. Because this offset map is generated only from the input image, it can be applied to the output of any segmentation model.

Key Results and Performance

The authors evaluated SegFix on challenging benchmarks including Cityscapes, ADE20K, and GTA5. SegFix demonstrated consistent improvements across the board:

  • State-of-the-Art Performance: At the time of submission, the combination of "HRNet + OCR + SegFix" ranked 1st on the Cityscapes semantic segmentation leaderboard (84.5% mIoU).
  • Quantitative Gains: On Cityscapes, it improved the mIoU of DeepLabv3 by 1.0% and boosted the boundary F-score (a measure of edge accuracy) by a massive 4.3%.
  • Instance Segmentation: The method also proved effective for instance segmentation, improving the mask AP of models like Mask R-CNN and PolyTransform by roughly 1.1% to 1.5%.
Qualitative results demonstrating how SegFix refines the initial segmentation output to produce sharper, more accurate boundaries.

Discussion and Limitations

SegFix acts as a modular "plug-and-play" polisher. Because the offset map only needs to be computed once per image, the refinement process is incredibly fast. Using a light backbone (like HRNet-W18), the system runs in about 16ms, making it viable for real-time applications.

However, it has a few notable limitations:

  • Propagation of Interior Errors: If the interior pixel is also misclassified by the base model, SegFix will simply propagate that error to the boundary. It relies on the assumption that the interior is "mostly" correct.
  • Fixed Offset Scaling: The current version uses a heuristic approach to determine how far to "look" into the interior. The authors suggest that adaptive scaling—where the model learns exactly how far to jump based on the local context—is a promising direction for future research.
  • Thin vs. Thick Boundaries: The method is primarily optimized for thin boundary refinement. Handling very thick, ambiguous transition zones remains a challenge.

Summary updated

BibTeX
@inproceedings{yuan2020segfix,
  author = {Yuhui Yuan and Jingyi Xie and Xilin Chen and Jingdong Wang},
  title = {{SegFix: Model-Agnostic Boundary Refinement for Segmentation}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58610-2\_29},
}
Figure