File size: 12,114 Bytes
de3a220
5669d81
 
2069f2d
5669d81
 
 
 
 
 
 
 
 
 
 
 
 
 
81d22da
de3a220
 
5669d81
 
 
91fdedc
5669d81
c87d1e2
 
78c8813
 
c87d1e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
---
tags:
- text-generation-inference
- experimental
- mtp
- image-classification
- VIGOR
- VisionGuard
- qwen3.5-9B
- JSON
- content-safety
- content-moderation
- multimodal
- safety-classifier
- guardrail
- visual-safety
- multimodal-content-filter
- uncensored
- flash
base_model:
- Qwen/Qwen3.5-9B
license: apache-2.0
language:
- en
pipeline_tag: image-text-to-text
library_name: transformers
---

![1](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/WFdxC_SFfu__1obm_-Mik.png)

# **VIGOR-flash**

> **VIGOR-flash (Vision Intelligence and Guardrail Oriented Reasoning)** is a dense 9-billion-parameter multimodal vision classification model based on **Qwen/Qwen3.5-9B**. It is designed for visual content-safety analysis and conservative Safe / NSFW classification, with a particular focus on identifying potentially sensitive, revealing, provocative, and sexually suggestive visual content. VIGOR-flash performs detailed visual analysis of clothing, dress codes, body exposure, poses, framing, and contextual settings to support structured content-safety decisions.

> [!IMPORTANT]
> MTP — Speculative Decoding: Yes | Template Defaults — Best (thinking off), Reasoning (thinking on) | Support — Content Safety Classifications

> [!IMPORTANT]
> This model is intended for research and content-safety classification only. Any outputs generated by this model are the sole responsibility of the user. The authors and hosting platform disclaim all liability for generated content. Users must ensure safe, ethical, and lawful usage.

## **Key Highlights**

* **Qwen 3.5 Foundation**: Built on **Qwen/Qwen3.5-9B**.
* **Dense 9B Architecture**: A dense 9-billion-parameter multimodal model.
* **VIGOR Architecture**: Vision Intelligence and Guardrail Oriented Reasoning.
* **Multimodal Image Classification**: Designed for visual content-safety classification and image analysis.
* **Safe / NSFW Classification**: Classifies visual content as either **Safe** or **NSFW**.
* **NSFW Sensual Content Detection**: Focuses on identifying potentially Not Safe for Work (NSFW) sensual content and related sensitive visual material.
* **Explicit & Sensitive Content Detection**: Designed to identify explicit, revealing, provocative, and otherwise potentially sensitive visual content.
* **Dress-Code Analysis**: Performs detailed analysis of clothing, coverage, exposure, and revealing garments.
* **Pose Analysis**: Analyzes body poses, positioning, framing, and potentially suggestive presentation.
* **Context & Setting Analysis**: Considers visual settings and contextual cues when determining content safety.
* **Conservative Safety Classification**: Uses a strict classification policy that favors safety when visual content is ambiguous.
* **Structured Output**: Produces machine-readable JSON containing scene descriptions, classification results, and reasoning.
* **MTP Tensor Preservation**: Preserves Multi-Token Prediction (MTP) tensors for faster speculative decoding and accelerated local inference.

## **Standard Prompt**

```text
You are a strict content-safety guardrail classifier for images designed for parental control and minor protection.

Your task is to analyze the image thoroughly, provide a detailed visual description, and classify whether the image is safe or unsafe (NSFW).

Enforce a strict zero-tolerance threshold:
- Any form of nudity, exposed breasts, buttocks, or genitalia must be classified as NSFW.
- Partial nudity, revealing underwear, lingerie, suggestive swimwear, or see-through clothing must be classified as NSFW.
- Anime nudes, ecchi, hentai, 2D/3D adult illustrations, suggestive manga art, and sexualized poses must be classified as NSFW.
- Explicit sexual acts, fetish material, or overt sexual positioning must be classified as NSFW.
- When in doubt, classify as NSFW.

Output strictly valid JSON with no extra conversational text or markdown code blocks outside the JSON format. Use exactly these keys in this order:
{
  "scene_description": "<Detailed, objective description of the subject, clothing, exposure, and pose>",
  "is_nsfw": true | false,
  "classification_reason": "<Precise reason for the classification based on clothing, exposure, or pose>",
  "nsfw": 1 | 0,
  "safe": 1 | 0
}

Field constraints:
- "is_nsfw" must be a JSON boolean (true or false), never a string.
- "nsfw" and "safe" must be JSON integers (1 or 0) and complementary: if is_nsfw is true then nsfw = 1 and safe = 0; if is_nsfw is false then nsfw = 0 and safe = 1.
```

> [!NOTE]
> When using Transformers inference, the Standard Prompt is optional. Simple instructions such as `"Classify this image as safe or nsfw."` can be used to obtain a classification. The Standard Prompt is primarily intended for GGUF quantizations and other inference implementations.

## **Quick Start with Transformers**

```bash
pip install transformers
pip install accelerate
```

```python
from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
import torch

# Load the model on the available device(s)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
    "prithivMLmods/VIGOR-flash",
    dtype="auto",
    device_map="auto"
)

# Recommended: Enable Flash Attention 2 for better acceleration
# and memory efficiency, especially in multi-image scenarios.
#
# model = Qwen3_5ForConditionalGeneration.from_pretrained(
#     "prithivMLmods/VIGOR-flash",
#     dtype=torch.bfloat16,
#     attn_implementation="flash_attention_2",
#     device_map="auto",
# )

processor = AutoProcessor.from_pretrained("prithivMLmods/VIGOR-flash")

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "image": "https://path/to/your/image.jpg",
            },
            {
                "type": "text",
                "text": "Classify this image as safe or nsfw."
            },
        ],
    }
]

# Prepare inputs for inference
inputs = processor.apply_chat_template(
    messages,
    tokenize=True,
    add_generation_prompt=True,
    return_dict=True,
    return_tensors="pt"
)

inputs = inputs.to(model.device)

# Generate the model output
generated_ids = model.generate(
    **inputs,
    max_new_tokens=256
)

generated_ids_trimmed = [
    out_ids[len(in_ids):]
    for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]

output_text = processor.batch_decode(
    generated_ids_trimmed,
    skip_special_tokens=True,
    clean_up_tokenization_spaces=False
)

print(output_text[0])
```

## **Sample Outputs**

**Safe Classification**

```json
{
  "scene_description": "Two young Rottweiler puppies are playfully wrestling on a grassy lawn scattered with fallen leaves. The puppy on top has its mouth open, gently biting the other's head, while the second puppy lies on its back with its paws raised in the air.",
  "is_nsfw": false,
  "classification_reason": "The image depicts two playful dogs engaging in natural canine play behavior. There is no evidence of nudity, revealing swimwear, suggestive poses, or other elements that would indicate an NSFW classification.",
  "nsfw": 0,
  "safe": 1
}
```

**Safe Classification**

```json
{
  "scene_description": "A middle-aged man with a beard stands in a kitchen, wearing a white t-shirt and grey pants. He is actively cooking, holding a frying pan over a gas stove while another pan sits on the burner containing food. The room has warm lighting coming from above, highlighting the cooking activity.",
  "is_nsfw": false,
  "classification_reason": "The image depicts a standard domestic scene focused on cooking. The subject is dressed in casual, everyday attire suitable for a home environment. There is no evidence of nudity, revealing swimwear, suggestive poses, or other content that would trigger the NSFW classification criteria.",
  "nsfw": 0,
  "safe": 1
}
```

**NSFW Classification**

```json
{
  "scene_description": "A blonde woman wearing sunglasses and a patterned skirt stands outdoors in a park setting, embracing another person whose upper body is largely exposed. The woman's attire includes pink bikini bottoms and a sheer, semi-transparent top that reveals significant areas of her torso.",
  "is_nsfw": true,
  "classification_reason": "The image contains significant exposure and suggestive elements. The central figure wears a sheer, see-through top with substantial body exposure and bikini bottoms. These visual elements meet the conservative NSFW classification criteria.",
  "nsfw": 1,
  "safe": 0
}
```

## **Intended Use**

* **Multimodal Image Classification**: Classifying visual media as Safe or NSFW.
* **Content Safety Classification**: Supporting automated visual content-safety classification.
* **NSFW Sensual Content Detection**: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.
* **Parental Controls**: Building conservative visual content-safety filtering systems.
* **Content Moderation**: Supporting automated image moderation pipelines.
* **Multimodal Safety Research**: Evaluating content-safety behavior in multimodal language models.
* **Guardrail Development**: Researching structured safety classification and filtering workflows.
* **Visual Safety Analysis**: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.

## **Limitations**

* **Experimental Model**: VIGOR-flash may produce incorrect or inconsistent classifications.
* **False Positives**: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.
* **False Negatives**: Unsafe content may occasionally be missed.
* **Context Sensitivity**: Classification performance depends on image quality, visual context, and the provided instruction.
* **Conservative Policy**: The model intentionally uses a strict classification threshold and may flag content that would not be considered NSFW under less restrictive moderation policies.
* **Visual Ambiguity**: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.
* **Computational Requirements**: As a dense 9-billion-parameter multimodal model, VIGOR-flash requires computational resources, although it is smaller than the 27B VIGOR variant.
* **Automated Classification**: Model predictions should not be treated as definitive legal, professional, or safety determinations.

## **License and Attributions**

* **Base Model**: [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) - The foundational multimodal model used for VIGOR-flash.

* **Previous Variant**: [prithivMLmods/OneDecision-VisionGuard-9B-SFT](https://huggingface.co/prithivMLmods/OneDecision-VisionGuard-9B-SFT).

* **Classification Improvements**: VIGOR-flash introduces improvements targeting marginal False Positive (FP / Type I Error) and False Negative (FN / Type II Error) classification errors, aiming for more reliable and consistent visual content-safety decisions.

* **MTP Tensor Preservation**: Multi-Token Prediction (MTP) tensors are preserved in this release to support faster Speculative Decoding. This enables speculative decoding directly with the model weights, significantly accelerating local inference.

* **TRL** – [Transformers Reinforcement Learning](https://huggingface.co/docs/trl/en/index): A full-stack library providing tools for training transformer language models using methods including Supervised Fine-Tuning (SFT), Group Relative Policy Optimization (GRPO), Direct Preference Optimization (DPO), and Reward Modeling.

* **Transformers** – [Hugging Face Transformers](https://huggingface.co/docs/transformers/en/index): Provides state-of-the-art machine learning models for text, computer vision, audio, video, and multimodal tasks, supporting both inference and training.

* **Developed by**: [prithivMLmods](https://huggingface.co/prithivMLmods).

* **License**: VIGOR-flash follows the **Apache 2.0** license of its base model, [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B), subject to the applicable model and component licensing terms.