Abstract
Introducing explicit constraints on the structural predictions has been an effective way to improve the performance of semantic segmentation models. Existing methods are mainly based on insufficient hand-crafted rules that only partially capture the image structure, and some methods can also suffer from the efficiency issue. In this work, we propose a simple, fast yet effective method that exploits structural information through direct supervision with minor additional expense. Specifically, our method explicitly requires the network to predict semantic segmentation as well as dilated affinity, which is a sparse version of pair-wise pixel affinity. The capability of telling the relationships between pixels is directly built into the model and enhances the quality of segmentation in two stages: joint training for robust features and fast affinity propagation for refinement.
Introduction
State-of-the-art semantic segmentation models, primarily based on Fully Convolutional Networks (FCNs), often struggle with boundary confusion and spatial inconsistency. Because FCNs typically treat segmentation as a pixel-wise classification task, pixels near object boundaries—which may have similar local features but different labels—are frequently misclassified. Furthermore, the lack of explicit structural constraints can lead to "noisy" predictions where isolated pixels are assigned incorrect categories.
While traditional solutions like Conditional Random Fields (CRFs) attempt to enforce spatial consistency, they are often computationally expensive and rely on hand-crafted heuristics. This paper introduces Dilated Affinity, a sparse and efficient mechanism to capture structural relationships between pixels directly within the learning process.
Methodology
The proposed framework centers on predicting a sparse version of pair-wise pixel affinity alongside the standard segmentation mask.
Dilated Pixel Affinity
Calculating the affinity between every pair of pixels in an image is computationally prohibitive. To address this, the authors employ a "dilated" sampling strategy. Similar to dilated convolutions, affinities are sampled at specific intervals or rates ($r1, r2$).
An affinity is defined as a binary signal: $1$ if two pixels share the same semantic label, and $0$ otherwise. By adding a simple $1 \times 1$ convolutional branch to a standard backbone (e.g., DeepLabv3+), the network learns to predict these relationships. This direct supervision incentivizes the backbone to learn more robust, structurally-aware features.
Balanced Loss and Propagation
To handle the inherent class imbalance in affinity data (where most neighbors share the same label), the authors utilize Focal Loss combined with square root inverse frequency reweighting. This ensures the model focuses on critical boundary cases.
Post-inference, a Fast Affinity Propagation step is used. The initial segmentation map is refined by updating each pixel's category based on its neighbors' predictions, weighted by the predicted affinities. This process is significantly faster than traditional CRF post-processing.
Experimental Results
The framework was integrated into a DeepLabv3+ (ResNet-101) model and evaluated on two major benchmarks:
- PASCAL VOC 2012: The model achieved 79.21% mIoU, a notable improvement over the 77.93% baseline. It outperformed other structural methods like Adaptive Affinity Fields (AAF).
- Cityscapes: Performance improved from 77.15% to 78.70% mIoU, demonstrating the method's effectiveness on complex urban scenes.
The results indicate that sparse, dilated samples provide sufficient context to refine boundaries effectively while maintaining high computational efficiency.
Conclusion
Dilated Affinity offers a simple yet powerful way to incorporate structural supervision into semantic segmentation. By learning pixel relationships directly from data rather than relying on heuristics, the model achieves better boundary definition and spatial consistency. Future work may involve exploring optimal dilation rates for specialized domains, such as medical or satellite imagery, and further integrating this approach into multi-task learning frameworks.
Summary updated