SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.13495 · 2021

SQUID: Deep Feature In-Painting for Unsupervised Anomaly Detection

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 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 3 have no contract verdict; 2 failures of our instrument; 0 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/2111.13495.json · badge: /api/ran/2111.13495.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
tiangexiang/squid canonical (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
binarize Ran
ran on a synthesized input
tiangexiang/squid/models/basic_modules.py
code served (permissive licence) · get_code("3fa73f2e0d35c1f3")
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 3, dtype family float, shape (2, 3, 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

torch.manual_seed(0)

# Create a small integer tensor with shape (2, 3)
integer_tensor = torch.tensor([[5, 10, 3], [7, 2, 15]], dtype=torch.float32)

# Define num_bits parameter
num_bits_value = 8

# Construct ARGS dict
ARGS = {
    'integer': integer_tensor,
    'num_bits': num_bits_value
}
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 Tensor, ndim 3, dtype family float, shape (2, 3, 8) — shape (2, 3, 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: none by the harness; any seed is in the setup block
build_disc Ran
ran on a synthesized input
tiangexiang/squid/tools.py
code served (permissive licence) · get_code("2d9d4932b42dd7c8")
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 SimpleDiscriminator. 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 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 importlib
from unittest.mock import MagicMock

torch.manual_seed(0)

# Create a minimal CONFIG object with required attributes
class Config:
    def __init__(self):
        self.discriminator_type = 'basic'
        self.size = 64

CONFIG = Config()

# Mock the discriminator module since we can't import the actual models
# Create stand-in discriminator classes
class SimpleDiscriminator(torch.nn.Module):
    def __init__(self, size):
        super().__init__()
        self.size = size
        self.conv1 = torch.nn.Conv2d(3, 16, kernel_size=3)
    
    def forward(self, x):
        return self.conv1(x)

class TinyDiscriminator(torch.nn.Module):
    def __init__(self, size):
        super().__init__()
        self.size = size
        self.linear = torch.nn.Linear(10, 1)
    
    def forward(self, x):
        return self.linear(x)

class BigDiscriminator(torch.nn.Module):
    def __init__(self, size):
        super().__init__()
        self.size = size
        self.conv1 = torch.nn.Conv2d(3, 64, kernel_size=3)
    
    def forward(self, x):
        return self.conv1(x)

class ExtraTinyDiscriminator(torch.nn.Module):
    def __init__(self, size):
        super().__init__()
        self.size = size
        self.linear = torch.nn.Linear(5, 1)
    
    def forward(self, x):
        return self.linear(x)

# Mock the models.discriminator module
mock_disc_module = MagicMock()
mock_disc_module.SimpleDiscriminator = SimpleDiscriminator
mock_disc_module.TinyDiscriminator = TinyDiscriminator
mock_disc_module.BigDiscriminator = BigDiscriminator
mock_disc_module.ExtraTinyDiscriminator = ExtraTinyDiscriminator

# Patch importlib to return our mock module
original_import = importlib.import_module

def mock_import_module(name):
    if name == 'models.discriminator':
        return mock_disc_module
    return original_import(name)

importlib.import_module = mock_import_module

ARGS = {
    'CONFIG': CONFIG
}
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 SimpleDiscriminator — a SimpleDiscriminator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleDiscriminator 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
hard_shrink_relu Ran
ran; our contract draft was wrong, not the code
tiangexiang/squid/models/memory.py
code served (permissive licence) · get_code("3a7e6b79fae3b99d")
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 (2, 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.functional as F

torch.manual_seed(0)

# Create a small tensor input
input_tensor = torch.randn(2, 4)

# Define lambda parameter (threshold)
lambd = 0.5

# Define epsilon parameter (small constant to avoid division by zero)
epsilon = 1e-12

# Construct ARGS dictionary
ARGS = {
    "input": input_tensor,
    "lambd": lambd,
    "epsilon": epsilon,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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: none by the harness; any seed is in the setup block
make_window Ran
ran on a synthesized input
tiangexiang/squid/models/basic_modules.py
code served (permissive licence) · get_code("e15bc4c625c83543")
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 4, dtype family float, shape (12, 2, 2, 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.functional as F

torch.manual_seed(0)

# Create a small input tensor with shape (B, W, H, C)
# Using distinct sizes: B=2, W=4, H=3, C=5
x = torch.randn(2, 4, 3, 5)

window_size = 2
stride = 1
padding = 0

ARGS = {
    "x": x,
    "window_size": window_size,
    "stride": stride,
    "padding": padding,
}
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 Tensor, ndim 4, dtype family float, shape (12, 2, 2, 5) — shape (12, 2, 2, 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: none by the harness; any seed is in the setup block
window_reverse Ran
ran; our contract draft was wrong, not the code
tiangexiang/squid/models/basic_modules.py
code served (permissive licence) · get_code("61bf152e6a42a184")
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 Tensor, ndim 4, dtype family float, shape (2, 8, 12, 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

torch.manual_seed(0)

# Parameters for window_reverse
# windows: (num_windows*B, window_size, window_size, C)
# The function expects windows to be partitioned from an image of size (B, H, W, C)
# where the image is divided into non-overlapping windows of size window_size x window_size

B = 2  # batch size
H = 8  # image height
W = 12  # image width
window_size = 4  # window size
C = 3  # number of channels

# Calculate number of windows
num_windows_h = H // window_size  # 2
num_windows_w = W // window_size  # 3
num_windows = num_windows_h * num_windows_w  # 6

# windows shape: (num_windows*B, window_size, window_size, C)
# = (6*2, 4, 4, 3) = (12, 4, 4, 3)
windows = torch.randn(num_windows * B, window_size, window_size, C)

ARGS = {
    "windows": windows,
    "window_size": window_size,
    "H": H,
    "W": W,
}
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 Tensor, ndim 4, dtype family float, shape (2, 8, 12, 3) — shape (2, 8, 12, 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: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 1 later) and 3 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
window_reverse 227 other papers
16 dated earlier, 4 the same month, 207 later · 34 only as an assembly brick
1608.03983 (2016-08)
SGDR: Stochastic Gradient Descent with Warm Restarts
1711.10925 (2017-11)
Deep Image Prior
2003.13678 (2020-03)
Designing Network Design Spaces
and 224 more not named here
hard_shrink_relu 1 other paper
1 dated earlier
2108.06852 (2021-08)
A Hybrid Video Anomaly Detection Framework via Memory-Augmented Flow Reconstruction and Flow-Guided Frame Prediction

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

Radiography imaging protocols focus on particular body regions, therefore producing images of great similarity and yielding recurrent anatomical structures across patients. To exploit this structured information, we propose the use of Space-aware Memory Queues for In-painting and Detecting anomalies from radiography images (abbreviated as SQUID). We show that SQUID can taxonomize the ingrained anatomical structures into recurrent patterns; and in the inference, it can identify anomalies (unseen/modified patterns) in the image. SQUID surpasses 13 state-of-the-art methods in unsupervised anomaly detection by at least 5 points on two chest X-ray benchmark datasets measured by the Area Under the Curve (AUC). Additionally, we have created a new dataset (DigitAnatomy), which synthesizes the spatial correlation and consistent shape in chest anatomy. We hope DigitAnatomy can prompt the development, evaluation, and interpretability of anomaly detection methods.

For agents

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

get_harvested_code_for_paper("2111.13495")
get_code_for_paper("2111.13495")
have("2111.13495")

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

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

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

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

Connect an agent — have() is free.