Edges Before Embeddings: A Confidence-Aware Blur Gate for Vision-Language Pipelines
Duy Tran Thanh * · 2026
Read Edges Before Embeddings: A Confidence-Aware Blur Gate for Vision-Language Pipelines by Duy Tran Thanh * (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-25838.txt.
Introduction
A blurry photo fed to an expensive vision model is money burned: the answer will be garbage and the bill full price. Duy Tran Thanh builds a gatekeeper in 2026, a small classifier that judges one image as sharp, blurred, or uncertain in about seven milliseconds on one CPU core. A search over forty six configurations in eight sweeps selected the recipe. Input resolution proved the dominant lever; model size paid off only above a few hundred pixels. A confidence aware routing rule, grounded in selective prediction theory, decides what passes.
An extra input channel carrying edge strength, the classical clue for blur, lifted the test score by over a point. The final MobileNet recipe scored near ninety eight percent F1 with a tiny deployable file. The author is candid about limits: one blur distribution, one random seed, and calibration judged by eye rather than measured.
Catalog record
| CREATOR | Duy Tran Thanh * |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 30 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2606.25838
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Edges Before Embeddings: A Confidence-Aware Blur Gate for Vision-Language Pipelines Duy Tran Thanh * Abstract Production vision pipelines silently degrade on blurry input, wasting compute on downstream OCR, retrieval, and vision-language model (VLM) calls that cannot recover a usable output. We present MagikaDocumentFromPixel , a lightweight, CPU-friendly image quality gate that classifies a single image as sharp , blurred , or uncertain in roughly 7 ms on a single CPU core. The contributions are (i) a recipe selected from a 46-configuration, 8-sweep empirical search that isolates input resolution as the dominant lever and shows architecture capacity only pays off at ≥ 384 \geq\!384 px; (ii) a confidence-aware routing formalism (Eq. 1 ) grounded in classical selective prediction [ 10 , 11 , 12 ] ; (iii) the Edge Prior Module (EPM) , a Laplacian-magnitude auxiliary input channel that gives the network direct access to the spectral evidence that classical blur heuristics [ 7 ] rely on and that lifts test F 1 by + 1.3 +1.3 points in a matched-env comparison; and (iv) an observation that the gate is one instance of a recurring design pattern that appears independently in Magika content-type detection [ 1 ] , risk-controlled OCR with VLMs [ 2 ] , and DocVLM [ 3 ] . The final recipe MobileNetV3-Large with the EPM trained at × 384 384\!\times\!384 on paired GoPro Large frames, evaluated with 5-scale test-time augmentation reaches F 1 = =\, 0.9803 (AUC 0.9989) with a 17 MB ONNX artifact, improving over our fixed-scale baseline on the same hardware (F 1 = 0.9672) by + 1.31 +1.31 points. We are explicit about limitations: results are on a single motion-blur distribution, numbers are from a single seed, and calibration is qualitative rather than measured. I Introduction Most production computer-vision pipelines were engineered under an implicit assumption that their input is legible . That assumption holds for curated benchmarks and breaks in deployment. Motion blur from hand-held capture, defocus on mobile devices, compression artifacts, low-light noise, and scanner skew all cause a pipeline to continue operating on unusable input. The typical failure modes we observe in engagements are: 1. Silent OCR corruption. An OCR system applied to a blurred receipt or invoice emits garbage tokens that are syntactically indistinguishable from legitimate text. Downstream rule engines and analytics cannot tell these apart. 2. Wasted VLM tokens. Vision-language models such as GPT-4V class services charge per token. A blurred frame still consumes the full per-call budget and yields no usable output. 3. Irrelevant retrieval. User-photo search returns low-quality matches on motion-blurred uploads, driving refund and support cost. 4. Infeasible curation. Hand-filtering blurry images out of multi-million-image datasets stalls supervised vision programs. 5. Slow capture feedback. Mobile and edge capture flows need immediate “please retake” feedback; a cloud roundtrip for every shot is too slow. Approach cheap CPU binary gate abs- tains image blur What it lacks Laplacian / FFT [ 7 ] \checkmark \sim \times \sim no abstention Learned IQA [ 14 , 15 ] \sim \times \times \sim score, not a gate Deblur GANs [ 9 ] \times \times \times \checkmark restores, not gates VLM judges (GPT-4V) \times \times \sim \sim too slow / costly Magika [ 1 ] \checkmark \checkmark \checkmark \times for files, not images Ours: blur gate ★ \checkmark \checkmark \checkmark \checkmark satisfies all four Fig. 1: Where our gate sits in the image-quality landscape. Each row scores a method on the four properties a production blur-gate needs; every existing approach fails at least one column. Our gate ( ★ ) is the first to satisfy all four, lifting F 1 on GoPro Large from 0.9672 (fixed-scale baseline) to 0.9803 on the same hardware (Tab. IV ). Architecture in Fig. 2 . photo (RGB) EPM (Edge Prior Module) grayscale Laplacian standardize 384 px 320 px 256 px 448 px 512 px resize: same photo, 5 sizes Small CNN MobileNetV3-Large 17 MB, \scriptstyle\sim 7 ms on a CPU (same model, all 5) \Sigma\,/\,5 average over the 5 sizes confident? ( \tau\!=\!0.60 ) sharp \to run OCR / VLM uncertain \to human review blurred \to ask for retake Fig. 2: Full architecture, read left-to-right. The Edge Prior Module ( EPM , Sec. III-D ) extracts an edge map in three steps grayscale, Laplacian filter, standardize and concatenates it onto the RGB photo as a 4th input channel. The shared CNN is evaluated at five image resolutions; the \Sigma/5 block averages the per-scale predictions, and the routing diamond emits sharp , uncertain , or blurred depending on whether the averaged confidence clears \tau\!=\!0.60 . The uncertain bucket is the deliberate abstention [ 10 , 12 ] that routes low-confidence cases to a heavier model or a human. = learnable; = frozen / parameter-free. The existing landscape leaves teams stuck between two ends. Heavy restoration networks (deblur GANs, hundreds of millions of parameters) are too expensive to run per upload and are designed to fix blur rather than detect it. Hand-crafted edge-variance heuristics (Laplacian variance, FFT band-energy) are cheap but break on textured-but-sharp scenes and smooth-but-sharp scenes and cannot be tuned per domain [ 7 ] . What a production team actually needs is a gate a fast, cheap, CPU-executable model that sits in front of the expensive pipeline and decides whether to pass the image through, reject it, or abstain. This paper describes such a gate. Contributions. The paper does not propose a new backbone or a new loss. Its contributions are: • An empirical recipe. A reproducible \sim\!7 ms-CPU, 17 MB blur detector reaching F 1 =\,0.9749 on GoPro Large in the original CUDA environment, selected from 46 training runs organized into 8 sweeps (Section V ). • The Edge Prior Module (EPM). A drop-in extension that concatenates per-pixel Laplacian magnitude as a 4th input channel, giving the CNN direct access to the spectral evidence that classical blur heuristics [ 7 ] rely on. In a matched-env comparison (AMD/ROCm), the EPM improves 5-scale-TTA F 1 from 0.9672 to \mathbf{0.9803} ( +1.31 points), with no architectural change other than the first-conv width (Section III-D ). • A structural finding about which levers matter. Across the full search, input resolution dominates backbone capacity: moving 128 \to 384 px adds \sim\!13 F 1 points, and MobileNetV3-Large outperforms MobileNetV3-Small only at \geq\!384 px (Section V ). • A routing formalism grounded in classical selective prediction. Equation 1 couples the classifier to a deployment-time abstention rule in the spirit of Chow [ 10 ] and Geifman-El-Yaniv [ 12 ] , with the abstention threshold \tau treated as a per-channel product knob (Section IV ). • A cross-paper observation (not a claimed contribution, but a framing). The cheap-gate + confidence + route pattern appears independently in Magika [ 1 ] , risk-controlled OCR with VLMs [ 2 ] , and DocVLM [ 3 ] ; we argue it is a default architecture for production vision/document systems (Section VII ). Scope and honest limits. All reported numbers are on the GoPro Large motion-blur distribution with a single random seed. Cross-dataset generalization (RealBlur, HIDE, REDS, OCR/document blur), calibration metrics (ECE, reliability diagrams), threshold sensitivity, and multi-seed variance are not included in this paper and are discussed as explicit limitations and future work (Section