agentleFS
LeostrukaLeostruka/devin-bundle/skills/image-forensics/SKILL.md

image-forensics

Skill0 starsChanged 3 months agoMITView on GitHub

Use when checking whether an image is a real camera capture or synthetic/generated, when tagging media provenance before ingestion, when verifying visual evidence for fact-check, or when validating that ai3d-gen source photos are real captures before splatting. Covers PRNU noise-residual forensics, EXIF/XMP/C2PA first pass, and PCE scoring via extensions/image-forensics.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never claim provenance from a single signal: combine metadata flags + residual + PCE.

    line 34
  2. Very specific:

    No camera reference available -> no_reference.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Image Forensics

Cheap image provenance: real-vs-synthetic plus "which camera took this". Route: extensions/image-forensics/verdict.py — JSON contract {ok, verdict, pce, metadata_flags, notes}.

Evidence ordering (always in this order)

  1. Metadata first pass — metadata.py: EXIF/XMP/C2PA report. Generator tags (stable diffusion, dall-e, ...) or a C2PA manifest are fast signals. Absence of EXIF is NOT evidence of synthesis: metadata dies on screenshot/re-upload; pixel noise does not.
  2. Noise residual — prnu.residual: denoise (wavelet via PyWavelets when installed, Gaussian fallback) and subtract; the remainder is the fingerprint candidate.
  3. Reference pattern — verdict.py --build-ref dir/ --out ref.npy averages residuals of N flat-ish real photos from one device.
  4. PCE score — prnu.pce: peak-to-correlation-energy of residual vs reference. Goljan's empirical band ~50-60 discriminates; calibrate on the local dataset, never treat thresholds as universal.
  5. Verdict: real_capture / synthetic / inconclusive / no_reference + flags + notes.

Abstain rules

  • Residual energy below the denoiser floor (flat or heavily recompressed input) -> inconclusive, note low_residual_energy.
  • Heavy crop/resize/recompression weakens the signal; say so in notes.
  • Never claim provenance from a single signal: combine metadata flags + residual + PCE. For publication, pair with fact-check.
  • No camera reference available -> no_reference; build one or abstain.

Commands

python extensions/image-forensics/verdict.py shot.jpg --ref ref.npy
python extensions/image-forensics/verdict.py --build-ref known_phone/ --out ref.npy
python extensions/image-forensics/metadata.py shot.jpg

Integrations

  • ai3d-gen preflight: source images should verify as real captures before the splat pipeline (synthetic inputs break PRNU assumptions).
  • fact-check: visual-evidence tagging.
  • PPISP (extensions/ppisp-prep) models complementary per-camera photometrics (exposure/vignette/CRF) — provenance vs correction answer different questions; do not conflate.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.