Skip to content

darkshapes/negate

Repository files navigation

language
en
library_name negate
license_name MPL-2.0 + Commons Clause 1.0
compatibility
macos
windows
linux

Stylized futuristic lines in the shape of an N

negate
critical analysis of origin detection

A scanning, training, and research library for scrutinizing illustration origin detection methods.



About

Negate is a modular system of image processing and feature extraction pipelines that measure machine aptitude of differentiating between synthetic and human-origin illustrations.

Quick Start

MacOS Terminal Windows Powershell Linux sh

1. uv from astral.sh

2. uv tool install 'negate @ git+https://github.com/darkshapes/negate'

3. negate infer image.webp

Result Translated Source
SYN Synthetic/AI
GNE Genuine/Human
? High Uncertainty

Tip

To run without installing, use the uv command uvx --from 'negate @ git+https://github.com/darkshapes/negate' infer image.webp

Training

Train a new model with the following command:

negate train

Tip

type a path to an image file or directory of image files to add genuine human origin assets to the dataset add synthetic images using -s before a path

Technical Details & Research Results

Abstract

Previous research has demonstrated the possibility of identifying deepfakes, synthetic images, illustrations and photographs. Yet generative models have since undergone dramatic improvements, challenging past identification research and calling into question the future efficacy of these developments. Most methods chose images easily discernible as synthetic by the naked eye of a trained artist, or evaluated their success against open models exclusively. In this work, we create a comprehensive analysis suite for decomposition and feature extraction of digital images to study the effectiveness of these methods. Then, using an ensemble of previous techniques, we train simple decision trees and SVM models on these features to achieve >70% accuracy in detecting synthetic vs. genuine illustrations. Our methods of training and inference require only consumer-grade hardware, use exclusively consensual datasets provided by artists and Creative-Commons sources, and provide reliable estimates against the modern image products of both open and black-box closed-source models.

Included Methods

  • local binary pattern

  • gray lvl co-occurrence matrix

  • energy

  • complexity

  • microtexture

  • histogram oriented gradient (hog)

  • variance

  • kurtosis

  • skew

  • palette features

  • spectral features

  • haar wavelet

  • laplacian

  • gaussian diff

  • snr/noise entropy

  • random resize crop

  • patchification

  • l1/mse/k1/bce

Feature Processing Options

  • Decision Tree + PCA

  • SVM (RBF)

  • MLP

  • LR

Structure

Directories are located within $HOME\.local\bin\uv\tools or .local/bin/uv/tools

Data Location source
adjustable parameters config/config.toml included
downloaded datasets .datasets/ HuggingFace
downloaded models /models root folder HuggingFace
trained models /models date-numbered subfolders generated via training
training metadata /results date-numbered subfolders generated via training

Module Summary Purpose
negate core module Root source code folder. Creates CLI arguments and interprets commands.
→→ decompose image processing RRC, Wavelet Transform - arxiv:2511.14030 https://arxiv.org/abs/2504.07078
→→ extract feature processing Residual analysis, VIT/VAE extraction, cross‑entropy loss - arxiv:2411.19417
→→ io load / save / state Hyperparameters, image datasets, console messages, model serialization and conversion.
→→ metrics evaluation Graphs, visualizations, model performance metadata, and a variety of heuristics for results interpretation.
→ inference predictions Detector functions to determine origin from trained model predictions.
→ train XGBoost PCA data transforms and gradient-boosted decision tree model training.
Visualization of Fourier Image Residual variance for the DinoViTL Model

Visualization of VAE mean loss results for the Flux Klein model

@misc{darkshapes2026,
    author={darkshapes},
    title={negate},
    year={2026},
    primaryClass={cs.CV},
    howpublished={\url={https://github.com/darkshapes/negate}},
}

About

slop shall not pass: critical analysis of origin detection

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages