A Streaming Machine Learning Framework for Online Aggression Detection on Twitter

Herodotos Herodotou, Despoina Chatzakou, Nicolas Kourtellis

TL;DR

This paper introduces a novel, real-time framework for detecting online aggression on Twitter using streaming machine learning. It achieves high accuracy comparable to traditional batch methods while efficiently processing massive data volumes with minimal hardware, demonstrating its scalability and adaptability to evolving online behaviors.

What Problem Does This Paper Address?

Online aggression, including hate speech and cyberbullying, is a growing concern on social media platforms like Twitter. The sheer volume and rapid evolution of user-generated content, coupled with users' ability to adapt their tactics to evade detection, pose significant challenges for existing detection systems. Traditional machine learning approaches often rely on batch processing, which can lead to outdated models and high computational costs, making them ill-suited for the dynamic nature of social media. The authors aim to bridge this gap by developing a practical, real-time framework that can continuously learn and adapt to new forms of aggression.

Methods

The core of this work is a streaming machine learning framework designed for Twitter. Instead of processing data in batches, it adopts a streaming paradigm where models are incrementally updated as new labeled data arrives. Key components include:

  • Streaming ML Classifiers: The framework utilizes state-of-the-art streaming algorithms like Hoeffding Trees (HT), Adaptive Random Forests (ARF), and Streaming Logistic Regression (SLR). These models update their parameters with each new instance, ensuring they remain current.
  • Adaptive Bag-of-Words (BoW): To capture evolving aggressive language, a novel adaptive BoW feature is introduced. This feature dynamically updates its vocabulary by incorporating words that become prevalent in aggressive tweets but not in normal ones, and vice-versa.
  • Scalable Architecture: The framework is built on Apache Spark Streaming, a distributed stream processing engine, enabling it to handle massive data streams by parallelizing computations across multiple machines.
  • Preprocessing and Normalization: Standard text preprocessing techniques are applied to clean tweet data, and various normalization methods are explored to improve model performance.

Datasets

The primary dataset used for training and evaluation is an abusive Twitter dataset provided by [6], initially containing 100k tweets labeled as abusive, hateful, spam, or normal. For their experiments, the authors removed spam tweets, resulting in a dataset of 86k labeled tweets. To simulate real-time scenarios and test scalability, they also created a larger dataset of 2 million unlabeled tweets. Additionally, they evaluated their framework on two other datasets: a Sarcasm dataset (6.5k sarcastic tweets out of 61k total) and an Offensive dataset (2k racist and 3k sexist tweets out of 16k total) to assess its generalizability.

Key Insights and Ideas

  • Streaming is Key for Dynamic Content: The paper strongly advocates for streaming ML in social media analysis, highlighting its ability to adapt to concept drift and evolving user behaviors, which batch models struggle with.
  • Adaptive Vocabulary is Crucial: The adaptive Bag-of-Words feature is a significant innovation, allowing the model to learn new slang, coded language, or evolving offensive terms in real-time, a critical aspect for staying ahead of malicious actors.
  • Scalability is Achievable with Commodity Hardware: The demonstration that the framework can process the entire Twitter Firehose with just three commodity machines is a major practical contribution, making real-time detection feasible for platforms.
  • Generalizability Beyond Aggression: The framework's success in detecting sarcasm, racism, and sexism with minimal adaptation suggests its broad applicability to various forms of undesirable online content.

Key Results

  • High Performance: The streaming ML models achieved over 90% accuracy, precision, and recall, performing comparably to or even better than traditional batch-based methods.
  • Scalability: The framework demonstrated impressive scalability, processing up to 14.5k tweets per second on a 3-node cluster, capable of handling the entire Twitter Firehose.
  • Efficiency: The use of streaming ML and distributed processing allowed for efficient handling of massive data volumes with relatively low computational resources.
  • Model Comparison: Hoeffding Tree (HT) and Streaming Logistic Regression (SLR) generally performed better or similarly to Adaptive Random Forests (ARF), with HT often reaching peak performance faster.
  • Feature Importance: Text-based features, particularly swear word counts and negative sentiment, were found to be the most important indicators of aggressive behavior.

Limitations and Future Work

  • Dataset Size for Hateful Tweets: The authors note that the relatively small number of hateful tweets in their primary dataset made it harder to classify that specific label accurately in a 3-class problem.
  • Hyperparameter Tuning in Streaming: While they performed hyperparameter tuning, the paper acknowledges that real-time hyperparameter tuning for evolving data streams remains an open research problem.
  • Future Work: The authors plan to extend their framework into a unified system for detecting a wider range of online behaviors (e.g., bullying, offensive language) and to investigate session-level detection (grouping tweets from the same user or conversation) using windowing functionalities.

Summary updated

BibTeX
@inproceedings{herodotou2020streaming,
  author = {Herodotos Herodotou and Despoina Chatzakou and Nicolas Kourtellis},
  title = {{A Streaming Machine Learning Framework for Online Aggression Detection on Twitter}},
  booktitle = {IEEE BigData},
  year = {2020},
  url = {https://openreview.net/forum?id=Ez6eOSSZ4Ea},
}
Figure