Papers › Boundary loss for highly unbalanced segmentation

Boundary loss for highly unbalanced segmentation

17 Dec 2018arXiv:1812.07032archive 2025-07-28

Hoel Kervadec, Jihene Bouchtiba, Christian Desrosiers, Eric Granger, Jose Dolz, Ismail Ben Ayed

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 L₂ 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 .

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 26 code samples harvested from 3 repositories linked to this paper: 22 ran (of which 0 constructed an object rather than computing a result; 20 with no instrument failure: 0 honoured, 0 violated, 20 with no contract checked; 2 where Syntology's instrument failed) · 4 unverified. Where Syntology's instrument failed: 2 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: official repository: 16 samples from 1 repository, 15 ran (15 with no instrument failure; 0 where Syntology's instrument failed); named in the paper: 9 samples from 1 repository, 6 ran (5 with no instrument failure; 1 where Syntology's instrument failed); community (archive-listed): 1 sample from 1 repository, 1 ran (0 with no instrument failure; 1 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

LIVIAETS/surface-loss officialmentioned in papermentioned on GitHubpytorchMITSyntology: 16 samples, 15 ran (0 instrument-failed) · 1 unverified report
JunMa11/SegWithDistMap mentioned in paperpytorchApache-2.0Syntology: 9 samples, 6 ran (1 instrument-failed) · 3 unverified report
BoujlidaMohamed/Segmentation-Loss-Keras mentioned on GitHubtfSyntology: not harvested report
LIVIAETS/boundary-loss mentioned on GitHubpytorchMITSyntology: 1 sample, 1 ran (1 instrument-failed) · 0 unverified report
bluesky314/Segmentation_Boundry_loss mentioned on GitHubSyntology: not harvested report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

26 samples harvested: 22 ran (of which 0 constructed an object rather than computing a result; 20 with no instrument failure: 0 honoured, 0 violated, 20 with no contract checked; 2 where Syntology's instrument failed) · 4 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

2ran · our draft was wrong
20ran
4unverified

Licence: 1 of the 26 samples is pointer only, meaning Syntology does not serve that copy's text. For that sample, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 3 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

LIVIAETS/surface-loss official repository 16 samples, 15 ran (0 instrument-failed) · 1 unverified
calc_dist_map keras_loss.py ran fingerprinted MIT (permissive) · 1360133daf617b75 · report fixture: signature seg:ndarray/2/int · returned ndarray · level recorded 2026-09-25
calc_dist_map_batch keras_loss.py ran MIT (permissive) · 5d556db04429fb51 · report fixture: signature y_true:Tensor/3/float · returned ndarray · level recorded 2026-09-25
convBatch models/unet.py ran MIT (permissive) · f782c9b52688a9a9 · report fixture: signature nin:int/0/int, nout:int/0/int, kernel_size:int/0/int, stride:int/0/int, padding:int/0/int, bias:bool/0/bool, layer:callable/0/?, dilation:int/0/int · returned Sequential · level recorded 2026-09-25
convBatch models/unet_3d.py ran MIT (permissive) · d6d8c157b0fe7c67 · report fixture: signature nin:int/0/int, nout:int/0/int, kernel_size:int/0/int, stride:int/0/int, padding:int/0/int, bias:bool/0/bool, layer:callable/0/?, dilation:int/0/int · returned Sequential · level recorded 2026-09-25
conv_block_1 models/enet.py ran MIT (permissive) · 3d16046506fbe457 · report fixture: signature in_dim:int/0/int, out_dim:int/0/int · returned Sequential · level recorded 2026-09-25
conv_block_3 models/residualunet.py ran MIT (permissive) · e8e661fe6aeab789 · report fixture: signature in_dim:int/0/int, out_dim:int/0/int, act_fn:callable/0/? · returned Sequential · level recorded 2026-09-25
conv_block_3_3 models/enet.py ran MIT (permissive) · 2dfdec9e4819ad2f · report fixture: signature in_dim:int/0/int, out_dim:int/0/int · returned Sequential · level recorded 2026-09-25
conv_block_Asym models/enet.py ran MIT (permissive) · ed82be9bf6339731 · report fixture: signature in_dim:int/0/int, out_dim:int/0/int, kernelSize:int/0/int · returned Sequential · level recorded 2026-09-25
conv_decod_block models/residualunet.py ran MIT (permissive) · 5cf3566e05bb18ec · report fixture: signature in_dim:int/0/int, out_dim:int/0/int, act_fn:callable/0/? · returned Sequential · level recorded 2026-09-25
equalized_png dataloader.py ran MIT (permissive) · 7ecbaf27d3da12ad · report fixture: signature resolution:tuple/1/int, K:int/0/int · returned Compose · level recorded 2026-09-25
get_hd_thing metrics_overtime.py ran MIT (permissive) · 4fc1f8360a0e35b4 · report fixture: signature np_pred:ndarray/3/int, np_target:ndarray/3/int, fn:callable/0/?, voxelspacing:tuple/1/float · returned float · level recorded 2026-09-25
png_transform dataloader.py ran MIT (permissive) · 846feecee7032e57 · report fixture: signature resolution:tuple/1/float, K:int/0/int · returned Compose · level recorded 2026-09-25
png_transform_npy dataloader.py ran MIT (permissive) · 5709081059db578c · report fixture: signature resolution:tuple/1/float, K:int/0/int · returned Compose · level recorded 2026-09-25
upSampleConv models/unet.py ran MIT (permissive) · 87dbd4de1038f468 · report fixture: signature nin:int/0/int, nout:int/0/int, kernel_size:int/0/int, upscale:int/0/int, padding:int/0/int, bias:bool/0/bool · returned Sequential · level recorded 2026-09-25
upSampleConv models/unet_3d.py ran MIT (permissive) · 8fabb14002c9b72f · report fixture: signature nin:int/0/int, nout:int/0/int, kernel_size:int/0/int, upscale:int/0/int, padding:int/0/int, bias:bool/0/bool · returned Sequential · level recorded 2026-09-25
surface_loss_keras keras_loss.py unverified MIT (permissive) · 7b6fa13d0d15c5c6 · report
JunMa11/SegWithDistMap named in the paper 9 samples, 6 ran (1 instrument-failed) · 3 unverified
AAAI_sdf_loss code/train_LA_AAAISDF.py ran fingerprinted Apache-2.0 (permissive) · 01eb16aef3c1a2ee · report fixture: signature net_output:Tensor/2/float, gt_sdm:Tensor/2/float · returned Tensor · level recorded 2026-09-26
compute_dtm code/train_LA_MultiHead_FGDTM_L1.py ran Apache-2.0 (permissive) · c31b9d7d8654e51e · report fixture: signature img_gt:ndarray/4/int, out_shape:tuple/1/int · returned ndarray · level recorded 2026-09-26
compute_dtm01 code/train_LA_HD.py ran Apache-2.0 (permissive) · 7c3c7a172dedaec1 · report fixture: signature img_gt:ndarray/4/int, out_shape:tuple/1/int · returned ndarray · level recorded 2026-09-26
compute_sdf in 5 papers code/train_LA_BD.py ran Apache-2.0 (permissive) · cd97b112475b91ef · report fixture: signature img_gt:ndarray/4/float, out_shape:tuple/1/int · returned ndarray · level recorded 2026-09-26
compute_sdf1_1 code/train_LA_BD.py ran Apache-2.0 (permissive) · 88bd81c3121062eb · report fixture: signature img_gt:ndarray/4/float, out_shape:tuple/1/int · returned ndarray · level recorded 2026-09-26
dice_loss in 193 papers
census: 10 implementations from 16 papers, 7 distinct outputs across 4 buckets, one shared input per bucket
code/train_LA_AAAISDF_L1.py ran · our draft was wrong fingerprinted Apache-2.0 (permissive) here; the stored copy is pointer only · 9f3489c005e0165d · report fixture: signature score:Tensor/2/float, target:Tensor/2/int · returned Tensor · level recorded 2026-09-24
compute_dtm code/train_LA_HD.py unverified Apache-2.0 (permissive) · 5ab231e5bc1d24e8 · report
compute_sdf in 5 papers code/train_LA_AAAISDF.py unverified Apache-2.0 (permissive) · 054bbe15e59a75fd · report
compute_sdf in 5 papers code/train_LA_AAAISDF_L1.py unverified Apache-2.0 (permissive) · 51591160b502b364 · report
LIVIAETS/boundary-loss community (archive-listed) 1 sample, 1 ran (1 instrument-failed) · 0 unverified
conv_block in 95 papers models/residualunet.py ran · our draft was wrong MIT (permissive) · b44139feb813153e · report fixture: signature in_dim:int/0/int, out_dim:int/0/int, act_fn:callable/0/?, kernel_size:int/0/int, stride:int/0/int, padding:int/0/int, dilation:int/0/int · returned Sequential · level recorded 2026-09-22

Tasks

Brain Lesion Segmentation From MriIschemic Stroke Lesion SegmentationLesion SegmentationMedical Image AnalysisMedical Image SegmentationSegmentationSemantic SegmentationUnbalanced Segmentation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Softmax

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections