Homoglyphed-EMNIST / README.md
yj2773's picture
Update README.md
d4d0e72 verified
metadata
license: mit
task_categories:
  - image-classification
  - text-classification
  - fill-mask
  - image-text-to-text
tags:
  - ocr
  - homoglyphs
  - emnist
  - security
  - adversarial-defense
pretty_name: HEMNIST (Homoglyphed-EMNIST)
size_categories:
  - 10K<n<100K

HEMNIST: Lightweight Language Agnostic Data Sanitization Pipeline

This repository contains the dataset and documentation for the paper "Lightweight Language Agnostic Data Sanitization Pipeline for Dealing with Homoglyphs in Code-Mixed Languages".

It introduces HEMNIST, an extended version of the EMNIST dataset designed to train models to recognize and sanitize homoglyph attacks (characters that look identical but have different encodings) often used to evade hate speech detection.

πŸ“ Table of Contents


πŸ“Š Dataset Description

With the rise in hate speech on social media, numerous NLP techniques have been employed to detect toxicity. However, malicious actors have started employing homoglyphsβ€”characters that look identical to standard characters but possess different Unicode encodings or structuresβ€”to evade detection. Most NLP models, trained on commonly recognized Unicode characters, fail to detect these adversarial perturbations.

HEMNIST (Homoglyphed-EMNIST) is an image dataset created to address this. It extends the classic EMNIST dataset by including images of homoglyphs, enabling the training of Optical Character Recognition (OCR) models capable of distinguishing between standard characters and their homoglyph equivalents.

  • Original Paper: Springer Link
  • Authors: Mohammad Yusuf Jamal Aziz Azmi, Subalalitha Chinnaudayar Navaneethakrishnan
  • Publisher: Springer Nature Switzerland

πŸ›  The Pipeline

The paper proposes a novel lightweight, language-agnostic data sanitization pipeline aimed at retrieving de-homoglyphed sentences from attacked text. The pipeline consists of three stages:

  1. CNN (Character Level OCR): Trained on HEMNIST to identify characters visually.
  2. Symspell Algorithm: Used for candidate word generation.
  3. N-grams: Used for word retrieval to reconstruct the sanitized sentence.

Pipeline Architecture


πŸ“ˆ Performance Metrics

The proposed pipeline achieves high similarity between the original text and the retrieved (sanitized) text across various levels of masking (homoglyph injection).

Masking Percentage Cosine Similarity
5% 0.922
10% 0.845
20% 0.671
30% 0.508
50% 0.231

πŸ–Ό Visual Examples

Below is a grid view of the HEMNIST dataset, showing the visual similarities between standard characters and the homoglyphs included in the training set.

HEMNIST Grid


πŸ”— External Resources


πŸ“š Citation

If you use this dataset or pipeline in your research, please cite the following publication:

@inproceedings{azmi2024lightweight,
  title={Lightweight Language Agnostic Data Sanitization Pipeline for Dealing with Homoglyphs in Code-Mixed Languages},
  author={Azmi, Mohammad Yusuf Jamal Aziz and Navaneethakrishnan, Subalalitha Chinnaudayar},
  booktitle={Speech and Language Technologies for Low-Resource Languages},
  publisher={Springer Nature Switzerland},
  year={2024},
  url={[https://link.springer.com/chapter/10.1007/978-3-031-58495-4_11](https://link.springer.com/chapter/10.1007/978-3-031-58495-4_11)}
}