Introduction
Semantic segmentation is a fundamental task in computer vision, yet standard Fully Convolutional Networks (FCNs) often struggle to produce sharp object boundaries. While these models are effective at identifying object categories, the spatial aggregation inherent in downsampling and convolutional layers tends to smooth features across edges. Consequently, thin structures often disappear, and boundaries become blurred. Traditional training relies on Cross-Entropy (CE) loss, which treats each pixel as an independent classification task, failing to account for the fine-grained spatial relationships between a boundary pixel and its neighbors.
Active Boundary Loss (ABL)
We introduce Active Boundary Loss (ABL), a novel, model-agnostic loss function that treats boundary alignment as a dynamic optimization problem. ABL mimics the behavior of active contour models within a differentiable framework, progressively "pushing" predicted boundaries toward ground-truth edges.
Methodology
The ABL framework operates in two distinct phases:
- Boundary Detection & Direction Mapping: The system identifies Predicted Boundary Pixels (PDBs) by detecting high KL-divergence between the class probability distributions of neighboring pixels. It then utilizes a Distance Transform of the Ground-Truth Boundaries (GTBs) to identify the direction (among eight neighbors) that leads to the closest actual edge.
- Differentiable Alignment: The loss is formulated to encourage the network to increase the KL-divergence between a boundary pixel and the neighbor situated away from the edge, effectively "moving" the boundary toward the ground truth. To prevent gradient "tug-of-war" in dense regions, a conflict suppression mechanism detaches the gradient flow for neighboring pixels, allowing the network to focus on specific pixel movements.
Experimental Evaluation
ABL was evaluated across three major benchmarks: Cityscapes (urban scenes), ADE20K (diverse indoor/outdoor scenes), and DAVIS-2016 (video object segmentation).
Quantitative Results
The integration of ABL consistently improved performance across various backbones:
- Cityscapes: Achieved a 1.0% mIoU improvement over the DeepLabV3 baseline and outperformed post-processing methods like SegFix in boundary F-scores.
- ADE20K: Boosted the OCR network's mIoU by 1.22% and pixel accuracy by 0.23%.
- Video Segmentation: Fine-tuning the STM network with ABL on DAVIS-2016 improved contour accuracy (F-mean) by 1.0%.
Qualitative Impact
Visual results demonstrate that ABL produces significantly cleaner edges for complex shapes. Thin structures, such as the spokes of a bicycle or overhead wires, are preserved with high fidelity, whereas standard CE loss typically produces indistinct blobs.
Discussion and Conclusion
ABL is most effective when introduced in the later stages of training, allowing the network to refine a "rough draft" of the boundaries. While it introduces a minor computational overhead during training due to distance transform calculations, it requires no changes to the model architecture and adds no cost during inference. By treating boundary refinement as an active movement problem, ABL provides a robust solution for high-precision semantic segmentation.
Summary updated