TL;DR
This paper introduces TopoReformer, a novel, model-agnostic pipeline that uses topological features to purify adversarial perturbations in text images, making OCR systems more robust. By leveraging the inherent stability of global structures like connectivity and holes, TopoReformer effectively mitigates attacks without requiring adversarial training or sacrificing performance on clean data.
What Problem Does This Paper Address?
Optical Character Recognition (OCR) systems are increasingly critical in high-stakes applications, from document processing to security systems. However, like many deep learning models, OCR systems are vulnerable to adversarial attacks. These attacks involve subtle, human-imperceptible modifications to input images that can cause OCR systems to misinterpret text, leading to significant errors and security risks. Existing defenses, such as adversarial training or input preprocessing, often suffer from being model-specific, computationally expensive, or vulnerable to novel or adaptive attacks. Furthermore, many defenses degrade performance on clean, unperturbed inputs. This paper addresses the need for a robust, generalizable, and efficient defense mechanism that can protect OCR systems from a wide range of adversarial attacks without compromising their performance on legitimate inputs.
Methods
The core of TopoReformer is a Topological Autoencoder (TopoAE). This component learns to represent input images in a latent space that preserves their topological structure. Topology, in this context, focuses on global properties like connectivity and holes, which are less susceptible to local, adversarial perturbations. The TopoAE uses a persistent homology loss to ensure that the latent representation maintains these topological features.
The purified output from the TopoAE is then passed through a Reformer module. This module, along with an Auxiliary Module, is trained using a novel "Freeze-Flow" training paradigm. This paradigm strategically routes gradients to ensure the Auxiliary Module effectively learns from the topological information provided by the TopoAE, enhancing robustness. The entire pipeline is designed to be model-agnostic, meaning it can be applied to any OCR model without retraining the OCR model itself.
Datasets
The paper evaluates TopoReformer on three datasets:
- MNIST: A classic dataset of handwritten digits.
- EMNIST: An extension of MNIST containing handwritten letters. These datasets were chosen because their character sets are similar to those encountered in OCR.
- OCR Dataset: A custom dataset for OCR tasks, spanning 53 classes (uppercase and lowercase characters, plus a blank token). This dataset is word-based, introducing structural challenges that require character-wise processing.
Key Insights and Ideas
- Topology as a Robust Feature: The fundamental insight is that adversarial perturbations often target local pixel relationships, while the global topological structure of text (e.g., the shape of letters, the presence of loops) remains intact. TopoReformer leverages this by enforcing topological consistency.
- Model-Agnostic Defense: The pipeline's ability to work with any OCR model without retraining is a significant advantage, making it highly practical for deployment.
- "Freeze-Flow" for Effective Auxiliary Training: The novel training paradigm is crucial for enabling the auxiliary component to effectively learn from topological cues, leading to improved robustness.
- Purification, Not Just Denoising: TopoReformer aims to project inputs onto a "cleaner" manifold by preserving essential topological features, rather than simply removing noise, which can be a more effective strategy against sophisticated attacks.
Key Results
- Classical Attacks: TopoReformer significantly improves F1-scores and precision on MNIST and EMNIST under attacks like Carlini-Wagner (C&W), PGD, and FGSM. For instance, under weak C&W attacks, F1-scores increased from 30.41% to 65.86% on MNIST.
- Adaptive Attacks: The method demonstrates strong robustness against adaptive attacks like EOT and EOT+BPDA, achieving F1-scores of 90.73% and 64.71% respectively on MNIST, compared to near-zero scores for the baseline.
- OCR-Specific Attacks: For OCR models, TopoReformer consistently reduces Attack Success Rate (ASR) and improves character accuracy and precision across various architectures (CRNN, Rosetta, STAR-Net, RARE, TRBA). For example, in CRNN, ASR dropped from 100% to 78.83%, with accuracy increasing to 71%.
- Unperturbed Performance: Importantly, TopoReformer maintains high performance on unperturbed (clean) data, with negligible degradation.
Limitations and Future Work
- Limitations: While effective, the paper notes that under the BPDA adaptive attack alone, the defense weakens. This is hypothesized to be because the topological regularizer enforces global Lipschitz-like smoothness but doesn't directly constrain fine-grained local curvature, which BPDA exploits.
- Future Work: The authors suggest integrating topology-aware training directly into OCR model optimization, eliminating the need for a separate Reformer stage. They also propose developing a comprehensive benchmark dataset and standardized classifier suite for evaluating OCR-specific adversarial attacks.
Summary updated