SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.02881 · 2023

KBNet: Kernel Basis Network for Image Restoration

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 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/2303.02881.json · badge: /api/ran/2303.02881.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
zhangyi-3/kbnet canonical (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
MAE Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhangyi-3/kbnet/Defocus_Deblurring/utils.py
code served (permissive licence) · get_code("5590b75db4c828a0")
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 float64, ndim 0, 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 numpy as np
from sklearn.metrics import mean_absolute_error

# The function expects two image arrays with shape (height, width, channels)
# where channels = 3 (it accesses indices 0, 1, 2)
# Create small distinct-sized image arrays
img1 = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8).astype(np.float32)
img2 = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8).astype(np.float32)

ARGS = {
    'img1': img1,
    'img2': img2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
PSNR Ran
ran, honoured the contract we drafted
zhangyi-3/kbnet/Defocus_Deblurring/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from fvasluianu97/RLN2, is pointer only (licence: NONE) · get_code("8eccacd101833667")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from fvasluianu97/RLN2, 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.

calculate_fid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhangyi-3/kbnet/basicsr/metrics/fid.py
code served (permissive licence) · get_code("1d7ce6d6dd7ff5c1")
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 float64, ndim 0, 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 numpy as np
from scipy import linalg

np.random.seed(0)

# Create small test matrices for FID calculation
# Using dimension 4 for feature space
feature_dim = 4

# Generate sample means (1D arrays of shape (4,))
mu1 = np.random.randn(feature_dim).astype(np.float32)
mu2 = np.random.randn(feature_dim).astype(np.float32)

# Generate covariance matrices (4x4 positive semi-definite matrices)
# Create them from random data to ensure they're positive semi-definite
A1 = np.random.randn(feature_dim, feature_dim).astype(np.float32)
sigma1 = (A1 @ A1.T) + np.eye(feature_dim) * 0.1

A2 = np.random.randn(feature_dim, feature_dim).astype(np.float32)
sigma2 = (A2 @ A2.T) + np.eye(feature_dim) * 0.1

ARGS = {
    'mu1': mu1,
    'sigma1': sigma1,
    'mu2': mu2,
    'sigma2': sigma2,
    'eps': 1e-06
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
calculate_psnr Ran
ran; our contract draft was wrong, not the code
zhangyi-3/kbnet/Denoising/utils_tool.py
pointer only (licence: MIT); the stored copy get_code serves, from AlifAshrafee/Restoring-Without-Forgetting, is pointer only (licence: NONE) · get_code("d292dd965ab59629")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), 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.

calculate_ssim Ran
ran; our contract draft was wrong, not the code
zhangyi-3/kbnet/Denoising/utils_tool.py
pointer only (licence: MIT); the stored copy get_code serves, from AlifAshrafee/Restoring-Without-Forgetting, is pointer only (licence: NONE) · get_code("a05b184dc6c264a0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), 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.

extract_inception_features Ran
ran, honoured the contract we drafted
zhangyi-3/kbnet/basicsr/metrics/fid.py
code served (permissive licence) · get_code("c9fb213c957dc82d")
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 2, dtype family float, shape (6, 128) as a later run recorded it. 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, 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)

# Create a minimal Inception model that returns a tuple with features
class MinimalInception(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 8, kernel_size=3, padding=1)
    
    def forward(self, x):
        # Return tuple where first element is the feature tensor
        features = self.conv(x)
        return (features,)

# Create a data generator that yields batches
def data_generator():
    for _ in range(3):
        # Yield tensors of shape (2, 3, 4, 4) - batch of 2, 3 channels, 4x4 spatial
        yield torch.randn(2, 3, 4, 4)

# Build the arguments
inception_model = MinimalInception()
gen = data_generator()

ARGS = {
    'data_generator': gen,
    'inception': inception_model,
    'len_generator': 3,
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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 (6, 128) — shape (6, 128) 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)
zhangyi-3/kbnet/basicsr/models/lr_scheduler.py
pointer only (licence: MIT); 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 (MIT), 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.

ssim Ran
ran, honoured the contract we drafted
zhangyi-3/kbnet/Denoising/utils_tool.py
pointer only (licence: MIT); the stored copy get_code serves, from AlifAshrafee/Restoring-Without-Forgetting, is pointer only (licence: NONE) · get_code("ba721aeacc165234")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), 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.

SSIM Not yet run
unverified (harvested, no recorded run)
zhangyi-3/kbnet/Defocus_Deblurring/utils.py
code served (permissive licence) · get_code("80d62faa4ff31b49")
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, 9 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 4 the same month, 7 later) and 0 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_position_from_periods 55 other papers
5 dated earlier, 3 the same month, 45 later, 2 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
ssim 18 other papers
7 dated earlier, 1 the same month, 10 later
1809.00219 (2018-09)
ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks
1904.03377 (2019-04)
Blind Super-Resolution With Iterative Kernel Correction
2005.05650 (2020-05)
Invertible Image Rescaling
and 15 more not named here
calculate_psnr 9 other papers
2 dated earlier, 1 the same month, 6 later
Zamir_Restormer_Efficient_Transformer_for_High-Resolution_Image_Restoration_CVPR_2022_paper (2022 (year only))
Restormer: Efficient Transformer for High-Resolution Image Restoration
2201.02973 (2022-01)
MAXIM: Multi-Axis MLP for Image Processing
2303.11684 (2023-03)
SpikeCV: Open a Continuous Computer Vision Era
and 6 more not named here
calculate_fid 8 other papers
1 dated earlier, 7 later
2204.04676 (2022-04)
Simple Baselines for Image Restoration
2308.14036 (2023-08)
MB-TaylorFormer: Multi-branch Efficient Transformer Expanded by Taylor Formula for Image Dehazing
2401.00027 (2024-01)
Efficient Multi-scale Network with Learnable Discrete Wavelet Transform for Blind Motion Deblurring
and 5 more not named here
calculate_ssim 8 other papers
2 dated earlier, 1 the same month, 5 later
Zamir_Restormer_Efficient_Transformer_for_High-Resolution_Image_Restoration_CVPR_2022_paper (2022 (year only))
Restormer: Efficient Transformer for High-Resolution Image Restoration
2201.02973 (2022-01)
MAXIM: Multi-Axis MLP for Image Processing
2303.11684 (2023-03)
SpikeCV: Open a Continuous Computer Vision Era
and 5 more not named here
extract_inception_features 8 other papers
1 dated earlier, 7 later
2204.04676 (2022-04)
Simple Baselines for Image Restoration
2308.14036 (2023-08)
MB-TaylorFormer: Multi-branch Efficient Transformer Expanded by Taylor Formula for Image Dehazing
2401.00027 (2024-01)
Efficient Multi-scale Network with Learnable Discrete Wavelet Transform for Blind Motion Deblurring
and 5 more not named here
PSNR 4 other papers
1 dated earlier, 3 later
Zamir_Restormer_Efficient_Transformer_for_High-Resolution_Image_Restoration_CVPR_2022_paper (2022 (year only))
Restormer: Efficient Transformer for High-Resolution Image Restoration
2405.03349 (2024-05)
Retinexmamba: Retinex-based Mamba for Low-light Image Enhancement
2410.21535 (2024-10)
ECMamba: Consolidating Selective State Space Model with Retinex Guidance for Efficient Multiple Exposure Correction
and 1 more not named here
MAE 2 other papers
2 dated earlier
2005.00305 (2020-05)
Defocus Deblurring Using Dual-Pixel Data
SSIM 1 other paper
1 dated earlier
Zamir_Restormer_Efficient_Transformer_for_High-Resolution_Image_Restoration_CVPR_2022_paper (2022 (year only))
Restormer: Efficient Transformer for High-Resolution Image Restoration

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

How to aggregate spatial information plays an essential role in learning-based image restoration. Most existing CNN-based networks adopt static convolutional kernels to encode spatial information, which cannot aggregate spatial information adaptively. Recent transformer-based architectures achieve adaptive spatial aggregation. But they lack desirable inductive biases of convolutions and require heavy computational costs. In this paper, we propose a kernel basis attention (KBA) module, which introduces learnable kernel bases to model representative image patterns for spatial information aggregation. Different kernel bases are trained to model different local structures. At each spatial location, they are linearly and adaptively fused by predicted pixel-wise coefficients to obtain aggregation weights. Based on the KBA module, we further design a multi-axis feature fusion (MFF) block to encode and fuse channel-wise, spatial-invariant, and pixel-adaptive features for image restoration. Our model, named kernel basis network (KBNet), achieves state-of-the-art performances on more than ten benchmarks over image denoising, deraining, and deblurring tasks while requiring less computational cost than previous SOTA methods.

For agents

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

get_harvested_code_for_paper("2303.02881")
get_code_for_paper("2303.02881")
have("2303.02881")

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

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

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

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

Connect an agent — have() is free.