SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.14290 · 2020

Post Training Uncertainty Calibration of Deep Networks For Medical Image Segmentation

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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 6 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2010.14290.json · badge: /api/ran/2010.14290.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
AxelJanRousseau/PostTrainCalibration canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
create_unet_like_model Ran
ran on a synthesized input
AxelJanRousseau/PostTrainCalibration/my_utils/unet_generalized.py
code served (permissive licence) · get_code("21b6802a3a6fc58e")
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 Functional. 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 numpy as np

ARGS = {
    'number_input_features': 4,
    'subsample_factors_per_pathway': [(1, 1, 1), (2, 2, 2), (4, 4, 4), (8, 8, 8), (16, 16, 16)],
    'kernel_sizes_per_pathway': [
        [[(3, 3, 3), (3, 3, 3)], [(3, 3, 3), (3, 3, 3)]],
        [[(3, 3, 3), (3, 3, 3)], [(3, 3, 3), (3, 3, 3)]],
        [[(3, 3, 3), (3, 3, 3)], [(3, 3, 3), (3, 3, 3)]],
        [[(3, 3, 3), (3, 3, 3)], [(3, 3, 3), (3, 3, 3)]],
        [[(3, 3, 3), (3, 3, 3)], []]
    ],
    'number_features_per_pathway': [
        [[30, 30], [30, 30]],
        [[60, 60], [60, 30]],
        [[120, 120], [120, 60]],
        [[240, 240], [240, 120]],
        [[480, 240], []]
    ],
    'kernel_sizes_common_pathway': [(1, 1, 1)],
    'number_features_common_pathway': [1],
    'dropout_common_pathway': [0],
    'dropout_during_inference': False,
    'dropout_decoders': False,
    'dropout_center': False,
    'output_size': [116, 116, 116],
    'metadata_sizes': None,
    'metadata_number_features': None,
    'metadata_dropout': None,
    'metadata_at_common_pathway_layer': None,
    'padding': 'valid',
    'pooling': 'max',
    'upsampling': 'copy',
    'activation': 'lrelu',
    'activation_final_layer': 'sigmoid',
    'kernel_initializer': 'he_normal',
    'batch_normalization': False,
    'batch_normalization_on_input': False,
    'instance_normalization': True,
    'instance_normalization_on_input': False,
    'relaxed_normalization_scheme': False,
    'mask_output': False,
    'residual_connections': False,
    'dense_connections': False,
    'add_extra_dimension': False,
    'l1_reg': 0.0,
    'l2_reg': 1e-05,
    'verbose': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Functional — a Functional output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Functional 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_dataLoader Ran
ran on a synthesized input
AxelJanRousseau/PostTrainCalibration/aux_scripts/save_aux_segmaps.py
code served (permissive licence) · get_code("11428da06cc416b1")
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 tuple. 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 numpy as np
import torch
import os
import tempfile

torch.manual_seed(0)

# Create a temporary directory structure with a mock predictions file
temp_dir = tempfile.mkdtemp()
validation_dir = os.path.join(temp_dir, 'validation')
os.makedirs(validation_dir, exist_ok=True)

# Create a small mock predictions array with shape (2, 3, 4, 5, 6)
# This will be permuted to (2, 5, 6, 3, 4) then reshaped
mock_predictions = np.random.randn(2, 3, 4, 5, 6).astype(np.float32)
np.save(os.path.join(validation_dir, 'predictions_0.npy'), mock_predictions)

ARGS = {
    'ds_path': temp_dir,
    'fold': 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple 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
sDice Ran
ran on a synthesized input
AxelJanRousseau/PostTrainCalibration/u-net_model_scripts/retrain_dropout.py
code served (permissive licence) · get_code("0c26b1456347d493")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

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

# Create small test tensors for y_pred and y_true
# Using float32 as typical for TensorFlow operations
batch_size = 2
spatial_dims = 4

# y_pred: model predictions (logits or probabilities), shape (batch, spatial)
y_pred_data = np.random.rand(batch_size, spatial_dims).astype(np.float32)
y_pred = tf.convert_to_tensor(y_pred_data)

# y_true: ground truth binary labels, shape (batch, spatial)
y_true_data = np.random.randint(0, 2, size=(batch_size, spatial_dims)).astype(np.float32)
y_true = tf.convert_to_tensor(y_true_data)

# smooth: smoothing constant to avoid division by zero
smooth = 1e-06

ARGS = {
    "y_pred": y_pred,
    "y_true": y_true,
    "smooth": smooth,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
train_loop Ran
ran on a synthesized input
AxelJanRousseau/PostTrainCalibration/u-net_model_scripts/finetune_base_model.py
code served (permissive licence) · get_code("cd5ce6539f54a651")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 numpy as np

torch.manual_seed(0)

class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.history = MinimalHistory()
    
    def fit(self, dataloader, verbose=2, sample_weight=None, class_weight=None):
        # Simulate fitting by consuming the dataloader
        for batch in dataloader:
            pass
        # Set history with a loss value
        self.history.history = {'loss': [0.5]}
    
    def evaluate(self, dataloader, verbose=2):
        # Simulate evaluation by consuming the dataloader and returning a loss
        for batch in dataloader:
            pass
        return 0.4

class MinimalHistory:
    def __init__(self):
        self.history = {'loss': []}

class MinimalScheduler:
    def on_epoch_end(self, epoch, val_loss):
        pass

class MinimalCheckpoint:
    def __init__(self):
        self.epochs_no_improve = 0
    
    def step(self, val_loss, model):
        self.epochs_no_improve += 1

# Create small data batches: list of (x, y) tuples
# x: batch of 2 samples, 4 features
# y: batch of 2 samples, 3 classes
dataLoader = [
    (torch.randn(2, 4), torch.randn(2, 3)),
    (torch.randn(2, 4), torch.randn(2, 3))
]

valLoader = [
    (torch.randn(2, 4), torch.randn(2, 3)),
    (torch.randn(2, 4), torch.randn(2, 3))
]

model = MinimalModel()
scheduler = MinimalScheduler()
checkpoint = MinimalCheckpoint()

ARGS = {
    'model': model,
    'dataLoader': dataLoader,
    'valLoader': valLoader,
    'epochs': 2,
    'scheduler': scheduler,
    'checkpoint': checkpoint
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
train_loop Ran
ran on a synthesized input
AxelJanRousseau/PostTrainCalibration/u-net_model_scripts/retrain_dropout.py
code served (permissive licence) · get_code("d7a8367bbcba0130")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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)

# Stand-in model class that mimics Keras API
class StandInModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
        self.history = type('obj', (object,), {'history': {'loss': [0.5, 0.4, 0.3]}})()
    
    def fit(self, dataloader, verbose=0):
        for x, y in dataloader:
            pass
        return self
    
    def evaluate(self, dataloader, verbose=0):
        total_loss = 0.0
        count = 0
        for x, y in dataloader:
            count += 1
            total_loss += 0.2
        return total_loss / max(count, 1)

# Stand-in scheduler
class StandInScheduler:
    def on_epoch_end(self, epoch, val_loss):
        pass

# Stand-in checkpoint
class StandInCheckpoint:
    def __init__(self):
        self.epochs_no_improve = 0
    
    def step(self, val_loss, model):
        self.epochs_no_improve += 1

# Create small data loaders with (x, y) tuples
dataLoader = [
    (torch.randn(2, 4), torch.randn(2, 2)),
    (torch.randn(2, 4), torch.randn(2, 2)),
]

valLoader = [
    (torch.randn(2, 4), torch.randn(2, 2)),
    (torch.randn(2, 4), torch.randn(2, 2)),
]

model = StandInModel()
epochs = 3
scheduler = StandInScheduler()
checkpoint = StandInCheckpoint()

ARGS = {
    'model': model,
    'dataLoader': dataLoader,
    'valLoader': valLoader,
    'epochs': epochs,
    'scheduler': scheduler,
    'checkpoint': checkpoint,
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
train_loop Ran
ran on a synthesized input
AxelJanRousseau/PostTrainCalibration/aux_scripts/Train_aux.py
code served (permissive licence) · get_code("32b55ab704551fca")
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 tuple. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np

torch.manual_seed(0)

# Define a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, x):
        return self.linear(x)

# Create tiny dataloaders as lists of (x, y) tuples
def create_dataloader(num_batches=3, batch_size=2, input_dim=4):
    dataloader = []
    for _ in range(num_batches):
        x = torch.randn(batch_size, input_dim)
        y = torch.randn(batch_size, 1)
        dataloader.append((x, y))
    return dataloader

# Create checkpoint class that the function uses
class Checkpoint:
    def __init__(self):
        self.epochs_no_improve = 0
        self.best_loss = float('inf')
    
    def step(self, val_loss, model):
        if val_loss < self.best_loss:
            self.best_loss = val_loss
            self.epochs_no_improve = 0
        else:
            self.epochs_no_improve += 1
    
    def __call__(self, val_loss, model):
        self.step(val_loss, model)

# Create scheduler class
class Scheduler:
    def step(self, val_loss):
        pass

# Build arguments
model = SimpleModel()
dataLoader = create_dataloader(num_batches=2, batch_size=2, input_dim=4)
valLoader = create_dataloader(num_batches=2, batch_size=2, input_dim=4)
epochs = 3
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
loss_function = nn.MSELoss()
scheduler = Scheduler()
checkpoint = Checkpoint()

ARGS = {
    'model': model,
    'dataLoader': dataLoader,
    'valLoader': valLoader,
    'epochs': epochs,
    'optimizer': optimizer,
    'loss_function': loss_function,
    'scheduler': scheduler,
    'checkpoint': checkpoint
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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.

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-23.

Repositories linked to this paper

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

Abstract

Neural networks for automated image segmentation are typically trained to achieve maximum accuracy, while less attention has been given to the calibration of their confidence scores. However, well-calibrated confidence scores provide valuable information towards the user. We investigate several post hoc calibration methods that are straightforward to implement, some of which are novel. They are compared to Monte Carlo (MC) dropout. They are applied to neural networks trained with cross-entropy (CE) and soft Dice (SD) losses on BraTS 2018 and ISLES 2018. Surprisingly, models trained on SD loss are not necessarily less calibrated than those trained on CE loss. In all cases, at least one post hoc method improves the calibration. There is limited consistency across the results, so we can't conclude on one method being superior. In all cases, post hoc calibration is competitive with MC dropout. Although average calibration improves compared to the base model, subject-level variance of the calibration remains similar.

For agents

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

get_harvested_code_for_paper("2010.14290")
get_code_for_paper("2010.14290")
have("2010.14290")

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

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

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

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

Connect an agent — have() is free.