Does the file fit?
Dimensions, format, aspect, and basic image constraints catch cheap failures before model work begins.
fast checksDelivered client system · Ain Shams University IT desk · 2025
A staged photo-validation pipeline that sorts university image batches into valid, invalid, or human review. The engineering story is the gate design: cheap checks first, expensive models only when needed, and uncertainty kept as a legitimate output.
Recorded run envelope. The ranges below are observed process measurements; the false-positive figure is a target threshold, kept visually separate from measured behavior.
01 · Architecture
PhotoValidator uses a staged cascade with a parallel middle. Specification and border checks can short-circuit obvious failures; candidates that pass those cheap gates fan out to text, watermark, and perceptual-quality modules that can run concurrently before the confidence engine returns valid, invalid, or manual review.
Dimensions, format, aspect, and basic image constraints catch cheap failures before model work begins.
fast checksCanny edges, morphology, and contour reasoning identify border and framing violations.
OpenCV geometryConvNeXt and PaddleOCR detect unwanted text and watermark patterns, with outputs kept separate.
parallel vision + OCRBRISQUE, NIQE, and CLIPIQA combine into an adaptive quality decision with review when confidence is low.
parallel quality gate

02 · Vision, made visible
The documentation treats each processing stage as an inspectable figure. The same test image travels from the original frame through grayscale, Sobel gradients, and Canny edges; worked border, text, and watermark examples then carry their confidence scores and final classification on the page. Click any figure to read it at full resolution.








03 · Training and failure
The first training path produced a large synthetic dataset, but the result overfit the generation process instead of generalizing to the faculty’s visual conditions. The valuable engineering move was recognizing the failure and changing the pipeline, rather than treating dataset size as progress.
The experiment exposed a distribution problem. The final system leans on staged checks, targeted detectors, shared preprocessing, caching, and a review band instead of trusting one overfit classifier.

04 · Engineering judgment
PaddleOCR wrote outputs in a path shape that conflicted with the rest of the pipeline. A runtime monkey patch normalized that boundary without rewriting the model.
A face/shoulder crop was abandoned because it could cut religious headwear and natural features. Validation should respect the person in the image.
Manual review is a first-class destination. The system can load once, process in parallel, fall back to CPU or heuristics, and leave a clear queue when confidence is not enough.
The TUI exposes batch queues, stage-level counters, flagged files, and a review path rather than hiding the pipeline behind a single progress bar.
queued → spec → border → text → quality
valid · invalid · manual reviewRecorded behavior includes 98–99% specification checks, 90–95% border detection, 93–96% watermark detection, 85–92% quality scoring, 200–400 images per minute, and a 5–10 second cold start.
models loaded once · shared preprocessing · graceful fallback05 · Delivery
The implementation was delivered with model memory controls, cache-aware execution, parallel processing, CPU/GPU fallback, reports, and the certificate above. The system is valuable because another operator can understand what it decided and what still needs attention.
06 · Complete record
The page gives the visual and engineering story. The original local artifacts preserve the full documentation, certificate, and working demo.