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

Integrating Pixhawk and Realsense Camera for Rover Autonomy

This study presents the design and implementation of a low-cost autonomous go-kart that uses a Pixhawk-4 flight controller and ArduPilot to enable waypoint-based navigation and speed control without human intervention. It also demonstrates how integrating an Intel RealSense depth camera improves safety through MAVLink-based obstacle avoidance, particularly in environments with obstacles.
Nathan K.
Mentored by Samuel Akinwande
Prioritizing Environmental and Behavioral Context in Autonomous Vehicle Hazard Detection

This study evaluates how autonomous vehicles can optimize critical, split-second braking decisions by prioritizing complex environmental and pedestrian behavioral conditions rather than relying solely on fixed distance-based rules. Utilizing a two-stage deep learning framework and an LSTM network on simulated time-series data, the research demonstrates that adaptive safety assessment using motion trends and dynamic Time-to-Collision thresholds significantly enhances hazard prediction accuracy.
Mia M.
Mentored by Aansh Shah
Quantifying the True Trade Value of NBA Players: A Data Driven Approach

This study investigates the drivers of NBA player valuation by analyzing performance metrics, advanced statistics, and salaries from the 2022–2023 season, using regression models to assess how performance relates to trade value. The findings show that while team payroll strongly correlates with team performance, individual player salaries often diverge from statistical output, highlighting the influence of factors beyond on-court performance.
Ali Q.
Mentored by Rami Abi-Akl