Table of Contents
Fetching ...

DiffQRCoder: Diffusion-based Aesthetic QR Code Generation with Scanning Robustness Guided Iterative Refinement

Jia-Wei Liao, Winston Wang, Tzu-Sian Wang, Li-Xuan Peng, Ju-Hsuan Weng, Cheng-Fu Chou, Jun-Cheng Chen

TL;DR

QR codes must balance readability with visual appeal, yet prior methods often sacrificed scan reliability for aesthetics. DiffQRCoder offers a training-free diffusion-based solution guided by Scanning Robust Perceptual Guidance (SRPG) and enhanced by SR-MPGD, achieving high scan robustness while preserving aesthetics. The approach introduces a Scanning Robust Loss (SRL) with a two-stage diffusion pipeline and a post-processing latent-optimization step, reporting SSR up to 99% and competitive CLIP aesthetics across varied scanning conditions. Extensive experiments and ablations confirm the effectiveness of SRPG and SR-MPGD, with strong improvements over baselines and demonstrated practicality for real-world use. The work advances aesthetic QR code generation by tightly integrating QR decoding constraints into diffusion-based generation, enabling compelling designs without sacrificing usability.

Abstract

With the success of Diffusion Models for image generation, the technologies also have revolutionized the aesthetic Quick Response (QR) code generation. Despite significant improvements in visual attractiveness for the beautified codes, their scannabilities are usually sacrificed and thus hinder their practical uses in real-world scenarios. To address this issue, we propose a novel training-free Diffusion-based QR Code generator (DiffQRCoder) to effectively craft both scannable and visually pleasing QR codes. The proposed approach introduces Scanning-Robust Perceptual Guidance (SRPG), a new diffusion guidance for Diffusion Models to guarantee the generated aesthetic codes to obey the ground-truth QR codes while maintaining their attractiveness during the denoising process. Additionally, we present another post-processing technique, Scanning Robust Manifold Projected Gradient Descent (SR-MPGD), to further enhance their scanning robustness through iterative latent space optimization. With extensive experiments, the results demonstrate that our approach not only outperforms other compared methods in Scanning Success Rate (SSR) with better or comparable CLIP aesthetic score (CLIP-aes.) but also significantly improves the SSR of the ControlNet-only approach from 60% to 99%. The subjective evaluation indicates that our approach achieves promising visual attractiveness to users as well. Finally, even with different scanning angles and the most rigorous error tolerance settings, our approach robustly achieves over 95% SSR, demonstrating its capability for real-world applications. Our project page is available at https://jwliao1209.github.io/DiffQRCoder.

DiffQRCoder: Diffusion-based Aesthetic QR Code Generation with Scanning Robustness Guided Iterative Refinement

TL;DR

QR codes must balance readability with visual appeal, yet prior methods often sacrificed scan reliability for aesthetics. DiffQRCoder offers a training-free diffusion-based solution guided by Scanning Robust Perceptual Guidance (SRPG) and enhanced by SR-MPGD, achieving high scan robustness while preserving aesthetics. The approach introduces a Scanning Robust Loss (SRL) with a two-stage diffusion pipeline and a post-processing latent-optimization step, reporting SSR up to 99% and competitive CLIP aesthetics across varied scanning conditions. Extensive experiments and ablations confirm the effectiveness of SRPG and SR-MPGD, with strong improvements over baselines and demonstrated practicality for real-world use. The work advances aesthetic QR code generation by tightly integrating QR decoding constraints into diffusion-based generation, enabling compelling designs without sacrificing usability.

Abstract

With the success of Diffusion Models for image generation, the technologies also have revolutionized the aesthetic Quick Response (QR) code generation. Despite significant improvements in visual attractiveness for the beautified codes, their scannabilities are usually sacrificed and thus hinder their practical uses in real-world scenarios. To address this issue, we propose a novel training-free Diffusion-based QR Code generator (DiffQRCoder) to effectively craft both scannable and visually pleasing QR codes. The proposed approach introduces Scanning-Robust Perceptual Guidance (SRPG), a new diffusion guidance for Diffusion Models to guarantee the generated aesthetic codes to obey the ground-truth QR codes while maintaining their attractiveness during the denoising process. Additionally, we present another post-processing technique, Scanning Robust Manifold Projected Gradient Descent (SR-MPGD), to further enhance their scanning robustness through iterative latent space optimization. With extensive experiments, the results demonstrate that our approach not only outperforms other compared methods in Scanning Success Rate (SSR) with better or comparable CLIP aesthetic score (CLIP-aes.) but also significantly improves the SSR of the ControlNet-only approach from 60% to 99%. The subjective evaluation indicates that our approach achieves promising visual attractiveness to users as well. Finally, even with different scanning angles and the most rigorous error tolerance settings, our approach robustly achieves over 95% SSR, demonstrating its capability for real-world applications. Our project page is available at https://jwliao1209.github.io/DiffQRCoder.
Paper Structure (49 sections, 24 equations, 13 figures, 8 tables, 1 algorithm)

This paper contains 49 sections, 24 equations, 13 figures, 8 tables, 1 algorithm.

Figures (13)

  • Figure 1: Aesthetic QR codes generated from DiffQRCoder. Our method takes a QR code and a text prompt as input to generate an aesthetic QR code. We leverage the pre-trained ControlNet and guide the generation process using our proposed Scanning Robust Perceptual Guidance (SRPG) to ensure the generated code is both scannable and attractive.
  • Figure 2: Existing methods struggle to balance scannability and aesthetics. Although QRBTF qrbtf2023 generate visually appealing QR codes, they lack scanning robustness. Conversely, QR Code AI Art qrcodeai and QR Diffusion qrdiffusion produce better scanning robust QR codes but are visually less appealing. Our approach can generate both attractive and scannable QR codes. Red frames indicate unscannable codes, while green frames denote scannable codes. Zoom in for better viewing details.
  • Figure 3: An overview of our two-stage pipeline with Scanning Robust Perceptual Guidance (SRPG). First, we encode target QR code $\mathbf{y}$ and prompt $p$ to embeddings for ControlNet input. In Stage-1, we utilize the pre-trained ControlNet to generate an attractive yet unscannable QR code. In Stage-2, we convert the QR code from Stage-1 into a latent representation $\Tilde{\mathbf{z}}_T$ by adding Gaussian noise and transforming the $\mathbf{y}$ to $\Tilde{\mathbf{y}}$, which has a more similar pattern as $\hat{\mathbf{x}}$, using Qart qartcodes. Finally, we feed the latent and the transformed code into ControlNet, guided by Scanning Robust Perceptual Guidance (SRPG), to create an aesthetic QR code with scannability.
  • Figure 4: An illustration of Scanning Robust Loss (SRL). SRL is designed at the module level, tailored to the QR code mechanism. The process begins by constructing a pixel-wise error matrix that measures the differences between the pixel values of the target QR code and the grayscale image. Subsequently, the error for each module is re-weighted using a Gaussian kernel, and the central submodule is extracted to implement an early-stopping mechanism. The mechanism stops refining the module and evaluating its error once the average pixel value of the central submodule matches the center pixel value of the target module. Finally, SRL can be calculated as the average error across all modules in the code.
  • Figure 5: Qualitative comparison with other generative-based methods. DiffQRCoder can generate attractive and scannable QR codes with different encoded messages and prompts.
  • ...and 8 more figures