SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.07032 · 2018

Boundary loss for highly unbalanced segmentation

arXiv · PDF · Open in the Atlas

Code that ran

22 of 26 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 19 have no contract verdict; 3 failures of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1812.07032.json · badge: /api/ran/1812.07032.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
LIVIAETS/surface-loss canonical (classifier label)
classifier basis: census
15 ran · 1 no recorded run
JunMa11/SegWithDistMap community (classifier label)
classifier basis not recorded on the link
6 ran · 3 no recorded run
LIVIAETS/boundary-loss community (classifier label)
classifier basis: plan_row
1 ran · 0 no recorded run
FunctionStatusWhere it lives
AAAI_sdf_loss Ran
ran on a synthesized input
JunMa11/SegWithDistMap/code/train_LA_AAAISDF.py
code served (permissive licence) · get_code("01eb16aef3c1a2ee")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for the function arguments
# The function expects:
# - net_output: a tensor (network predictions, likely SDF values)
# - gt_sdm: a tensor (ground truth signed distance map)

batch_size = 2
spatial_dim = 4

net_output = torch.randn(batch_size, spatial_dim, dtype=torch.float32)
gt_sdm = torch.randn(batch_size, spatial_dim, dtype=torch.float32)

ARGS = {
    "net_output": net_output,
    "gt_sdm": gt_sdm,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calc_dist_map Ran
ran on a synthesized input
LIVIAETS/surface-loss/keras_loss.py
code served (permissive licence) · get_code("1360133daf617b75")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy.ndimage import distance_transform_edt as distance

# Construct a small segmentation map (binary mask)
# The function expects a numpy array that can be converted to bool
seg = np.array([
    [0, 1, 1, 0],
    [1, 1, 0, 0],
    [0, 0, 1, 1],
    [1, 0, 1, 0]
], dtype=np.int32)

ARGS = {
    "seg": seg
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calc_dist_map_batch Ran
ran on a synthesized input
LIVIAETS/surface-loss/keras_loss.py
code served (permissive licence) · get_code("5d556db04429fb51")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (2, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from scipy.ndimage import distance_transform_edt as distance

torch.manual_seed(0)

# Create a small batch of binary segmentation masks
# Shape: (batch_size=2, height=4, width=3)
batch_size = 2
height = 4
width = 3

# Create random binary segmentation masks
seg_batch = torch.randint(0, 2, (batch_size, height, width)).float()

ARGS = {
    "y_true": seg_batch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_dtm Ran
ran on a synthesized input
JunMa11/SegWithDistMap/code/train_LA_MultiHead_FGDTM_L1.py
code served (permissive licence) · get_code("c31b9d7d8654e51e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 5, dtype family float, shape (2, 1, 4, 3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create a small binary segmentation mask
# Shape: (batch_size=2, spatial_dims...)
# The function expects img_gt to be indexable by [b] and have .astype(np.bool)
# out_shape should be (batch_size, channels, spatial_dims...)

batch_size = 2
channels = 1
spatial_x = 4
spatial_y = 3
spatial_z = 5

# img_gt: shape (batch_size, spatial_x, spatial_y, spatial_z)
# Contains foreground (1) and background (0)
img_gt = np.random.randint(0, 2, size=(batch_size, spatial_x, spatial_y, spatial_z)).astype(np.uint8)

# Ensure at least one foreground pixel in each batch
img_gt[0, 0, 0, 0] = 1
img_gt[1, 1, 1, 1] = 1

# out_shape: the output shape (batch_size, channels, spatial_x, spatial_y, spatial_z)
out_shape = (batch_size, channels, spatial_x, spatial_y, spatial_z)

ARGS = {
    "img_gt": img_gt,
    "out_shape": out_shape,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 5, dtype family float, shape (2, 1, 4, 3, 5) — shape (2, 1, 4, 3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_dtm01 Ran
ran on a synthesized input
JunMa11/SegWithDistMap/code/train_LA_HD.py
code served (permissive licence) · get_code("7c3c7a172dedaec1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 5, dtype family float, shape (2, 3, 4, 3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small binary mask for testing
# Shape: (batch_size=2, height=4, width=3, depth=5)
# The function iterates over batch dimension and channel dimension
img_gt = np.zeros((2, 4, 3, 5), dtype=np.uint8)

# Add some foreground regions (positive mask)
img_gt[0, 1:3, 1:2, 2:4] = 1
img_gt[1, 0:2, 0:3, 1:3] = 1

# Output shape: (batch_size, channels, height, width, depth)
out_shape = (2, 3, 4, 3, 5)

ARGS = {
    "img_gt": img_gt,
    "out_shape": out_shape
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 5, dtype family float, shape (2, 3, 4, 3, 5) — shape (2, 3, 4, 3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_sdf Ran
ran on a synthesized input
JunMa11/SegWithDistMap/code/train_LA_BD.py
code served (permissive licence) · get_code("cd97b112475b91ef")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 5, dtype family float, shape (2, 2, 4, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy.ndimage import distance_transform_edt as distance
from skimage import segmentation as skimage_seg

# Create a small binary segmentation mask
# Shape: (batch_size, x, y, z) = (2, 4, 4, 4)
batch_size = 2
x_dim = 4
y_dim = 4
z_dim = 4

# Create a simple binary mask with some foreground and background
img_gt = np.zeros((batch_size, x_dim, y_dim, z_dim), dtype=np.float32)

# Add some foreground pixels to the first batch
img_gt[0, 1:3, 1:3, 1:3] = 1

# Add some foreground pixels to the second batch
img_gt[1, 1:3, 1:3, 1:3] = 1

# Output shape: (batch_size, channels, x, y, z) = (2, 2, 4, 4, 4)
# The function iterates over channels starting from 1, so we need at least 2 channels
out_shape = (batch_size, 2, x_dim, y_dim, z_dim)

ARGS = {
    "img_gt": img_gt,
    "out_shape": out_shape,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, skimage — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 5, dtype family float, shape (2, 2, 4, 4, 4) — shape (2, 2, 4, 4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_sdf1_1 Ran
ran on a synthesized input
JunMa11/SegWithDistMap/code/train_LA_BD.py
code served (permissive licence) · get_code("88bd81c3121062eb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 5, dtype family float, shape (2, 2, 4, 3, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy.ndimage import distance_transform_edt as distance
from skimage import segmentation as skimage_seg

# Create a small binary segmentation mask
# Shape: (batch_size=2, height=4, width=3, depth=2)
batch_size = 2
height = 4
width = 3
depth = 2

# Create img_gt with shape (batch_size, height, width, depth)
# Fill with random binary values
np.random.seed(0)
img_gt = np.random.randint(0, 2, size=(batch_size, height, width, depth)).astype(np.float32)

# Make sure we have at least some positive and negative regions for distance transform
img_gt[0, 0, 0, :] = 1  # ensure some positive mask
img_gt[0, -1, -1, :] = 0  # ensure some negative mask

# out_shape should be (batch_size, num_channels, height, width, depth) or similar
# Based on the loop structure, it appears to be (batch_size, channels, ...)
# The function expects out_shape to have at least 2 dimensions for batch and channel indexing
out_shape = (batch_size, 2, height, width, depth)

ARGS = {
    "img_gt": img_gt,
    "out_shape": out_shape,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, skimage — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 5, dtype family float, shape (2, 2, 4, 3, 2) — shape (2, 2, 4, 3, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
convBatch Ran
ran; our contract draft was wrong, not the code
LIVIAETS/surface-loss/models/unet.py
code served (permissive licence) · get_code("f782c9b52688a9a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'nin': 3,
    'nout': 64,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'bias': False,
    'layer': nn.Conv2d,
    'dilation': 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
convBatch Ran
ran on a synthesized input
LIVIAETS/surface-loss/models/unet_3d.py
code served (permissive licence) · get_code("d6d8c157b0fe7c67")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "nin": 3,
    "nout": 16,
    "kernel_size": 3,
    "stride": 1,
    "padding": 1,
    "bias": False,
    "layer": nn.Conv3d,
    "dilation": 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
conv_block Ran
ran; our contract draft was wrong, not the code
LIVIAETS/boundary-loss/models/residualunet.py
code served (permissive licence) · get_code("b44139feb813153e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define activation function
act_fn = nn.ReLU()

# Define all parameters for conv_block
ARGS = {
    'in_dim': 3,
    'out_dim': 16,
    'act_fn': act_fn,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'dilation': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
conv_block_1 Ran
ran on a synthesized input
LIVIAETS/surface-loss/models/enet.py
code served (permissive licence) · get_code("3d16046506fbe457")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "in_dim": 3,
    "out_dim": 64,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
conv_block_3 Ran
ran on a synthesized input
LIVIAETS/surface-loss/models/residualunet.py
code served (permissive licence) · get_code("e8e661fe6aeab789")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create activation function
act_fn = nn.ReLU()

# Define arguments for conv_block_3
ARGS = {
    "in_dim": 3,
    "out_dim": 16,
    "act_fn": act_fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
conv_block_3_3 Ran
ran on a synthesized input
LIVIAETS/surface-loss/models/enet.py
code served (permissive licence) · get_code("2dfdec9e4819ad2f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function takes two integer parameters: in_dim and out_dim
# These specify the number of input and output channels for the Conv2d layer

ARGS = {
    "in_dim": 4,
    "out_dim": 3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
conv_block_Asym Ran
ran on a synthesized input
LIVIAETS/surface-loss/models/enet.py
code served (permissive licence) · get_code("ed82be9bf6339731")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_dim': 3,
    'out_dim': 16,
    'kernelSize': 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
conv_decod_block Ran
ran on a synthesized input
LIVIAETS/surface-loss/models/residualunet.py
code served (permissive licence) · get_code("5cf3566e05bb18ec")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define the arguments for conv_decod_block
in_dim = 16
out_dim = 8
act_fn = nn.ReLU()

ARGS = {
    "in_dim": in_dim,
    "out_dim": out_dim,
    "act_fn": act_fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
dice_loss Ran
ran; our contract draft was wrong, not the code
JunMa11/SegWithDistMap/code/train_LA_AAAISDF_L1.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from axi404/pmt, is pointer only (licence: NONE) · get_code("9f3489c005e0165d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from axi404/pmt, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

equalized_png Ran
ran on a synthesized input
LIVIAETS/surface-loss/dataloader.py
code served (permissive licence) · get_code("7ecbaf27d3da12ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Compose. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from PIL import Image

torch.manual_seed(0)

ARGS = {
    "resolution": (256, 256),
    "K": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_hd_thing Ran
ran on a synthesized input
LIVIAETS/surface-loss/metrics_overtime.py
code served (permissive licence) · get_code("4fc1f8360a0e35b4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

def mock_hausdorff_fn(np_pred, np_target, voxelspacing=None):
    """Mock function that computes a hausdorff distance-like metric"""
    return 42.0

np_pred = np.zeros((4, 5, 6), dtype=np.uint8)
np_target = np.ones((4, 5, 6), dtype=np.uint8)

ARGS = {
    'np_pred': np_pred,
    'np_target': np_target,
    'fn': mock_hausdorff_fn,
    'voxelspacing': (1.0, 2.0, 3.0)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
png_transform Ran
ran on a synthesized input
LIVIAETS/surface-loss/dataloader.py
code served (permissive licence) · get_code("846feecee7032e57")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Compose. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from PIL import Image
from torchvision import transforms

torch.manual_seed(0)

# The function png_transform takes:
# - resolution: Tuple[float, ...] - a tuple of floats
# - K: int - an integer

# Looking at the function body, neither parameter is actually used in the returned Callable.
# The function just returns a transforms.Compose with fixed lambda functions.
# So we need to provide valid values for both parameters.

ARGS = {
    "resolution": (224.0, 224.0),
    "K": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
png_transform_npy Ran
ran on a synthesized input
LIVIAETS/surface-loss/dataloader.py
code served (permissive licence) · get_code("5709081059db578c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Compose. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from PIL import Image
from torchvision import transforms

torch.manual_seed(0)

# Create a simple PIL Image for testing
test_image = Image.new('RGB', (8, 6), color=(128, 128, 128))

ARGS = {
    'resolution': (8.0, 6.0),
    'K': 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
upSampleConv Ran
ran on a synthesized input
LIVIAETS/surface-loss/models/unet.py
code served (permissive licence) · get_code("87dbd4de1038f468")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Define the helper functions and classes from the provided code
def convBatch(nin, nout, kernel_size=3, stride=1, padding=1, bias=False, layer=nn.Conv2d, dilation=1):
    return nn.Sequential(layer(nin, nout, kernel_size=kernel_size, stride=stride, padding=padding, bias=bias, dilation=dilation), nn.BatchNorm2d(nout), nn.PReLU())

class interpolate(nn.Module):
    def __init__(self, scale_factor, mode='nearest'):
        super().__init__()
        self.scale_factor = scale_factor
        self.mode = mode

    def forward(self, cin):
        return F.interpolate(cin, mode=self.mode, scale_factor=self.scale_factor)

def upSampleConv(nin, nout, kernel_size=3, upscale=2, padding=1, bias=False):
    return nn.Sequential(interpolate(mode='nearest', scale_factor=upscale), convBatch(nin, nout, kernel_size=kernel_size, stride=1, padding=padding, bias=bias), convBatch(nout, nout, kernel_size=3, stride=1, padding=1, bias=bias))

# Create valid arguments for upSampleConv
ARGS = {
    'nin': 3,
    'nout': 4,
    'kernel_size': 3,
    'upscale': 2,
    'padding': 1,
    'bias': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
upSampleConv Ran
ran on a synthesized input
LIVIAETS/surface-loss/models/unet_3d.py
code served (permissive licence) · get_code("8fabb14002c9b72f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'nin': 16,
    'nout': 32,
    'kernel_size': 3,
    'upscale': 2,
    'padding': 1,
    'bias': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_dtm Not yet run
unverified (harvested, no recorded run)
JunMa11/SegWithDistMap/code/train_LA_HD.py
code served (permissive licence) · get_code("5ab231e5bc1d24e8")
How it ran

no invocation recorded.

compute_sdf Not yet run
unverified (harvested, no recorded run)
JunMa11/SegWithDistMap/code/train_LA_AAAISDF.py
code served (permissive licence) · get_code("054bbe15e59a75fd")
How it ran

no invocation recorded.

compute_sdf Not yet run
unverified (harvested, no recorded run)
JunMa11/SegWithDistMap/code/train_LA_AAAISDF_L1.py
code served (permissive licence) · get_code("51591160b502b364")
How it ran

no invocation recorded.

surface_loss_keras Not yet run
unverified (harvested, no recorded run)
LIVIAETS/surface-loss/keras_loss.py
code served (permissive licence) · get_code("7b6fa13d0d15c5c6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 26 samples lifted from this paper's linked repositories, 26 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 4 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 20 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
dice_loss 8 other papers
8 later
1907.07034 (2019-07)
Uncertainty-aware Self-ensembling Model for Semi-supervised 3D Left Atrium Segmentation
2003.09005 (2020-03)
Semi-Supervised Semantic Segmentation with Cross-Consistency Training
2009.04448 (2020-09)
Semi-supervised Medical Image Segmentation through Dual-task Consistency
and 5 more not named here
compute_sdf1_1 1 other paper
1 later
2111.08176 (2021-11)
Coarse-to-fine Animal Pose and Shape Estimation
convBatch 1 other paper
1 dated earlier
1612.01105 (2016-12)
Pyramid Scene Parsing Network
conv_block 1 other paper
1 dated earlier
1804.02967 (2018-04)
HyperDense-Net: A hyper-densely connected CNN for multi-modal image segmentation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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_2$ 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 .

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1812.07032")
get_code_for_paper("1812.07032")
have("1812.07032")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1812.07032.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1812.07032.svg)](https://syntology.ai/paper/1812.07032)

Connect an agent — have() is free.