SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.05723 · NeurIPS · 2024

Binarized Diffusion Model for Image Super-Resolution

Yong Guo, Xin Yuan, Yulun Zhang, Linghe Kong, Zheng Chen, Haotong Qin, Xiongfei Su

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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, 2 violated it and 1 has no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-21; 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/2406.05723.json · badge: /api/ran/2406.05723.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
zhengchen1999/BI-DiffSR canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
default Ran
ran, violated the contract we drafted
zhengchen1999/BI-DiffSR/diffglv/archs/unet_BI_DiffSR_arch.py
code served (permissive licence) · get_code("fbf9ec7be545688e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned str. 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 numpy as np
from inspect import isfunction

torch.manual_seed(0)

# Test case 1: val exists (not None), d is a regular value
val_case1 = 42
d_case1 = 100

# Test case 2: val is None, d is a regular value
val_case2 = None
d_case2 = "default_string"

# Test case 3: val is None, d is a function
val_case3 = None
def d_case3():
    return [1, 2, 3]

# Test case 4: val exists, d is a function (function should not be called)
val_case4 = torch.tensor([1.0, 2.0, 3.0])
def d_case4():
    return torch.tensor([4.0, 5.0, 6.0])

# We'll use case 2 for the main ARGS
ARGS = {
    'val': None,
    'd': "default_value"
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
dict2str Ran
ran; our contract draft was wrong, not the code
zhengchen1999/BI-DiffSR/diffglv/utils/options.py
code served (permissive licence) · get_code("769e9c110eeb4a0d")
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 str. 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

# Simple nested dictionary with various types of values
opt = {
    'model_name': 'resnet50',
    'learning_rate': 0.001,
    'batch_size': 32,
    'use_cuda': False,
    'training': {
        'epochs': 100,
        'optimizer': 'adam',
        'loss': {
            'type': 'cross_entropy',
            'weight': 0.5
        }
    },
    'augmentation': {
        'flip': True,
        'rotate': 90
    }
}

ARGS = {
    'opt': opt,
    'indent_level': 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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
disabled_train Ran
ran on a synthesized input
zhengchen1999/BI-DiffSR/diffglv/metrics/lpips.py
code served (permissive licence) · get_code("566b9df70aa38276")
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 SimpleModel. 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)

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

model = SimpleModel()

ARGS = {
    "self": model
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
exists Ran
ran, violated the contract we drafted
zhengchen1999/BI-DiffSR/diffglv/archs/unet_BI_DiffSR_arch.py
code served (permissive licence) · get_code("608e364a9d2376a3")
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 bool, 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

def exists(x):
    return x is not None

ARGS = {
    "x": torch.tensor([1, 2, 3, 4])
}
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 bool, 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_position_from_periods Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhengchen1999/BI-DiffSR/diffglv/utils/lr_scheduler.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from AlifAshrafee/Restoring-Without-Forgetting, is pointer only (licence: NONE) · get_code("cd569444547de84f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from AlifAshrafee/Restoring-Without-Forgetting, and GitHub detected no licence in that repository when it was checked. 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.

make_beta_schedule Ran
ran, honoured the contract we drafted
zhengchen1999/BI-DiffSR/diffglv/utils/beta_schedule.py
code served (permissive licence) · get_code("78feb2965623416b")
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 ndarray, ndim 1, dtype family float, shape (100,) 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
import math

torch.manual_seed(0)

ARGS = {
    'schedule': 'linear',
    'n_timestep': 100,
    'linear_start': 0.0001,
    'linear_end': 0.02,
    'cosine_s': 0.008
}
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 ndarray, ndim 1, dtype family float, shape (100,) — shape (100,) 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
worker Ran
ran; our contract draft was wrong, not the code
zhengchen1999/BI-DiffSR/diffglv/utils/extract_subimages.py
code served (permissive licence) · get_code("4d7726c024b37357")
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 str. 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 cv2
import numpy as np
import tempfile
import os

# Create a temporary directory for saving crops
temp_dir = tempfile.mkdtemp()

# Create a small test image (100x100 RGB image)
test_image = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
temp_image_path = os.path.join(temp_dir, "test_imagex2.png")
cv2.imwrite(temp_image_path, test_image)

# Define the opt dictionary with all required parameters
opt = {
    'crop_size': 32,
    'step': 16,
    'thresh_size': 8,
    'save_folder': temp_dir,
    'compression_level': 9
}

# Define ARGS mapping
ARGS = {
    'path': temp_image_path,
    'opt': opt
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
worker Ran
ran; our contract draft was wrong, not the code
zhengchen1999/BI-DiffSR/diffglv/utils/make_ds.py
code served (permissive licence) · get_code("def5f7aaab361d9c")
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 str. 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 tempfile
import os
from PIL import Image
import numpy as np

# Create a temporary directory for saving
temp_dir = tempfile.mkdtemp()

# Create a small test image file
test_image_path = os.path.join(temp_dir, "test_image.png")
test_image_array = np.random.randint(0, 256, (120, 120, 3), dtype=np.uint8)
test_image = Image.fromarray(test_image_array)
test_image.save(test_image_path)

# Define the opt dictionary with all required keys
opt = {
    'scale': 4,
    'save_folder': temp_dir,
    'downsample_type': 'bicubic',
    'wash_only': False,
    'rescaling': True,
}

ARGS = {
    'path': test_image_path,
    'opt': opt,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 3 the same month, 4 later) and 1 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
default 207 other papers
150 dated earlier, 7 the same month, 44 later, 6 same year, order not determinable · 41 only as an assembly brick
1711.11585 (2017-11)
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2010.08162 (2020-10)
SidechainNet: An All-Atom Protein Structure Dataset for Machine Learning
and 204 more not named here
exists 144 other papers
86 dated earlier, 5 the same month, 48 later, 5 same year, order not determinable · 40 only as an assembly brick
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1711.11585 (2017-11)
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
and 141 more not named here
get_position_from_periods 55 other papers
35 dated earlier, 3 the same month, 14 later, 3 same year, order not determinable
2110.04627 (2021-10)
Vector-quantized Image Modeling with Improved VQGAN
136790177 (2022 (year only))
Frequency and Spatial Dual Guidance for Image Dehazing
2204.04676 (2022-04)
Simple Baselines for Image Restoration
and 52 more not named here
disabled_train 2 other papers
1 dated earlier, 1 later
2311.16518 (2023-11)
SeeSR: Towards Semantics-Aware Real-World Image Super-Resolution
2503.19262 (2025-03)
Learning Hazing to Dehazing: Towards Realistic Haze Generation for Real-World Image Dehazing
dict2str 1 other paper
1 dated earlier
2305.12966 (2023-05)
Hierarchical Integration Diffusion Model for Realistic Image Deblurring
make_beta_schedule 1 other paper
1 dated earlier
2305.12966 (2023-05)
Hierarchical Integration Diffusion Model for Realistic Image Deblurring
worker 1 other paper
1 dated earlier
1809.00219 (2018-09)
ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Advanced diffusion models (DMs) perform impressively in image super-resolution (SR), but the high memory and computational costs hinder their deployment. Binarization, an ultra-compression algorithm, offers the potential for effectively accelerating DMs. Nonetheless, due to the model structure and the multi-step iterative attribute of DMs, existing binarization methods result in significant performance degradation. In this paper, we introduce a novel binarized diffusion model, BI-DiffSR, for image SR. First, for the model structure, we design a UNet architecture optimized for binarization. We propose the consistent-pixel-downsample (CP-Down) and consistent-pixel-upsample (CP-Up) to maintain dimension consistent and facilitate the full-precision information transfer. Meanwhile, we design the channel-shuffle-fusion (CS-Fusion) to enhance feature fusion in skip connection. Second, for the activation difference across timestep, we design the timestep-aware redistribution (TaR) and activation function (TaA). The TaR and TaA dynamically adjust the distribution of activations based on different timesteps, improving the flexibility and representation alability of the binarized module. Comprehensive experiments demonstrate that our BI-DiffSR outperforms existing binarization methods. Code is released at: https://github.com/zhengchen1999/BI-DiffSR.

For agents

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

get_harvested_code_for_paper("2406.05723")
get_code_for_paper("2406.05723")
have("2406.05723")

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

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

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

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

Connect an agent — have() is free.