Skip to content
KitploitKITPLOIT
أدواتالمدونة
إرسال
أدواتالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

··الخلاصات·اتصال·الخصوصية·© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
Learning-to-Detect — Detects unknown jailbreak attacks in large vision-language models using hidden state analysis and autoencoders, with training and evaluation pipelines for robust safety monitoring. | Kitploit
أدوات/GitHubGitHub/shuangliangx/learning-to-detect
Defensive ToolsVulnerability AnalysisMachine LearningAI SecurityAnomaly Detection
GitHubshuangliangx/learning-to-detect

Learning-to-Detect

Detects unknown jailbreak attacks in large vision-language models using hidden state analysis and autoencoders, with training and evaluation pipelines for robust safety monitoring.

عرض المستودع

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →
مشاركة
148منذ 16 أياملم تتم المراجعة بعد
المحتوى غير متوفر باللغة المطلوبة. عرض النسخة الإنجليزية.

Learning to Detect Unknown Jailbreak Attacks in Large Vision-Language Models

Official implementation of “Learning to Detect Unknown Jailbreak Attacks in Large Vision-Language Models.”

This repository contains the data-processing, hidden-state extraction, classifier training, safety-pattern auto-encoder, and evaluation code used in the project.

Contents

  • Models
  • Repository Structure
  • Detection Pipeline
  • Datasets

Models

The experiments use the following base models:

  • LLaVA-v1.6-Vicuna-7B, a large vision-language model based on Vicuna.
  • Llama Guard 3 8B, a safety guardrail model used to assess generated responses.

Download the model weights separately and place them under:

root@kitploit:~
asset/weights/

Repository Structure

root@kitploit:~
.
├── asset/
│   ├── advbench/                 # AdvBench images
│   ├── harmbench/                # HarmBench DirectRequest images
│   ├── GQA/                      # GQA images
│   ├── HiddenStates/             # Extracted hidden states
│   └── weights/                  # Model weights (not included)
├── Benchmarks/                   # Evaluation benchmark metadata
├── vicuna/
│   ├── instructions/
│   │   ├── advbench.json
│   │   ├── GQA.json
│   │   └── harmbench.json        # HarmBench DirectRequest metadata
│   ├── qa.py
│   ├── qa-baseline.py
│   └── train.py
├── autoencoder.py
├── llama3_guard.py
└── test.py

Detection Pipeline

Some scripts use paths relative to their own working directory. Run the commands from the directories shown below.

1. Query the vision-language model

Query the model on the unsafe source data (AdvBench) and safe source data (GQA):

root@kitploit:~
cd vicuna
python qa.py --dataset advbench
python qa.py --dataset GQA
cd ..

The HarmBench DirectRequest data can be queried with the same interface:

root@kitploit:~
cd vicuna
python qa.py --dataset harmbench
cd ..

2. Assess and split model responses

Assess the generated AdvBench responses with Llama Guard 3:

root@kitploit:~
python llama3_guard.py --file vicuna/instructions/advbench.json

Create the AdvBench and GQA training/test splits:

root@kitploit:~
cd vicuna/instructions
python process.py
cd ../..

3. Extract hidden states

Extract hidden states for the evaluation benchmarks currently configured in vicuna/qa-baseline.py:

root@kitploit:~
cd vicuna
python qa-baseline.py
cd ..

4. Train and test the MSCAV classifiers

root@kitploit:~
cd vicuna
python train.py --train
python train.py --test
cd ..

5. Train the Safety Pattern Auto-Encoder (SPAE)

root@kitploit:~
python autoencoder.py

6. Evaluate detection performance

root@kitploit:~
python test.py

Datasets

Training and appendix data

The included HarmBench DirectRequest subset contains 320 image–request pairs. Image paths in harmbench.json are repository-relative and follow the same layout convention as AdvBench.

Evaluation benchmarks

Metadata for the included evaluation sets is stored in Benchmarks/, including HADES, JOOD, MML-m, MOAT, SEED, and SafetyBench variants.

External dataset resources:

  • MM-SafetyBench
  • HADES

Place any separately downloaded dataset assets under asset/ and keep the image paths in the corresponding JSON files consistent with the local directory layout.

تنزيل الأداة
DatasetRoleMetadataImages
AdvBenchUnsafe source datavicuna/instructions/advbench.jsonasset/advbench/
GQASafe source datavicuna/instructions/GQA.jsonasset/GQA/
HarmBench (DirectRequest)Unsafe-source experiment reported in the appendixvicuna/instructions/harmbench.jsonasset/harmbench/