Abstract
Modern Natural Language Processing (NLP) models are vulnerable to "visual text attacks," where characters are replaced by visually similar symbols (e.g., 'apple' to 'ạƿpӏϵ') to evade detection. This paper introduces I2CES, a 2D image-based character embedding space that captures visual features more effectively than previous methods. We also demonstrate a vision-based defense architecture that allows models to "see" text similarly to humans, significantly improving robustness against these adversarial perturbations.
Introduction
Most state-of-the-art NLP models treat text as a sequence of discrete identities (IDs). While effective for standard text, this approach fails when encountering visually similar characters from different alphabets or symbols—common in spam, gaming forums, or censorship evasion. To a human, 'apple' and 'ạƿpӏϵ' are identical; to a standard model, they are entirely different sequences, often leading to "unknown" tokens and model failure. Previous attempts to address this used flattened image vectors (ICES) or Unicode descriptions (DCES), both of which have significant limitations in capturing spatial information or handling non-standard character sets.
Methodology
I2CES: Image-based 2-dimensional Character Embedding Space
The authors propose I2CES to find visual "neighbors" for attacks. Instead of flat pixel lists, they utilize a Convolutional Neural Network (CNN)—a modified VGG-16—to extract features from 100x100 character images. To ensure the model captures the "essence" of a character's shape, the CNN is trained on a diverse dataset including 8 fonts, varying sizes, rotations, and salt-and-pepper noise. The output of the final convolutional layer serves as the character's embedding, allowing for the identification of visually similar characters via cosine similarity.
Vision-based Defense (VB and AT+VB)
The core defense strategy involves a Vision-based (VB) model where the input to the NLP classifier is the image of the character itself rather than a character ID.
The pipeline processes character images through a 2D-CNN to generate embeddings, which are then fed into a Char-CNN classifier. This model is further strengthened through Adversarial Training (AT+VB), where it is trained on "attacked" text using visual neighbors identified by I2CES.
Evaluation and Results
The approach was evaluated on three benchmarks: AG’s news corpus, DBPedia, and Yelp reviews.
Attack Success and Defense Robustness
Standard Char-CNN models experienced a massive drop in accuracy under I2CES attacks. As the probability of character replacement ($p$) increased, accuracy often plummeted from ~90% to below 20%. In contrast, the vision-based models showed remarkable resilience.
On the DBPedia dataset, the AT+VB model achieved 35% higher accuracy than the standard VB model under attack. Importantly, these vision-based models maintained performance on "clean" text, indicating no penalty for the added security.
Discussion
The research highlights that 2D spatial information is crucial for character recognition. By using a 2D-CNN, the model learns spatial hierarchies, allowing it to recognize characters despite variations in size or position. This "human-like" processing bridges the gap between machine and human perception. Furthermore, I2CES identified significantly more visual neighbors (697 for English letters) than previous methods, including symbols and numbers that description-based methods missed.
Conclusion
While effective, the current model has limitations. Some visual neighbors are so distorted they require linguistic context for human recognition; future work should integrate linguistic knowledge to improve "guessing" based on context. Additionally, extending this work to languages with complex glyphs like Chinese or Korean remains a key area for future research.
Summary updated