Evidence-submission portals often receive the wrong kind of upload. People submit a document where a site photo belongs, or the other way round, and catching these by hand doesn't scale.
The pipeline scores each image on five signals: pixel variance, edge density, entropy, heuristic rules and OCR layout analysis. Four document indicators each add a point: text-area ratio ≥ 0.12, vertical text spread ≥ 0.4, at least 4 valid words, and consistent text alignment. A voting step using 40% region agreement and OCR feasibility resolves ambiguous cases.
Stack: Python, FastAPI, React, OCR.