FAWA: Fast Adversarial Watermark Attack on Optical Character Recognition (OCR) Systems

Chen Lu, Jiao Sun, Wei XuarXiv 2020 · DOI

Abstract

Deep neural networks (DNNs) significantly improved the accuracy of optical character recognition (OCR) and inspired many important applications. Unfortunately, OCRs also inherit the vulnerabilities of DNNs under adversarial examples. Different from colorful vanilla images, text images usually have clear backgrounds. Adversarial examples generated by most existing adversarial attacks are unnatural and pollute the background severely. To address this issue, we propose the Fast Adversarial Watermark Attack (FAWA) against sequence-based OCR models in the white-box manner. By disguising the perturbations as watermarks, we can make the resulting adversarial images appear natural to human eyes and achieve a perfect attack success rate. FAWA works with either gradient-based or optimization-based perturbation generation. In both letter-level and word-level attacks, our experiments show that in addition to natural appearance, FAWA achieves a 100% attack success rate with 60% less perturbations and 78% fewer iterations on average. In addition, we further extend FAWA to support full-color watermarks, other languages, and even the OCR accuracy-enhancing mechanism.

Introduction

Deep Learning-based Optical Character Recognition (OCR) systems are critical for processing financial documents, IDs, and license plates. However, these systems are susceptible to adversarial examples—inputs designed to trigger incorrect outputs. Traditional adversarial attacks like FGSM or C&W often introduce pixel-level noise across the entire image. While effective on natural images, this noise is highly conspicuous on the clean, high-contrast white backgrounds typical of text documents. Furthermore, modern OCRs are sequence-based (utilizing CNNs and LSTMs), requiring attacks to consider contextual dependencies rather than isolated characters.

Methodology

FAWA (Fast Adversarial Watermark Attack) addresses these challenges by concealing adversarial noise within natural-looking document watermarks (e.g., "CONFIDENTIAL" stamps). The attack pipeline consists of three primary stages:

  1. Watermark Localization: The system identifies high-sensitivity regions by generating a saliency map through a "basic" attack. A watermark is then automatically positioned over these regions to maximize impact.
  2. Perturbation Generation: Noise is confined strictly within the watermark boundaries using a binary mask. FAWA supports two generation methods: Grad-WM (gradient-based via Momentum Iterative FGSM) and Opt-WM (optimization-based via Adam).
  3. Sequence-Targeted Loss: FAWA leverages Connectionist Temporal Classification (CTC) loss. This allows the attack to target specific character operations—replacements, insertions, or deletions—within the output sequence.
The automated pipeline for determining the optimal watermark placement by identifying high-sensitivity regions through a saliency map.

To maintain human readability, the authors employ "text masks" to keep the watermark behind the original text and use full-color conversions, as human perception tends to overlook colored background patterns.

Experimental Setup

The framework was evaluated using a corpus from the IMDB dataset, generating 1,479 sentences and 1,092 word images across five fonts (Courier, Georgia, Helvetica, Times, and Arial). The target model was Calamari-OCR, a state-of-the-art engine combining CNNs and LSTMs.

Key Results and Insights

FAWA demonstrates superior performance and visual fidelity compared to standard adversarial methods:

  • Perfect Success Rate: Achieved a 100% targeted attack success rate in both letter and word-level tasks.
  • Efficiency: Required 78% fewer iterations to converge and 60% less total perturbation (MSE) than baseline attacks.
  • The "Gray Background" Advantage: Mathematically, hiding attacks on gray backgrounds is more efficient. FAWA found that gray watermark backgrounds require 72% less perturbation because reduced contrast increases model susceptibility to subtle shifts.
  • Accuracy Enhancement: Conversely, FAWA can be used to create "protective watermarks." By targeting the ground-truth text, the method can boost OCR confidence and correct errors in low-quality documents.

Limitations and Future Work

FAWA currently operates as a white-box attack, requiring full access to the target model's parameters. Future research is needed to evaluate "transferability" to black-box systems and the "print-to-scan" challenge—whether digital watermarks remain effective after physical printing and re-digitization.

Summary updated

Abstract

Deep neural networks (DNNs) significantly improved the accuracy of optical character recognition (OCR) and inspired many important applications. Unfortunately, OCRs also inherit the vulnerabilities of DNNs under adversarial examples. Different from colorful vanilla images, text images usually have clear backgrounds. Adversarial examples generated by most existing adversarial attacks are unnatural and pollute the background severely. To address this issue, we propose the Fast Adversarial Watermark Attack (FAWA) against sequence-based OCR models in the white-box manner. By disguising the perturbations as watermarks, we can make the resulting adversarial images appear natural to human eyes and achieve a perfect attack success rate. FAWA works with either gradient-based or optimization-based perturbation generation. In both letter-level and word-level attacks, our experiments show that in addition to natural appearance, FAWA achieves a 100% attack success rate with 60% less perturbations and 78% fewer iterations on average. In addition, we further extend FAWA to support full-color watermarks, other languages, and even the OCR accuracy-enhancing mechanism.
BibTeX
@misc{lu2020fawa,
  author = {Chen Lu and Jiao Sun and Wei Xu},
  title = {{FAWA: Fast Adversarial Watermark Attack on Optical Character Recognition (OCR) Systems}},
  year = {2020},
  eprint = {2012.08096},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2012.08096},
}
Figure