Multimodal or Text? Retrieval or BERT ? Benchmarking Classifiers for the Shared Task on Hateful Memes (2021)

Abstract: The Shared Task on Hateful Memes is a challenge that aims at the detection of hateful content in memes by inviting the implementation of systems that understand memes, potentially by combining image and textual information. The challenge consists of three detection tasks: hate, protected category and attack type. The first is a binary classification task, while the other two are multi-label classification tasks. Our participation included a text-based BERT baseline (TxtBERT), the same but adding information from the image (ImgBERT), and neural retrieval approaches. We also experimented with retrieval augmented classification models. We found that an ensemble of TxtBERT and ImgBERT achieves the best performance in terms of ROC AUC score in two out of the three tasks on our development set.

## introduction multimodal classification is an important research topic that attracts a lot of interest, especially when combining image and text @xcite @xcite @xcite @xcite . humans understand the world and make decisions, by using many different sources. hence, it is reasonable to infer that artificial intelligence (ai) methods can also benefit by combining different types of data as their input @xcite . the hateful memes challenge and dataset were first introduced by facebook ai in 2020 @xcite . the goal was to assess multimodal (image and text) hate detection models. the dataset was created in a way such that models operating only on the text or only on the image would not have a good performance, giving focus to multimodality (see section 2). the winning system used an ensemble of different vision and language transformer models, which was further enhanced with information from input objects detected in the image and their labels @xcite . the hateful memes shared task extends this competition by adding fine-grained labels for two multi-label tasks (see fig. 1 ). the first task is to predict the protected category and the second to predict the attack type. ## dataset the provided dataset comprises images and text. first, @xcite collected real memes from social media, which they called source set and then, used them to create new memes. for each meme in the source set, the annotators searched for images that had similar semantic context with the image of the meme and replaced the image of the meme with the retrieved images. 1 the newly developed memes were then annotated as hateful or not by the annotators. for the hateful memes, counterfactual examples were created and added to the dataset by replacing the image or the text. following this process a dataset of 10,000 memes was created. for the shared task on hateful memes at woah 2021, the same dataset was used, but with additional labels. new fine-grained labels were created for two categories: protected category and attack type. protected category indicates the group of people that is attacked in a hateful meme and consists of five labels: race, disability, religion, nationality and sex. the attack type refers to the way that hate is expressed and consists of seven labels: contempt, mocking, inferiority, slurs, exclusion, dehumanizing, inciting violence . if a meme is not hateful, then the pc empty label is assigned for the protected category task and the attack empty label for the attack type task. a meme can have one or more labels, leading to a multi-label classification setting. participants of the shared task were provided with a training set comprising 8,500 image-text pairs and two development datasets with 500 and 540 image-text pairs. in our work, we merged these sets and split the total of 9,140 unique pairs to 80% for training, 10 % for validation and 10 % as a development set. the unseen test set for which we submitted our models' predictions consisted of 1,000 examples. the dataset was imbalanced, with approximately 64% of the memes being not hateful. ## methods the methods we implemented for this challenge comprise image and text retrieval, bert-based text (and image) and retrieval-augmented classification (rac). the following subsections describe the implemented methods. ## experimental results the official evaluation measure of the shared task is the roc auc score. hence, we provided the output probability distribution over the labels of each task from a model in order to evaluate it. the classifiers of our models did not output a probability for the corresponding empty label (meaning that the meme is not hateful) of each task. in order to assign a probability to the not hateful label of the binary classification task we compute 1 -hateful probability. to the pc empty and attack empty labels of the corresponding task, we assign the probability of 1 -maximum probability of the other labels. the provided evaluation script computes the roc auc score micro averaged and with the one-vs-rest method. it also computes the micro f1 score by applying a threshold (0.5) to the predicted probabilities. each team participating in the shared task on hateful memes could submit predictions from two systems on the unseen test set. we chose to submit the txtbert and the ensemble of txtbert and imgbert. 3 in the roc auc scores for the protected category and the attack type tasks. since we do not have the gold labels of the test set in order to evaluate all the models we implemented, we report their results on the development set we created. ## discussion mnn:bert outperforms mnn:base in all three tasks. this is probably due to the fact that a simple centroid of word embedding ignores word order, by contrast to a bert-based representation, which also encodes the position of the word. interestingly, captionbert outperformed imgbert both in hate and protected category detection. this means that integrating the automatically generated caption of the image, instead of the image itself, was beneficial for two out of three tasks. in attack type detection, however, this didn't apply. we also observe that employing the most similar text in the txtbert model (txtrac), leads to a worse performance, showing that the retrieved text does not help the text classification model as expected. this probably occurs due to the diversity of the texts in the dataset. however, txtrac outperforms caption-bert in all tasks in terms of roc auc, maybe because generated captions from s&t, which is only trained on ms coco can contain errors. the ensemble model, that averages the predictions of txtbert and imgbert, outperformed the rest of the models, in roc auc, for hate and attack type detection. however, we note that for a fair comparison we should have created also checkpoint-based ensembles per model. that is, we can't be certain whether the superior performance of the ensemble stems from the combination of textual and visual information or from the reduction of the variance of the models that are used by the ensemble. in the roc auc scores for the hidden test set (see for the two multilabel tasks we also evaluated our models per label in order to obtain a better understanding of their performance. we observe that even though the dataset is imbalanced containing more not hateful memes, the scores of the models for the empty label are lower than the ones for the other labels in both tasks. this means that the models do not achieve a very high performance on the empty label as expected. also, we see that there ## conclusions we participated in the shared task on hateful memes with the aim of detecting memes with hateful content, as well as the protected categories and the attack types in hateful memes. we experimented with models that employ only the text, that employ the text and image, and with models that also add information from retrieved texts. txtbert, a bert for sequence classification that uses only the text, achieves very good performance. an ensemble of txtbert and a multimodal bert (imgbert) outperforms all other methods on our development set in two out of the three tasks. we found that retrieval methods based on both the image and the text do not work well on this dataset, probably due to its complex context and diversity. in future work we plan to experiment with large pre-trained vision and language transformer models, different sources for retrieval and explainability approaches for multimodal methods.