How I Built a Lightweight Image Forensics Engine in Python (And Why Naive ELA Fails)
Описание и применение
Создан легковесный движок ELA на Python, который корректно выявляет подделки в сканированных документах, избегая ложных срабатываний, благодаря NIST‑калиброванному ресейву, динамической контрастной усиленности и адаптивному порогу шума.
Задача
Detecting subtle image tampering in scanned documents without generating false positives from high‑contrast text.
Результат
deeptrace‑ela achieves sub‑100 ms latency, <30 MB RAM usage, and accurate detection of tampered regions in 1080p images without GPU.
Рабочий процесс
- Install deeptrace‑ela via pip
- Import analyze_ela in Python
- Run analyze_ela on an image with quality=95
- Inspect result.verdict, result.mean_error, and result.anomalies
- Save heatmap with result.save_heatmap
- Optionally run deeptrace‑ela from CLI with --output or --json
Доказательства
Over the past few months, I built and open‑sourced deeptrace‑ela — a zero‑GPU, NIST‑grade Error Level Analysis (ELA) forensics engine in Python.
If you run that script on a real‑world document (like a scanned contract or a PDF receipt), it fails catastrophically.
We added three deterministic safeguards: NIST‑Calibrated Resave Tier (Q = 95), Dynamic Contrast Amplification, Adaptive Ambient Thresholding (μ + 3.5σ).
Execution speed: ~35ms – 85ms on a 1080p image on a standard laptop CPU
- Дата записи: 2026-10-25T18:26:13.135Z