# Boundary loss for highly unbalanced segmentation

arXiv: https://arxiv.org/abs/1812.07032 · HTML: https://mlsanity.com/paper/1812.07032/

## Key facts

- Cited by 190 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 17 Dec 2018.

## Built on by (most cited first, 30 of 190)

- [Recent advances and clinical applications of deep learning in medical image analysis](https://mlsanity.com/paper/2105.13381/) (2021)
- [Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medical image segmentation](https://mlsanity.com/paper/2102.04525/) (2021)
- [Topology-Aware Segmentation Using Discrete Morse Theory](https://mlsanity.com/paper/2103.09992/) (2021)
- [Active Boundary Loss for Semantic Segmentation](https://mlsanity.com/paper/2102.02696/) (2021)
- [Analyzing Overfitting under Class Imbalance in Neural Networks for Image Segmentation](https://mlsanity.com/paper/2102.10365/) (2021)
- [Loss Functions in the Era of Semantic Segmentation: A Survey and Outlook](https://mlsanity.com/paper/2312.05391/) (2023)
- [Semantic Diffusion Network for Semantic Segmentation](https://mlsanity.com/paper/2302.02057/) (2023)
- [Few-Shot Medical Image Segmentation via a Region-enhanced Prototypical Transformer](https://mlsanity.com/paper/2309.04825/) (2023)
- [Centerline Boundary Dice Loss for Vascular Segmentation](https://mlsanity.com/paper/2407.01517/) (2024)
- [MicroSegNet: A Deep Learning Approach for Prostate Segmentation on Micro-Ultrasound Images](https://mlsanity.com/paper/2305.19956/) (2023)
- [Structure-Aware Image Segmentation with Homotopy Warping](https://mlsanity.com/paper/2112.07812/) (2021)
- [Promise:Prompt-driven 3D Medical Image Segmentation Using Pretrained Image Foundation Models](https://mlsanity.com/paper/2310.19721/) (2023)
- [A survey on shape-constraint deep learning for medical image segmentation](https://mlsanity.com/paper/2101.07721/) (2021)
- [Noisy Labels are Treasure: Mean-Teacher-Assisted Confident Learning for Hepatic Vessel Segmentation](https://mlsanity.com/paper/2106.01860/) (2021)
- [RDP-Net: Region Detail Preserving Network for Change Detection](https://mlsanity.com/paper/2202.09745/) (2022)
- [A Generalized Surface Loss for Reducing the Hausdorff Distance in Medical Imaging Segmentation](https://mlsanity.com/paper/2302.03868/) (2023)
- [Boundary Difference Over Union Loss For Medical Image Segmentation](https://mlsanity.com/paper/2308.00220/) (2023)
- [Do We Really Need Dice? The Hidden Region-Size Biases of Segmentation Losses](https://mlsanity.com/paper/2104.08717/) (2021)
- [DermoSegDiff: A Boundary-aware Segmentation Diffusion Model for Skin Lesion Delineation](https://mlsanity.com/paper/2308.02959/) (2023)
- [ObjectAug: Object-level Data Augmentation for Semantic Image Segmentation](https://mlsanity.com/paper/2102.00221/) (2021)
- [JPerceiver: Joint Perception Network for Depth, Pose and Layout Estimation in Driving Scenes](https://mlsanity.com/paper/2207.07895/) (2022)
- [Identifying the key components in ResNet-50 for diabetic retinopathy grading from fundus images: a systematic investigation](https://mlsanity.com/paper/2110.14160/) (2021)
- [Spatially Covariant Lesion Segmentation](https://mlsanity.com/paper/2301.07895/) (2023)
- [MAD-AD: Masked Diffusion for Unsupervised Brain Anomaly Detection](https://mlsanity.com/paper/2502.16943/) (2025)
- [A Semantic Segmentation Network for Urban-Scale Building Footprint Extraction Using RGB Satellite Imagery](https://mlsanity.com/paper/2104.01263/) (2021)
- [Multi-site, Multi-domain Airway Tree Modeling (ATM'22): A Public Benchmark for Pulmonary Airway Segmentation](https://mlsanity.com/paper/2303.05745/) (2023)
- [Ultrasound Nodule Segmentation Using Asymmetric Learning with Simple Clinical Annotation](https://mlsanity.com/paper/2404.14852/) (2024)
- [Enhancing Boundary Segmentation for Topological Accuracy with Skeleton-based Methods](https://mlsanity.com/paper/2404.18539/) (2024)
- [A Unified Interactive Model Evaluation for Classification, Object Detection, and Instance Segmentation in Computer Vision](https://mlsanity.com/paper/2308.05168/) (2023)
- [MeshPose: Unifying DensePose and 3D Body Mesh reconstruction](https://mlsanity.com/paper/2406.10180/) (2024)

## Abstract (arXiv)

Widely used loss functions for CNN segmentation, e.g., Dice or cross-entropy, are based on integrals over the segmentation regions. Unfortunately, for highly unbalanced segmentations, such regional summations have values that differ by several orders of magnitude across classes, which affects training performance and stability. We propose a boundary loss, which takes the form of a distance metric on the space of contours, not regions. This can mitigate the difficulties of highly unbalanced problems because it uses integrals over the interface between regions instead of unbalanced integrals over the regions. Furthermore, a boundary loss complements regional information. Inspired by graph-based optimization techniques for computing active-contour flows, we express a non-symmetric L2 distance on the space of contours as a regional integral, which avoids completely local differential computations involving contour points. This yields a boundary loss expressed with the regional softmax probability outputs of the network, which can be easily combined with standard regional losses and implemented with any existing deep network architecture for N-D segmentation. We report comprehensive evaluations and comparisons on different unbalanced problems, showing that our boundary loss can yield significant increases in performances while improving training stability. Our code is publicly available: https://github.com/LIVIAETS/surface-loss .
