TL;DR
To the human eye, a QR code linking to your favorite restaurant's menu looks identical to one designed to steal your bank credentials. Instead of decoding the hidden URL and running slow web checks, QRNet learns to spot "quishing" (QR phishing) attacks simply by looking at the raw pixels of the QR code image itself. Trained on over a million samples, it proves that malicious links leave distinct visual fingerprints right inside the black-and-white grid.
What Problem Does This Paper Address?
When you hover over a sketchy link in an email, you can read the URL and spot a typo-squatted domain. QR codes strip away that human intuition, hiding the destination behind an unreadable mosaic of squares. Because of this visual opacity, QR code phishing—or quishing—has exploded.
Traditionally, security tools defend against quishing in two steps: first, decode the QR image to extract the URL; second, analyze that URL using blacklists, lexical features, or live webpage scraping. But decoding requires extra processing, fails on damaged codes, and exposes scanners to potential payload exploits. Recent attempts to detect malicious QR codes directly from images have relied on tiny datasets, handcrafted grid features, or off-the-shelf vision models pretrained on natural photos (like dogs and cars in ImageNet) rather than geometric bit matrices. The authors ask: can we build a dedicated visual architecture that natively "speaks QR" to catch phishing attacks without ever decoding the link?
Methods
The authors introduce QRNet, a custom convolutional neural network (CNN) trained from scratch on $224 \times 224$ grayscale QR images in two distinct phases:
- Unsupervised Autoencoder Pretraining (The Novel Twist): Before it ever sees a "benign" or "malicious" label, QRNet’s four-block encoder compresses QR images into a compact spatial latent representation ($14 \times 14 \times 384$), and a symmetrical decoder reconstructs the image pixel-for-pixel. This forces the network to learn the fundamental grammar of QR codes—finder patterns, module edges, and data density. Remarkably, 99.76% of the autoencoder's reconstructed images still scan and return the exact same URL payload as the originals.
- Two-Stage Supervised Classification: The decoder is discarded, and a lightweight classification head (global average pooling + dense layers) is attached to the pretrained encoder. First, the encoder is frozen to warm up the classification head; then, the entire network is fine-tuned end-to-end to spot quishing.
To benchmark QRNet fairly, the authors pit it against 12 standard baselines: 8 classical machine learning models (like XGBoost and LightGBM) fed with handcrafted Histogram of Oriented Gradients (HOG) edge features, and 4 ImageNet-pretrained deep learning heavyweights (ResNet50, DenseNet121, EfficientNetB0, and YOLOv11).
Datasets
- CIC-Trap4Phish (Main Dataset): 1,005,738 labeled QR images (429,976 benign; 575,762 malicious), making this the largest image-based quishing benchmark to date. The authors also programmatically extracted QR version (grid size) and mask pattern labels from ~956,000 of these images to test structural transfer learning.
- QR Code Quishing 200k (External Dataset): An independent, balanced set of 200,000 QR images (100k benign, 100k malicious) used to test zero-shot generalization and domain adaptation.
Key Insights and Ideas
- Dogs and cats don't help with QR codes: Off-the-shelf deep learning models pretrained on ImageNet (like ResNet50 and YOLOv11) actually lost to classical XGBoost trained on HOG features. Natural-image priors don't translate well to rigid, high-contrast binary grids; learning QR representations from scratch via reconstruction is much more effective.
- Convergent evolution in explainability: Using five explainability methods (including Grad-CAM and SHAP), the authors peeked inside both QRNet and the HOG-based XGBoost model. Despite learning completely different representations, both models independently focused on the right and central-right regions of the QR grid—areas rich in encoded data modules and structural format info—while largely ignoring the left side.
- A true "QR Backbone": Because QRNet was pretrained via reconstruction, its internal features aren't just memorizing phishing artifacts. When repurposed, the exact same encoder effortlessly classified internal QR specifications like version numbers and bit-mask patterns.
Key Results
- Main Quishing Detection: On the full 150,861-image test set, QRNet achieved 90.52% accuracy, 91.57% F1-score, and a 96.80% ROC-AUC. It beat the strongest optimized baseline (XGBoost on top-700 HOG features, which got 88.22% accuracy and 95.37% ROC-AUC) with overwhelming statistical significance ($p < 10^{-29}$ on both DeLong and McNemar tests).
- Distortion Robustness: Tested across 27 visual degradations without retraining, QRNet shrugged off heavy Gaussian noise ($\sigma = 0.20$), JPEG compression (down to quality 30), brightness/contrast shifts, and upscaling, maintaining >96% ROC-AUC.
- External Generalization & Transfer: Applied zero-shot to the unseen 200k external dataset, QRNet hit 92.38% accuracy (98.03% ROC-AUC), climbing to 94.13% accuracy after fine-tuning. On structural transfer tasks, it achieved macro-F1 scores of 97.61% for QR version detection and 97.56% for mask pattern classification.
Limitations and Future Work
QRNet relies heavily on crisp module boundaries. Under severe Gaussian blur (radius $\ge 1.0$), aggressive downscaling ($112 \times 112$), or heavy occlusion (20% covered), its fixed-threshold accuracy drops sharply—eventually defaulting to predicting almost everything as malicious. Furthermore, the current benchmarks consist of clean, digitally generated black-and-white codes.
For future work, the authors suggest testing QRNet in the wild: integrating it into mobile cameras to handle angled, poorly lit, or printed scans; evaluating stylized QR codes with embedded logos and colors; defending against adversarial pixel perturbations; and shrinking the model via quantization for fast on-device edge deployment.
Summary updated