Skip to content
AI.info

Research

Using Machine Learning to Enhance the Detection of Obfuscated Abusive Words in Swahili: A Focus on Child Safety

Overview Research area: Natural language processing for low-resource languages, specifically machine-learning-based detection of abusive and deliberately obfuscated text in Swahili, framed around chil

Using Machine Learning to Enhance the Detection of Obfuscated Abusive Words in Swahili: A Focus on Child Safety
arXiv
2602.13455
Published
2026-02-13
Authors
Phyllis Nabangi, Abdul-Jalil Zakaria, Jema David Ndibwile

AI summary

Overview

Research area: Natural language processing for low-resource languages, specifically machine-learning-based detection of abusive and deliberately obfuscated text in Swahili, framed around child online safety.

Technical level: Intermediate. The paper applies well-established classical machine-learning classifiers (Support Vector Machines, Logistic Regression, Decision Trees, Random Forest) with standard text vectorization and resampling, and reports conventional classification metrics. No deep learning architectures are implemented.

Scope: A small-scale binary classification study that asks whether classical machine-learning models can distinguish obfuscated from non-obfuscated abusive Swahili text, using a 100-item Swahili dataset and 5-fold cross-validation.

What This Paper Is About

Children increasingly encounter cyberbullying, hate speech, and online sexual exploitation, but automated detection tools are built mainly for high-resource languages such as English, French, and Chinese. Swahili is described as the most widely spoken language in Africa, with over 16 million native speakers and upwards of 100 million total speakers, yet it lacks the annotated corpora and linguistic tooling that detection systems depend on. The goal of this paper is to test whether classical machine-learning models, combined with TF-IDF text representation and SMOTE resampling, can detect abusive Swahili text that has been deliberately obfuscated to evade filters.

Key Contributions

  1. First application of machine learning to Swahili obfuscated abusive word detection. The authors state that prior work on obfuscated abusive words in Swahili used a rule-based approach (Njovangwa and Justo, 2021), and that no work to their knowledge had applied machine-learning techniques to this specific problem.

  2. A binary classification framing for obfuscation detection. Rather than detecting abuse itself, the task is defined as classifying whether an already-abusive text is obfuscated (label 1) or non-obfuscated (label 0), which targets the evasion behavior directly.

  3. A comparative benchmark of four classical classifiers. SVM, Logistic Regression, Decision Tree, and Random Forest are evaluated under identical preprocessing (TF-IDF), imbalance handling (SMOTE), and 5-fold cross-validation, with precision, recall, and F1 reported alongside accuracy.

  4. A candid assessment of dataset limitations. The authors explicitly report that the small size and imbalance of their dataset limit the generalizability of the findings, and they flag the Decision Tree's perfect recall as a probable overfitting signal rather than a genuine strength.

Main Findings

  • Decision Tree: highest accuracy, suspected overfitting. The Decision Tree Classifier reached a mean accuracy of 99%, with precision 0.98, recall 1.00, and F1-score 0.99. The authors interpret the perfect recall as a sign the model may be too finely tuned to the training data and may not generalize to unseen data.

  • Logistic Regression: strong and balanced. Mean accuracy of approximately 88%, with precision 0.88, recall 0.88, and F1-score 0.88.

  • SVM: strong and balanced. Mean accuracy of approximately 87%, with precision 0.86, recall 0.88, and F1-score 0.87. The paper attributes this to SVM's effectiveness in high-dimensional spaces and its robustness against overfitting.

  • Random Forest: unexpectedly weakest. Mean accuracy of approximately 82%, with precision 0.79, recall 0.86, and F1-score 0.83. The authors call this result unexpected for an ensemble method and attribute it to the small dataset size, the need for well-tuned parameters, and the inherent randomness of the ensemble.

  • Dataset size and imbalance limit generalizability. The authors state directly that their dataset's small size and imbalance constrain how far the findings can be extended.

Methodology in Plain English

The researchers took a small collection of Swahili abusive texts and labeled each one according to whether it had been obfuscated (1) or not (0). The dataset used in the study comprises 100 abusive words (50 English and 50 Swahili), 100 abusive texts (50 English and 50 Swahili), 100 obfuscated abusive texts, 100 obfuscated non-abusive texts, and 100 non-abusive texts; this study focused only on the abusive Swahili texts, comprising 100 texts.

Each text was converted into numbers using TF-IDF (Term Frequency–Inverse Document Frequency), which scores how important each word is within a document relative to the whole collection. Because the obfuscated class was the minority, SMOTE was applied to generate synthetic minority-class examples by interpolating between existing minority samples, producing a more balanced training set.

Four classifiers — SVM, Logistic Regression, Random Forest, and Decision Tree — were each placed inside a pipeline that combined text vectorization with the classifier. Performance was measured with 5-fold cross-validation: the data was split into k = 5 subsets, each round trained on 4 subsets and tested on the remaining one, repeated 5 times so each subset served as the validation set once. Accuracy, precision, recall, and F1-score were computed for each model.

Why This Matters

The work targets a gap where high-resource languages get sophisticated detection tooling while African languages like Swahili are left behind, despite Swahili's large speaker base. Because offenders obfuscate text specifically to evade automated filters, detection systems that only work on clean text leave a wide opening. The paper's contribution is less about delivering a deployable system than about establishing whether classical machine learning is even viable here, and honestly documenting where the evidence runs out.

Real-world applications:

  • Content moderation on social platforms serving East African and Swahili-speaking communities.
  • Child-safety filtering tools that flag deliberately disguised harmful messages sent to minors.
  • Automated decision-support for human moderators and child-protection investigators who currently review reports manually.
  • Culturally localized cyberbullying detection where the abusive vocabulary differs from English-language models.

Industry relevance: Platforms operating in East African markets currently depend on human reviewers or English-centric classifiers for Swahili content. This paper suggests that even simple classical models can separate obfuscated from non-obfuscated abusive Swahili text well above chance, which matters for teams deciding whether to invest in local-language moderation. The counterweight is the dataset problem: the paper's own results show that a 100-text sample yields an unreliable ordering of models, which is a warning to anyone planning to build production systems on similarly small data.

Future Directions

  • Mitigate overfitting in the Decision Tree using pruning, and validate the model on genuinely held-out data to determine whether the 99% accuracy is real.
  • Explore more sophisticated architectures such as LSTM and BERT to strengthen detection of obfuscated abusive language.
  • Expand and diversify the dataset with more examples of obfuscated and non-obfuscated texts, and improve feature extraction to capture nuanced linguistic patterns.
  • Explore transfer learning and multimodal data, including touch-gesture biometrics, and develop and validate multilingual models in real deployment settings.

Target Audience

Researchers and practitioners working on low-resource-language NLP, African language technology, and abusive-language detection will find the paper most useful, particularly those interested in a transparent account of what classical models can and cannot do on very small Swahili datasets. It is also relevant to trust-and-safety teams, child-protection organizations, and policy audiences focused on online safety in the Global South, and to students looking for a clearly scoped example of a small-scale classification study with an explicit limitations discussion.

Authors’ abstract

The rise of digital technology has dramatically increased the potential for cyberbullying and online abuse, necessitating enhanced measures for detection and prevention, especially among children. This study focuses on detecting abusive obfuscated language in Swahili, a low-resource language that poses unique challenges due to its limited linguistic resources and technological support. Swahili is chosen due to its popularity and being the most widely spoken language in Africa, with over 16 million native speakers and upwards of 100 million speakers in total, spanning regions in East Africa and some parts of the Middle East. We employed machine learning models including Support Vector Machines (SVM), Logistic Regression, and Decision Trees, optimized through rigorous parameter tuning and techniques like Synthetic Minority Over-sampling Technique (SMOTE) to handle data imbalance. Our analysis revealed that, while these models perform well in high-dimensional textual data, our dataset's small size and imbalance limit our findings' generalizability. Precision, recall, and F1 scores were thoroughly analyzed, highlighting the nuanced performance of each model in detecting obfuscated language. This research contributes to the broader discourse on ensuring safer online environments for children, advocating for expanded datasets and advanced machine-learning techniques to improve the effectiveness of cyberbullying detection systems. Future work will focus on enhancing data robustness, exploring transfer learning, and integrating multimodal data to create more comprehensive and culturally sensitive detection mechanisms.

Read the original paper