SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.00317 · CVPR · 2021

Explore Image Deblurring via Encoded Blur Kernel Space

Minh Hoai, Anh Tran, Phong Tran, Quynh Phung

arXiv · PDF · Open in the Atlas

Code that ran

3 of 7 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 2 have no contract verdict; 1 failure 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/2104.00317.json · badge: /api/ran/2104.00317.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
VinAIResearch/blur-kernel-space-exploring marked official in Papers with Code
Papers with Code archive
3 ran · 4 no recorded run
FunctionStatusWhere it lives
ResidualBlock_noBN Ran
ran on a synthesized input
VinAIResearch/blur-kernel-space-exploring/models/kernel_encoding/kernel_wizard.py
code served (permissive licence) · get_code("d9559e2de1750a1d")
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 4, dtype family float, shape (2, 8, 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
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F

def initialize_weights(net_l, scale=1):
    if not isinstance(net_l, list):
        net_l = [net_l]
    for net in net_l:
        for m in net.modules():
            if isinstance(m, nn.Conv2d):
                init.kaiming_normal_(m.weight, a=0, mode='fan_in')
                m.weight.data *= scale
                if m.bias is not None:
                    m.bias.data.zero_()
            elif isinstance(m, nn.Linear):
                init.kaiming_normal_(m.weight, a=0, mode='fan_in')
                m.weight.data *= scale
                if m.bias is not None:
                    m.bias.data.zero_()
            elif isinstance(m, nn.BatchNorm2d):
                init.constant_(m.weight, 1)
                init.constant_(m.bias.data, 0.0)

class ResidualBlock_noBN(nn.Module):
    """Residual block w/o BN
    ---Conv-ReLU-Conv-+-
     |________________|
    """

    def __init__(self, nf=64):
        super(ResidualBlock_noBN, self).__init__()
        self.conv1 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True)
        self.conv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True)
        initialize_weights([self.conv1, self.conv2], 0.1)

    def forward(self, x):
        identity = x
        out = F.relu(self.conv1(x), inplace=False)
        out = self.conv2(out)
        return identity + out

INIT_ARGS = {
    'nf': 8
}

ARGS = {
    'x': torch.randn(2, 8, 4, 3)
}

if __name__ == '__main__':
    model = ResidualBlock_noBN(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: {ARGS['x'].shape}")
    assert output.shape == ARGS['x'].shape, "Output shape mismatch"
    print("Test passed!")
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 4, dtype family float, shape (2, 8, 4, 3) — shape (2, 8, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResnetBlock Ran
ran on a synthesized input
VinAIResearch/blur-kernel-space-exploring/models/kernel_encoding/kernel_wizard.py
code served (permissive licence) · get_code("9c92d5a9436b3cd9")
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 4, dtype family float, shape (2, 64, 8, 8) 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

# Define initialization arguments
INIT_ARGS = {
    'dim': 64,
    'padding_type': 'reflect',
    'norm_layer': nn.BatchNorm2d,
    'use_dropout': True,
    'use_bias': False,
}

# Define forward pass arguments
ARGS = {
    'x': torch.randn(2, 64, 8, 8),
}

# Construct and call the class
if __name__ == '__main__':
    model = nn.Module()
    
    class ResnetBlock(nn.Module):
        """Define a Resnet block"""

        def __init__(self, dim, padding_type, norm_layer, use_dropout, use_bias):
            """Initialize the Resnet block
            A resnet block is a conv block with skip connections
            We construct a conv block with build_conv_block function,
            and implement skip connections in <forward> function.
            Original Resnet paper: https://arxiv.org/pdf/1512.03385.pdf
            """
            super(ResnetBlock, self).__init__()
            self.conv_block = self.build_conv_block(dim, padding_type, norm_layer, use_dropout, use_bias)

        def build_conv_block(self, dim, padding_type, norm_layer, use_dropout, use_bias):
            """Construct a convolutional block.
            Parameters:
                dim (int)           -- the number of channels in the conv layer.
                padding_type (str)  -- the name of padding
                                       layer: reflect | replicate | zero
                norm_layer          -- normalization layer
                use_dropout (bool)  -- if use dropout layers.
                use_bias (bool)     -- if the conv layer uses bias or not
            Returns a conv block (with a conv layer, a normalization layer,
                                  and a non-linearity layer (ReLU))
            """
            conv_block = []
            p = 0
            if padding_type == 'reflect':
                conv_block += [nn.ReflectionPad2d(1)]
            elif padding_type == 'replicate':
                conv_block += [nn.ReplicationPad2d(1)]
            elif padding_type == 'zero':
                p = 1
            else:
                raise NotImplementedError(f'padding {padding_type} is not implemented')
            conv_block += [nn.Conv2d(dim, dim, kernel_size=3, padding=p, bias=use_bias), norm_layer(dim), nn.ReLU(True)]
            if use_dropout:
                conv_block += [nn.Dropout(0.5)]
            p = 0
            if padding_type == 'reflect':
                conv_block += [nn.ReflectionPad2d(1)]
            elif padding_type == 'replicate':
                conv_block += [nn.ReplicationPad2d(1)]
            elif padding_type == 'zero':
                p = 1
            else:
                raise NotImplementedError(f'padding {padding_type} is not implemented')
            conv_block += [nn.Conv2d(dim, dim, kernel_size=3, padding=p, bias=use_bias), norm_layer(dim)]
            return nn.Sequential(*conv_block)

        def forward(self, x):
            """Forward function (with skip connections)"""
            out = x + self.conv_block(x)
            return out

    resnet_block = ResnetBlock(**INIT_ARGS)
    output = resnet_block(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: {ARGS['x'].shape}")
    assert output.shape == ARGS['x'].shape, "Output shape mismatch"
    print("Success!")
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 4, dtype family float, shape (2, 64, 8, 8) — shape (2, 64, 8, 8) 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)
get_norm_layer Ran
ran; our contract draft was wrong, not the code
VinAIResearch/blur-kernel-space-exploring/models/kernel_encoding/kernel_wizard.py
code served (permissive licence) · get_code("51b7f1eec09b0863")
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 partial. 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
import functools

torch.manual_seed(0)

class Identity(nn.Module):
    def forward(self, x):
        return x

def get_norm_layer(norm_type='instance'):
    """Return a normalization layer
    Parameters:
        norm_type (str) -- the name of the normalization
                            layer: batch | instance | none

    For BatchNorm, we use learnable affine parameters and
    track running statistics (mean/stddev).

    For InstanceNorm, we do not use learnable affine
    parameters. We do not track running statistics.
    """
    if norm_type == 'batch':
        norm_layer = functools.partial(nn.BatchNorm2d, affine=True, track_running_stats=True)
    elif norm_type == 'instance':
        norm_layer = functools.partial(nn.InstanceNorm2d, affine=False, track_running_stats=False)
    elif norm_type == 'none':

        def norm_layer(x):
            return Identity()
    else:
        raise NotImplementedError(f'normalization layer {norm_type}                                    is not found')
    return norm_layer

ARGS = {
    'norm_type': 'instance'
}
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 partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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
KernelAdapter Not yet run
unverified (harvested, no recorded run)
VinAIResearch/blur-kernel-space-exploring/models/kernel_encoding/kernel_wizard.py
code served (permissive licence) · get_code("76b78282fc6301fa")
How it ran

no invocation recorded.

KernelExtractor Not yet run
unverified (harvested, no recorded run)
VinAIResearch/blur-kernel-space-exploring/models/kernel_encoding/kernel_wizard.py
code served (permissive licence) · get_code("ced24bc291963da6")
How it ran

no invocation recorded.

KernelWizard Not yet run
unverified (harvested, no recorded run)
VinAIResearch/blur-kernel-space-exploring/models/kernel_encoding/kernel_wizard.py
code served (permissive licence) · get_code("3630f2fa96d79752")
How it ran

no invocation recorded.

UnetSkipConnectionBlock Not yet run
unverified (harvested, no recorded run)
VinAIResearch/blur-kernel-space-exploring/models/kernel_encoding/kernel_wizard.py
code served (permissive licence) · get_code("7bf412873e1cf26a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
get_norm_layer
brick of this paper's assembly: helper
1 other paper
1 later
2605.27990 (2026-05)
Geometry-Correct Diffusion Posterior Sampling with Denoiser-Pullback Curvature Guidance and Manifold-Aligned Damping

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

This paper introduces a method to encode the blur operators of an arbitrary dataset of sharp-blur image pairs into a blur kernel space. Assuming the encoded kernel space is close enough to in-the-wild blur operators, we propose an alternating optimization algorithm for blind image deblurring. It approximates an unseen blur operator by a kernel in the encoded space and searches for the corresponding sharp image. Unlike recent deep-learningbased methods, our system can handle unseen blur kernel, while avoiding using complicated handcrafted priors on the blur operator often found in classical methods. Due to the method's design, the encoded kernel space is fully differentiable, thus can be easily adopted in deep neural network models. Moreover, our method can be used for blur synthesis by transferring existing blur operators from a given dataset into a new domain. Finally, we provide experimental results to confirm the effectiveness of the proposed method. The code is available at https: //github.com/VinAIResearch/blur-kernelspace-exploring.

For agents

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

get_harvested_code_for_paper("2104.00317")
get_code_for_paper("2104.00317")
have("2104.00317")

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

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

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

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

Connect an agent — have() is free.