Inferring Offensiveness In Images From Natural Language Supervision

Patrick Schramowski, Kristian Kersting

Introduction

Modern AI models are trained on massive web-scraped datasets like ImageNet, which often contain "polluted" content including derogatory categories, offensive imagery, and stereotypical associations. Manually auditing millions of images is unfeasible. This research introduces a scalable method to detect "general offensiveness"—encompassing violence, animal cruelty, and hate symbols—by leveraging the implicit moral knowledge within pre-trained vision-language models.

Methodology: Soft-Prompt Tuning with CLIP

The researchers utilize CLIP (Contrastive Language-Image Pre-training), which understands visual concepts through natural language. To bridge the gap between general visual recognition and moral judgment, they employ Soft-Prompt Tuning.

Instead of using static text prompts (e.g., "Is this image offensive?"), the approach treats the prompt as a mathematical vector (embedding). This vector is optimized via gradient descent using a small set of human-annotated examples. This "steers" the model’s latent space to distinguish between offensive and non-offensive content without requiring a full retraining of the massive CLIP architecture.

Experimental Setup and Datasets

The model was trained and evaluated using the Socio-Moral Image Database (SMID), containing 2,941 images human-labeled for moral content. Once tuned, the classifier was used to audit the ImageNet-ILSVRC-2012 dataset, which serves as a primary benchmark for computer vision.

Key Results and Qualitative Analysis

The tuned CLIP model (specifically the ViT-B/16 variant) achieved a high accuracy of 96.3% on the SMID dataset. Remarkably, the model demonstrated extreme data efficiency: using only 4% of the SMID data (roughly 60 images) was sufficient to achieve over 90% accuracy, highlighting the depth of moral knowledge already present in CLIP's pre-trained weights.

Figure 3: Examples of images from ImageNet flagged by the model, categorized by labels such as weapons (revolver, assault rifle), potentially sensitive clothing (bikini, abaya), and disturbing scenes (ice bear, butcher shop).

When applied to ImageNet, the model flagged over 30,000 images in the training set and 1,500 in the validation set. These findings were categorized into three main types:

  • Objects: Weapons like revolvers, gas masks, and guillotines.
  • Symbols: Extremist symbols and hate speech.
  • Actions: Scenes depicting animal cruelty, humans in distress, or catastrophic events.

Discussion and Limitations

While highly effective, the authors acknowledge that offensiveness is inherently subjective and culturally dependent. Since CLIP is trained on internet data, it likely reflects the biases of dominant online cultures. Future work aims to move beyond binary classification toward multi-labeling (e.g., distinguishing "violence" from "hate symbols") and improving model explainability to understand which visual features trigger an "offensive" classification.

Conclusion

By turning pre-trained models into their own auditors, this research provides a powerful tool for cleaning large-scale datasets. This approach ensures that the "moral mirrors" of AI more accurately reflect intended human values rather than the uncurated biases of the open web.

Summary updated

BibTeX
@inproceedings{schramowski2022inferring,
  author = {Patrick Schramowski and Kristian Kersting},
  title = {{Inferring Offensiveness In Images From Natural Language Supervision}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=gCmCiclZV6Q},
}
Figure