ai-image-detector  by lynote-ai

Detect AI-generated images with multiple backends

Created 2 months ago
302 stars

Top 88.1% on SourcePulse

GitHubView on GitHub
Project Summary

AI Image Detector provides a small, user-friendly tool for identifying AI-generated images. It offers a probabilistic signal for image authenticity, suitable for engineers, researchers, and power users. The project aims to deliver an easily installable solution with reproducible reports, treating its output as one signal among others rather than definitive proof.

How It Works

The detector employs a probabilistic approach with a modular backend system. The default is UnivFD, utilizing CLIP ViT-L/14 features with a linear classifier, chosen for its small model size, understandability, and cross-generator generalization. Additional backends include hybrid ensembles (combining UnivFD with Hugging Face classifiers), external detectors like nonescape-mini and sentry-convnext-small, and the 'ultra' backend, which ensembles multiple strong models. This ensemble approach is highlighted as the most effective practical route without custom model training. The system also supports post-hoc threshold calibration (e.g., balanced_accuracy, f1) to enhance performance on specific datasets.

Quick Start & Requirements

  • Installation: Requires Python 3.10+. Install via pip: pip install -e .
  • Optional Extras: .[eval] for dataset benchmarks, .[hf] for Hugging Face backends, .[api] for FastAPI, .[web] for Gradio UI, .[dev] for development tools.
  • Usage: Command-line interface aidetect for detecting single images (aidetect detect image.jpg) or folders (aidetect detect ./images --csv report.csv). The --backend flag allows selection of specific models (e.g., aidetect detect image.jpg --backend ultra).
  • Relevant Links: UniversalFakeDetect paper, UniversalFakeDetect code, AIDE paper, GenImage benchmark, Tiny-GenImage, CIFAKE benchmark.

Highlighted Details

  • Offers a variety of backends, from the simple UnivFD to complex ensembles like 'ultra'.
  • Supports threshold calibration and optimization metrics (e.g., F1, balanced accuracy) for tailored performance.
  • Includes benchmarking tools for evaluating performance on custom folders or Hugging Face datasets.
  • The 'ultra' backend is presented as the strongest practical option for high accuracy.

Maintenance & Community

No specific details regarding maintainers, community channels (like Discord/Slack), or project roadmap were found in the provided README.

Licensing & Compatibility

The README does not explicitly state the software license. This omission requires further investigation for compatibility, especially for commercial use or integration into closed-source projects.

Limitations & Caveats

AI image detection is inherently probabilistic; results should be treated as signals, not definitive proof. No detector is universally effective, as factors like new generative models, image recompression, screenshots, crops, edits, upscaling, and adversarial post-processing can alter detection outcomes. Benchmarks may overstate real-world reliability if deployment data distributions differ from benchmark datasets. The tool currently assesses whole-image synthetic likelihood and does not localize edited regions within an image.

Health Check
Last Commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Kevin Hou Kevin Hou(Head of Product Engineering at Windsurf).

ImageAI by OlafenwaMoses

0%
9k
Python library for computer vision tasks
Created 8 years ago
Updated 2 years ago
Starred by Clement Delangue Clement Delangue(Cofounder of Hugging Face), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
26 more.

pytorch-image-models by huggingface

0%
37k
PyTorch image model collection with training, eval, and inference scripts
Created 7 years ago
Updated 1 day ago
Feedback? Help us improve.