Skip to content

slop shall not pass: entrypoint synthetic image classifier. related studies - arxiv:2502.15176 2409.07913 2505.11278 DOI:10.17605/OSF.IO/BNPC4 10.59720/24-270

Notifications You must be signed in to change notification settings

darkshapes/negate

Repository files navigation



negate

entrypoint synthetic image classifier

negate pytest

About

A command-line tool and Python library for processing and analyzing images, extracting Laplacian residuals to measure fractal and texture complexity, and other comparative analysis methods to discriminate synthetic images from real ones.

Test Results

Demonstration of the provided test results and visualizations on our synthetic darkshapes/a_slice dataset and private works of human origin provided by consent from the generous artists at https://purelyhuman.xyz.

Bar graph comparing fractal complexity of synthetic and original images Bar graph comparing texture complexity of synthetic and original images

Install

Important

Requires uv

git clone https://github.com/darkshapes/negate.git
cd negate
uv sync

macos/linux

source .venv/bin/activate

windows

Set-ExecutionPolicy Bypass -Scope Process -Force; .venv\Scripts\Activate.ps1

Test:

Add human-origin assets to assets/real

python -m tests.test_extract -v

Scan A Folder or File

usage: negate [-h] [-i INPUT] [-g] [-v] [-o OUTPUT]

Extract Laplacian residuals from images.

options:
  -h, --help           show this help message and exit
  -i, --input INPUT    Input folder or individual image.
  -g, --graph          Graph the distribution of residuals on a plot
  -v, --verbose        Enable verbose output.
  -o, --output OUTPUT  (OPTIONAL) Output folder for residuals.

Train Model:

python -m negate.train

Call from another application

import asyncio
from pathlib import Path

from negate import ResidualExtractor, flag_origin

image_path = "some/image/path.jpg"
output_folder = ".output"

residual_extractor = ResidualExtractor(image_path, output_folder, verbose=False)

async def async_main() -> tuple[list,list]:
    fractal, texture = await residual_extractor.process_residuals()
    return residual_extractor

residual_extractor = asyncio.run(async_main())
flag_origin(residual_extractor)

About

slop shall not pass: entrypoint synthetic image classifier. related studies - arxiv:2502.15176 2409.07913 2505.11278 DOI:10.17605/OSF.IO/BNPC4 10.59720/24-270

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages