Detection and Analysis of Cyberbullying on Social Media Using Natural Language Processing
Abstract
The exponential growth of social media has amplified cyberbullying a pervasive form
of online harassment that inflicts severe psychological distress on victims and unlike
conventional bullying, cyberbullying on platforms such as Twitter operates through
rapid, public, and often anonymous interactions, rendering automated detection
particularly challenging. This study proposes a machine learning framework for
detecting and classifying cyberbullying in English social media text, utilizing a
balanced dataset of 10,000 manually annotated records across six categories (age,
ethnicity, gender, religion, other cyberbullying, and not cyberbullying) to train twelve
distinct models under standardized experimental conditions. Experimental results
demonstrate that a fine-tuned BERT model achieved the highest overall performance
with 84.65% accuracy, 84.59% precision, 84.65% recall, 84.48% F1-score, and 0.9734
ROC-AUC, while Random Forest recorded the strongest baseline at 83.85% accuracy
and 83.94% F1-score; notably, BERT excelled at identifying identity-based harassment
with over 93% F1-score for age, ethnicity, and religion, whereas the linguistically
ambiguous "other cyberbullying" class remained the most challenging at 84.19% F1.
These findings confirm that transformer-based contextual representations significantly
outperform traditional classifiers for multi-class cyberbullying detection, and the
proposed framework offers a viable solution for assisting content moderators in
proactively identifying harmful content, thereby contributing to safer and more
inclusive online environments.
Collections
- 2026-2030 [51]