Papers
Topics
Authors
Recent
2000 character limit reached

ADNet: Adaptive Dual-network for QR Deblurring

Updated 15 October 2025
  • ADNet is a deep learning framework that adaptively selects between an edge-guided Transformer and an efficient convolutional network to restore QR codes.
  • It employs a blur severity-based routing strategy using Laplacian Variance thresholds to optimize decoding reliability and reduce computational latency.
  • The framework leverages explicit edge priors through a novel Edge-Guided Attention Block, achieving high QR decoding rates and improved efficiency.

An Adaptive Dual-network (ADNet) is a deep learning framework designed for QR code motion deblurring that dynamically integrates two specialized networks to support robust decoding under varied blur conditions. ADNet leverages explicit edge priors through a Transformer-based attention mechanism for severe blur and a lightweight convolutional network for mild blur, using a routing strategy based on input blur severity. The design is motivated by the unique structural properties of QR codes—highly regular modules and sharp edges—which facilitate a prior-driven restoration approach distinct from general-purpose image deblurring.

1. Dual-network Architecture Overview

ADNet consists of two principal sub-networks optimized for different regimes of blur:

  • Edge-Guided Restormer (EG-Restormer): Incorporates the Edge-Guided Attention Block (EGAB) to inject explicit edge priors into a Transformer architecture. EG-Restormer is invoked for severely blurred QR codes where accurate edge recovery is crucial for decoding.
  • Lightweight and Efficient Network (LENet): Employs a Simple Gate Depthwise Convolution Block (SGDB), facilitating fast deblurring optimized for inputs with mild blur.

Both subnetworks employ a U-shaped encoder–decoder architecture. EG-Restormer’s encoder increases channel width while spatially downsampling; its decoder refines and upsamples features to produce an additive residual image. LENet eschews Transformer modules for SGDB and incorporates an Edge Sharpening Attention Block (ESAB) in its decoder for efficiency in detail restoration.

2. Blur Severity-based Routing Strategy

The ADNet framework features an explicit Blur Severity-based Routing (BSR) module, which determines, for a given QR code image IbI_b, which subnetwork to activate:

  • Blur Metric: The system computes Laplacian Variance (LV) of the input as a quantification of sharpness. Higher LV indicates lower blur.
  • Threshold Calibration: A hard threshold τ\tau is calculated using sets of LV for decodable and non-decodable images after LENet processing:

τ=min(Ldecodable)+max(Lnon-decodable)2\tau = \frac{\min(\mathcal{L}_{\text{decodable}}) + \max(\mathcal{L}_{\text{non-decodable}})}{2}

  • Routing Logic: If M(Ib)>τ\mathcal{M}(I_b) > \tau, LENet is applied. Success of QR decoding is checked; if decoding fails, EG-Restormer is triggered. For M(Ib)τ\mathcal{M}(I_b) \leq \tau, the input is sent directly to EG-Restormer.

This adaptive routing enables computational resource savings and latency reduction on resource-constrained devices while maximizing decoding reliability.

3. Edge-Guided Attention Block (EGAB)

A substantive innovation within ADNet is EGAB, which enhances attention calculations using explicit edge priors:

  • Edge Map Generation: The Edge Generation Attention (EGA) module applies four parallel Sobel operators (detecting horizontal, vertical, 4545^\circ, and 135135^\circ edges) to the mean of the input feature map XinX_{\text{in}}. Outputs are fused by fixed-weight convolutions and a max operation, yielding an edge map EE.
  • Attention Modulation: In multi-head attention, the query QQ and key KK matrices are modulated by the edge map EE as follows:

QE=Q(1+WE×E)Q_E = Q \cdot (1 + W_E \times E)

KE=K(1+WE×E)K_E = K \cdot (1 + W_E \times E)

The transformed QEQ_E and KEK_E are used in the transposed dot-product attention:

Xout=Attention(Q^E,K^E,V^)+XinX_{\text{out}} = \text{Attention}(\hat{Q}_E, \hat{K}_E, \hat{V}) + X_{\text{in}}

This mechanism enforces explicit focus on edge regions, crucial for structured module restoration in QR codes.

4. Quantitative Performance and Efficiency

ADNet achieves a competitive trade-off between decoding rate and computational load:

Network Decoding Rate (DR) Avg. Inference Time (s)
EG-Restormer 90% 0.91
LENet Lower for severe 0.28
ADNet 90% 0.737

The dynamic routing strategy reduces average latency by approximately 19% relative to full EG-Restormer usage, with no loss in overall decoding success for severely blurred samples.

5. Technical Details and Implementation

Significant technical elements include:

  • SGDB Architecture in LENet: Features Layer Normalization, 1×1 and 3×3 depthwise convolutions, SimpleGate for gating non-linearity, and weighted residual addition. ESAB in LENet's decoder further enhances edge restoration speed and accuracy.
  • Training Regimen: Both sub-networks are trained independently using AdamW optimizer. EG-Restormer utilizes progressively larger patch sizes during training; LENet is trained on fixed-size patches for maximal efficiency.
  • Edge Prior Integration: The explicit edge prior is unique to this approach and contrasts with implicit edge sensitivity in generic deblurring models.

6. QR Code-specific Restoration and Application Scope

ADNet is tailored to the requirements of QR code deblurring, where successful decoding is prioritized over perceptual image quality. The heavy reliance on edge priors directly leverages QR code structure (square modules and alignment patterns), resulting in:

  • Superior restoration of QR-specific patterns under severe motion blur.
  • Energy-efficient deblurring for mildly blurred codes, enhancing device battery performance and reducing computational load.
  • Real-time applicability in settings such as logistics, retail point-of-sale, and mobile devices, as well as potential adaptation for other structured image domains—e.g., text or document deblurring acts, provided similar edge-centric priors are pertinent.

7. Significance and Further Implications

ADNet’s edge-guided dual-network architecture, dynamic routing, and explicit edge modulation present a compelling model for structured image restoration tasks. The demonstrated success in balancing accuracy and efficiency for QR code deblurring justifies further investigation into analogous mechanisms for other domain-specific restoration problems where structural priors are well-defined. The approach implies a broader paradigm shift from generic image quality metrics to task-driven restoration objectives, particularly in industrial and mobile computational imaging contexts.

Slide Deck Streamline Icon: https://streamlinehq.com

Whiteboard

Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to Adaptive Dual-network (ADNet).