Cyberbullying detection across English, Arabic, and Algerian Darija using Transformer-based hybrid models, contrastive learning, and ensemble methods.
# Multilingual Cyberbullying Detection on Social Media
> A Transformer-Based Hybrid Approach for detecting cyberbullying across English, Arabic, and Algerian Dialect (Darija) social media content.
**Master's Thesis** | University of Abdelhamid Mehri – Constantine 2 | Faculty of NTIC | Data Science and Intelligent Systems (SDSI) | June 2025
---
## Overview
This repository contains the full implementation of our thesis work on automatic cyberbullying detection. We propose a robust multilingual framework that combines:
- **Pre-trained Transformer models** fine-tuned for each language
- **Contrastive Learning** (Circle Loss) to improve embedding discriminability
- **Hybrid CNN-Transformer architectures** to capture local and global patterns
- **Ensemble Learning** (Majority Voting, Averaging, Stacking, Boosting) for final predictions
The framework is evaluated on three datasets spanning English, Arabic, and Algerian dialect, consistently outperforming state-of-the-art baselines.
---
## Global Architecture
---
## Results Summary
| Language | Dataset | Best Strategy | Best Model(s) | Accuracy | F1-Score |
|---|---|---|---|---|---|
| 🇬🇧 English | Tweet-based cyberbullying | Majority Vote (5 models) | DistilBERT+CNN, BERT+CNN, HateBERT+CL, BERTweet+CNN, RoBERTa | **95.55%** | **95.55%** |
| 🇸🇦 Arabic | Instagram (46,898 comments) | Stacking Ensemble | QARiB, MARBERT, AraBERTv0.2-Twitter | **70.10%** | **68.31%** |
| 🇩🇿 Algerian Darija | DzBullying (4,008 comments) | Averaging Ensemble | DziriBERT, DziriBERT-sentiment, mBERT | **83.54%** | **85.84%** |
### English: Comparison with State-of-the-Art
| Work | Technique | Accuracy | F1-Score |
|---|---|---|---|
| Joseph et al. | CNN | 83.10% | – |
| Vivekananth & Sharma | LGBM | 83.82% | – |
| Mahmud et al. | XGBoost | 84.00% | 84.56% |
| Philipo et al. | BERT | 94.00% | 94.00% |
| **This work** | **Ensemble (Majority Vote)** | **95.55%** | **95.55%** |
---
## Repository Structure
```
multilingual-cyberbullyin …