ToxicBench
收藏资源简介:
ToxicBench是一个开源的基准测试,旨在评估文本到图像生成模型中NSFW文本生成的安全性。该数据集包含了一系列精心挑选的文本提示,用于触发图像中的NSFW文本生成。ToxicBench提供了一个新的评估指标,以及一个用于评估NSFW内容和生成质量的评估管道,目的是指导未来在图像生成模型中减轻NSFW文本生成的研究工作。
ToxicBench is an open-source benchmark designed to evaluate the safety of NSFW text-triggered content generation in text-to-image generation models. This dataset comprises a curated collection of text prompts intended to trigger the generation of NSFW content in images. ToxicBench provides a novel evaluation metric as well as an evaluation pipeline for assessing NSFW content and generation quality, with the goal of guiding future research efforts to mitigate NSFW text generation in image generation models.
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年



