SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.17195 · CVPR · 2021

A Closer Look at Fourier Spectrum Discrepancies for CNN-generated Images Detection

Ngoc-Trung Tran, Ngai-Man Cheung, Keshigeyan Chandrasegaran

arXiv · PDF · Open in the Atlas

Code that ran

4 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 4 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/2103.17195.json · badge: /api/ran/2103.17195.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
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
crop_celeba_image_coords Ran
ran, honoured the contract we drafted
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection/src/gans/dataset_tool.py
code served (permissive licence) · get_code("a21cbed769d5a919")
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, ndim 1, dtype family int; 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
import numpy as np

torch.manual_seed(0)

# crop_celeba_image_coords only takes crop_size parameter
# It's an int that should be smaller than both 218 and 178 (the original image dimensions)
# Let's use a valid crop size like 178 (the smaller dimension)

ARGS = {
    "crop_size": 178
}
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 tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
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
crop_lsun_image_coords Ran
ran, honoured the contract we drafted
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection/src/gans/dataset_tool.py
code served (permissive licence) · get_code("305522bea5504b26")
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, ndim 1, dtype family int; 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
import numpy as np

torch.manual_seed(0)

# The function crop_lsun_image_coords takes three integer parameters:
# height, width, and crop_size
# It computes center crop coordinates for LSUN images

ARGS = {
    "height": 256,
    "width": 256,
    "crop_size": 224,
}
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 tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
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
gradient_penalty Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection/src/gans/gp.py
code served (permissive licence) · get_code("e9717dca89fe2a5d")
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 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 torch.nn as nn

torch.manual_seed(0)

# Define a simple discriminator function that takes input and returns predictions
class SimpleDiscriminator(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, x):
        return self.linear(x)

# Create instances
f = SimpleDiscriminator()

# Create real and fake tensors with batch_size=2, feature_dim=4
real = torch.randn(2, 4)
fake = torch.randn(2, 4)

# Define valid gp_mode and sample_mode values
gp_mode = '1-gp'  # Can be '1-gp', '0-gp', 'lp', or 'none'
sample_mode = 'line'  # Can be 'line', 'real', 'fake', or 'dragan'

ARGS = {
    'f': f,
    'real': real,
    'fake': fake,
    'gp_mode': gp_mode,
    'sample_mode': sample_mode
}
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 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
load_mat_testing_data Ran
ran; our contract draft was wrong, not the code
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection/src/classifiers/knn_classifier.py
code served (permissive licence) · get_code("11904da58eadcee1")
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 os
import tempfile
import numpy as np
from scipy.io import savemat

# Create a temporary directory with .mat files
temp_dir = tempfile.mkdtemp()

# Create sample .mat files with the expected structure
for i in range(5):
    data = {'c': np.random.randn(1, 8)}  # 'c' key with shape (1, 8)
    savemat(os.path.join(temp_dir, f'file_{i}.mat'), data)

ARGS = {
    'gan_fts_dir': temp_dir,
    'num_examples': 3
}
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 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
get_adversarial_losses_fn Not yet run
unverified (harvested, no recorded run)
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection/src/gans/gan_loss.py
code served (permissive licence) · get_code("921afe1e7169d881")
How it ran

no invocation recorded.

load_mat_training_data Not yet run
unverified (harvested, no recorded run)
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection/src/classifiers/knn_classifier.py
code served (permissive licence) · get_code("fb0768087746d652")
How it ran

no invocation recorded.

train_one_knn_and_test Not yet run
unverified (harvested, no recorded run)
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection/src/classifiers/knn_classifier.py
code served (permissive licence) · get_code("70efd344be6ec025")
How it ran

no invocation recorded.

train_one_mlp_and_test Not yet run
unverified (harvested, no recorded run)
sutd-visual-computing-group/Fourier-Discrepancies-CNN-Detection/src/classifiers/mlp_classifier.py
code served (permissive licence) · get_code("16a56d098d14cba5")
How it ran

no invocation recorded.

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 8 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 8 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

CNN-based generative modelling has evolved to produce synthetic images indistinguishable from real images in the RGB pixel space. Recent works have observed that CNNgenerated images share a systematic shortcoming in replicating high frequency Fourier spectrum decay attributes. Furthermore, these works have successfully exploited this systematic shortcoming to detect CNN-generated images reporting up to 99% accuracy across multiple state-of-theart GAN models. In this work, we investigate the validity of assertions claiming that CNN-generated images are unable to achieve high frequency spectral decay consistency. We meticulously construct a counterexample space of high frequency spectral decay consistent CNN-generated images emerging from our handcrafted experiments using DCGAN, LSGAN, WGAN-GP and StarGAN, where we empirically show that this frequency discrepancy can be avoided by a minor architecture change in the last upsampling operation. We subsequently use images from this counterexample space to successfully bypass the recently proposed forensics detector which leverages on high frequency Fourier spectrum decay attributes for CNN-generated image detection. Through this study, we show that high frequency Fourier spectrum decay discrepancies are not inherent characteristics for existing CNN-based generative models-contrary to the belief of some existing work-, and such features are not robust to perform synthetic image detection. Our results prompt re-thinking of using high frequency Fourier spectrum decay attributes for CNNgenerated image detection. Code and models are available at https://keshik6.github.io/Fourier-Discrepancies-CNN-Detection/

For agents

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

get_harvested_code_for_paper("2103.17195")
get_code_for_paper("2103.17195")
have("2103.17195")

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

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

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

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

Connect an agent — have() is free.