Stylized Aesthetic QR Code

Mingliang Xu, Hao Su, Yafei Li, Xi Li, Jing Liao, Jianwei Niu, Pei Lv, Bing Zhou

TL;DR

The paper introduces SEE (Stylize aEsthEtic) QR codes, a novel three-stage framework that automatically transforms standard, visually unpleasant QR codes into high-quality artistic pieces. By integrating tailored neural style transfer with an iterative error-correction mechanism, the approach generates highly personalized QR codes that maintain excellent scannability across various mobile devices and lighting conditions.

What Problem Does This Paper Address?

While Quick Response (QR) codes are ubiquitous, their default appearance—monochromatic, mechanical black-and-white squares—is visually disruptive. Previous attempts to beautify them generally fall into embedded, deformed, manual, or blended types.

However, existing blended-type methods suffer from three main drawbacks:

  1. Lack of Personalization: They generate different appearances only by changing the background image; users cannot easily render a single image into multiple diverse artistic styles.
  2. Poor Artistry: They typically overlay rigid black/white modules directly onto an image, creating a jarring visual contrast where the modules look like mechanical noise.
  3. Low Robustness: They rely on fixed parameters to maintain readability rather than actively evaluating and correcting scanning errors caused by stylistic alterations.

Methods

The authors propose a three-stage pipeline to synthesize robust, stylized aesthetic QR codes:

Overview of the proposed three-stage approach for generating SEE QR codes.
  1. Stage A: Baseline Aesthetic QR Code Generation: Instead of relying purely on local image features, the system uses a global gray-value optimization strategy. It prioritizes scheduling black/white modules in the darkest and lightest areas of the background image to minimize visual contrast. Furthermore, square modules are replaced with circular spots to improve scanning consistency across different angles.
  2. Stage B: Style Transfer: The baseline QR code is passed through a CNN-based style transfer network. Standard style transfer networks focus heavily on high-level global features, which creates messy color blocks that destroy fine QR modules. To fix this, the authors refined the loss network (VGG-16), utilizing lower-level layers (relu1_2, relu2_1, relu3_1) for style and content reconstruction. This forces the network to preserve the discrete, fragmented structure of the QR modules while seamlessly blending them into a unified artistic style.
  3. Stage C: Iterative Error Correction: Style transfer inevitably introduces decoding errors. The authors introduce a mathematical robustness evaluation function based on sampling and thresholding. The algorithm detects non-robust modules and iteratively adjusts their grayscale values until the code is fully readable, before finally mapping the optimized grayscale image back into the target RGB color space.
Close-up comparison showing how the proposed method unifies modules and images into a single style, unlike traditional methods.

Datasets

  • Dataset D: A custom-prepared evaluation dataset containing 300 images ($512 \times 512$ pixels) spanning landscapes, cartoons, animals, characters, and trademarks, used as the blending content targets.
  • MS-COCO: Used to pre-train the adapted feed-forward style transfer network.
  • Style Targets: 10 distinct artistic style images used to evaluate the network's universal style-rendering capabilities.

Key Insights and Ideas

  • Lower VGG Layers are Key for QR Structure: The "aha moment" in the style transfer stage was realizing that lower layers of a pre-trained VGG network emphasize localized, discrete textures. By shifting the style loss to these lower layers, the network treats the QR modules as structural textures to be stylized rather than noise to be smoothed over.
  • Unified Styling Over Direct Overlay: Traditional methods stylize the image and then stamp the QR modules on top. By stylizing the combined baseline QR code, both the background image and the functional modules are modified simultaneously into a cohesive aesthetic.

Key Results

  • Robustness: The adapted style transfer network in Stage B reduced the initial number of error modules by approximately 60% compared to standard style transfer baselines before any explicit error correction was applied.
  • Real-World Scannability: In real-world testing across four different smartphone brands (iPhone, Huawei, Samsung, Xiaomi) and multiple apps (WeChat, Alipay, standard readers), the final SEE QR codes achieved a successful decoding rate of over 96% (and frequently 100%), even at small physical print sizes ($3\text{cm} \times 3\text{cm}$).
  • Visual Appeal: Structural Similarity Index (SSIM) evaluations showed the proposed method outperformed alternative two-stage blending techniques in 96.3% of test cases. User surveys involving 40 volunteers ranked SEE QR codes significantly higher in attractiveness and personalization than state-of-the-art alternatives.
Examples of stylized SEE QR codes generated from a single input image.

Limitations and Future Work

The authors note an inherent trade-off between visual quality and robustness. Increasing the robustness parameter ($\delta$) or the circular spot radius ($r$) guarantees easier scanning under harsh conditions but introduces more noise-like spots, slightly degrading the artistic fidelity. Future work could explore dynamic, content-aware spot shaping to further mask these functional elements.

Summary updated

BibTeX
@article{xu2019stylized,
  author = {Mingliang Xu and Hao Su and Yafei Li and Xi Li and Jing Liao and Jianwei Niu and Pei Lv and Bing Zhou},
  title = {{Stylized Aesthetic QR Code}},
  journal = {IEEE Trans. Multimedia},
  year = {2019},
  url = {https://openreview.net/forum?id=UZGz12_TxP},
}
Figure