SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_25276 · AAAI · 2023

Robust One-Shot Segmentation of Brain Tissues via Image-Aligned Style Transformation

Qiang Li, Sheng Wang, Jinxin Lv, Xiaoyu Zeng, Ran Duan, Zhiwei Wang

Open in the Atlas

Code that ran

9 of 16 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 9 have no contract verdict; 0 failures of our instrument; 7 no recorded run), measured 2026-11-22; 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/aaai_25276.json · badge: /api/ran/aaai_25276.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
JinxLv/One-shot-segmentation-via-IST canonical (classifier label)
classifier basis: census
9 ran · 7 no recorded run
FunctionStatusWhere it lives
Grad Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/recursive_cascaded_networks.py
code served (permissive licence) · get_code("c0e20955d0bc9550")
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, ndim 6, 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 tensorflow as tf
import numpy as np

# Create a small 3D image tensor
# Expected shape: (batch, depth, height, width, channels)
# Using batch=2, depth=4, height=3, width=5, channels=1
img_data = np.random.randn(2, 4, 3, 5, 1).astype(np.float32)
img = tf.convert_to_tensor(img_data)

ARGS = {
    "img": img
}
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 tuple, ndim 6, dtype family float — a tuple 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
affine_flow Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/data_augmentation.py
code served (permissive licence) · get_code("1b4ff0fd4492e5f6")
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 5, dtype family float, shape (2, 4, 5, 6, 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 tensorflow as tf
import numpy as np

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

# W is indexed as W[:, :, 0], W[:, :, 1], W[:, :, 2]
# So W should have shape [batch, something, 3]
# Each slice W[:, :, i] is reshaped to [-1, 1, 1, 1, 3]
# This means W[:, :, i] has shape [batch, 3] so it can be reshaped to [batch, 1, 1, 1, 3]
W = tf.constant(np.random.randn(2, 3, 3).astype(np.float32))

# b is reshaped to [-1, 1, 1, 1, 3]
# So b should have shape [batch, 3]
b = tf.constant(np.random.randn(2, 3).astype(np.float32))

# len1, len2, len3 are integers used to create ranges
len1 = 4
len2 = 5
len3 = 6

ARGS = {
    "W": W,
    "b": b,
    "len1": len1,
    "len2": len2,
    "len3": len3,
}
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 5, dtype family float, shape (2, 4, 5, 6, 3) — shape (2, 4, 5, 6, 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
cross_entropy Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/loss_functions.py
code served (permissive licence) · get_code("2acc3dbb21701b7f")
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)

# Create small test tensors
# The function expects tensors with shape that is either 4D or 5D
# 4D shape: (batch, height, width, channels)
# 5D shape: (batch, depth, height, width, channels)

batch_size = 2
height = 3
width = 4
channels = 5

# Create 4D tensors for testing (will trigger the 4D case)
# y_true should be one-hot encoded or probability-like (values between 0 and 1)
y_true = tf.random.uniform(shape=(batch_size, height, width, channels), minval=0.0, maxval=1.0, dtype=tf.float32)
# Normalize to make it look like probabilities
y_true = y_true / tf.reduce_sum(y_true, axis=-1, keepdims=True)

# y_pred should also be probability-like
y_pred = tf.random.uniform(shape=(batch_size, height, width, channels), minval=0.1, maxval=0.9, dtype=tf.float32)
# Normalize to make it look like probabilities
y_pred = y_pred / tf.reduce_sum(y_pred, axis=-1, keepdims=True)

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
}
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
get_coef Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/transform.py
code served (permissive licence) · get_code("d0de6300264407c3")
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 3, dtype family float, shape (2, 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 tensorflow as tf

def get_coef(u):
    return tf.stack([(1 - u) ** 3 / 6, (3 * u ** 3 - 6 * u ** 2 + 4) / 6, (-3 * u ** 3 + 3 * u ** 2 + 3 * u + 1) / 6, u ** 3 / 6], axis=1)

# Create a small TensorFlow tensor as input
u = tf.constant([[0.0, 0.25, 0.5, 0.75],
                  [0.1, 0.3, 0.6, 0.9]], dtype=tf.float32)

ARGS = {
    "u": u
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 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
identify_axis Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/loss_functions.py
code served (permissive licence) · get_code("91141ed3163de65d")
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 int; 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

torch.manual_seed(0)

# The function identify_axis takes a 'shape' parameter
# It checks the length of shape and returns different values based on whether len(shape) is 5, 4, or other
# shape should be a tuple or list representing tensor dimensions

# Test case 1: 5D shape
shape_5d = (2, 3, 4, 5, 6)

# Test case 2: 4D shape
shape_4d = (2, 3, 4, 5)

# Test case 3: Invalid shape (for completeness, though it will raise)
shape_invalid = (2, 3)

# We'll use the 5D shape as the primary argument
ARGS = {
    "shape": shape_5d
}
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 int — 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
mask_metrics Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/recursive_cascaded_networks.py
code served (permissive licence) · get_code("6d45b492b283082c")
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, ndim 2, 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 tensorflow as tf
import numpy as np

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

# Create small test segmentation masks
# Shape: (batch_size=2, height=4, width=3, depth=2)
# Values should be 0 (background) or 255 (foreground)
batch_size = 2
height = 4
width = 3
depth = 2

seg1_data = np.random.choice([0, 255], size=(batch_size, height, width, depth)).astype(np.float32)
seg2_data = np.random.choice([0, 255], size=(batch_size, height, width, depth)).astype(np.float32)

seg1 = tf.constant(seg1_data)
seg2 = tf.constant(seg2_data)

img_size = (height, width, depth)

ARGS = {
    "seg1": seg1,
    "seg2": seg2,
    "img_size": img_size
}
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 tuple, ndim 2, dtype family float — a tuple 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
masked_mean Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/framework.py
code served (permissive licence) · get_code("d3971ed2df2141bf")
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

# Create small tensors for the masked_mean function
arr = tf.constant([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)

mask = tf.constant([[1.0, 1.0, 0.0, 1.0],
                    [1.0, 0.0, 1.0, 1.0]], dtype=tf.float32)

ARGS = {
    "arr": arr,
    "mask": mask
}
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
pad_3d Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/transform.py
code served (permissive licence) · get_code("d7569a1677102532")
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 5, dtype family float, shape (2, 5, 6, 7, 1) 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

# Create a small 5D tensor for padding
# Shape: [batch=2, depth=3, height=4, width=5, channels=1]
mat = tf.constant(np.random.randn(2, 3, 4, 5, 1), dtype=tf.float32)

# Padding amount
pad = 1

ARGS = {
    "mat": mat,
    "pad": pad,
}
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 5, dtype family float, shape (2, 5, 6, 7, 1) — shape (2, 5, 6, 7, 1) 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
set_tf_keys Ran
ran on a synthesized input
JinxLv/One-shot-segmentation-via-IST/network/framework.py
code served (permissive licence) · get_code("2cc4d063c1d1d0aa")
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 dict. 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

torch.manual_seed(0)

# The function set_tf_keys takes:
# 1. feed_dict - a dictionary to process
# 2. **kwargs - additional keyword arguments to process
# Both are converted to have ':0' appended to keys and merged

feed_dict = {
    'input_tensor': torch.randn(2, 4),
    'output_tensor': torch.randn(2, 3),
}

kwargs_dict = {
    'weights': torch.randn(4, 3),
    'bias': torch.randn(3),
}

ARGS = {
    'feed_dict': feed_dict,
}
ARGS.update(kwargs_dict)
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
CosineDisMap Not yet run
unverified (harvested, no recorded run)
JinxLv/One-shot-segmentation-via-IST/network/my_network.py
code served (permissive licence) · get_code("31e39677ae5fdd90")
How it ran

no invocation recorded.

dice_loss Not yet run
unverified (harvested, no recorded run)
JinxLv/One-shot-segmentation-via-IST/network/loss_functions.py
code served (permissive licence) · get_code("877533306ff7525f")
How it ran

no invocation recorded.

get_bias Not yet run
unverified (harvested, no recorded run)
JinxLv/One-shot-segmentation-via-IST/network/my_network.py
code served (permissive licence) · get_code("0666fe7b366fee3f")
How it ran

no invocation recorded.

leakyReLU Not yet run
unverified (harvested, no recorded run)
JinxLv/One-shot-segmentation-via-IST/network/base_networks.py
code served (permissive licence) · get_code("7bfa42c0b7f9e8c4")
How it ran

no invocation recorded.

random_affine Not yet run
unverified (harvested, no recorded run)
JinxLv/One-shot-segmentation-via-IST/network/data_augmentation.py
code served (permissive licence) · get_code("3289c7d534d997f2")
How it ran

no invocation recorded.

random_intensity Not yet run
unverified (harvested, no recorded run)
JinxLv/One-shot-segmentation-via-IST/network/data_augmentation.py
code served (permissive licence) · get_code("73b56e48fbbc1035")
How it ran

no invocation recorded.

sample_power Not yet run
unverified (harvested, no recorded run)
JinxLv/One-shot-segmentation-via-IST/network/transform.py
code served (permissive licence) · get_code("d560d49c07951d0a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
get_coef 2 other papers
2 dated earlier
1907.12353 (2019-07)
Recursive Cascaded Networks for Unsupervised Medical Image Registration
1909.11966 (2019-09)
Dual-Stream Pyramid Registration Network
masked_mean 2 other papers
2 dated earlier
1907.12353 (2019-07)
Recursive Cascaded Networks for Unsupervised Medical Image Registration
1909.11966 (2019-09)
Dual-Stream Pyramid Registration Network
pad_3d 2 other papers
2 dated earlier
1907.12353 (2019-07)
Recursive Cascaded Networks for Unsupervised Medical Image Registration
1909.11966 (2019-09)
Dual-Stream Pyramid Registration Network
sample_power 2 other papers
2 dated earlier
1907.12353 (2019-07)
Recursive Cascaded Networks for Unsupervised Medical Image Registration
1909.11966 (2019-09)
Dual-Stream Pyramid Registration Network
set_tf_keys 2 other papers
2 dated earlier
1907.12353 (2019-07)
Recursive Cascaded Networks for Unsupervised Medical Image Registration
1909.11966 (2019-09)
Dual-Stream Pyramid Registration Network
leakyReLU 1 other paper
1 dated earlier
1909.11966 (2019-09)
Dual-Stream Pyramid Registration Network

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

One-shot segmentation of brain tissues is typically a dualmodel iterative learning: a registration model (reg-model) warps a carefully-labeled atlas onto unlabeled images to initialize their pseudo masks for training a segmentation model (seg-model); the seg-model revises the pseudo masks to enhance the reg-model for a better warping in the next iteration. However, there is a key weakness in such dual-model iteration that the spatial misalignment inevitably caused by the reg-model could misguide the seg-model, which makes it converge on an inferior segmentation performance eventually. In this paper, we propose a novel image-aligned style transformation to reinforce the dual-model iterative learning for robust one-shot segmentation of brain tissues. Specifically, we first utilize the reg-model to warp the atlas onto an unlabeled image, and then employ the Fourier-based amplitude exchange with perturbation to transplant the style of the unlabeled image into the aligned atlas. This allows the subsequent seg-model to learn on the aligned and style-transferred copies of the atlas instead of unlabeled images, which naturally guarantees the correct spatial correspondence of an image-mask training pair, without sacrificing the diversity of intensity patterns carried by the unlabeled images. Furthermore, we introduce a feature-aware content consistency in addition to the image-level similarity to constrain the reg-model for a promising initialization, which avoids the collapse of image-aligned style transformation in the first iteration. Experimental results on two public datasets demonstrate 1) a competitive segmentation performance of our method compared to the fully-supervised method, and 2) a superior performance over other state-of-the-art with an increase of average Dice by up to 4.67%. The source code is available at: https://github.com/JinxLv/One-shot-segmentation-via-IST.

For agents

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

get_harvested_code_for_paper("aaai_25276")
get_code_for_paper("aaai_25276")
have("aaai_25276")

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

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

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

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

Connect an agent — have() is free.