SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.12397 · 2023

PatchCraft: Exploring Texture Patch for Efficient AI-generated Image Detection

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 0 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/2311.12397.json · badge: /api/ran/2311.12397.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
hridayK/Detection-of-AI-generated-images community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_filter_a Ran
ran on a synthesized input
hridayK/Detection-of-AI-generated-images/preprocessing/filters.py
code served (permissive licence) · get_code("f2683875803d5ab1")
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 3, dtype family int, shape (4, 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 numpy as np
import cv2

# Create a small test image (4x4 with 3 channels)
test_image = np.random.randint(0, 256, size=(4, 4, 3), dtype=np.uint8)

ARGS = {
    "src": test_image
}
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 ndarray, ndim 3, dtype family int, shape (4, 4, 3) — shape (4, 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: none by the harness; any seed is in the setup block
apply_filter_b Ran
ran on a synthesized input
hridayK/Detection-of-AI-generated-images/preprocessing/filters.py
code served (permissive licence) · get_code("6f7e9abbee70a7ba")
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 3, dtype family int, shape (32, 32, 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 numpy as np
import cv2

# Create a small test image as a numpy array
# The function expects a numpy array that can be processed by cv2.filter2D
test_image = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)

ARGS = {
    "src": test_image
}
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 ndarray, ndim 3, dtype family int, shape (32, 32, 3) — shape (32, 32, 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
apply_filter_c Ran
ran on a synthesized input
hridayK/Detection-of-AI-generated-images/preprocessing/filters.py
code served (permissive licence) · get_code("729cf0a607399cb8")
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 2, dtype family int, shape (10, 10) 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 numpy as np
import cv2

# Create a small test image (grayscale)
# Using a 10x10 image with uint8 values
test_image = np.random.randint(0, 256, size=(10, 10), dtype=np.uint8)

ARGS = {
    "src": test_image
}
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 ndarray, ndim 2, dtype family int, shape (10, 10) — shape (10, 10) 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_l1 Ran
ran on a synthesized input
hridayK/Detection-of-AI-generated-images/preprocessing/patch_generator.py
code served (permissive licence) · get_code("080f591967ce709d")
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 float, 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
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - v is indexed as v[j][i], so it's a 2D structure (likely list of lists or 2D array)
# - x is used as range(0, x), so it's an integer (number of columns)
# - y is used as range(0, y - 1) and v[j][i + 1], so it's an integer (number of rows)
# - The function accesses v[j][i] and v[j][i + 1] where j goes from 0 to x-1 and i goes from 0 to y-2
# - So v should be a 2D structure with at least x columns and y rows

# Create a simple 2D list structure
# Using distinct sizes: x=4 columns, y=3 rows
v = [
    [1.0, 2.0, 3.0],  # column 0
    [1.5, 2.5, 3.5],  # column 1
    [2.0, 3.0, 4.0],  # column 2
    [2.5, 3.5, 4.5],  # column 3
]

x = 4
y = 3

ARGS = {
    "v": v,
    "x": x,
    "y": y,
}
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 float, 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_l2 Ran
ran on a synthesized input
hridayK/Detection-of-AI-generated-images/preprocessing/patch_generator.py
code served (permissive licence) · get_code("53dfdb4c613f15d5")
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 float, 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - v is indexed as v[j][i], so it's a 2D structure (list of lists or similar)
# - x and y are integers used in range loops
# - The function accesses v[j][i] and v[j+1][i] for j in range(0, x-1) and i in range(0, y)
# - This means v needs at least x rows and y columns

# Create a 2D list structure for v with distinct dimensions
# x=5 means we iterate j from 0 to 3 (x-1), so we need at least 5 rows
# y=4 means we iterate i from 0 to 3, so we need at least 4 columns
x = 5
y = 4

# Create v as a 2D list of lists with shape (x, y)
v = [[float(i * y + j) for j in range(y)] for i in range(x)]

ARGS = {
    "v": v,
    "x": x,
    "y": y
}
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 float, 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
img_to_patches Ran
ran on a synthesized input
hridayK/Detection-of-AI-generated-images/preprocessing/patch_generator.py
code served (permissive licence) · get_code("c8a135aaf75a7717")
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 tuple. 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 PIL.Image
import numpy as np
import tempfile
import os

# Create a minimal test image and save it
# The function expects to read from a file path
temp_dir = tempfile.mkdtemp()
img_path = os.path.join(temp_dir, "test_image.jpg")

# Create a 256x256 RGB image
test_image_array = np.random.randint(0, 256, (256, 256, 3), dtype=np.uint8)
test_image = PIL.Image.fromarray(test_image_array, mode='RGB')
test_image.save(img_path)

ARGS = {
    "input_path": img_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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 6 samples lifted from this paper's linked repositories, 6 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-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

Recent generative models show impressive performance in generating photographic images. Humans can hardly distinguish such incredibly realistic-looking AI-generated images from real ones. AI-generated images may lead to ubiquitous disinformation dissemination. Therefore, it is of utmost urgency to develop a detector to identify AI generated images. Most existing detectors suffer from sharp performance drops over unseen generative models. In this paper, we propose a novel AI-generated image detector capable of identifying fake images created by a wide range of generative models. We observe that the texture patches of images tend to reveal more traces left by generative models compared to the global semantic information of the images. A novel Smash&Reconstruction preprocessing is proposed to erase the global semantic information and enhance texture patches. Furthermore, pixels in rich texture regions exhibit more significant fluctuations than those in poor texture regions. Synthesizing realistic rich texture regions proves to be more challenging for existing generative models. Based on this principle, we leverage the inter-pixel correlation contrast between rich and poor texture regions within an image to further boost the detection performance. In addition, we build a comprehensive AI-generated image detection benchmark, which includes 17 kinds of prevalent generative models, to evaluate the effectiveness of existing baselines and our approach. Our benchmark provides a leaderboard for follow-up studies. Extensive experimental results show that our approach outperforms state-of-the-art baselines by a significant margin. Our project: https://fdmas.github.io/AIGCDetect

For agents

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

get_harvested_code_for_paper("2311.12397")
get_code_for_paper("2311.12397")
have("2311.12397")

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

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

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

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

Connect an agent — have() is free.