SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.00947 · 2024

XNet v2: Fewer Limitations, Better Results and Greater Universality

arXiv · PDF · Open in the Atlas

Code that ran

5 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, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 4 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/2409.00947.json · badge: /api/ran/2409.00947.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
yanfeng-zhou/xnetv2 canonical (classifier label)
classifier basis: census
5 ran · 4 no recorded run
FunctionStatusWhere it lives
get_network Ran
ran; our contract draft was wrong, not the code
yanfeng-zhou/xnetv2/models/getnetwork.py
code served (permissive licence) · get_code("573416227a4dbf42")
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 SimpleUNet. 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)

# Define minimal stand-in implementations for the network functions
class SimpleUNet(nn.Module):
    def __init__(self, in_channels, num_classes):
        super().__init__()
        self.conv = nn.Conv2d(in_channels, num_classes, 3, padding=1)
    
    def forward(self, x):
        return self.conv(x)

class SimpleXNetV2(nn.Module):
    def __init__(self, in_channels, num_classes):
        super().__init__()
        self.conv = nn.Conv2d(in_channels, num_classes, 3, padding=1)
    
    def forward(self, x):
        return self.conv(x)

class SimpleXNetV2_3D_Min(nn.Module):
    def __init__(self, in_channels, num_classes):
        super().__init__()
        self.conv = nn.Conv3d(in_channels, num_classes, 3, padding=1)
    
    def forward(self, x):
        return self.conv(x)

# Create local references to these functions so get_network can call them
def unet(in_channels, num_classes):
    return SimpleUNet(in_channels, num_classes)

def xnetv2(in_channels, num_classes):
    return SimpleXNetV2(in_channels, num_classes)

def xnetv2_3d_min(in_channels, num_classes):
    return SimpleXNetV2_3D_Min(in_channels, num_classes)

# Inject these into the scope where get_network will look for them
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'unet', unet)
setattr(current_module, 'xnetv2', xnetv2)
setattr(current_module, 'xnetv2_3d_min', xnetv2_3d_min)

# Define valid arguments for get_network
ARGS = {
    'network': 'unet',
    'in_channels': 3,
    'num_classes': 10
}
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 SimpleUNet — a SimpleUNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleUNet 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
imagefloder_XNetv2 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yanfeng-zhou/xnetv2/dataload/dataset_2d.py
code served (permissive licence) · get_code("16eb179a6260c6f7")
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 dataset_XNetv2. 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 os
import torch
import numpy as np
from PIL import Image
import tempfile
import shutil

torch.manual_seed(0)

# Create temporary directory structure with test data
temp_dir = tempfile.mkdtemp()
image_dir = os.path.join(temp_dir, 'image')
mask_dir = os.path.join(temp_dir, 'mask')
os.makedirs(image_dir)
os.makedirs(mask_dir)

# Create sample images and masks
for i in range(2):
    img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(image_dir, f'image_{i}.png'))
    
    mask_array = np.random.randint(0, 2, (64, 64), dtype=np.uint8)
    mask = Image.fromarray(mask_array * 255)
    mask.save(os.path.join(mask_dir, f'image_{i}.png'))

# Create augmentation transform class that mimics albumentations
class SimpleAugmentation:
    def __call__(self, **kwargs):
        return kwargs

# Create normalization transform class
class SimpleNormalization:
    def __call__(self, **kwargs):
        result = {}
        for key, val in kwargs.items():
            if isinstance(val, np.ndarray):
                # Normalize to [0, 1] range
                val_min = np.min(val)
                val_max = np.max(val)
                if val_max - val_min > 0:
                    result[key] = torch.from_numpy((val - val_min) / (val_max - val_min)).float()
                else:
                    result[key] = torch.from_numpy(val).float()
            else:
                result[key] = val
        return result

# Setup arguments
ARGS = {
    'data_dir': temp_dir,
    'data_transform_1': SimpleAugmentation(),
    'data_normalize_1': SimpleNormalization(),
    'wavelet_type': 'db1',
    'alpha': (0.1, 0.5),
    'beta': (0.1, 0.5),
    'sup': True,
    'num_images': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, pywt, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dataset_XNetv2 — a dataset_XNetv2 output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dataset_XNetv2 output the recorded ndim 1 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
segmentation_loss Ran
ran; our contract draft was wrong, not the code
yanfeng-zhou/xnetv2/loss/loss_function.py
code served (permissive licence) · get_code("2d479a2838da5c16")
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 MixSoftmaxCrossEntropyLoss. 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 segmentation_loss function takes parameters:
# - loss: str (default not specified, but used in if-elif chain)
# - aux: bool (default False)
# - **kwargs: additional keyword arguments

# Based on the function body, we need to test the main code path.
# The function returns different loss modules based on the 'loss' parameter.

ARGS = {
    'loss': 'CE',
    'aux': 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 MixSoftmaxCrossEntropyLoss — a MixSoftmaxCrossEntropyLoss output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MixSoftmaxCrossEntropyLoss 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
unet Ran
ran; our contract draft was wrong, not the code
yanfeng-zhou/xnetv2/models/networks_2d/unet.py
code served (permissive licence) · get_code("5c1d672f866c6d11")
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 U_Net. 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.nn import init

torch.manual_seed(0)

ARGS = {
    'in_channels': 3,
    'num_classes': 1
}
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 U_Net — a U_Net output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a U_Net 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
unet3d Ran
ran; our contract draft was wrong, not the code
yanfeng-zhou/xnetv2/models/networks_3d/unet3d.py
code served (permissive licence) · get_code("111456e55acbacd1")
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 UNet3D. 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 collections import OrderedDict

torch.manual_seed(0)

ARGS = {
    'in_channels': 1,
    'num_classes': 3,
}
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 UNet3D — a UNet3D output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a UNet3D 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
unet3d_min Not yet run
unverified (harvested, no recorded run)
yanfeng-zhou/xnetv2/models/networks_3d/unet3d.py
code served (permissive licence) · get_code("af762bd0bd41ebb6")
How it ran

no invocation recorded.

xnetv2 Not yet run
unverified (harvested, no recorded run)
yanfeng-zhou/xnetv2/models/networks_2d/XNetv2.py
code served (permissive licence) · get_code("30db2ab551abd4b5")
How it ran

no invocation recorded.

xnetv2_3d Not yet run
unverified (harvested, no recorded run)
yanfeng-zhou/xnetv2/models/networks_3d/XNetv2_3D.py
code served (permissive licence) · get_code("48006cc76add68c5")
How it ran

no invocation recorded.

xnetv2_3d_min Not yet run
unverified (harvested, no recorded run)
yanfeng-zhou/xnetv2/models/networks_3d/XNetv2_3D.py
code served (permissive licence) · get_code("cdf5321731ea5def")
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, 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 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.

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

XNet introduces a wavelet-based X-shaped unified architecture for fully- and semi-supervised biomedical segmentation. So far, however, XNet still faces the limitations, including performance degradation when images lack high-frequency (HF) information, underutilization of raw images and insufficient fusion. To address these issues, we propose XNet v2, a low- and high-frequency complementary model. XNet v2 performs wavelet-based image-level complementary fusion, using fusion results along with raw images inputs three different sub-networks to construct consistency loss. Furthermore, we introduce a feature-level fusion module to enhance the transfer of low-frequency (LF) information and HF information. XNet v2 achieves state-of-the-art in semi-supervised segmentation while maintaining competitve results in fully-supervised learning. More importantly, XNet v2 excels in scenarios where XNet fails. Compared to XNet, XNet v2 exhibits fewer limitations, better results and greater universality. Extensive experiments on three 2D and two 3D datasets demonstrate the effectiveness of XNet v2. Code is available at https://github.com/Yanfeng-Zhou/XNetv2 .

For agents

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

get_harvested_code_for_paper("2409.00947")
get_code_for_paper("2409.00947")
have("2409.00947")

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

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

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

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

Connect an agent — have() is free.