[论文解读] UnsafeBench: Benchmarking Image Safety Classifiers on Real-World and AI-Generated Images
本论文提出UnsafeBench,一个基准测试框架,用于在11种不安全类别下,对真实世界和AI生成图像的图像安全分类器进行评估。该框架引入了一个包含10,000张图像的手动标注数据集,并提出PerspectiveVision,一种基于视觉语言模型(VLM)的审核工具,其F1得分达到0.810,与GPT-4V等闭源模型性能相当,凸显了真实世界分类器在AI生成内容上的性能下降问题。
With the advent of text-to-image models and concerns about their misuse, developers are increasingly relying on image safety classifiers to moderate their generated unsafe images. Yet, the performance of current image safety classifiers remains unknown for both real-world and AI-generated images. In this work, we propose UnsafeBench, a benchmarking framework that evaluates the effectiveness and robustness of image safety classifiers, with a particular focus on the impact of AI-generated images on their performance. First, we curate a large dataset of 10K real-world and AI-generated images that are annotated as safe or unsafe based on a set of 11 unsafe categories of images (sexual, violent, hateful, etc.). Then, we evaluate the effectiveness and robustness of five popular image safety classifiers, as well as three classifiers that are powered by general-purpose visual language models. Our assessment indicates that existing image safety classifiers are not comprehensive and effective enough to mitigate the multifaceted problem of unsafe images. Also, there exists a distribution shift between real-world and AI-generated images in image qualities, styles, and layouts, leading to degraded effectiveness and robustness. Motivated by these findings, we build a comprehensive image moderation tool called PerspectiveVision, which improves the effectiveness and robustness of existing classifiers, especially on AI-generated images. UnsafeBench and PerspectiveVision can aid the research community in better understanding the landscape of image safety classification in the era of generative AI.
研究动机与目标
- 为解决现有图像安全分类器在真实世界和AI生成的不安全图像上缺乏全面评估的问题。
- 探究现有分类器在仅基于真实世界数据进行训练的情况下,是否能有效泛化至AI生成内容。
- 开发一种强大且开源的图像审核工具,能够检测来自不同图像源的多样化不安全内容。
- 为生成式AI时代下的图像安全研究提供标准化基准。
- 分析真实世界与AI生成不安全图像之间的分布差异,及其对分类器性能的影响。
提出的方法
- 从LAION-5B(真实世界)和Lexica(AI生成)中筛选出10,000张图像,手动标注其安全性和11种不安全类别。
- 收集了五种传统图像安全分类器(Q16、NSFW_Detector、NudeNet、SD_Filter、MultiHeaded)以及三种基于VLM的分类器(LLaVA、InstructBLIP、GPT-4V),并使用RoBERTa对输出进行分类。
- 通过人工检查和类别特定评估,对分类器的覆盖范围与不安全类别进行对齐。
- 在六个外部数据集上评估其有效性与鲁棒性,测量F1得分,并分析各类别和图像源之间的性能一致性。
- 设计PerspectiveVision作为端到端的图像审核工具,采用集成VLM和微调分类头,实现多类别检测。
- 开展消融研究,评估训练数据组成和分布偏移对分类器泛化能力的影响。

实验结果
研究问题
- RQ1现有图像安全分类器从真实世界图像泛化到AI生成的不安全图像时表现如何?
- RQ2当前分类器在哪些不安全内容类别上检测效果最好,哪些最差?
- RQ3通用视觉语言模型(VLM)是否能在检测多维度不安全内容方面超越传统图像安全分类器?
- RQ4真实世界与AI生成图像之间的分布差异如何影响分类器性能?
- RQ5开源的多类别图像审核工具能否实现与专有最先进模型相当的性能?
主要发现
- 现有图像安全分类器在不同不安全类别上表现不均衡,尤其在仇恨和政治内容等类别上存在显著性能不足。
- 仅在真实世界数据上训练的分类器在应用于AI生成图像时,由于分布偏移导致性能显著下降,F1得分最高下降达30%。
- 基于VLM的分类器GPT-4V在基准测试中取得最高F1得分0.810,优于传统模型,并与闭源最先进系统性能相当。
- 所提出的开源工具PerspectiveVision在六个评估数据集上整体F1得分为0.810,展现出强大的泛化能力和多类别检测性能。
- AI生成图像表现出独特的视觉模式,如艺术化表达和网格布局,当前分类器难以泛化识别,表明需要开展领域自适应训练。
- UnsafeBench数据集揭示了对不安全内容的偏向性,且AI生成来源多样性有限,主要来自Stable Diffusion,提示需扩大数据收集范围。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。