SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.20890 · NeurIPS · 2025

FerretNet: Efficient Synthetic Image Detection via Local Pixel Dependencies

Jian Liu, Shuqiao Liang, Renzhang Chen, Quanlong Guan

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2509.20890.json · badge: /api/ran/2509.20890.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
xigua7105/FerretNet community
Papers with Code archive
4 ran · 0 no recorded run
FunctionStatusWhere it lives
DSBlock Ran
ran on a synthesized input
xigua7105/FerretNet/src/model/ferretnet.py
code served (permissive licence) · get_code("6b1b253bf8e42921")
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; 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 torch
from torch import nn

class DilatedConv2d(nn.Module):

    def __init__(self, in_channels: int, out_channels: int, stride: int):
        super().__init__()
        self.conv1 = nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=3, stride=stride, padding=1, groups=in_channels, dilation=1, bias=False)
        self.conv2 = nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=3, stride=stride, padding=2, groups=in_channels, dilation=2, bias=False)
        self.conv3 = nn.Conv2d(in_channels=out_channels, out_channels=out_channels, kernel_size=1, stride=1, padding=0, groups=1, dilation=1, bias=False)

    def forward(self, x):
        x = self.conv1(x) + self.conv2(x)
        x = self.conv3(x)
        return x

class SeparableConv2d(nn.Module):

    def __init__(self, in_channels: int, out_channels: int, kernel_size: int=3, stride: int=1, padding: int=0):
        super().__init__()
        self.depth_wise = nn.Conv2d(in_channels, in_channels, kernel_size, stride, padding=padding, groups=in_channels, bias=False)
        self.point_wise = nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=1, bias=False)

    def forward(self, x):
        x = self.depth_wise(x)
        x = self.point_wise(x)
        return x

class DSBlock(nn.Module):

    def __init__(self, in_channels: int, out_channels: int, stride: int):
        super().__init__()
        self.layers = nn.Sequential(DilatedConv2d(in_channels, out_channels, stride), nn.BatchNorm2d(out_channels), nn.ReLU(inplace=True), SeparableConv2d(out_channels, out_channels, 3, 1, 1), nn.BatchNorm2d(out_channels))
        if stride != 1 or in_channels != out_channels:
            self.shortcut = nn.Sequential(nn.Conv2d(in_channels, out_channels, 1, stride), nn.BatchNorm2d(out_channels))
        else:
            self.shortcut = nn.Identity()
        self.relu = nn.ReLU(inplace=True)

    def forward(self, x):
        x = self.layers(x) + self.shortcut(x)
        x = self.relu(x)
        return x

INIT_ARGS = {
    'in_channels': 4,
    'out_channels': 8,
    'stride': 1
}

ARGS = {
    'x': torch.randn(2, 4, 16, 16)
}
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)
DilatedConv2d Ran
ran on a synthesized input · constructed an object; no result was computed
xigua7105/FerretNet/src/model/ferretnet.py
code served (permissive licence) · get_code("c7aab8a60951cef1")
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 an instance of its own class, DilatedConv2d: the run constructed the object and did not call it, so no result was computed. 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)

class DilatedConv2d(nn.Module):

    def __init__(self, in_channels: int, out_channels: int, stride: int):
        super().__init__()
        self.conv1 = nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=3, stride=stride, padding=1, groups=in_channels, dilation=1, bias=False)
        self.conv2 = nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=3, stride=stride, padding=2, groups=in_channels, dilation=2, bias=False)
        self.conv3 = nn.Conv2d(in_channels=out_channels, out_channels=out_channels, kernel_size=1, stride=1, padding=0, groups=1, dilation=1, bias=False)

    def forward(self, x):
        x = self.conv1(x) + self.conv2(x)
        x = self.conv3(x)
        return x

ARGS = {
    "in_channels": 4,
    "out_channels": 8,
    "stride": 1,
}
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 DilatedConv2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DilatedConv2d 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
Ferret Ran
ran on a synthesized input · constructed an object; no result was computed
xigua7105/FerretNet/src/model/ferretnet.py
code served (permissive licence) · get_code("a96cc1deff0a1a29")
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 an instance of its own class, Ferret: the run constructed the object and did not call it, so no result was computed. 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)

# Define stand-in LPD functions
class LPDStandIn(nn.Module):
    def __init__(self, window_size: int):
        super().__init__()
        self.window_size = window_size
    
    def forward(self, x):
        # Return a tensor of the same shape as input
        return torch.zeros_like(x)

class LPDStandIn2(nn.Module):
    def __init__(self, window_size: int):
        super().__init__()
        self.window_size = window_size
    
    def forward(self, x):
        # Return a tensor of the same shape as input
        return torch.zeros_like(x)

# Create lpd_dict with callable functions that return modules
lpd_dict = {
    "lpd_func1": LPDStandIn,
    "lpd_func2": LPDStandIn2,
}

ARGS = {
    "in_channels": 3,
    "num_classes": 10,
    "dim": 16,
    "depths": [2, 3],
    "lpd_func": "lpd_func1",
    "window_size": 5,
    "lpd_dict": lpd_dict,
}
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 Ferret — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Ferret 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
SeparableConv2d Ran
ran on a synthesized input · constructed an object; no result was computed
xigua7105/FerretNet/src/model/ferretnet.py
code served (permissive licence) · get_code("6be99b3691bb75ec")
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 an instance of its own class, SeparableConv2d: the run constructed the object and did not call it, so no result was computed. 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)

# SeparableConv2d takes in_channels, out_channels, kernel_size, stride, padding
# It creates a depth_wise conv followed by a point_wise conv
# The forward method expects a 4D tensor (batch, channels, height, width)

# Create a small input tensor: batch=2, channels=3, height=4, width=4
input_tensor = torch.randn(2, 3, 4, 4)

ARGS = {
    "in_channels": 3,
    "out_channels": 5,
    "kernel_size": 3,
    "stride": 1,
    "padding": 1,
}
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 SeparableConv2d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SeparableConv2d 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 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 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 4 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-24.

Repositories linked to this paper

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

Abstract

The increasing realism of synthetic images generated by advanced models such as VAEs, GANs, and LDMs poses significant challenges for synthetic image detection. To address this issue, we explore two artifact types introduced during the generation process: (1) latent distribution deviations and (2) decoding-induced smoothing effects, which manifest as inconsistencies in local textures, edges, and color transitions. Leveraging local pixel dependencies (LPD) properties rooted in Markov Random Fields, we reconstruct synthetic images using neighboring pixel information to expose disruptions in texture continuity and edge coherence. Building upon LPD, we propose FerretNet, a lightweight neural network with only 1.1M parameters that delivers efficient and robust synthetic image detection. Extensive experiments demonstrate that FerretNet-trained exclusively on the 4class ProGAN dataset-achieves an average accuracy of 97.1% on an open-world benchmark comprising 22 generative models. Our code and datasets are publicly available at https://github.com/xigua7105/FerretNet.

For agents

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

get_harvested_code_for_paper("2509.20890")
get_code_for_paper("2509.20890")
have("2509.20890")

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

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

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

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

Connect an agent — have() is free.