OmniVision DocIntel API™ — Document Forensics & ELA
Asynchronous FastAPI microservice for digital document forensics, OpenCV quality inspection & Error Level Analysis
Empirical benchmark comparing INT8 Post-Training Quantized ONNX against vanilla TorchScript C++ tracing.
01 // SYSTEM OVERVIEW
OmniVision-DocIntel API™ is an enterprise-grade digital document forensics and quality assurance microservice. Engineered with asynchronous FastAPI and OpenCV, it provides automated defense against manipulated invoices, forged tax returns, and spliced receipts through Error Level Analysis (ELA), Laplacian blur variance screening, orientation auto-correction, and Prometheus telemetry.
02 // THE PROBLEM & ENGINEERING SIGNIFICANCE
FinTech, InsurTech, and compliance platforms receive thousands of unstandardized document scans daily. Bad actors exploit manual review fatigue by digitally altering financial totals, dates, and account numbers using photo-editing software.
Standard OCR engines blindly read spliced text without assessing pixel integrity, leading to millions in fraudulent loan disbursements and insurance payouts.
- •Detecting pixel-level copy-paste splices on compressed JPEG/PNG documents without requiring heavy GPU deep learning models.
- •Filtering out blurred or severely tilted mobile camera scans before downstream OCR pipeline execution.
- •Maintaining sub-100ms API response times under high burst concurrency with strict rate-limiting guardrails.
03 // DATA PIPELINE & PREPROCESSING
- Streaming in-memory byte buffer decoding via Pillow and OpenCV (zero disk writes)
- Color channel normalization and grayscale projection for gradient computation
- Laplacian operator convolution to evaluate focus quality and camera blur
04 // SYSTEM ARCHITECTURE & DATA FLOW
Client (REST / Streamlit) -> FastAPI Async Gateway -> Token-Bucket Rate Limiter -> OpenCV Blur & Skew Engine -> Error Level Analysis (ELA) Forensics -> Prometheus Telemetry -> JSON Audit Response.
Non-blocking ASGI server with Pydantic v2 schema validation, CORS security, and health probes.
Measures Laplacian variance (blur detection) and computes histogram exposure levels.
Resaves images at known 95% JPEG quality and computes pixel-level absolute difference residuals.
Exposes real-time request counts, latency histograms, and forensic flag rates.
05 // MODEL ENGINEERING & HYPERPARAMETERS
Calibrated against multi-tier tampering benchmarks with varying JPEG compression ratios.
- • Blur Threshold: Var < 100.0
- • ELA Scale Factor: 10x
- • ELA Tamper Threshold: Std > 18.0
- • Rate Limit: 60 RPM
06 // FAILURE ANALYSIS & ZERO-TRUST SAFEGUARDS
- • Heavily re-compressed documents (compressed > 5 times) where ELA differences flatten out.
- • Extremely low-resolution scans (< 300x300 pixels) where Laplacian variance is naturally low.
07 // PRODUCTION DEPLOYMENT SPECS
08 // ARCHITECTURAL DECISIONS & TRADE-OFFS
09 // PLANNED IMPROVEMENTS & NEXT REVISIONS
- →Add automated font-consistency analysis using localized OCR character geometry.
- →Integrate EXIF metadata tampering and camera serial hash verification.