Privacy-Preserving Classification of Personal Text Messages with Secure Multi-Party Computation: An Application to Hate-Speech Detection

Martine De Cock, Rafael Dowsley, Anderson C. A. Nascimento, Devin Reich, Ariel Todoki

TL;DR

This paper introduces the first provably secure method for privacy-preserving text classification using Secure Multiparty Computation (SMC). Their approach allows a text classifier owner (Bob) to classify a user's (Alice's) personal text messages without learning the content of the messages, and Alice learns nothing about Bob's classification model beyond the result. This is achieved through novel SMC protocols for feature extraction and classification, demonstrating practical efficiency for hate speech detection.

What Problem Does This Paper Address?

In today's digital age, analyzing personal text messages (like SMS or emails) offers significant value for applications ranging from mental health monitoring to targeted advertising and content moderation. However, granting access to such sensitive data to third-party applications or services inherently raises privacy concerns. Existing methods for privacy-preserving machine learning often rely on techniques like Differential Privacy (DP), which can degrade accuracy, or Homomorphic Encryption (HE), which can be computationally prohibitive. This paper tackles the challenge of performing text classification with strong privacy guarantees, specifically focusing on preventing the data owner (Alice) from revealing her text content to the model owner (Bob), and vice-versa for the model itself, while maintaining high accuracy and practical performance.

Methods

The core of this work lies in developing and combining novel Secure Multiparty Computation (SMC) protocols. SMC allows multiple parties to jointly compute a function over their private inputs without revealing those inputs to each other. The proposed solution involves two main phases:

  1. Privacy-Preserving Feature Extraction: This phase securely identifies which words from Alice's text message are present in Bob's hate speech lexicon. This is achieved using a secure equality test protocol to compare words from Alice's text against Bob's lexicon. The output is a binary feature vector, securely shared between Alice and Bob, indicating the presence or absence of specific words.
  2. Privacy-Preserving Classification: This phase takes the securely shared feature vector and applies Bob's trained machine learning model to predict the class label (e.g., hate speech or not). The paper proposes a novel SMC protocol for classification using AdaBoost ensembles of decision stumps, in addition to leveraging an existing protocol for logistic regression.

Crucially, the authors employ a "commodity-based model" which assumes a trusted initializer for pre-distributing correlated randomness. This setup simplifies the secure computation of multiplications, a key operation in SMC. The entire system is built upon their own privacy-preserving machine learning (PPML) framework, designed for efficiency and modularity.

Datasets

The authors evaluated their system using a dataset of 10,000 tweets, 60% of which were annotated as hate speech against women or immigrants. This dataset was sourced from a prior work ([7]). The text was preprocessed by converting characters to lowercase and extracting word unigrams and bigrams. This resulted in a large feature space of 123,482 distinct features. No new benchmark datasets were introduced.

Key Insights and Ideas

  • SMC for Text is Feasible and Efficient: The paper demonstrates that SMC, often perceived as computationally expensive, can be practically applied to text classification tasks, achieving results in seconds rather than minutes or hours.
  • Novelty in Protocol Combination and Optimization: While some building blocks (like secure equality tests) are known, the paper's contribution lies in the careful selection and optimization of ML models (decision stumps, logistic regression) and their integration into end-to-end SMC protocols for feature extraction and classification.
  • Feature Engineering is Crucial: The experimental results highlight that the choice of features (unigrams vs. unigrams+bigrams) and the number of features significantly impacts both accuracy and runtime, emphasizing the importance of feature engineering in privacy-preserving ML.
  • AdaBoost for Efficiency: The proposed secure AdaBoost classification protocol, specifically designed for binary features and decision stumps, is shown to be highly efficient.

Key Results

The paper reports excellent runtime performance without sacrificing accuracy.

  • Speed: The proposed Rust implementation achieved classification times in seconds, significantly outperforming a prior HE-based solution that took 19 minutes for a single tweet. For example, logistic regression with 50 features and unigrams took as little as 0.953 seconds in Rust.
  • Accuracy: The highest accuracy achieved was 74.4% using an AdaBoost model with 500 features (unigrams and bigrams). This was comparable to non-private models.
  • Comparison: The Rust implementation generally outperformed the Java implementation in terms of speed.

Limitations and Future Work

  • Setup Assumption: The reliance on a trusted initializer for pre-distributed randomness is a common assumption in SMC, but its absence would require additional pre-computation steps.
  • Adversarial Model: The security proofs are based on the "honest-but-curious" adversarial model, meaning the adversary follows the protocol but tries to gain extra information. More robust security against active adversaries might require different protocols.
  • Feature Engineering Optimization: While feature engineering was shown to be critical, the paper suggests further exploration into optimizing computational and communication complexities, for instance, by using bucketization techniques for feature extraction.
  • Broader ML Model Support: The current work focuses on logistic regression and AdaBoost. Future work could extend these privacy-preserving techniques to a wider range of machine learning models.
  • Real-world Deployment: While the results are promising, deploying such systems in real-world, wide-area networks might benefit from exploring alternatives like Yao's garbled circuits for certain parts of the protocol.

Summary updated

Abstract

Classification of personal text messages has many useful applications in surveillance, e-commerce, and mental health care, to name a few. Giving applications access to personal texts can easily lead to (un)intentional privacy violations. We propose the first privacy-preserving solution for text classification that is provably secure. Our method, which is based on Secure Multiparty Computation (SMC), encompasses both feature extraction from texts, and subsequent classification with logistic regression and tree ensembles. We prove that when using our secure text classification method, the application does not learn anything about the text, and the author of the text does not learn anything about the text classification model used by the application beyond what is given by the classification result itself. We perform end-to-end experiments with an application for detecting hate speech against women and immigrants, demonstrating excellent runtime results without loss of accuracy.
BibTeX
@inproceedings{cock2019privacy,
  author = {Martine De Cock and Rafael Dowsley and Anderson C. A. Nascimento and Devin Reich and Ariel Todoki},
  title = {{Privacy-Preserving Classification of Personal Text Messages with Secure Multi-Party Computation: An Application to Hate-Speech Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=qAi2Xigogz},
}
Figure