SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.01995 · 2020

A Learning Strategy for Contrast-agnostic MRI Segmentation

arXiv · PDF · Open in the Atlas

Code that ran

3 of 9 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, 1 violated it and 1 has no contract verdict; 1 failure of our instrument; 6 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/2003.01995.json · badge: /api/ran/2003.01995.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
BBillot/hypothalamus_seg community (classifier label)
classifier basis not recorded on the link
3 ran · 5 no recorded run
BBillot/lab2im extension (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
blurring_sigma_for_downsampling Ran
ran on a synthesized input
BBillot/hypothalamus_seg/ext/lab2im/edit_tensors.py
code served (permissive licence) · get_code("b149f1adf50c5f3c")
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 1, dtype family float, shape (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 numpy as np
import tensorflow as tf
import keras.layers as KL

# Test case 1: numpy arrays without optional parameters
current_res_1 = np.array([64.0, 128.0, 256.0])
downsample_res_1 = np.array([32.0, 64.0, 128.0])

# Test case 2: numpy arrays with mult_coef
current_res_2 = np.array([100.0, 200.0])
downsample_res_2 = np.array([50.0, 100.0])
mult_coef_2 = 0.5

# Test case 3: numpy arrays with thickness
current_res_3 = np.array([512.0, 512.0, 512.0])
downsample_res_3 = np.array([256.0, 256.0, 256.0])
thickness_3 = np.array([200.0, 200.0, 200.0])

# Test case 4: tensorflow tensors without optional parameters
current_res_4 = tf.constant([64.0, 128.0], dtype=tf.float32)
downsample_res_4 = tf.constant([32.0, 64.0], dtype=tf.float32)

# Test case 5: tensorflow tensors with mult_coef
current_res_5 = tf.constant([100.0, 150.0, 200.0], dtype=tf.float32)
downsample_res_5 = tf.constant([50.0, 75.0, 100.0], dtype=tf.float32)
mult_coef_5 = 0.8

# Test case 6: tensorflow tensors with thickness
current_res_6 = tf.constant([256.0, 256.0], dtype=tf.float32)
downsample_res_6 = tf.constant([128.0, 128.0], dtype=tf.float32)
thickness_6 = tf.constant([100.0, 100.0], dtype=tf.float32)

# Use the first test case as the default
ARGS = {
    "current_res": current_res_1,
    "downsample_res": downsample_res_1,
    "mult_coef": None,
    "thickness": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (3,) — shape (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
dice Ran
ran, violated the contract we drafted
BBillot/hypothalamus_seg/hypothalamus_seg/evaluate.py
code served (permissive licence) · get_code("473e64d96ff495f2")
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 float64, ndim 0, 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 numpy as np

# Create small binary numpy arrays for dice score calculation
x = np.array([1, 0, 1, 1], dtype=np.int32)
y = np.array([1, 1, 1, 0], dtype=np.int32)

ARGS = {
    "x": x,
    "y": y,
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
fast_dice Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
BBillot/hypothalamus_seg/hypothalamus_seg/evaluate.py
code served (permissive licence) · get_code("20fee68d49715c2b")
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 1, dtype family float, shape (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 numpy as np

# Create simple label maps (2D arrays with integer labels)
x = np.array([[0, 1, 1, 2],
              [0, 1, 2, 2],
              [1, 1, 2, 0],
              [0, 1, 2, 2]], dtype=np.int32)

y = np.array([[0, 1, 1, 2],
              [0, 1, 1, 2],
              [1, 1, 2, 0],
              [0, 0, 2, 2]], dtype=np.int32)

# Labels to evaluate dice score on
labels = np.array([0, 1, 2], dtype=np.int32)

ARGS = {
    'x': x,
    'y': y,
    'labels': labels
}
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 ndarray, ndim 1, dtype family float, shape (3,) — shape (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
ae Not yet run
unverified (harvested, no recorded run)
BBillot/hypothalamus_seg/ext/neuron/models.py
code served (permissive licence) · get_code("de7c8ce7df00775b")
How it ran

no invocation recorded.

dilation_net Not yet run
unverified (harvested, no recorded run)
BBillot/hypothalamus_seg/ext/neuron/models.py
code served (permissive licence) · get_code("b2cae58c1646a6d9")
How it ran

no invocation recorded.

get_shapes Not yet run
unverified (harvested, no recorded run)
BBillot/lab2im/lab2im/lab2im_model.py
code served (permissive licence) · get_code("f5072ba28ff3b675")
How it ran

no invocation recorded.

lab2im_model Not yet run
unverified (harvested, no recorded run)
BBillot/hypothalamus_seg/ext/lab2im/lab2im_model.py
code served (permissive licence) · get_code("cdddfcd6ab41fc05")
How it ran

no invocation recorded.

sobel_kernels Not yet run
unverified (harvested, no recorded run)
BBillot/hypothalamus_seg/ext/lab2im/edit_tensors.py
code served (permissive licence) · get_code("7053f37198d52faf")
How it ran

no invocation recorded.

unet Not yet run
unverified (harvested, no recorded run)
BBillot/hypothalamus_seg/ext/neuron/models.py
code served (permissive licence) · get_code("a3e1213061f59f1e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 5 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
blurring_sigma_for_downsampling 1 other paper
1 later
2107.09559 (2021-07)
SynthSeg: Segmentation of brain MRI scans of any contrast and resolution without retraining
dice 1 other paper
1 later
2209.02032 (2022-09)
Robust machine learning segmentation for large-scale analysis of heterogeneous clinical brain MRI datasets
fast_dice 1 other paper
1 later
2209.02032 (2022-09)
Robust machine learning segmentation for large-scale analysis of heterogeneous clinical brain MRI datasets
sobel_kernels 1 other paper
1 later
2107.09559 (2021-07)
SynthSeg: Segmentation of brain MRI scans of any contrast and resolution without retraining

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

We present a deep learning strategy that enables, for the first time, contrast-agnostic semantic segmentation of completely unpreprocessed brain MRI scans, without requiring additional training or fine-tuning for new modalities. Classical Bayesian methods address this segmentation problem with unsupervised intensity models, but require significant computational resources. In contrast, learning-based methods can be fast at test time, but are sensitive to the data available at training. Our proposed learning method, SynthSeg, leverages a set of training segmentations (no intensity images required) to generate synthetic sample images of widely varying contrasts on the fly during training. These samples are produced using the generative model of the classical Bayesian segmentation framework, with randomly sampled parameters for appearance, deformation, noise, and bias field. Because each mini-batch has a different synthetic contrast, the final network is not biased towards any MRI contrast. We comprehensively evaluate our approach on four datasets comprising over 1,000 subjects and four types of MR contrast. The results show that our approach successfully segments every contrast in the data, performing slightly better than classical Bayesian segmentation, and three orders of magnitude faster. Moreover, even within the same type of MRI contrast, our strategy generalizes significantly better across datasets, compared to training using real images. Finally, we find that synthesizing a broad range of contrasts, even if unrealistic, increases the generalization of the neural network. Our code and model are open source at https://github.com/BBillot/SynthSeg.

For agents

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

get_harvested_code_for_paper("2003.01995")
get_code_for_paper("2003.01995")
have("2003.01995")

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

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

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

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

Connect an agent — have() is free.