Back To Projects

Detecting Racial and Ethnic Bias in Social Media Posts Using Machine Learning

Mira C.

This study investigates the use of machine learning to detect racial and ethnic bias in social media posts using TF-IDF text embeddings and multiple classification models. Results show that Random Forest achieved the highest overall accuracy of 93.45%, demonstrating the potential of machine learning to support automated bias detection despite challenges posed by imbalanced data and the complexity of language.


Social media platforms contain large amounts of user-generated content, making it difficult for humans to identify harmful language manually. This project investigates whether machine learning can be used to detect racial and ethnic bias in social media posts. The dataset used was Hate Speech and Bias against Asians, Blacks, Jews, Latines, and Muslims: A Dataset for Machine Learning and Text Analytics, which contains 5,880 labeled tweets collected between 2020 and 2022. Several machine learning models were trained and evaluated using TF-IDF (Term Frequency-Inverse Document Frequency) text embeddings, including K-Nearest Neighbors (KNN), Random Forest, Multi-Layer Perceptron (MLP), AdaBoost, and Support Vector Classification (SVC). Random Forest achieved the highest accuracy (93.45%) and precision (57.14%), while the Multi-Layer Perceptron achieved the highest recall (11.54%) and F1 score (0.141). These findings suggest that machine learning can assist in detecting racial and ethnic bias in social media posts, although performance remains limited due to the imbalanced dataset and the complexity of language.

Explore More!

Source Code
Mira C.
Matan Gans
Computer Science MS from Brown

Related Projects

A Comprehensive Review on Deep Learning Architectures for Image Segmentation

This paper provides a comprehensive review of recent advancements in deep learning-based models for image segmentation, including U-Net, Mask R-CNN, and transformer-based models, analyzing their performance, challenges like data shortage, and potential future directions for improved real-time deployment and interpretability.
Madhurima M.
Mentored by Victoria Lloyd
Improving User Retention in Video Game Industry

This research paper delves into the intersection of player data analytics and affective computing to predict and adapt game difficulty levels for the purpose of enhancing player retention in the gaming industry.
Ethan V.
Mentored by Anjali Singh
Using Machine Learning Models to Analyze the Aerodynamic Properties of Airfoils

This research posits that leveraging artificial intelligence could significantly reduce financial and computational costs while identifying optimal airfoil geometries.
Aaron W.
Mentored by Ronil Synghal