SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.07328 · ICLR · 2023

MODELING MULTIMODAL ALEATORIC UNCERTAINTY IN SEGMENTATION WITH MIXTURE OF STOCHASTIC EXPERTS

Zhitong Gao, Yucong Chen, Chuyu Zhang, Xuming He

arXiv · PDF · Open in the Atlas

Code that ran

5 of 10 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; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 5 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/2212.07328.json · badge: /api/ran/2212.07328.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
gaozhitong/mose-auseg marked official in Papers with Code
Papers with Code archive
5 ran · 3 no recorded run
IMPLabUniPr/swin2-mose extension (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 1 no recorded run
FunctionStatusWhere it lives
Gating Ran
ran on a synthesized input
gaozhitong/mose-auseg/models/MoSE.py
code served (permissive licence) · get_code("64cc9ace598f9303")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 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 torch
import torch.nn as nn

class Gating(nn.Module):
    """
    Get probabilities for experts using the gating network.
    """

    def __init__(self, num_filter, num_expert):
        super(Gating, self).__init__()
        self.num_expert = num_expert
        self.fc_layer = nn.Sequential(nn.Linear(num_filter, num_filter, bias=True), nn.ReLU(), nn.Linear(num_filter, num_filter, bias=True), nn.ReLU(), nn.Linear(num_filter, self.num_expert, bias=False))

    def forward(self, feature_map):
        encoding = torch.mean(feature_map, dim=2, keepdim=True).squeeze(dim=2)
        encoding = torch.mean(encoding, dim=2, keepdim=True).squeeze(dim=2)
        z = self.fc_layer(encoding)
        prob = torch.nn.functional.softmax(z, dim=-1).float()
        return prob


INIT_ARGS = {
    'num_filter': 4,
    'num_expert': 3,
}

ARGS = {
    'feature_map': torch.randn(2, 4, 5, 6),
}

if __name__ == '__main__':
    model = Gating(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float, shape (2, 3) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
cal_metrics_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gaozhitong/mose-auseg/models/MoSE.py
code served (permissive licence) · get_code("f66c73d52b935e54")
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.functional as F
import numpy as np

torch.manual_seed(0)

# Create sample and gt arrays
# Shape: (B, N, H, W) for binary segmentation
B, N, M, H, W = 2, 3, 2, 4, 4
sample_arr = torch.randint(0, 2, (B, N, H, W), dtype=torch.long)
gt_arr = torch.randint(0, 2, (B, M, H, W), dtype=torch.long)

# Create probability distributions
prob_sample = torch.ones(B, N) / N
prob_gt = torch.ones(B, M) / M

ARGS = {
    "sample_arr": sample_arr,
    "gt_arr": gt_arr,
    "prob_sample": prob_sample,
    "prob_gt": prob_gt,
    "to_one_hot": False,
    "nlabels": 1,
    "label_range": None,
    "ret_h_score": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, ot, scipy, 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
get_uniform_prob Ran
ran, honoured the contract we drafted
gaozhitong/mose-auseg/models/MoSE.py
code served (permissive licence) · get_code("9dfce7cb25c702b3")
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) and returned Tensor, ndim 1, dtype family float, shape (5,) 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

torch.manual_seed(0)

# N is the number of elements for the uniform probability distribution
N = 5

# device is where the tensor should be created
device = 'cpu'

ARGS = {
    'N': N,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 1, dtype family float, shape (5,) — shape (5,) 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_weight Ran
ran; our contract draft was wrong, not the code
gaozhitong/mose-auseg/models/MoSE.py
code served (permissive licence) · get_code("51d24951f7ebb889")
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) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 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 torch

torch.manual_seed(0)

# Create small batch tensors for probability distributions
# prob_sample: shape (batch_size, num_classes)
# prob_gt: shape (batch_size, num_classes)
prob_sample = torch.rand(2, 4)  # batch=2, dim=4
prob_gt = torch.rand(2, 3)      # batch=2, dim=3 (different from prob_sample for clarity)

ARGS = {
    "prob_sample": prob_sample,
    "prob_gt": prob_gt,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 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
iou_dist Ran
ran; our contract draft was wrong, not the code
gaozhitong/mose-auseg/models/MoSE.py
code served (permissive licence) · get_code("3f73f92d47dc1956")
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 numpy as np

torch.manual_seed(0)

# m1: tensor used in torch.sum(m1 * m2, dim=[-1, -2]) and torch.sum(m1, dim=[-1, -2])
# Shape should be (batch, height, width) or similar with at least 2 spatial dims
m1 = torch.randn(2, 4, 3)

# m2: tensor with same shape as m1, used in element-wise multiplication
m2 = torch.randn(2, 4, 3)

# label_range: used in condition "if label_range is not None and len(label_range) > 1"
# Should be a sequence with more than 1 element to trigger the nanmean branch
label_range = [0, 1, 2]

ARGS = {
    "m1": m1,
    "m2": m2,
    "label_range": label_range,
    "eps": 1e-08,
}
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 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
MoSE Not yet run
unverified (harvested, no recorded run)
gaozhitong/mose-auseg/models/MoSE.py
code served (permissive licence) · get_code("dcebf3751afb1a72")
How it ran

no invocation recorded.

Noise_injector Not yet run
unverified (harvested, no recorded run)
gaozhitong/mose-auseg/models/MoSE.py
code served (permissive licence) · get_code("e31e897e9545b529")
How it ran

no invocation recorded.

build_model Not yet run
unverified (harvested, no recorded run)
IMPLabUniPr/swin2-mose/src/super_res/model.py
pointer only (licence: GPL-2.0) · get_code("b985a16c7e304bc8")
How it ran

The body of this sample is withheld: GPL-2.0, as GitHub detects it on this paper's repository, IMPLabUniPr/swin2-mose, is not in the permissive set Syntology serves inline. 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. No invocation recorded.

get_cost_matrix Not yet run
unverified (harvested, no recorded run)
gaozhitong/mose-auseg/models/MoSE.py
code served (permissive licence) · get_code("9c5ac86b50c73a3f")
How it ran

no invocation recorded.

nanmean Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from OATML-Markslab/Tranception
pointer only · get_code("5574012ba4af04ff")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. No invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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
nanmean
brick of this paper's assembly: helper
2 other papers
2 dated earlier
2106.02584 (2021-06)
Self-Attention Between Datapoints: Going Beyond Individual Input-Output Pairs in Deep Learning
2205.13760 (2022-05)
Tranception: protein fitness prediction with autoregressive transformers and inference-time retrieval

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

Equipping predicted segmentation with calibrated uncertainty is essential for safety-critical applications. In this work, we focus on capturing the data-inherent uncertainty (aka aleatoric uncertainty) in segmentation, typically when ambiguities exist in input images. Due to the high-dimensional output space and potential multiple modes in segmenting ambiguous images, it remains challenging to predict well-calibrated uncertainty for segmentation. To tackle this problem, we propose a novel mixture of stochastic experts (MoSE) model, where each expert network estimates a distinct mode of the aleatoric uncertainty and a gating network predicts the probabilities of an input image being segmented in those modes. This yields an efficient two-level uncertainty representation. To learn the model, we develop a Wasserstein-like loss that directly minimizes the distribution distance between the MoSE and ground truth annotations. The loss can easily integrate traditional segmentation quality measures and be efficiently optimized via constraint relaxation. We validate our method on the LIDC-IDRI dataset and a modified multimodal Cityscapes dataset. Results demonstrate that our method achieves the state-of-the-art or competitive performance on all metrics. 1

For agents

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

get_harvested_code_for_paper("2212.07328")
get_code_for_paper("2212.07328")
have("2212.07328")

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

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

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

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

Connect an agent — have() is free.