SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.12639 · ICML · 2022

Blurs Behave Like Ensembles: Spatial Smoothings to Improve Accuracy, Uncertainty, and Robustness

Namuk Park, Songkuk Kim

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; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2105.12639.json · badge: /api/ran/2105.12639.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
xxxnell/spatial-smoothing canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
xxxnell/how-do-vits-work community
Papers with Code archive
3 ran · 0 no recorded run
FunctionStatusWhere it lives
Blur Ran
ran on a synthesized input
xxxnell/spatial-smoothing/models/smoothing_block.py
code served (permissive licence) · get_code("5e06a1320d7d8bc6")
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, 4, 5, 6) 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 math
import torch.nn.functional as F

class SamePad(nn.Module):

    def __init__(self, filter_size, pad_mode='constant', **kwargs):
        super(SamePad, self).__init__()
        self.pad_size = [int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0)), int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0))]
        self.pad_mode = pad_mode

    def forward(self, x):
        x = F.pad(x, self.pad_size, mode=self.pad_mode)
        return x

    def extra_repr(self):
        return 'pad_size=%s, pad_mode=%s' % (self.pad_size, self.pad_mode)

class Blur(nn.Module):

    def __init__(self, in_filters, sfilter=(1, 1), pad_mode='replicate', **kwargs):
        super(Blur, self).__init__()
        filter_size = len(sfilter)
        self.pad = SamePad(filter_size, pad_mode=pad_mode)
        self.filter_proto = torch.tensor(sfilter, dtype=torch.float, requires_grad=False)
        self.filter = torch.einsum('i, j -> i j', self.filter_proto, self.filter_proto)
        self.filter = self.filter / torch.sum(self.filter)
        self.filter = self.filter.repeat([in_filters, 1, 1, 1])
        self.filter = torch.nn.Parameter(self.filter, requires_grad=False)

    def forward(self, x):
        x = self.pad(x)
        x = F.conv2d(x, self.filter, groups=x.size()[1])
        return x

    def extra_repr(self):
        return 'pad=%s, filter_proto=%s' % (self.pad, self.filter_proto.tolist())


INIT_ARGS = {
    'in_filters': 4,
    'sfilter': (1, 2),
    'pad_mode': 'replicate'
}

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

if __name__ == '__main__':
    blur = Blur(**INIT_ARGS)
    output = blur(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    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, 4, 5, 6) — shape (2, 4, 5, 6) 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)
Blur Ran
ran on a synthesized input
xxxnell/how-do-vits-work/models/smoothing_block.py
code served (permissive licence) · get_code("5e8b0ed1757e7193")
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, 4, 3, 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
import torch.nn as nn
import math
import torch.nn.functional as F

class SamePad(nn.Module):

    def __init__(self, filter_size, pad_mode='constant', **kwargs):
        super(SamePad, self).__init__()
        self.pad_size = [int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0)), int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0))]
        self.pad_mode = pad_mode

    def forward(self, x):
        x = F.pad(x, self.pad_size, mode=self.pad_mode)
        return x

    def extra_repr(self):
        return 'pad_size=%s, pad_mode=%s' % (self.pad_size, self.pad_mode)

class Blur(nn.Module):

    def __init__(self, in_filters, sfilter=(1, 1), pad_mode='replicate', **kwargs):
        super(Blur, self).__init__()
        filter_size = len(sfilter)
        self.pad = SamePad(filter_size, pad_mode=pad_mode)
        self.filter_proto = torch.tensor(sfilter, dtype=torch.float, requires_grad=False)
        self.filter = torch.tensordot(self.filter_proto, self.filter_proto, dims=0)
        self.filter = self.filter / torch.sum(self.filter)
        self.filter = self.filter.repeat([in_filters, 1, 1, 1])
        self.filter = torch.nn.Parameter(self.filter, requires_grad=False)

    def forward(self, x):
        x = self.pad(x)
        x = F.conv2d(x, self.filter, groups=x.size()[1])
        return x

    def extra_repr(self):
        return 'pad=%s, filter_proto=%s' % (self.pad, self.filter_proto.tolist())


INIT_ARGS = {
    'in_filters': 4,
    'sfilter': (1, 1),
    'pad_mode': 'replicate'
}

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

if __name__ == '__main__':
    blur = Blur(**INIT_ARGS)
    output = blur(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    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, 4, 3, 5) — shape (2, 4, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SamePad Ran
ran on a synthesized input
xxxnell/spatial-smoothing/models/smoothing_block.py
code served (permissive licence) · get_code("7d31fb2fc7950e03")
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, 4, 7, 7) 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 math
import torch.nn.functional as F

class SamePad(nn.Module):

    def __init__(self, filter_size, pad_mode='constant', **kwargs):
        super(SamePad, self).__init__()
        self.pad_size = [int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0)), int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0))]
        self.pad_mode = pad_mode

    def forward(self, x):
        x = F.pad(x, self.pad_size, mode=self.pad_mode)
        return x

    def extra_repr(self):
        return 'pad_size=%s, pad_mode=%s' % (self.pad_size, self.pad_mode)


INIT_ARGS = {
    'filter_size': 5,
    'pad_mode': 'constant'
}

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

if __name__ == '__main__':
    module = SamePad(**INIT_ARGS)
    output = module(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Module: {module}")
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, 4, 7, 7) — shape (2, 4, 7, 7) 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)
TanhBlurBlock Ran
ran on a synthesized input
xxxnell/spatial-smoothing/models/smoothing_block.py
code served (permissive licence) · get_code("c452d32abae32178")
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, 4, 4, 4) 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.functional as F
import math
import types as _types

class SamePad(nn.Module):
    def __init__(self, filter_size, pad_mode='constant', **kwargs):
        super(SamePad, self).__init__()
        self.pad_size = [int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0)), int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0))]
        self.pad_mode = pad_mode

    def forward(self, x):
        x = F.pad(x, self.pad_size, mode=self.pad_mode)
        return x

    def extra_repr(self):
        return 'pad_size=%s, pad_mode=%s' % (self.pad_size, self.pad_mode)

class Blur(nn.Module):
    def __init__(self, in_filters, sfilter=(1, 1), pad_mode='replicate', **kwargs):
        super(Blur, self).__init__()
        filter_size = len(sfilter)
        self.pad = SamePad(filter_size, pad_mode=pad_mode)
        self.filter_proto = torch.tensor(sfilter, dtype=torch.float, requires_grad=False)
        self.filter = torch.einsum('i, j -> i j', self.filter_proto, self.filter_proto)
        self.filter = self.filter / torch.sum(self.filter)
        self.filter = self.filter.repeat([in_filters, 1, 1, 1])
        self.filter = torch.nn.Parameter(self.filter, requires_grad=False)

    def forward(self, x):
        x = self.pad(x)
        x = F.conv2d(x, self.filter, groups=x.size()[1])
        return x

    def extra_repr(self):
        return 'pad=%s, filter_proto=%s' % (self.pad, self.filter_proto.tolist())

def blur(in_filters, sfilter=(1, 1), pad_mode='constant'):
    if tuple(sfilter) == (1, 1) and pad_mode in ['constant', 'zero']:
        layer = nn.AvgPool2d(kernel_size=2, stride=1, padding=1)
    else:
        layer = Blur(in_filters, sfilter=sfilter, pad_mode=pad_mode)
    return layer

def relu():
    return nn.ReLU()

layers = _types.SimpleNamespace(**{n: globals()[n] for n in ['Blur', 'SamePad', 'blur', 'relu'] if n in globals()})

class TanhBlurBlock(nn.Module):
    def __init__(self, in_filters, temp=10.0, sfilter=(1, 1), pad_mode='constant', **kwargs):
        super(TanhBlurBlock, self).__init__()
        self.temp = temp
        self.relu = layers.relu()
        self.tanh = nn.Tanh()
        self.blur = layers.blur(in_filters, sfilter=sfilter, pad_mode=pad_mode)

    def forward(self, x):
        x = self.temp * self.tanh(x / self.temp)
        x = self.relu(x)
        x = self.blur(x)
        return x

    def extra_repr(self):
        return 'temp=%.3e' % self.temp

INIT_ARGS = {
    'in_filters': 4,
    'temp': 10.0,
    'sfilter': (1, 1),
    'pad_mode': 'constant'
}

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

if __name__ == '__main__':
    model = TanhBlurBlock(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    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, 4, 4, 4) — shape (2, 4, 4, 4) 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)
TanhBlurBlock Ran
ran on a synthesized input
xxxnell/how-do-vits-work/models/smoothing_block.py
code served (permissive licence) · get_code("d858d5b3ac196749")
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, 4, 4, 4) 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.functional as F
import math
import types as _types

class SamePad(nn.Module):
    def __init__(self, filter_size, pad_mode='constant', **kwargs):
        super(SamePad, self).__init__()
        self.pad_size = [int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0)), int((filter_size - 1) / 2.0), int(math.ceil((filter_size - 1) / 2.0))]
        self.pad_mode = pad_mode

    def forward(self, x):
        x = F.pad(x, self.pad_size, mode=self.pad_mode)
        return x

    def extra_repr(self):
        return 'pad_size=%s, pad_mode=%s' % (self.pad_size, self.pad_mode)

class Blur(nn.Module):
    def __init__(self, in_filters, sfilter=(1, 1), pad_mode='replicate', **kwargs):
        super(Blur, self).__init__()
        filter_size = len(sfilter)
        self.pad = SamePad(filter_size, pad_mode=pad_mode)
        self.filter_proto = torch.tensor(sfilter, dtype=torch.float, requires_grad=False)
        self.filter = torch.tensordot(self.filter_proto, self.filter_proto, dims=0)
        self.filter = self.filter / torch.sum(self.filter)
        self.filter = self.filter.repeat([in_filters, 1, 1, 1])
        self.filter = torch.nn.Parameter(self.filter, requires_grad=False)

    def forward(self, x):
        x = self.pad(x)
        x = F.conv2d(x, self.filter, groups=x.size()[1])
        return x

    def extra_repr(self):
        return 'pad=%s, filter_proto=%s' % (self.pad, self.filter_proto.tolist())

def blur(in_filters, sfilter=(1, 1), pad_mode='constant'):
    if tuple(sfilter) == (1, 1) and pad_mode in ['constant', 'zero']:
        layer = nn.AvgPool2d(kernel_size=2, stride=1, padding=1)
    else:
        layer = Blur(in_filters, sfilter=sfilter, pad_mode=pad_mode)
    return layer

def relu():
    return nn.ReLU()

layers = _types.SimpleNamespace(**{n: globals()[n] for n in ['Blur', 'SamePad', 'blur', 'relu'] if n in globals()})

class TanhBlurBlock(nn.Module):
    def __init__(self, in_filters, temp=10.0, sfilter=(1, 1), pad_mode='constant', **kwargs):
        super(TanhBlurBlock, self).__init__()
        self.temp = temp
        self.relu = layers.relu()
        self.tanh = nn.Tanh()
        self.blur = layers.blur(in_filters, sfilter=sfilter, pad_mode=pad_mode)

    def forward(self, x):
        x = self.temp * self.tanh(x / self.temp)
        x = self.relu(x)
        x = self.blur(x)
        return x

    def extra_repr(self):
        return 'temp=%.3e' % self.temp

INIT_ARGS = {
    'in_filters': 4,
    'temp': 10.0,
    'sfilter': (1, 1),
    'pad_mode': 'constant'
}

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

if __name__ == '__main__':
    model = TanhBlurBlock(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {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 4, dtype family float, shape (2, 4, 4, 4) — shape (2, 4, 4, 4) 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)
blur Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xxxnell/spatial-smoothing/models/smoothing_block.py
code served (permissive licence) · get_code("a913c63854e37921")
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 AvgPool2d. 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)

ARGS = {
    'in_filters': 3,
    'sfilter': (1, 1),
    'pad_mode': 'constant'
}
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 AvgPool2d — a AvgPool2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AvgPool2d 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
blur Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xxxnell/how-do-vits-work/models/smoothing_block.py
code served (permissive licence) · get_code("5ccfb7ec6032f45e")
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 AvgPool2d. 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)

ARGS = {
    'in_filters': 3,
    'sfilter': (1, 1),
    'pad_mode': 'constant'
}
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 AvgPool2d — a AvgPool2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AvgPool2d 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
relu Ran
ran on a synthesized input
xxxnell/spatial-smoothing/models/smoothing_block.py
code served (permissive licence) · get_code("d419f818792d3793")
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 ReLU. 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)

ARGS = {}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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 6 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 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.

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

Repositories linked to this paper

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

Abstract

Neural network ensembles, such as Bayesian neural networks (BNNs), have shown success in the areas of uncertainty estimation and robustness. However, a crucial challenge prohibits their use in practice. BNNs require a large number of predictions to produce reliable results, leading to a significant increase in computational cost. To alleviate this issue, we propose spatial smoothing, a method that spatially ensembles neighboring feature map points of convolutional neural networks. By simply adding a few blur layers to the models, we empirically show that spatial smoothing improves accuracy, uncertainty estimation, and robustness of BNNs across a whole range of ensemble sizes. In particular, BNNs incorporating spatial smoothing achieve high predictive performance merely with a handful of ensembles. Moreover, this method also can be applied to canonical deterministic neural networks to improve the performances. A number of evidences suggest that the improvements can be attributed to the stabilized feature maps and the smoothing of the loss landscape. In addition, we provide a fundamental explanation for prior works-namely, global average pooling, pre-activation, and ReLU6-by addressing them as special cases of spatial smoothing. These not only enhance accuracy, but also improve uncertainty estimation and robustness by making the loss landscape smoother in the same manner as spatial smoothing.

For agents

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

get_harvested_code_for_paper("2105.12639")
get_code_for_paper("2105.12639")
have("2105.12639")

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

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

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

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

Connect an agent — have() is free.