Evaluates the effectiveness of image safety classifiers in detecting various unsafe content categories across real-world and AI-generated images. It also probes classifier robustness to distribution shifts caused by artistic representations and grid layouts in AI-generated content. Use when the user wants to benchmark on UnsafeBench, or asks about evaluating this task. Reports F1-Score.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add qhjqhj00/research-skills-pool --skill unsafebench-eval --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Unsafebench Eval?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/qhjqhj00-unsafebench-eval)More formats (shields.io, HTML) on the badges page.
---
name: unsafebench-eval
description: Evaluates the effectiveness of image safety classifiers in detecting various unsafe content categories across real-world and AI-generated images. It also probes classifier robustness to distribution shifts caused by artistic representations and grid layouts in AI-generated content. Use when the user wants to benchmark on UnsafeBench, or asks about evaluating this task. Reports F1-Score.
metadata:
skill_kind: dataset_eval
source_arxiv: 2405.03486
bibtex_key: qu2024unsafebench
confidence: high
---
# unsafebench-eval
> UnsafeBench: Benchmarking Image Safety Classifiers on Real-World and AI-Generated Images — Qu et al. (2024) (arXiv:2405.03486, 2024)
## What this evaluates
Evaluates the effectiveness of image safety classifiers in detecting various unsafe content categories across real-world and AI-generated images. It also probes classifier robustness to distribution shifts caused by artistic representations and grid layouts in AI-generated content.
## Datasets
- **UnsafeBench** — total ?; splits: LAION-5B (Real-World) (-1), Lexica (AI-Generated) (-1)
## Metrics
- `F1-Score` **(primary)** — range: [0, 1]
- Harmonic mean of precision and recall, calculated per unsafe category and overall. Precision = TP / (TP + FP), Recall = TP / (TP + FN).
## Input / output format
**Input**: Single images sourced from LAION-5B (real-world) or Lexica (AI-generated), optionally accompanied by text prompts for VLM-based classifiers.
**Output**: Binary or multi-class safety labels (e.g., safe, hate, harassment, violence, sexual, shocking, illegal activity, deception, political, health, spam) per image.
## Scoring recipe
```python
def compute_f1(predictions, gold_labels):
tp = sum(1 for p, g in zip(predictions, gold_labels) if p == 1 and g == 1)
fp = sum(1 for p, g in zip(predictions, gold_labels) if p == 1 and g == 0)
fn = sum(1 for p, g in zip(predictions, gold_labels) if p == 0 and g == 1)
precision = tp / (tp + fp) if (tp + fp) > 0 else 0.0
recall = tp / (tp + fn) if (tp + fn) > 0 else 0.0
return 2 * precision * recall / (precision + recall) if (precision + recall) > 0 else 0.0
```
## Common pitfalls
- Relying on a single prompt for VLM-based classifiers without majority voting, which can drop F1-Score by ~0.10.
- Ignoring distribution shifts between real-world and AI-generated images, leading to overestimation of classifier robustness.
- Overlooking the impact of artistic representations and grid layouts, which cause significant false negatives for models trained only on real-world data.
## Evidence (verbatim from paper)
> We calculate the overall F1-Score of Q16 combined with NudeNet across the unsafe categories they can cover, and the score is 0.665.
## Citation
```bibtex
@misc{qu2024unsafebench,
title={UnsafeBench: Benchmarking Image Safety Classifiers on Real-World and AI-Generated Images},
author={Qu et al. (2024)},
year={2024},
note={arXiv:2405.03486}
}
```
- arXiv: 2405.03486
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!