Security Tensors Dataset
收藏资源简介:
Security Tensors数据集是为了训练可训练的输入向量,称为安全张量,这些张量能够在推理过程中通过文本或视觉模态应用,以增强大型视觉语言模型(LVLM)的安全性。数据集包含恶意图像-文本对、对比性良性对以及一般良性样本,旨在训练模型识别和拒绝有害的视觉输入,同时保持对良性任务的性能。数据集通过精心设计,确保安全张量能够有效地将文本安全机制扩展到视觉模态,解决跨模态安全对齐的挑战。
The Security Tensors dataset is designed for training trainable input vectors termed Security Tensors, which can be applied via text or visual modalities during inference to enhance the safety of Large Vision-Language Models (LVLMs). The dataset comprises malicious image-text pairs, contrastive benign pairs and general benign samples, aiming to train models to identify and reject harmful visual inputs while maintaining performance on benign tasks. Meticulously crafted, this dataset ensures that Security Tensors can effectively extend text-based security mechanisms to the visual modality, addressing the challenge of cross-modal security alignment.
数据集概述
数据集来源
- 数据集来源于论文《Security Tensors as a Cross-Modal Bridge: Extending Text-Aligned Safety to Vision in LVLM》的官方实现代码库。
数据集结构
Dataset/目录包含以下训练数据:- SA set(Safety-Aligned)
- TCB set(Text-Conditioned Benign)
- GB set(General Benign)
数据内容
- 图像数据:位于
Dataset/images/目录下。 - 标注文件:与图像对应的
.json文件,包含以下字段:pic_path:图像路径input:输入文本output:输出文本type:数据类型(SA set、TCB set 或 GB set)output_refuse:拒绝输出文本(仅 SA set 包含)
标签规则
- SA set:标签为
"output_refuse" - TCB set 和 GB set:标签为
"output"
数据用途
- 用于训练和评估大型视觉语言模型(LVLM)的文本和视觉安全向量("security tensors")。
模型支持
- 支持以下模型的训练和评估:
- LLaMA-3.2-vision
- LLaVA-1.5
- Qwen-VL
训练与评估
- 训练:模型特定的训练脚本位于各模型目录的
Training/子目录下。 - 评估:模型特定的评估脚本位于各模型目录的
Infer/子目录下。
安全层分析
- 包含分析安全向量如何激活 LVLM 安全层的脚本,位于
Safety_Layers_LVLM/目录下。
环境配置
- 提供
environment.yml文件用于复现实验环境。

- 1Security Tensors as a Cross-Modal Bridge: Extending Text-Aligned Safety to Vision in LVLM中国科学技术大学 · 2025年



