M ason P erplexity at Multimodal Hate Speech Event Detection 2024: Hate Speech and Target Detection Using Transformer Ensembles (2024)

Abstract: The automatic identification of offensive language such as hate speech is important to keep discussions civil in online communities. Identifying hate speech in multimodal content is a particularly challenging task because offensiveness can be manifested in either words or images or a juxtaposition of the two. This paper presents the MasonPerplexity submission for the Shared Task on Multimodal Hate Speech Event Detection at CASE 2024 at EACL 2024. The task is divided into two sub-tasks: sub-task A focuses on the identification of hate speech and sub-task B focuses on the identification of targets in text-embedded images during political events. We use an XLM-roBERTa-large model for sub-task A and an ensemble approach combining XLM-roBERTa-base, BERTweet-large, and BERT-base for sub-task B. Our approach obtained 0.8347 F1-score in sub-task A and 0.6741 F1-score in sub-task B ranking 3rd on both sub-tasks.

## introduction in the context of polarized political discussions, when feelings and perspectives are strong, identifying offensive content is essential to moderation efforts in online communities. the challenge is increased by the use of text-embedded images in which negative emotions can be expressed both verbally and visually. besides, in the current era of vlogging and reels, people are inclined to utilize memes and emojis or opt for text-embedded images to express their sentiments and comment on online content. as a result, the task of detecting hate speech is expanding to encompass images, posing a new challenge beyond the realm of textual content and across diverse languages. the shared task on multimodal hate event detection at case 2024 @xcite deals with the identification of hate speech and its targets in text-embedded images during political events. the main objective is to automatically determine if an image that includes text contains hate speech (sub-task a) and, if so, to identify its targets categorized as community, individual, and organization @xcite . identifying the target of offensive messages is vital to understanding their potential harm as demonstrated by annotation taxonomies such as olid @xcite and tbo @xcite . in this paper, we discuss transformer-based approaches to hate speech detection in political events using the multimodal hate speech event detection dataset @xcite . the paper sheds light on the challenges of handling multimodal content, particularly text-embedded images. for sub-task a (hate speech detection), we employ the xlm-roberta-large @xcite ) model. for sub-task b (target detection), we adopt an ensemble approach combining xlm-roberta-base, bertweet-large @xcite , and bert-base @xcite . these models are selected to effectively address the unique challenges posed by diverse multimodal content. we report that our approach obtained a 0.8347 f1-score in sub-task a and a 0.6741 f1-score in sub-task b, ranking 3 rd on both sub-tasks. ## related work offensive content and hate speech offensive content is pervasive in social media motivating the development of systems capable of recognizing it automatically. while definitions may vary, hate speech is arguably the most widely explored type of offensive content @xcite . several studies have proposed new datasets and models to label hateful posts on social media @xcite . more recently, studies have focused on recognizing the specific parts of an instance that may be considered offensive or hateful, as in the case of hatexplain @xcite , tsd @xcite , and mudes (ranasinghe and @xcite . the vast majority of work on text-based hate speech detection is on english but several papers have created resources and models for languages such as bengali @xcite , french @xcite , greek @xcite , @xcite , and turkish @xcite . multimodal hate speech while the aforementioned studies have focused on the identification of hateful content in texts, there has been growing interest in identifying hateful content in text and images simultaneously. hermida and santos (2023), @xcite , and @xcite highlight the significance of multimodal analysis offering a comprehensive overview of various methodologies employed to detect hate speech in images and memes. various datasets have been introduced for multimodal hate speech detection @xcite @xcite the study by @xcite presents a twitter corpus with content related to the us elections of 2020. the study by @xcite explores the combination of various modalities for hate speech detection such as text, video, and audio. while the clear majority of studies deal with english, research on different languages @xcite @xcite . related shared tasks @xcite organizes case 2023, a series of shared tasks identifying multimodal hate speech event detection. there are two sub-tasks to identify hate speech and targets in the different sub-tasks. participants present the utilization of transformer models like bert, roberta, and xlnet, as well as effective approaches such as vision transformers and clip which contributed to the outstanding outcomes. similarly, different shared tasks have been organized to identify offensive language from texts i.e. (aragón et al., 2019), @xcite . all of this research highlights how important it is to combine several data modalities in order to improve hate speech or offensive language detection. ## datasets in sub-task a, the training dataset provided by the organizers contains 3,600 images. additionally, a development set and a testing set were provided by the organizers each including 443 instances. instances in the sub-task a dataset @xcite are annotated using two labels: no-hate (labeled as 0) and hate (labeled as 1). we present an example of the training data of sub-task a in figure 1 . the label distribution, presented in we have used google vision api foot_0 to retrieve text from the images of all the phases of both the subtasks. although the ocr can detect text in a variety of languages, the accuracy may change depending on the language. it's possible that some languages are more accurate and supported than others. the input image quality has an impact on ocr accuracy. in certain situations, the original formatting may not be preserved by the api. ## experiments in sub-task a, we use bertweet-large (ushio and camacho-collados, 2021) @xcite , bert-base @xcite , and xlm-r (conneau et al., 2020) models. notably, xlm-r shows the best f1 score. we also use gpt-3.5 foot_1 zeroshot and few-shot prompting with test f1 score 0.73, 0.77. for sub-task b, we also start with bertweet-large, bert-base, and xlm-r using the same learning rate and epochs as in sub-task a. later, we apply a weighted ensemble approach to these models, resulting in the 0.65 f1 score for the task. to tackle class imbalance in sub-task b, we employed back translation, converting the training data through xosha to twi to english and lao to pashto to yoruba to english. this significantly improves overall model performance from 0.65 to 0.67. the ensemble method with majority voting is proven helpful in this type of case where a single model may not be able to label the data correctly due to class imbalance @xcite . moreover, we follow the approach of back translation of @xcite . we follow the approach of back translation of @xcite . for this, we select languages that demonstrate limited or no cultural overlap with the original language featured in the dataset. xosha, twi, lao, pashto, and yoruba are languages that are very diverse culturally and geographically. this diversity underscores the significance of considering a wide range of cultural and geographical influences when working with these languages. by intentionally selecting these languages without cultural overlap, we introduce a purposeful aspect of diversity, mitigating potential biases, and enhancing the dataset with a broader spectrum of linguistic expressions. moreover, the ensemble method with majority voting is also proven helpful in this type of case where a single model may not label the data correctly due to class imbalance @xcite . for instance, when two out of three models predict a sentence as a hate event, the sentence is subsequently labeled as a hate event through the application of majority voting. we also use gpt-3.5 zero-shot and few-shot prompting with test f1 scores of 0.53, and 0.57. the prompt provided to gpt3.5 is available in figure 3 . role: you are a helpful ai assistant. you are given the task @xmath0. definition: <sub-task_definition>. you will be given a text to label @xmath1. task: generate the label for this text in the following format: <@xmath2. thanks. we also utilize gpt-3.5 through the openai api for two primary sub-tasks: hate speech detection (sub-task a) and hate speech target detection (sub-task b). we fine-tune gpt-3.5 using specifically curated training and evaluation datasets, conducting the process over four epochs. it is worth noting that, no other hyper-parameter can be set other than epochs while fine-tuning gpt3.5 through the api. notably, the openai api does not provide conventional metrics such as training loss, validation loss, precision, or recall. upon completion of the fine-tuning, the api assigns a unique id to our model. we use this id to process the test dataset for both sub-tasks. for labeling and predictions, the api returns results based on the test dataset. in sub-task a, which focuses on detecting hate speech, our model achieves an f1 score of 0.82, indicating a high level of accuracy. conversely, in sub-task b, where the objective is to identify the targets of hate speech, the model attains a lower f1 score of 0.63, reflecting the inherent challenges in this particular aspect of hate speech analysis. hyperparameters of all the models used excluding gpt3.5 in the experiments are available in figure 3 ## results the detailed experimental results of the models in sub-task a and sub-task b are available in tables 4, and 5, respectively. in sub-task a, we evaluate a bert-base, bertweet-large, and xlm-r model. xlm-r delivers the best performance with a 0.83 f1-score. in sub-task b, our ensemble approach was provides the best f1-score of 0.67. ## error analysis in sub-task a, our aim is to detect non-hate (labeled as 0) and hate (labeled as 1) speeches. therefore, the task of our model is to categorize text into two categories: non-hate or hate. the confusion matrix, presented in figure 4 , illustrates both the true labels and predicted labels, indicating that our model according to our initial analysis, there are some challenges that can affect our results. firstly, there is an imbalance in label distribution within our dataset, where certain data classes contain more instances than others. this makes it difficult for the model to learn properties of classes that contain fewer examples. secondly, we observed that some labels in the dataset are correctly attributed. this is the case of many offensive and hate speech datasets due to the intrinsic subjectivity of the task, as noted by @xcite . incorrect labels can confuse our model, making it harder for it to learn properly and leading to mistakes in the evaluation state. it may also explain why gpt3.5 underperformed, even after finetuning. also, as this is primarily a text classification task -models like xlm-r do better than gpt3.5. finally, another limitation lies in the impact of external factors on the reliability of our multimodal hate event detection model over time. the dynamic nature of online discourse and political shifts may affect its efficacy. even though our models achieve good results, recognizing and dealing with these challenges is important when developing high-performing models that work well in the ever-changing world of online conversations and political events. ## conclusion and future work this paper evaluated various approaches to multimodal hate event detection. we tested multiple models such as gpt, xlm-r, and bert on subtask a and sub-task b of the competition and we addressed the difficulties associated with handling multimodal content. our xlm-r model performed well in subtask a ranking third, achieving an f1 score of 0.83. in the same way, for subtask b, our ensemble method, which combined bert base, bertweet large, and xlm-r, also ranked third, achieving an f1 score of 0.67. despite encountering label distribution imbalances in the training and evaluation sets, our approaches successfully navigated these challenges. future studies will focus on exploring potential biases in our models and further refining strategies for handling class imbalance as in @xcite . moreover, as online communication continues to increase multimodality, developing robust hate speech detection systems requires fusing information from different modalities. future work should focus on faceted annotation schemes and semi-supervised approaches to improve generalization. evaluating model biases, and exploring the impacts of label imbalance are also important areas needing attention. we hope our experiments provide a valuable starting point for further research towards safer online spaces.