SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.13417 · CVPR · 2024

Diversified and Personalized Multi-rater Medical Image Segmentation

Zhe Xu, Zongyuan Ge, Kong, Jianfei Cai, Xiangde Luo, Yicheng Wu, Xiaoqing Guo, Wenjun Liao

arXiv · PDF · Open in the Atlas

Code that ran

6 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 7 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/2403.13417.json · badge: /api/ran/2403.13417.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
ycwu1997/D-Persona community
Papers with Code archive
6 ran · 7 no recorded run
FunctionStatusWhere it lives
AxisAlignedConvGaussian Ran
ran on a synthesized input · constructed an object; no result was computed
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("b18d9d9e9cc5fd70")
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, AxisAlignedConvGaussian: 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.distributions import Normal, Independent

torch.manual_seed(0)

# Define the initializers parameter - it's passed to Encoder but not actually used in the code
initializers = {}

# Build ARGS dict with all parameters for AxisAlignedConvGaussian
ARGS = {
    'input_channels': 3,
    'num_filters': [16, 32],
    'no_convs_per_block': 2,
    'latent_dim': 4,
    'initializers': initializers,
    'posterior': 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 AxisAlignedConvGaussian — 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 AxisAlignedConvGaussian 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
Conv_block Ran
ran on a synthesized input · constructed an object; no result was computed
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("3ee9c5b960877358")
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, Conv_block: 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

torch.manual_seed(0)

ARGS = {
    'input_channels': 3,
    'num_filters': [16, 32, 64],
    'padding': True
}
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 Conv_block — 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 Conv_block 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
Encoder Ran
ran on a synthesized input · constructed an object; no result was computed
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("4c04758700bbb420")
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, Encoder: 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

torch.manual_seed(0)

ARGS = {
    "input_channels": 3,
    "num_filters": [16, 32, 64],
    "no_convs_per_block": 2,
    "initializers": None,
    "padding": True,
    "posterior": 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 Encoder — 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 Encoder 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
Fcomb Ran
ran on a synthesized input · constructed an object; no result was computed
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("000cfc831f795d4b")
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, Fcomb: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn
import numpy as np

torch.manual_seed(0)

# Create initializers dict
initializers = {
    'w': 'kaiming'  # or 'orthogonal'
}

# Define ARGS dict with all parameters for Fcomb
ARGS = {
    'num_filters': [32, 64],
    'latent_dim': 8,
    'num_output_channels': 3,
    'num_classes': 5,
    'no_convs_fcomb': 3,
    'initializers': initializers,
    'use_tile': True
}
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 Fcomb — 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 Fcomb 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
Projection Ran
ran on a synthesized input · constructed an object; no result was computed
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("d48d3bee8bf2ad60")
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, Projection: 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

torch.manual_seed(0)

# Define the helper functions and classes from the function body
def truncated_normal_(tensor, mean=0, std=1):
    size = tensor.shape
    tmp = tensor.new_empty(size + (4,)).normal_()
    valid = (tmp < 2) & (tmp > -2)
    ind = valid.max(-1, keepdim=True)[1]
    tensor.data.copy_(tmp.gather(-1, ind).squeeze(-1))
    tensor.data.mul_(std).add_(mean)

def init_weights(m):
    if type(m) == nn.Conv2d or type(m) == nn.ConvTranspose2d:
        nn.init.kaiming_normal_(m.weight, mode='fan_in', nonlinearity='relu')
        truncated_normal_(m.bias, mean=0, std=0.001)

class Conv_block(nn.Module):
    def __init__(self, input_channels, num_filters, padding=True):
        super(Conv_block, self).__init__()
        self.input_channels = input_channels
        self.num_filters = num_filters
        layers = []
        for i in range(len(self.num_filters)):
            input_dim = self.input_channels if i == 0 else output_dim
            output_dim = num_filters[i]
            if i != 0:
                layers.append(nn.AvgPool2d(kernel_size=2, stride=2, padding=0))
            layers.append(nn.Conv2d(input_dim, output_dim, kernel_size=3, padding=int(padding)))
            layers.append(nn.ReLU(inplace=True))
            layers.append(nn.Dropout2d(0.1))
            layers.append(nn.Conv2d(output_dim, output_dim, kernel_size=3, padding=int(padding)))
            layers.append(nn.ReLU(inplace=True))
        self.layers = nn.Sequential(*layers)
        self.layers.apply(init_weights)

    def forward(self, input):
        output = self.layers(input)
        return output

class Projection(nn.Module):
    def __init__(self, num_experts, latent_dim):
        super(Projection, self).__init__()
        self.num_experts = num_experts
        self.latent_dim = latent_dim
        self.multi_expert_heads = nn.ModuleList([Conv_block(16, [32, 16, 6], 3) for _ in range(self.num_experts)])
        self.pooling_layer = nn.AdaptiveAvgPool2d([1, 1])
        self.activation = torch.nn.Softmax(dim=2)

    def forward(self, feature_map, z_set, idx):
        feats = self.multi_expert_heads[idx](feature_map)
        bs = feature_map.shape[0]
        global_z = self.pooling_layer(feats).view(bs, self.latent_dim, -1).permute(0, 2, 1)
        z_expert = global_z
        similarity = torch.bmm(z_expert, z_set.permute(0, 2, 1))
        similarity = self.activation(similarity)
        output = torch.bmm(similarity, z_set)
        return output

# Create instances for ARGS
num_experts = 2
latent_dim = 6
projection = Projection(num_experts=num_experts, latent_dim=latent_dim)

# Create input tensors
# feature_map: batch_size=2, channels=16, height=8, width=8
feature_map = torch.randn(2, 16, 8, 8)

# z_set: batch_size=2, num_vectors=3, latent_dim=6
z_set = torch.randn(2, 3, 6)

# idx: index into multi_expert_heads
idx = 0

ARGS = {
    "num_experts": num_experts,
    "latent_dim": latent_dim,
}
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 Projection — 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 Projection 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
l2_regularisation Ran
ran, honoured the contract we drafted
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("c23b05634625d281")
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
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

m = SimpleModel()

ARGS = {
    "m": m
}
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
DPersona Not yet run
unverified (harvested, no recorded run)
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("5eee90808985ff41")
How it ran

no invocation recorded.

Unet Not yet run
unverified (harvested, no recorded run)
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("027e3b920d3ea5ac")
How it ran

no invocation recorded.

UnetHeadless Not yet run
unverified (harvested, no recorded run)
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("7f90b2fef3d369fd")
How it ran

no invocation recorded.

create_segmentation_backbone Not yet run
unverified (harvested, no recorded run)
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("418bd83da2c8743a")
How it ran

no invocation recorded.

init_weights Not yet run
unverified (harvested, no recorded run)
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("1ee546f8f6f45bb4")
How it ran

no invocation recorded.

init_weights_orthogonal_normal Not yet run
unverified (harvested, no recorded run)
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("8a8e825e5c98f97a")
How it ran

no invocation recorded.

truncated_normal_ Not yet run
unverified (harvested, no recorded run)
ycwu1997/D-Persona/D-Persona/code/lib/DPersona.py
code served (permissive licence) · get_code("6f12908079fae859")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 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
l2_regularisation
brick of this paper's assembly: helper
6 other papers
4 dated earlier, 2 later
1806.05034 (2018-06)
A Probabilistic U-Net for Segmentation of Ambiguous Images
1907.01949 (2019-07)
Supervised Uncertainty Quantification for Segmentation with Multiple Annotations
2203.04895 (2022-03)
Joint Learning of Salient Object Detection, Depth Estimation and Contour Extraction
and 3 more not named here
init_weights
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2306.05671 (2023-06)
Topology-Aware Uncertainty for Image Segmentation
truncated_normal_
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2306.05671 (2023-06)
Topology-Aware Uncertainty for 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-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

Annotation ambiguity due to inherent data uncertainties such as blurred boundaries in medical scans and different observer expertise and preferences has become a major obstacle for training deep-learning based medical image segmentation models. To address it, the common practice is to gather multiple annotations from different experts, leading to the setting of multi-rater medical image segmentation. Existing works aim to either merge different annotations into the "groundtruth" that is often unattainable in numerous medical contexts, or generate diverse results, or produce personalized results corresponding to individual expert raters. Here, we bring up a more ambitious goal for multi-rater medical image segmentation, i.e., obtaining both diversified and personalized results. Specifically, we propose a two-stage framework named D-Persona (first Diversification and then Personalization). In Stage I, we exploit multiple given annotations to train a Probabilistic U-Net model, with a bound-constrained loss to improve the prediction diversity. In this way, a common latent space is constructed in Stage I, where different latent codes denote diversified expert opinions. Then, in Stage II, we design multiple attention-based projection heads to adaptively query the corresponding expert prompts from the shared latent space, and then perform the personalized medical image segmentation. We evaluated the proposed model on our in-house Nasopharyngeal Carcinoma dataset and the public lung nodule dataset (i.e., LIDC-IDRI). Extensive experiments demonstrated our D-Persona can provide diversified and personalized results at the same time, achieving new SOTA performance for multi-rater medical image segmentation. Our code will be released at https: //github.com/ycwu1997/D-Persona.

For agents

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

get_harvested_code_for_paper("2403.13417")
get_code_for_paper("2403.13417")
have("2403.13417")

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

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

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

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

Connect an agent — have() is free.