Preprint
Machine Learning

A Comparative Analysis of Machine Learning Techniques for Cyberbullying Detection on Twitter

Amgad Muneer(Universiti Teknologi Petronas), Suliman Mohamed Fati(Prince Sultan University)
October 29, 2020Future Internet206 citations

206

Citations

10

Influential Citations

Future Internet

Venue

2020

Year

Abstract

The advent of social media, particularly Twitter, raises many issues due to a misunderstanding regarding the concept of freedom of speech. One of these issues is cyberbullying, which is a critical global issue that affects both individual victims and societies. Many attempts have been introduced in the literature to intervene in, prevent, or mitigate cyberbullying; however, because these attempts rely on the victims’ interactions, they are not practical. Therefore, detection of cyberbullying without the involvement of the victims is necessary. In this study, we attempted to explore this issue by compiling a global dataset of 37,373 unique tweets from Twitter. Moreover, seven machine learning classifiers were used, namely, Logistic Regression (LR), Light Gradient Boosting Machine (LGBM), Stochastic Gradient Descent (SGD), Random Forest (RF), AdaBoost (ADB), Naive Bayes (NB), and Support Vector Machine (SVM). Each of these algorithms was evaluated using accuracy, precision, recall, and F1 score as the performance metrics to determine the classifiers’ recognition rates applied to the global dataset. The experimental results show the superiority of LR, which achieved a median accuracy of around 90.57%. Among the classifiers, logistic regression achieved the best F1 score (0.928), SGD achieved the best precision (0.968), and SVM achieved the best recall (1.00).

Analysis

Why This Paper Matters

Cyberbullying is a pervasive issue on social media, and automated detection is crucial for intervention without relying on victim reports. This paper addresses a practical gap by compiling a large, global dataset and systematically comparing multiple machine learning classifiers. The findings are significant because they demonstrate that a relatively simple model like Logistic Regression can outperform more complex ensemble methods, which has implications for computational efficiency and real-world deployment.

The study's focus on a global dataset (37,373 tweets) is a strength, as it increases the diversity of language and context, making the results more generalizable than studies using single-region data. By evaluating seven classifiers under the same conditions, the paper provides a fair comparison that is often missing in literature, offering a clear benchmark for future research.

Technical Contributions

The paper's main technical contributions include:

  • Dataset creation: A new global dataset of 37,373 unique tweets, which is a valuable resource for the research community.
  • Comprehensive evaluation: Systematic comparison of seven classifiers (LR, LGBM, SGD, RF, ADB, NB, SVM) using four standard metrics.
  • Performance insights: Identification of trade-offs between precision and recall across classifiers, with SGD achieving highest precision and SVM achieving perfect recall.
  • Practical recommendation: Demonstrating that Logistic Regression offers the best balance of accuracy and F1 score, suggesting that simpler models can be effective for this task.

Results

The experimental results show that Logistic Regression achieved a median accuracy of 90.57%, the highest among all classifiers. It also achieved the best F1 score of 0.928, indicating a strong balance between precision and recall. SGD achieved the highest precision at 0.968, meaning it had the fewest false positives, while SVM achieved a perfect recall of 1.00, meaning it identified all actual cyberbullying instances but likely at the cost of precision. These results highlight the importance of selecting metrics based on the application's needs—e.g., high recall for safety, high precision for reducing false alarms.

Significance

This paper contributes to the field of social media content moderation by providing a robust comparison of machine learning techniques for cyberbullying detection. The finding that Logistic Regression performs competitively with more complex models is practically significant, as it suggests that lightweight models can be deployed in real-time systems with lower computational costs. The dataset and methodology also serve as a baseline for future research, encouraging further exploration into feature engineering and deep learning approaches. Overall, this work supports the development of automated tools to mitigate cyberbullying, which has positive societal implications.