This repository contains code for detecting hate speech in videos and memes using multimodal architectures. The project includes Simple Embedding Fusion (aka Simple Fusion) and MO-Hate architectures.
The datasets used in this project are HateMM and Hateful Memes. You can download it from the following link:
To install the necessary packages, run the following command:
pip install -r requirements.txt
Before running the experiments, you need to preprocess the dataset to extract features. The preprocessing scripts are located in the Preprocessing/ directory. Make sure to specify the correct path to the downloaded datasets in the below code files.
Video Frames and Audio Transcript:
python Preprocessing/frameExtract.py
and then
python Preprocessing/WhisperTranscript.py
Audio Features:
python Preprocessing/AudioMFCC_Features.py
or
python Preprocessing/CLAP_and_Wav2Vec2_features.py
Text Features:
python Preprocessing/BERT_HXP_Embeddings.py
Image Features:
python Preprocessing/CLIP_image_features.py
or
python Preprocessing/DINOv2_image_features.py
or
python Preprocessing/ViT_Memes_Features.py
Video Features:
python Preprocessing/ViT_VideoFrame_Features.py
The Simple Fusion architecture experiments are implemented in the Simple Fusion/ directory. To run the simple fusion experiments, follow these steps:
Train the Simple Fusion Model on HateMM:
python Simple-Fusion/HateMM_Fusion.py
Train the Simple Fusion Model on Hateful Memes:
python Simple-Fusion/HateMemesFusion.py
The MO-Hate architecture experiments are implemented in the MO-Hate/ directory. To run these experiments, follow these steps:
Train the MO-Hate Model on HateMM:
python MO-Hate/main.py
Train the MO-Hate Model on Hateful Memes:
python MO-Hate/memes.py
For testing either on random or specific images from the test set, follow these steps:
Load the trained model and run the file:
python test_videos.py
or
python test_memes.py
@inproceedings{10.1145/3701716.3718382,
author = {Koushik, Girish A. and Kanojia, Diptesh and Treharne, Helen},
title = {Towards a Robust Framework for Multimodal Hate Detection: A Study on Video vs. Image-based Content},
year = {2025},
isbn = {9798400713316},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3701716.3718382},
pages = {2014–2023},
location = {Sydney NSW, Australia},
series = {WWW '25}
}
Note: Some parts of the preprocessing and training codes for Simple Embedding Fusion and MO-Hate have been taken from their respective GitHub repositories. Please refer to the following links for more details:
15 commits
1 commits
Python
100.0%
This repository contains code for detecting hate speech in videos and memes using multimodal architectures. The project includes Simple Embedding Fusion (aka Simple Fusion) and MO-Hate architectures.
The datasets used in this project are HateMM and Hateful Memes. You can download it from the following link:
To install the necessary packages, run the following command:
pip install -r requirements.txt
Before running the experiments, you need to preprocess the dataset to extract features. The preprocessing scripts are located in the Preprocessing/ directory. Make sure to specify the correct path to the downloaded datasets in the below code files.
Video Frames and Audio Transcript:
python Preprocessing/frameExtract.py
and then
python Preprocessing/WhisperTranscript.py
Audio Features:
python Preprocessing/AudioMFCC_Features.py
or
python Preprocessing/CLAP_and_Wav2Vec2_features.py
Text Features:
python Preprocessing/BERT_HXP_Embeddings.py
Image Features:
python Preprocessing/CLIP_image_features.py
or
python Preprocessing/DINOv2_image_features.py
or
python Preprocessing/ViT_Memes_Features.py
Video Features:
python Preprocessing/ViT_VideoFrame_Features.py
The Simple Fusion architecture experiments are implemented in the Simple Fusion/ directory. To run the simple fusion experiments, follow these steps:
Train the Simple Fusion Model on HateMM:
python Simple-Fusion/HateMM_Fusion.py
Train the Simple Fusion Model on Hateful Memes:
python Simple-Fusion/HateMemesFusion.py
The MO-Hate architecture experiments are implemented in the MO-Hate/ directory. To run these experiments, follow these steps:
Train the MO-Hate Model on HateMM:
python MO-Hate/main.py
Train the MO-Hate Model on Hateful Memes:
python MO-Hate/memes.py
For testing either on random or specific images from the test set, follow these steps:
Load the trained model and run the file:
python test_videos.py
or
python test_memes.py
@inproceedings{10.1145/3701716.3718382,
author = {Koushik, Girish A. and Kanojia, Diptesh and Treharne, Helen},
title = {Towards a Robust Framework for Multimodal Hate Detection: A Study on Video vs. Image-based Content},
year = {2025},
isbn = {9798400713316},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3701716.3718382},
pages = {2014–2023},
location = {Sydney NSW, Australia},
series = {WWW '25}
}
Note: Some parts of the preprocessing and training codes for Simple Embedding Fusion and MO-Hate have been taken from their respective GitHub repositories. Please refer to the following links for more details:
15 commits
1 commits
Python
100.0%