Skip to content

Repository files navigation

PixelWitness

A Manifest V3 Chrome extension that automatically scores ordinary webpage images for likely AI generation. Image decoding, three-model inference, score fusion, and metadata checks all run inside Chrome; image bytes are never sent to an inference service.

Status: submission candidate, not yet submitted. The built extension clears the bounty target on our public proxy holdout, but that result cannot predict the private benchmark. See COMPLIANCE.md for the remaining license-interpretation gate.

Browser benchmark

The release build was tested in a clean Chromium profile against 40 untouched pairs from Sightengine's public "Which Image Is AI?" game. The split rule and decision calibration were frozen before this holdout was run.

Metric at displayed 65% threshold Result
Balanced accuracy 82.50%
AI recall 87.50%
Real-image specificity 77.50%
Pairwise accuracy 90.00%
Images 80
Median CPU-WASM latency 5.82 s/image

This is a useful web-realistic proxy, not an estimate of the private bounty score. No benchmark images, labels, paths, or hashes are bundled into or read by the extension. The committed aggregate result is in benchmarks/sightengine-v1-browser-holdout.summary.json.

Privacy and runtime guarantees

  • No cloud inference, external inference API, telemetry, or localhost service.
  • No Python, Node.js, Flask, or other companion process at extension runtime.
  • Three quantized ONNX files and the ONNX Runtime Web WASM backend are packaged in dist/.
  • After installation, model inference works with network access disabled.
  • The extension only fetches the URL of an image already displayed by the current page, using Chrome extension host permissions. It does not send the image anywhere else.
  • All executable JavaScript and WebAssembly is packaged locally; the manifest has no remotely hosted code.

How detection works

Every eligible image is decoded once and scored sequentially by three complementary detectors:

Member Input AI output Fusion weight Upstream license
xRayon ConvNeXtV2-Base 256 x 256 class 1 0.30 MIT
Six-Fingers ViT-S 384 x 384 single fake logit 0.40 MIT
Sentry ConvNeXt-Small Fake5M 224 x 224 class 0 0.30 Apache-2.0

Each member uses its own published resize, center-crop, mean, and standard deviation. Bounded model log-odds are combined with the frozen weights above. The development-set decision point is calibrated to the bounty's displayed 65% threshold. Explicit generator provenance such as C2PA trainedAlgorithmicMedia, ComfyUI, Stable Diffusion, Midjourney, DALL-E, or Firefly metadata can increase the score; generic C2PA presence cannot.

The badge is an AI-generation score, not a promise of certainty. AI 2% means the detector found little evidence that the image is AI-generated. On this holdout, 35 of 40 AI images scored at least 65%.

Build and install

Prerequisites: Node.js 22+, pnpm 11+, and Chrome 121+.

pnpm install --frozen-lockfile
pnpm verify:release

Then open chrome://extensions, enable Developer mode, choose Load unpacked, and select the generated dist/ directory. Visit an ordinary HTTP or HTTPS page; scores appear automatically on images at least 64 x 64 pixels.

The exact quantized models are committed as release inputs. To reproduce them from pinned upstream checkpoints, Python 3.12+ is also required:

python -m venv .venv
.venv/Scripts/python -m pip install -r requirements-model.txt
.venv/Scripts/python tools/prepare_ensemble_models.py --force-export
pnpm verify:release

On macOS/Linux, replace .venv/Scripts/python with .venv/bin/python. The preparation script verifies the upstream checkpoint, release archive, and generated ONNX SHA-256 digests before installing any model.

Reproduce the public benchmark

Do not use the holdout split for additional tuning. To download the public pairs and run the built extension in a fresh Chrome profile:

.venv/Scripts/python tools/download_sightengine_pairs.py
pnpm build:release
node tools/benchmark_extension_in_chrome.mjs \
  --split holdout \
  --chrome /path/to/chrome \
  --output output/browser-holdout.json

CHROME_PATH can be used instead of --chrome. Add --verify-badges --offline-smoke to verify automatic ordinary-page badges and local inference after Playwright disables browser networking. tools/benchmark_local_ensemble.py is a faster ONNX/Pillow diagnostic, but Chrome Canvas preprocessing and batch-one WASM inference make the browser run authoritative.

Architecture

  • src/content/: discovers static and dynamically inserted images and renders badges.
  • src/background/: validates requests, owns the URL result cache, and starts the offscreen runtime.
  • src/offscreen/: fetches displayed image bytes and runs sequential WASM inference.
  • src/model/: per-model preprocessing and conservative metadata evidence.
  • tools/: pinned model preparation and benchmark utilities.
  • third-party-licenses/: retained upstream notices shipped in the release build.

License

The extension source is MIT licensed. ONNX Runtime Web, xRayon, and Six-Fingers retain their MIT notices. The included Sentry model retains its Apache-2.0 notice and full license. See COMPLIANCE.md before making a bounty claim.

About

Privacy-preserving MV3 Chrome extension for browser-local AI image detection

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages