Abstract
Semantic segmentation often struggles with poor boundary localization due to the geometric blindness of standard pixel-wise losses like Cross-Entropy. We present InverseForm, a novel structural boundary-aware loss function that utilizes a pre-trained Inverse Transformation Network to learn spatial relationships between predicted and ground-truth boundaries. This "plug-in" loss provides a differentiable, geometrically aware signal during training, leading to sharper boundaries and improved mean Intersection over Union (mIoU) across major benchmarks, including Cityscapes and NYU-Depth-v2, without increasing inference latency.
The Problem: Geometrically Blind Loss
Semantic segmentation—the task of assigning a category label to every pixel—is a cornerstone of computer vision. However, standard training typically relies on Cross-Entropy (CE) loss, which treats each pixel independently. CE is "geometrically blind": it penalizes a small spatial shift (e.g., a boundary moved by two pixels) as severely as a categorical error, failing to recognize that the underlying structure is largely correct. While distance-based metrics like Hausdorff distance exist, they are often non-differentiable or difficult to optimize for complex variations like rotation and scaling.
Methods: Learning the Metric
InverseForm addresses this by introducing a structural boundary-aware loss term. The core innovation is the Inverse Transformation Network, a dedicated component trained to predict the transformation coefficients (homography parameters) required to align two boundary maps.
During the training of the primary segmentation model, the Inverse Transformation Network remains frozen. The segmentation model generates a predicted boundary map, which is compared against the ground truth. If the prediction is perfect, the transformation between them should be an Identity Matrix. InverseForm loss is calculated as the distance (Euclidean or Geodesic) between the predicted transformation and this Identity Matrix. To capture both local precision and global context, images are processed in tiles. Crucially, since the boundary head and inverse network are only used during training, the final model maintains its original inference speed.
Key Results
The researchers evaluated InverseForm on three major benchmarks: Cityscapes (urban driving), NYU-Depth-v2 (indoor scenes), and PASCAL-Context (multi-task learning).
- NYU-Depth-v2: Achieved a state-of-the-art 53.1% mIoU.
- Cityscapes: Enhanced the HRNet-48-OCR baseline to 87.0% mIoU, ranking 3rd on the public leaderboard at submission.
- Qualitative Sharpness: Visual inspections reveal that thin structures, such as poles and curbsides, are significantly sharper and better aligned with the image content compared to baseline models.
Conclusion
InverseForm effectively "bakes" geometric common sense into segmentation models. By learning the metric for boundary distance rather than relying on hand-crafted formulas, it provides a robust, differentiable signal that complements standard Cross-Entropy. Future work may explore more complex architectures for the inverse network and optimization strategies to mitigate gradient instability when using Geodesic distances.
Summary updated