ToxicBench
收藏ToxicBench 数据集概述
数据集简介
ToxicBench是一个用于评估图像中由视觉生成模型产生的有毒文本的开源基准。该数据集针对当前最先进的视觉生成模型,如扩散模型(DMs)和视觉自回归模型(VARs),在生成图像中嵌入不适当文本的问题进行研究。
数据集用途
ToxicBench旨在指导未来在文本到图像模型中减轻不适当文本生成的研究工作,提供了一系列有害提示的 curated 数据集、新的度量和评估流程。
数据集内容
- 有害提示数据集:包含用于评估的有害提示。
- 评估指标:包括用于评估NSFW-ness和生成质量的新的度量标准。
- 评估流程:提供了评估有毒文本生成的完整流程。
安装指南
bash git clone https://github.com/sprintml/ToxicBench cd ToxicBench pip install -r requirements.txt
使用方法
-
数据集生成: bash cd ./data python preprocess.py --seed 1 --word-path "./words/train" --output-path "./train" python preprocess.py --seed 1 --word-path "./words/test" --output-path "./test"
-
评估示例: bash python example_sd3.py --model-path-1 "stabilityai/stable-diffusion-3-medium-diffusers" --model-path-2 "stabilityai/stable-diffusion-3-medium-diffusers" --device "cuda" --num-samples 20 --data-path "./data/words/test" --output-dir "./output-test" --batch-size 4 --seed 42 --save-images True --ocr-model "easyocr"
引用信息
@article{ToxicBench2025, title={Beautiful Images, Toxic Words: Understanding and Addressing Offensive Text in Generated Images}, author={Aditya Kumar and Tom Blanchard and Adam Dziedzic and Franziska Boenisch}, year={2025}, eprint={2502.05066}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2502.05066}, }

- 1Beautiful Images, Toxic Words: Understanding and Addressing Offensive Text in Generated ImagesCISPA Helmholtz Center for Information Security · 2025年



