A Hybrid Approach Using MAE‑ViT Enhancement and Inpainting for the Detection and Reconstruction of Damaged QR Codes
DOI:
https://doi.org/10.59247/jfsc.v4i3.438Keywords:
Decoder Assistance, Image Enhancement, Image Inpainting, Masked Autoencoder, Quick Response Code, Vision TransformerAbstract
The use of Quick Response codes has become a standard in various digital applications, yet they remain highly susceptible to physical degradation. Standard decoding libraries generally perform well under ideal conditions but experience reduced accuracy when processing damaged codes. This study proposes a hybrid preprocessing approach that combines Masked Autoencoder–Vision Transformer (MAE–ViT) enhancement and mask-guided inpainting to improve the detection and reconstruction of damaged QR codes. Although light, medium, and heavy degradations are examined, the primary target regime is moderate damage near the decoder failure boundary. The enhancement stage refines global and local visual structure to improve contrast, edge sharpness, and module visibility, while the inpainting stage reconstructs missing or corrupted regions that still disrupt scanability. By applying this hybrid pipeline before standard decoding with ZXing, ZBar, and OpenCV, the method functions as a decoder-assistance module rather than replacing conventional decoders. Experimental results show that the proposed approach improves decoding success on damaged QR codes relative to direct baseline decoding, with the strongest gains under moderate degradation, while restoration quality and processing time are reported as supporting metrics. A supplementary real-world hold-out evaluation is also discussed to clarify generalization limits. The hybrid MAE–ViT framework therefore provides a practical solution for enhancing QR scanability under recoverable damage conditions.
References
S. Scanzio, M. Rosani, M. Scamuzzi, and G. Cena, “QR Codes: From a Survey of the State of the Art to Executable eQR Codes for the Internet of Things,” IEEE Internet of Things Journal, vol. 11, no. 13, pp. 23699–23710, 2024, https://doi.org/10.1109/JIOT.2024.3385542.
L. Tarjan, I. Šenk, S. Tegeltija, S. Stankovski, and G. Ostojic, “A readability analysis for QR code application in a traceability system,” Computers and Electronics in Agriculture, vol. 109, pp. 1–11, 2014, https://doi.org/10.1016/j.compag.2014.08.015.
H. Kato and K. T. Tan, “Pervasive 2D barcodes for camera phone applications,” IEEE Pervasive Computing, vol. 6, no. 4, pp. 76–85, 2007, https://doi.org/10.1109/MPRV.2007.80.
Y. Kato, D. Deguchi, T. Takahashi, I. Ide, and H. Murase, “Low resolution QR-code recognition by applying super-resolution using the property of QR-codes,” in Proceedings of the International Conference on Document Analysis and Recognition, ICDAR, Beijing, China, 2011, pp. 992–996, https://doi.org/10.1109/ICDAR.2011.201.
P. Sirikongtham and A. Nimkoompai, “Enhancing the scanability of damaged QR codes through image restoration using GANs combined with the spectral normalization technique,” International Journal of Advanced Computer Science and Applications, vol. 16, no. 10, pp. 638–644, 2025, https://doi.org/10.14569/IJACSA.2025.0161066.
Y. Sancar, “Reconstructing unreadable QR codes: a deep learning based super resolution strategy,” PeerJ Computer Science, vol. 11, pp. e2841–e2841, 2025, https://doi.org/10.7717/peerj-cs.2841.
J. Zheng et al., “EHFP-GAN: Edge-Enhanced Hierarchical Feature Pyramid Network for Damaged QR Code Reconstruction,” Mathematics, vol. 11, no. 20, p. 4349, 2023, https://doi.org/10.3390/math11204349.
T. Muallim, H. Kucuk, M. Bareket, and M. Kahraman, “Lightweight Deep Learning Model and Novel Dataset for Restoring Damaged Barcodes and QR Codes in Logistics Applications,” CMES - Computer Modeling in Engineering and Sciences, vol. 143, no. 3, pp. 3557–3581, 2025, https://doi.org/10.32604/cmes.2025.064733.
K. Song, N. Liu, Z. Gao, J. Zhang, G. Zhai, and X. P. Zhang, “Deep Restoration of Invisible QR Code from TPVM Display,” in 2020 IEEE International Conference on Multimedia and Expo Workshops, ICMEW 2020, London, UK, 2020, pp. 1–6, 2020, https://doi.org/10.1109/ICMEW46912.2020.9105961.
T. Shindo, T. Watanabe, R. Yano, M. Arimoto, M. Takahashi, and H. Watanabe, “Super Resolution for QR Code Images,” in Proc. IEEE 11th Global Conf. on Consumer Electronics (GCCE), 2023, pp. 274–277, 2023, https://doi.org/10.1109/gcce56475.2022.10014154.
C. Dong, C. C. Loy, K. He, and X. Tang, “Image Super-Resolution Using Deep Convolutional Networks,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 38, no. 2, pp. 295–307, 2016, https://doi.org/10.1109/TPAMI.2015.2439281.
J. Kim, J. K. Lee, and K. M. Lee, “Accurate image super-resolution using very deep convolutional networks,” in Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2016, pp. 1646–1654, 2016, https://doi.org/10.1109/CVPR.2016.182.
B. Lim, S. Son, H. Kim, S. Nah, and K. M. Lee, “Enhanced Deep Residual Networks for Single Image Super-Resolution,” in IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshops, 2017, pp. 1132–1140, 2017, https://doi.org/10.1109/CVPRW.2017.151.
G. Liu, F. A. Reda, K. J. Shih, T. C. Wang, A. Tao, and B. Catanzaro, “Image Inpainting for Irregular Holes Using Partial Convolutions,” in Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), Cham, Switzerland: Springer, 2018, pp. 89–105, 2018, https://doi.org/10.1007/978-3-030-01252-6_6.
[15] J. Yu, Z. Lin, J. Yang, X. Shen, X. Lu, and T. S. Huang, “Generative Image Inpainting with Contextual Attention,” in Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2018, pp. 5505–5514, 2018, https://doi.org/10.1109/CVPR.2018.00577.
K. Nazeri, E. Ng, T. Joseph, F. Z. Qureshi, and M. Ebrahimi, “EdgeConnect: Generative Image Inpainting with Adversarial Edge Learning,” arXiv:1901.00212, 2019, http://arxiv.org/abs/1901.00212.
Y. Wang, B. Song, and Z. Zhang, “An image inpainting method based on generative adversarial networks inversion and autoencoder,” IET Image Processing, vol. 18, no. 4, pp. 1042–1052, 2024, https://doi.org/10.1049/ipr2.13005.
I. J. Goodfellow et al., “Generative adversarial nets,” in Advances in Neural Information Processing Systems, 2014, pp. 2672–2680, https://doi.org/10.1007/978-3-658-40442-0_9.
P. Isola, J. Y. Zhu, T. Zhou, and A. A. Efros, “Image-to-image translation with conditional adversarial networks,” in Proceedings - 30th IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, pp. 5967–5976, 2017, https://doi.org/10.1109/CVPR.2017.632.
T. Miyato, T. Kataoka, M. Koyama, and Y. Yoshida, “Spectral normalization for generative adversarial networks,” in 6th International Conference on Learning Representations, ICLR 2018 - Conference Track Proceedings, 2018
O. Ronneberger, P. Fischer, and T. Brox, “U-net: Convolutional networks for biomedical image segmentation,” in Lecture Notes in Computer Science, Cham, Switzerland: Springer, 2015, pp. 234–241, 2015, https://doi.org/10.1007/978-3-319-24574-4_28.
A. Vaswani et al., “Attention is all you need,” in Advances in Neural Information Processing Systems, 2017, pp. 5999–6009, 2017, https://doi.org/10.1201/9781003561460-19.
A. Dosovitskiy et al., “an Image Is Worth 16X16 Words: Transformers for image recognition at scale,” in ICLR 2021 - 9th International Conference on Learning Representations, 2021
K. He, X. Chen, S. Xie, Y. Li, P. Dollar, and R. Girshick, “Masked Autoencoders Are Scalable Vision Learners,” in Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2022, pp. 15979–15988, 2022, https://doi.org/10.1109/CVPR52688.2022.01553.
C. Cao, Q. Dong, and Y. Fu, “Learning Prior Feature and Attention Enhanced Image Inpainting,” in Lecture Notes in Computer Science, vol. 13675 LNCS, 2022, pp. 306–322, 2022, https://doi.org/10.1007/978-3-031-19784-0_18.
W. Li, Z. Lin, K. Zhou, L. Qi, Y. Wang, and J. Jia, “MAT: Mask-Aware Transformer for Large Hole Image Inpainting,” in Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2022, pp. 10748–10758, https://doi.org/10.1109/CVPR52688.2022.01049.
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Ari Setiawan, Hadi Santoso, Bambang Jokonowo

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
This journal is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
