GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hate-alert/HateVLMs

BranchesTags
Open more actions menu

Latest commit

 

History

10 Commits
10 Commits

Folders and files

NameName
Last commit message
Last commit date
data_set
data_set
 
 
gpu
gpu
 
 
inference
inference
 
 
models
models
 
 
output
output
 
 
superpixels
superpixels
 
 
utils
utils
 
 
zero_shot_analysis
zero_shot_analysis
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
__init__.py
__init__.py
 
 
perform_inference.py
perform_inference.py
 
 
pipeline.png
pipeline.png
 
 
qodana.yaml
qodana.yaml
 
 

Repository files navigation

Exploring the Limits of Zero Shot Vision Language Models for Hate Meme Detection: The Vulnerabilities and their Interpretations

Accepted at AAAI (ICWSM) 2025

Naquee Rizwan, Paramananda Bhaskar, Mithun Das, Swadhin Satyaprakash Majhi, Punyajoy Saha, Animesh Mukherjee: [Paper] [Arxiv] [Slides]


Abstract

There is a rapid increase in the use of multimedia content in current social media platforms. One of the highly popular forms of such multimedia content are memes. While memes have been primarily invented to promote funny and buoyant discussions, malevolent users exploit memes to target individuals or vulnerable communities, making it imperative to identify and address such instances of hateful memes. Thus social media platforms are in dire need for active moderation of such harmful content. While manual moderation is extremely difficult due to the scale of such content, automatic moderation is challenged by the need of good quality annotated data to train hate meme detection algorithms. This makes a perfect pretext for exploring the power of modern day vision language models (VLMs) that have exhibited outstanding performance across various tasks. In this paper we study the effectiveness of VLMs in handling intricate tasks such as hate meme detection in a completely zero-shot setting so that there is no dependency on annotated data for the task. We perform thorough prompt engineering and query state-of-the-art VLMs using various prompt types to detect hateful/harmful memes. We further interpret the misclassification cases using a novel superpixel based occlusion method. Finally we show that these misclassifications can be neatly arranged into a typology of error classes the knowledge of which should enable the design of better safety guardrails in future.



File/Folder Description šŸ“‚

HateVLMs/
ā”œā”€ā”€ data_set/ # Dataset loading and processing
│ ā”œā”€ā”€ dataset_wrapper.py # Wrapper class for unified dataset interface
│ ā”œā”€ā”€ facebook_hateful_meme_dataset.py # Facebook Hateful Memes dataset loader
│ ā”œā”€ā”€ mami_hateful_meme_dataset.py # MAMI dataset loader
│ ā”œā”€ā”€ Harm_C_Dataset.py # Harmful Memes (COVID-19) dataset loader
│ ā”œā”€ā”€ Harm_P_Dataset.py # Harmful Memes (Politics) dataset loader
│ ā”œā”€ā”€ BHM_dataset.py # Bangla Hateful Memes dataset loader
│ └── hinglish_dataset.py # HinGlish Offensive Memes dataset loader

ā”œā”€ā”€ gpu
│ ā”œā”€ā”€ __init__.py
│ └── gpu_initializer.py # Select device: cpu or cuda

ā”œā”€ā”€ models/ # Model initialization and loading
│ ā”œā”€ā”€ idefics_checkpoint_initializer.py
│ ā”œā”€ā”€ instruct_blip_checkpoint_initializer.py
│ └── llava_checkpoint_initializer.py

ā”œā”€ā”€ inference/ # Inference scripts for different models
│ ā”œā”€ā”€ idefics_inference.py
│ ā”œā”€ā”€ instruct_blip_inference.py
│ └── llava_inference.py

ā”œā”€ā”€ output
│ ā”œā”€ā”€ baselines
│ └── zero_shot

ā”œā”€ā”€ superpixels/ # Superpixel-based occlusion analysis
│ ā”œā”€ā”€ superpixels.py # SLIC superpixel generation
│ └── super_pixel_analysis.py # Occlusion-based interpretation

ā”œā”€ā”€ zero_shot_analysis/ # Zero-shot evaluation analysis
│ ā”œā”€ā”€ bertopic.ipynb # BERTopic clustering for error typology
│ └── bertopic_explanations.ipynb # Analysis of model explanations

ā”œā”€ā”€ utils/ # Utility functions
│ ā”œā”€ā”€ parser_generalized.py # Generalized output parser
│ └── parser_instructBLIP.py # InstructBLIP-specific output parser

ā”œā”€ā”€ perform_inference.py # Main script to run inference across models and datasets
└── README.md # Project documentation

This project structure enables a systematic evaluation of Vision Language Models (VLMs) for hate meme detection across multiple datasets and languages in zero-shot setup. Further, it provides tools for automatic typology induction using BERTopic, error analysis, and black-box model interpretation using superpixel occlusion.


Please cite our paper

@inproceedings{rizwan2025exploring,
  title={Exploring the Limits of Zero Shot Vision Language Models for Hate Meme Detection: The Vulnerabilities and their Interpretations},
  author={Rizwan, Naquee and Bhaskar, Paramananda and Das, Mithun and Majhi, Swadhin Satyaprakash and Saha, Punyajoy and Mukherjee, Animesh},
  booktitle={Proceedings of the International AAAI Conference on Web and Social Media},
  volume={19},
  pages={1669--1689},
  year={2025}
}
@misc{rizwan2025exploringlimitszeroshot,
      title={Exploring the Limits of Zero Shot Vision Language Models for Hate Meme Detection: The Vulnerabilities and their Interpretations}, 
      author={Naquee Rizwan and Paramananda Bhaskar and Mithun Das and Swadhin Satyaprakash Majhi and Punyajoy Saha and Animesh Mukherjee},
      year={2025},
      eprint={2402.12198},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2402.12198}, 
}

Contact

For any questions or issues, please contact: [email protected], [email protected]

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity
Custom properties

Stars

3 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.