SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.06131 · ICCV · 2023

UniverSeg: Universal Medical Image Segmentation

Mert Sabuncu, John Guttag, Victor Butoi, Adrian Dalca, Jose Gonzalez Ortiz, Tianyu Ma, Mgh

arXiv · PDF · Open in the Atlas

Code that ran

8 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 8 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/2304.06131.json · badge: /api/ran/2304.06131.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
JJGO/UniverSeg marked official in Papers with Code
Papers with Code archive
6 ran · 8 no recorded run
deel-ai-papers/consema community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
CrossConv2d Ran
ran on a synthesized input · constructed an object; no result was computed
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("9994802f43d8b159")
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 an instance of its own class, CrossConv2d: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn

torch.manual_seed(0)

# Create sample tensors for testing
# x: (B=2, Sx=3, Cx=4, H=8, W=8)
# y: (B=2, Sy=5, Cy=6, H=8, W=8)
x = torch.randn(2, 3, 4, 8, 8)
y = torch.randn(2, 5, 6, 8, 8)

ARGS = {
    'in_channels': (4, 6),  # tuple for different input channels
    'out_channels': 7,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'dilation': 1,
    'groups': 1,
    'bias': True,
    'padding_mode': 'zeros',
    'device': None,
    'dtype': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CrossConv2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CrossConv2d 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
UniversegInferenceWrap Ran
ran on a synthesized input · constructed an object; no result was computed
deel-ai-papers/consema/src/benchmarkerie/models.py
pointer only (licence: NOASSERTION) · get_code("fc48c1f3df993437")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, deel-ai-papers/consema (NOASSERTION). 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.

Vmap Ran
ran on a synthesized input · constructed an object; no result was computed
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("7daac70e030811f7")
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 an instance of its own class, Vmap: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn
import einops as E

torch.manual_seed(0)

# Define a simple module that processes tensors
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(5, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create the module to be vmapped
simple_module = SimpleModule()

# Create input tensor of shape (batch_size=2, group_size=3, feature_dim=5)
x = torch.randn(2, 3, 5)

ARGS = {
    "module": simple_module
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Vmap — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Vmap 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
as_2tuple Ran
ran, honoured the contract we drafted
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("142578030862b078")
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 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
import numpy as np
from typing import Union, Tuple

torch.manual_seed(0)

size2t = Union[int, Tuple[int, int]]

# Test case 1: integer input
val_int = 5

# Test case 2: tuple input
val_tuple = (3, 7)

# Test case 3: list input (also valid per the assertion)
val_list = [2, 4]

# For the function signature, we only have one parameter: val
# We'll test with an integer as the primary case
ARGS = {
    "val": 5
}
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, ndim 1, dtype family int — 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
dice_score Ran
ran, honoured the contract we drafted
deel-ai-papers/consema/src/benchmarkerie/models.py
pointer only (licence: NOASSERTION) · get_code("da563328802c0ab5")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, deel-ai-papers/consema (NOASSERTION). 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.

get_nonlinearity Ran
ran; our contract draft was wrong, not the code
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("1617355e53350393")
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 ReLU. 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 get_nonlinearity takes a single parameter: nonlinearity
# which is Optional[str]. It returns an nn.Module based on the string value.
# The function checks:
# 1. if nonlinearity is None -> returns nn.Identity()
# 2. if nonlinearity == 'Softmax' -> returns nn.Softmax(dim=1)
# 3. if hasattr(nn, nonlinearity) -> returns getattr(nn, nonlinearity)()
# 4. else raises ValueError

# We'll test with a valid nonlinearity that exists in nn module
ARGS = {
    'nonlinearity': 'ReLU'
}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
validate_arguments_init Ran
ran; our contract draft was wrong, not the code
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("e61d58ef89523382")
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 type. 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
from pydantic import validate_arguments

torch.manual_seed(0)

# Create a simple test class
class SimpleClass:
    def __init__(self, x: int, y: str = "default"):
        self.x = x
        self.y = y

# Create another test class with type hints
class AnotherClass:
    def __init__(self, value: float, enabled: bool = True):
        self.value = value
        self.enabled = enabled

ARGS = {
    "class_": SimpleClass
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
vmap Ran
ran; our contract draft was wrong, not the code
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("290578cdad9c6a53")
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 3, 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 einops as E
from typing import Callable

torch.manual_seed(0)

# Create a simple module that works with batched inputs
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 5)
    
    def forward(self, x, *args, **kwargs):
        # x shape: (B*S, 4) after rearrange
        return self.linear(x)

# Instantiate the module
module = SimpleModule()

# Create input tensor of shape (batch_size=2, group_size=3, feature_dim=4)
x = torch.randn(2, 3, 4)

# Additional args and kwargs (can be empty)
args = ()
kwargs = {}

ARGS = {
    "module": module,
    "x": x,
    "args": args,
    "kwargs": kwargs,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py could not observe it (no_result)
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
ConvOp Not yet run
unverified (harvested, no recorded run)
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("adf8d27021bbab9c")
How it ran

no invocation recorded.

CrossBlock Not yet run
unverified (harvested, no recorded run)
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("616bb64d3505047c")
How it ran

no invocation recorded.

CrossOp Not yet run
unverified (harvested, no recorded run)
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("02274408c04c614d")
How it ran

no invocation recorded.

UniverSeg Not yet run
unverified (harvested, no recorded run)
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("d931621ba7ba79fc")
How it ran

no invocation recorded.

initialize_bias Not yet run
unverified (harvested, no recorded run)
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("874ef3743327a7df")
How it ran

no invocation recorded.

initialize_layer Not yet run
unverified (harvested, no recorded run)
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("d3e23d20c761e266")
How it ran

no invocation recorded.

initialize_weight Not yet run
unverified (harvested, no recorded run)
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("99341f22e98fdf80")
How it ran

no invocation recorded.

reset_conv2d_parameters Not yet run
unverified (harvested, no recorded run)
JJGO/UniverSeg/universeg/model.py
code served (permissive licence) · get_code("a55e933baa469a5c")
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, 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 16 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-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

While deep learning models have become the predominant method for medical image segmentation, they are typically not capable of generalizing to unseen segmentation tasks involving new anatomies, image modalities, or labels. Given a new segmentation task, researchers generally have to train or fine-tune models. This is time-consuming and poses a substantial barrier for clinical researchers, who often lack the resources and expertise to train neural networks. We present UniverSeg, a method for solving unseen medical segmentation tasks without additional training. Given a query image and an example set of image-label pairs that define a new segmentation task, UniverSeg employs a new CrossBlock mechanism to produce accurate segmentation maps without additional training. To achieve generalization to new tasks, we have gathered and standardized a collection of 53 open-access medical segmentation datasets with over 22,000 scans, which we refer to as MegaMedical. We used this collection to train UniverSeg on a diverse set of anatomies and imaging modalities. We demonstrate that Uni-* Denotes equal contribution verSeg substantially outperforms several related methods on unseen tasks, and thoroughly analyze and draw insights about important aspects of the proposed system. The Uni-verSeg source code and model weights are freely available at https://universeg.csail.mit.edu

For agents

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

get_harvested_code_for_paper("2304.06131")
get_code_for_paper("2304.06131")
have("2304.06131")

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

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

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

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

Connect an agent — have() is free.