MIR-SafetyBench
收藏资源简介:
MIR-SafetyBench通过多图像关系攻击评估多模态大型语言模型(MLLM)的安全性,涵盖6个安全类别和9种关系类型。安全类别包括仇恨言论、暴力、自残、非法活动、骚扰和隐私。关系类型包括类比、因果关系、互补性、分解、相关性、空间嵌入、空间并列、时间连续性和时间跳跃。每个样本包含唯一标识符、原始不安全问题、多图像关系类型、利用多图像关系的攻击提示、图像的文字描述、每个图像的关键词、图像文件路径列表和生成迭代次数。
MIR-SafetyBench evaluates the safety of Multimodal Large Language Models (MLLMs) via multi-image relational attacks, covering 6 safety categories and 9 relational types. The safety categories include hate speech, violence, self-harm, illegal activities, harassment, and privacy. The relational types include analogy, causal relationship, complementarity, decomposition, relevance, spatial embedding, spatial juxtaposition, temporal continuity, and temporal jump. Each sample contains a unique identifier, the original unsafe question, the multi-image relational type, the attack prompt leveraging multi-image relations, the textual description of each image, keywords for each image, a list of image file paths, and the number of generation iterations.
MIR-SafetyBench 数据集概述
数据集基本信息
- 数据集名称:MIR-SafetyBench
- 发布机构:thu-coai
- 获取地址:https://huggingface.co/datasets/thu-coai/MIR-SafetyBench
- 论文地址:https://arxiv.org/pdf/2601.14127
数据集目的与范围
该数据集是一个用于评估多模态大语言模型(MLLMs)在多图像关系(MIR)安全攻击下安全性的综合评估框架。
数据集结构
安全类别
数据集涵盖6个安全类别:
- Hate Speech
- Violence
- Self-Harm
- Illegal Activities
- Harassment
- Privacy
关系类型
数据集包含9种多图像关系类型:
- Analogy
- Causality
- Complementarity
- Decomposition
- Relevance
- Spatial Embedding
- Spatial Juxtaposition
- Temporal Continuity
- Temporal Jump
数据字段
每个样本包含以下字段:
id:唯一标识符original_question:原始不安全问题relationship_type:多图像关系类型revised_prompt:利用多图像关系的攻击提示image_descriptions:图像的文本描述image_keywords:每个图像的关键词images:图像文件路径列表iteration:生成迭代编号
评估框架
评估指标
- HarmBench:使用 HarmBench-Llama-2-13b-cls 进行二元安全分类。
输出结构
评估结果按阶段组织,包含以下目录结构:
results/ ├── infer/ │ └── {model_name}/ │ └── {category}/ │ └── {relationship_type}.json └── harmbench/ └── {model_name}/ └── {category}/ └── {relationship_type}.json
每个推理结果包含:
original_question:原始不安全问题revised_prompt:包含图像的攻击提示answer:模型的响应item_index:样本索引inference_status:success、failed或crashed
结果分析
使用 statics.py 分析结果并计算攻击成功率(ASR)。输出包括:
- 每种关系类型的不安全计数
- 每种关系类型的总样本数
- 每种关系类型的 ASR(%)
- 所有类别的总体 ASR
使用方式
模型适配
可通过在 models/ 目录下创建新的模型适配器来添加自定义模型。适配器必须实现三个函数:
load_model(model_path, num_gpus=1)infer(pipe, prompts: List[str], image_path_sets: List[List[str]])unload_model(pipe)
支持模型类型
- 标准视觉语言对话模型:使用 vLLM 进行高效推理。
- 具有思维链推理的模型:从推理轨迹中提取答案。
- 闭源模型:支持基于 API 的模型(如 OpenAI、Claude 等),处理速率限制和重试。
引用
如需使用此基准测试,请引用: bibtex @misc{chen2026effectssmartsafetyrisks, title={The Side Effects of Being Smart: Safety Risks in MLLMs Multi-Image Reasoning}, author={Renmiao Chen and Yida Lu and Shiyao Cui and Xuan Ouyang and Victor Shea-Jay Huang and Shumin Zhang and Chengwei Pan and Han Qiu and Minlie Huang}, year={2026}, eprint={2601.14127}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2601.14127}, }




