OCR-Assisted Masked BERT for Homoglyph Restoration towards Multiple Phishing Text Downstream Tasks
Source abstract
Abstract
Restoring texts corrupted by visually perturbed homoglyph characters presents significant challenges to conventional Natural Language Processing (NLP) systems, primarily due to ambiguities arising from characters that appear visually similar yet differ semantically. Traditional text restoration methods struggle with these homoglyph perturbations due to limitations such as a lack of contextual understanding and difficulty in handling cases where one character maps to multiple candidates. To address these issues, we propose an Optical Character Recognition (OCR)-assisted masked Bidirectional Encoder Representations from Transformers (BERT) model specifically designed for homoglyph-perturbed text restoration. Our method integrates OCR preprocessing with a character-level BERT architecture, where OCR preprocessing transforms visually perturbed characters into their approximate alphabetic equivalents, significantly reducing multi-correspondence ambiguities. Subsequently, the character-level BERT leverages bidirectional contextual information to accurately resolve remaining ambiguities by predicting intended characters based on surrounding semantic cues. Extensive experiments conducted on realistic phishing email datasets demonstrate that the proposed method significantly outperforms existing restoration techniques, including OCR-based, dictionary-based, and traditional BERT-based approaches, achieving a word-level restoration accuracy of up to 99.59% in fine-tuned settings. Additionally, our approach exhibits robust performance in zero-shot scenarios and maintains effectiveness under low-resource conditions. Further evaluations across multiple downstream tasks, such as part-of-speech tagging, chunking, toxic comment classification, and homoglyph detection under conditions of severe visual perturbation (up to 40%), confirm the method’s generalizability and applicability. Our proposed hybrid approach, combining OCR preprocessing with character-level contextual modeling, represents a scalable and practical solution for mitigating visually adversarial text attacks, thereby enhancing the security and reliability of NLP systems in real-world applications.
Source: openalex_inverted_index · Quality: baseline
Research context
OpenAlex topics: Handwritten Text Recognition Techniques · Advanced Image and Video Retrieval Techniques · Web Data Mining and Analysis
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
References (34)
Show source-provided references
1. Adversarial attacks on deep-learning models in natural language processing: a survey
2. Visual spoofing in content-based spam detection
3. Bad characters: imperceptible NLP attacks
4. Detection method of homograph internationalized domain names with OCR10.2197/ipsjjip.27.536 ↗
5. Keller · Findings of the association for computational linguistics: ACL-IJCNLP 2021 · 2021 · 1616
6. A survey of adversarial defenses and robustness in NLP10.1145/3593042 ↗
7. ShamFinder: an automated framework for detecting IDN homographs
8. Large scale detection of IDN domain name masquerading
9. OCR post-correction for detecting adversarial text images
10. Detecting homoglyph attacks with a siamese neural network
11. A case of identity: detection of suspicious IDN homograph domains using active DNS measurements
12. Homoglyph attack detection model using machine learning and hash function10.3390/jsan11030054 ↗
13. Spam detection in SMS using machine learning through text mining
14. Plagiarism detection in texts obfuscated with homoglyphs
15. Detect visual spoofing in unicode-based text
16. OCR-based detection and correction of homoglyph attacks
17. TrOCR: transformer-based optical character recognition with pre-trained models
18. Robust open-vocabulary translation from visual text representations
19. SHIELD: defending textual neural networks against multiple black-box adversarial attacks with stochastic multi-expert patcher
20. CharacterBERT: reconciling ELMo and BERT for word-level open-vocabulary representations from characters
21. CharBERT: character-aware pre-trained language model
22. TEXTBUGGER: generating adversarial text against real-world applications
23. Text processing like humans do: visually attacking and shielding NLP systems
24. LEGIT: a framework for evaluating the readability of visually perturbed text
25. Lee · Findings of the association for computational linguistics: NAACL 2025 · 2025 · 4367
26. Lee MA. madmaze/pytesseract; 2024 [Internet]. [cited 2025 Aug 6]. Available from: https://github.com/madmaze/pytesseract.
27. Cozens S. Authors TNP, Contributors GF. notofonts/runic. Noto Fonts; 2024 [Internet]. [cited 2025 Aug 6]. Available from: https://github.com/notofonts/runic.
28. B S. satbyy/go-noto-universal; 2024 [Internet]. [cited 2025 Aug 6]. Available from: https://github.com/satbyy/go-noto-universal.
29. Bitcoin Abuse. Bitcoin Abuse Database; 2023 [Internet]. [cited 2025 Aug 6]. Available from: https://www.bitcoinabuse.com/.
30. Aligning books and movies: towards story-like visual explanations by watching movies and reading books
31. Pointer sentinel mixture models
32. Masked language model scoring
33. BERT: pre-training of deep bidirectional transformers for language understanding
34. Multimodal AI model for zero-shot vehicle brand identification10.1007/s11042-024-20559-3 ↗