prithivMLmods commited on
Commit
f8010fb
·
verified ·
1 Parent(s): 1b2aa6a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +158 -84
README.md CHANGED
@@ -4,37 +4,73 @@ base_model:
4
  - Qwen/Qwen3.5-4B
5
  ---
6
 
7
- <div style="font-family: 'Ubuntu', 'Segoe UI', Roboto, sans-serif; background-color: #000000; color: #FFFFFF; padding: 30px; border-radius: 12px; line-height: 1.6;">
8
 
9
- <h1 style="color: #FFFFFF; font-weight: 700; font-size: 28px; border-bottom: 1px solid #333; padding-bottom: 10px; margin-top: 0;">VisionGuardrail-4B</h1>
10
-
11
- <p style="font-size: 16px;">
12
- <b style="color: #FFFFFF;">VisionGuardrail-4B</b> is a multimodal content-safety classifier based on <b style="color: #FFFFFF;">Qwen/Qwen3.5-4B</b> and trained on the <a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">prithivMLmods/ImageShield-Guardrail-Pro</a> content-safety guardrail dataset. The model is designed to classify visual content as <b style="color: #FFFFFF;">Safe</b> or <b style="color: #FFFFFF;">Unsafe</b>, with a particular focus on detecting <b style="color: #FFFFFF;">Not Safe for Work (NSFW) sensual content</b> and other potentially sensitive visual content. VisionGuardrail-4B excels at detecting <b style="color: #FFFFFF;">explicit and sensitive visual content</b>, with detailed analysis of <b style="color: #FFFFFF;">dress codes, clothing exposure, poses, framing, and different visual settings</b> to support conservative content-safety classification.
13
  </p>
14
 
15
- <div style="background-color: #111; border: 1px solid #333; border-left: 4px solid #FF4500; padding: 15px; border-radius: 4px; margin: 20px 0; color: #FFFFFF;">
16
- This model is an experimental release and may generate unexpected behaviors or reasoning artifacts in certain scenarios. <b style="color: #FFFFFF;">This model is intended for research and content-safety classification only.</b> 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.
17
- </div>
18
 
19
- <h2 style="color: #FFFFFF; font-weight: 700; font-size: 22px; margin-top: 30px; border-bottom: 1px solid #333; padding-bottom: 5px;">Key Highlights</h2>
20
- <ul style="list-style-type: none; padding-left: 0; color: #FFFFFF; font-size: 15px;">
21
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Qwen 3.5 Foundation</b>: Built on <b style="color: #FFFFFF;">Qwen/Qwen3.5-4B</b>.</li>
22
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Multimodal Content Filter</b>: Designed for visual content-safety classification.</li>
23
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b style="color: #FFFFFF;">prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</li>
24
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Safe / Unsafe Classification</b>: Classifies visual content as either <b style="color: #FFFFFF;">Safe</b> or <b style="color: #FFFFFF;">Unsafe</b>.</li>
25
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">NSFW Sensual Content Detection</b>: Focused on identifying potentially <b style="color: #FFFFFF;">Not Safe for Work (NSFW) sensual content</b> and related sensitive visual material.</li>
26
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</li>
27
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</li>
28
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</li>
29
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</li>
30
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</li>
31
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  </ul>
33
 
34
- <h2 style="color: #FFFFFF; font-weight: 700; font-size: 22px; margin-top: 30px; border-bottom: 1px solid #333; padding-bottom: 5px;">Standard Instruction</h2>
35
- <div style="position: relative; background-color: #111; border: 1px solid #333; border-radius: 4px; margin: 15px 0;">
36
- <button style="position: absolute; top: 8px; right: 8px; background-color: #333; color: #FFF; border: none; padding: 4px 8px; border-radius: 3px; cursor: pointer; font-family: 'Ubuntu', sans-serif; font-size: 12px;" onclick="copyCode(this)">Copy</button>
37
- <pre style="margin: 0; padding: 15px; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;"><code style="color: #FFFFFF; font-family: 'Ubuntu Mono', monospace; font-size: 14px;">You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
 
 
38
 
39
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
40
 
@@ -59,24 +95,29 @@ STRICT ZERO-TOLERANCE CLASSIFICATION RULES:
59
  Output strictly valid JSON with no extra conversational text, commentary, or markdown formatting outside the JSON object:
60
 
61
  {
62
- "caption": "<Detailed, objective visual description of the subject, clothing, exposure, pose, and setting>",
63
  "is_nsfw": true | false,
64
- "reason": "<Precise reason for classification based on clothing, exposure, pose, context, or other visual cues>",
65
  "nsfw": 1 | 0,
66
  "safe": 1 | 0
67
- }</code></pre>
 
68
  </div>
69
 
70
- <h2 style="color: #FFFFFF; font-weight: 700; font-size: 22px; margin-top: 30px; border-bottom: 1px solid #333; padding-bottom: 5px;">Quick Start with Transformers</h2>
71
- <div style="position: relative; background-color: #111; border: 1px solid #333; border-radius: 4px; margin: 15px 0;">
72
- <button style="position: absolute; top: 8px; right: 8px; background-color: #333; color: #FFF; border: none; padding: 4px 8px; border-radius: 3px; cursor: pointer; font-family: 'Ubuntu', sans-serif; font-size: 12px;" onclick="copyCode(this)">Copy</button>
73
- <pre style="margin: 0; padding: 15px; overflow-x: auto;"><code style="color: #FFFFFF; font-family: 'Ubuntu Mono', monospace; font-size: 14px;">pip install transformers
74
- pip install accelerate</code></pre>
 
 
 
75
  </div>
76
 
77
- <div style="position: relative; background-color: #111; border: 1px solid #333; border-radius: 4px; margin: 15px 0;">
78
- <button style="position: absolute; top: 8px; right: 8px; background-color: #333; color: #FFF; border: none; padding: 4px 8px; border-radius: 3px; cursor: pointer; font-family: 'Ubuntu', sans-serif; font-size: 12px;" onclick="copyCode(this)">Copy</button>
79
- <pre style="margin: 0; padding: 15px; overflow-x: auto;"><code style="color: #FFFFFF; font-family: 'Ubuntu Mono', monospace; font-size: 14px;">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
 
80
  import torch
81
 
82
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
@@ -127,63 +168,96 @@ output_text = processor.batch_decode(
127
  clean_up_tokenization_spaces=False
128
  )
129
 
130
- print(output_text[0])</code></pre>
 
131
  </div>
132
 
133
- <hr style="border: 0; border-top: 1px solid #333; margin: 30px 0;">
134
 
135
- <h2 style="color: #FFFFFF; font-weight: 700; font-size: 22px; margin-top: 30px; border-bottom: 1px solid #333; padding-bottom: 5px;">Training Details</h2>
136
- <table style="width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 14px; color: #FFFFFF;">
137
  <tbody>
138
- <tr style="border-bottom: 1px solid #333;"><td style="padding: 10px; font-weight: bold; width: 35%;">Base Model</td><td style="padding: 10px;"><b style="color: #FFFFFF;">Qwen/Qwen3.5-4B</b></td></tr>
139
- <tr style="border-bottom: 1px solid #333;"><td style="padding: 10px; font-weight: bold;">Model</td><td style="padding: 10px;"><b style="color: #FFFFFF;">VisionGuardrail-4B</b></td></tr>
140
- <tr style="border-bottom: 1px solid #333;"><td style="padding: 10px; font-weight: bold;">Model Type</td><td style="padding: 10px;"><b style="color: #FFFFFF;">Multimodal Content-Safety Classifier</b></td></tr>
141
- <tr style="border-bottom: 1px solid #333;"><td style="padding: 10px; font-weight: bold;">Training Dataset</td><td style="padding: 10px;"><b style="color: #FFFFFF;">prithivMLmods/ImageShield-Guardrail-Pro</b></td></tr>
142
- <tr style="border-bottom: 1px solid #333;"><td style="padding: 10px; font-weight: bold;">Training Objective</td><td style="padding: 10px;"><b style="color: #FFFFFF;">Content-safety guardrail classification</b></td></tr>
143
- <tr style="border-bottom: 1px solid #333;"><td style="padding: 10px; font-weight: bold;">Primary Classification</td><td style="padding: 10px;"><b style="color: #FFFFFF;">Safe / Unsafe</b></td></tr>
144
- <tr style="border-bottom: 1px solid #333;"><td style="padding: 10px; font-weight: bold;">Safety Focus</td><td style="padding: 10px;"><b style="color: #FFFFFF;">Not Safe for Work (NSFW) Sensual Content</b></td></tr>
145
- <tr style="border-bottom: 1px solid #333;"><td style="padding: 10px; font-weight: bold;">Visual Analysis</td><td style="padding: 10px;"><b style="color: #FFFFFF;">Dress Codes, Poses, Exposure & Settings</b></td></tr>
146
- <tr><td style="padding: 10px; font-weight: bold;">Training Framework</td><td style="padding: 10px;"><b style="color: #FFFFFF;">TRL</b></td></tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  </tbody>
148
  </table>
149
 
150
- <h2 style="color: #FFFFFF; font-weight: 700; font-size: 22px; margin-top: 30px; border-bottom: 1px solid #333; padding-bottom: 5px;">Intended Use</h2>
151
- <ul style="list-style-type: none; padding-left: 0; color: #FFFFFF; font-size: 15px;">
152
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li>
153
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</li>
154
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Parental Controls</b>: Building conservative visual content-safety filtering systems.</li>
155
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Content Moderation</b>: Supporting automated safety classification pipelines.</li>
156
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</li>
157
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Guardrail Development</b>: Researching structured safety classification and filtering workflows.</li>
158
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</li>
 
159
  </ul>
160
 
161
- <h2 style="color: #FFFFFF; font-weight: 700; font-size: 22px; margin-top: 30px; border-bottom: 1px solid #333; padding-bottom: 5px;">Limitations</h2>
162
- <ul style="list-style-type: none; padding-left: 0; color: #FFFFFF; font-size: 15px;">
163
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li>
164
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</li>
165
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">False Negatives</b>: Unsafe content may occasionally be missed.</li>
166
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Context Sensitivity</b>: Classification performance depends on image quality, visual context, and the provided instruction.</li>
167
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Conservative Policy</b>: The model intentionally uses a strict classification threshold and may flag content that would not be considered NSFW under less restrictive moderation policies.</li>
168
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Visual Ambiguity</b>: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.</li>
169
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</li>
 
170
  </ul>
171
 
172
- <h2 style="color: #FFFFFF; font-weight: 700; font-size: 22px; margin-top: 30px; border-bottom: 1px solid #333; padding-bottom: 5px;">Acknowledgements</h2>
173
- <ul style="list-style-type: none; padding-left: 0; color: #FFFFFF; font-size: 15px;">
174
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <a href="https://huggingface.co/Qwen/Qwen3.5-4B" style="color: #FF4500; text-decoration: none;">Qwen/Qwen3.5-4B</a>: Base multimodal model used for this project.</li>
175
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">ImageShield-Guardrail-Pro</a>: Content-safety guardrail dataset used for training VisionGuardrail-4B.</li>
176
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <b style="color: #FFFFFF;">TRL</b> – <a href="https://huggingface.co/docs/trl/en/index" style="color: #FF4500; text-decoration: none;">Transformers Reinforcement Learning</a>: TRL is a full-stack library providing tools to train transformer language models with methods including Supervised Fine-Tuning (SFT), Group Relative Policy Optimization (GRPO), Direct Preference Optimization (DPO), Reward Modeling, and more.</li>
177
- <li style="padding-left: 25px; position: relative; margin-bottom: 10px;"><span style="position: absolute; left: 0; color: #FF4500; font-weight: bold;">+</span> <a href="https://huggingface.co/docs/transformers/en/index" style="color: #FF4500; text-decoration: none;">Transformers</a>: Transformers provides state-of-the-art machine learning models for text, computer vision, audio, video, and multimodal tasks, supporting both inference and training.</li>
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  </ul>
179
- </div>
180
-
181
- <script>
182
- function copyCode(btn) {
183
- const code = btn.parentElement.querySelector('code').innerText;
184
- navigator.clipboard.writeText(code).then(() => {
185
- btn.innerText = 'Copied!';
186
- setTimeout(() => { btn.innerText = 'Copy'; }, 2000);
187
- });
188
- }
189
- </script>
 
4
  - Qwen/Qwen3.5-4B
5
  ---
6
 
7
+ <div style="font-family: 'Ubuntu', 'Segoe UI', Roboto, sans-serif; background-color: #000000; color: #FFFFFF; padding: 40px; border-radius: 12px; max-width: 900px; margin: 0 auto;">
8
 
9
+ <h1 style="font-size: 2.5em; font-weight: 700; border-bottom: 2px solid #333; padding-bottom: 10px; margin-top: 0; color: #FFFFFF;">VisionGuardrail-4B</h1>
10
+
11
+ <p style="line-height: 1.6; font-size: 1.1em;">
12
+ <b>VisionGuardrail-4B</b> is a multimodal content-safety classifier based on <b>Qwen/Qwen3.5-4B</b> and trained on the <a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">prithivMLmods/ImageShield-Guardrail-Pro</a> content-safety guardrail dataset. The model is designed to classify visual content as <b>Safe</b> or <b>Unsafe</b>, with a particular focus on detecting <b>Not Safe for Work (NSFW) sensual content</b> and other potentially sensitive visual content. VisionGuardrail-4B excels at detecting <b>explicit and sensitive visual content</b>, with detailed analysis of <b>dress codes, clothing exposure, poses, framing, and different visual settings</b> to support conservative content-safety classification.
13
  </p>
14
 
15
+ <blockquote style="border: 1px solid #555; padding: 15px 20px; margin: 25px 0; border-radius: 6px; color: #FFFFFF; font-style: normal;">
16
+ This model is an experimental release and may generate unexpected behaviors or reasoning artifacts in certain scenarios. <b>This model is intended for research and content-safety classification only.</b> 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.
17
+ </blockquote>
18
 
19
+ <h2 style="font-size: 1.8em; font-weight: 600; margin-top: 40px; border-bottom: 1px solid #333; padding-bottom: 8px; color: #FFFFFF;">Key Highlights</h2>
20
+
21
+ <ul style="list-style: none; padding: 0; margin-top: 15px;">
22
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
23
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
24
+ <b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.
25
+ </li>
26
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
27
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
28
+ <b>Multimodal Content Filter</b>: Designed for visual content-safety classification.
29
+ </li>
30
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
31
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
32
+ <b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.
33
+ </li>
34
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
35
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
36
+ <b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.
37
+ </li>
38
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
39
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
40
+ <b>NSFW Sensual Content Detection</b>: Focused on identifying potentially <b>Not Safe for Work (NSFW) sensual content</b> and related sensitive visual material.
41
+ </li>
42
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
43
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
44
+ <b>Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.
45
+ </li>
46
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
47
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
48
+ <b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.
49
+ </li>
50
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
51
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
52
+ <b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.
53
+ </li>
54
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
55
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
56
+ <b>Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.
57
+ </li>
58
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
59
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
60
+ <b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.
61
+ </li>
62
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
63
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
64
+ <b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.
65
+ </li>
66
  </ul>
67
 
68
+ <h2 style="font-size: 1.8em; font-weight: 600; margin-top: 40px; border-bottom: 1px solid #333; padding-bottom: 8px; color: #FFFFFF;">Standard Instruction</h2>
69
+
70
+ <div style="position: relative; margin: 20px 0;">
71
+ <button style="position: absolute; top: 8px; right: 8px; background: #222; color: #FFF; border: 1px solid #555; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;">Copy</button>
72
+ <pre style="background-color: #111111; border: 1px solid #333333; border-radius: 8px; padding: 40px 20px 20px 20px; overflow-x: auto; margin: 0;"><code style="color: #FFFFFF; font-family: 'Ubuntu Mono', 'Courier New', monospace; font-size: 14px; line-height: 1.5;">
73
+ You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
74
 
75
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
76
 
 
95
  Output strictly valid JSON with no extra conversational text, commentary, or markdown formatting outside the JSON object:
96
 
97
  {
98
+ "caption": "&lt;Detailed, objective visual description of the subject, clothing, exposure, pose, and setting&gt;",
99
  "is_nsfw": true | false,
100
+ "reason": "&lt;Precise reason for classification based on clothing, exposure, pose, context, or other visual cues&gt;",
101
  "nsfw": 1 | 0,
102
  "safe": 1 | 0
103
+ }
104
+ </code></pre>
105
  </div>
106
 
107
+ <h2 style="font-size: 1.8em; font-weight: 600; margin-top: 40px; border-bottom: 1px solid #333; padding-bottom: 8px; color: #FFFFFF;">Quick Start with Transformers</h2>
108
+
109
+ <div style="position: relative; margin: 20px 0;">
110
+ <button style="position: absolute; top: 8px; right: 8px; background: #222; color: #FFF; border: 1px solid #555; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;">Copy</button>
111
+ <pre style="background-color: #111111; border: 1px solid #333333; border-radius: 8px; padding: 40px 20px 20px 20px; overflow-x: auto; margin: 0;"><code style="color: #FFFFFF; font-family: 'Ubuntu Mono', 'Courier New', monospace; font-size: 14px; line-height: 1.5;">
112
+ pip install transformers
113
+ pip install accelerate
114
+ </code></pre>
115
  </div>
116
 
117
+ <div style="position: relative; margin: 20px 0;">
118
+ <button style="position: absolute; top: 8px; right: 8px; background: #222; color: #FFF; border: 1px solid #555; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;">Copy</button>
119
+ <pre style="background-color: #111111; border: 1px solid #333333; border-radius: 8px; padding: 40px 20px 20px 20px; overflow-x: auto; margin: 0;"><code style="color: #FFFFFF; font-family: 'Ubuntu Mono', 'Courier New', monospace; font-size: 14px; line-height: 1.5;">
120
+ from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
121
  import torch
122
 
123
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
 
168
  clean_up_tokenization_spaces=False
169
  )
170
 
171
+ print(output_text[0])
172
+ </code></pre>
173
  </div>
174
 
175
+ <h2 style="font-size: 1.8em; font-weight: 600; margin-top: 40px; border-bottom: 1px solid #333; padding-bottom: 8px; color: #FFFFFF;">Training Details</h2>
176
 
177
+ <table style="width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 1em;">
 
178
  <tbody>
179
+ <tr style="border-bottom: 1px solid #333;">
180
+ <td style="padding: 12px; font-weight: bold; width: 30%; border-right: 1px solid #333;">Base Model</td>
181
+ <td style="padding: 12px;"><b>Qwen/Qwen3.5-4B</b></td>
182
+ </tr>
183
+ <tr style="border-bottom: 1px solid #333;">
184
+ <td style="padding: 12px; font-weight: bold; border-right: 1px solid #333;">Model</td>
185
+ <td style="padding: 12px;"><b>VisionGuardrail-4B</b></td>
186
+ </tr>
187
+ <tr style="border-bottom: 1px solid #333;">
188
+ <td style="padding: 12px; font-weight: bold; border-right: 1px solid #333;">Model Type</td>
189
+ <td style="padding: 12px;"><b>Multimodal Content-Safety Classifier</b></td>
190
+ </tr>
191
+ <tr style="border-bottom: 1px solid #333;">
192
+ <td style="padding: 12px; font-weight: bold; border-right: 1px solid #333;">Training Dataset</td>
193
+ <td style="padding: 12px;"><b>prithivMLmods/ImageShield-Guardrail-Pro</b></td>
194
+ </tr>
195
+ <tr style="border-bottom: 1px solid #333;">
196
+ <td style="padding: 12px; font-weight: bold; border-right: 1px solid #333;">Training Objective</td>
197
+ <td style="padding: 12px;"><b>Content-safety guardrail classification</b></td>
198
+ </tr>
199
+ <tr style="border-bottom: 1px solid #333;">
200
+ <td style="padding: 12px; font-weight: bold; border-right: 1px solid #333;">Primary Classification</td>
201
+ <td style="padding: 12px;"><b>Safe / Unsafe</b></td>
202
+ </tr>
203
+ <tr style="border-bottom: 1px solid #333;">
204
+ <td style="padding: 12px; font-weight: bold; border-right: 1px solid #333;">Safety Focus</td>
205
+ <td style="padding: 12px;"><b>Not Safe for Work (NSFW) Sensual Content</b></td>
206
+ </tr>
207
+ <tr style="border-bottom: 1px solid #333;">
208
+ <td style="padding: 12px; font-weight: bold; border-right: 1px solid #333;">Visual Analysis</td>
209
+ <td style="padding: 12px;"><b>Dress Codes, Poses, Exposure & Settings</b></td>
210
+ </tr>
211
+ <tr>
212
+ <td style="padding: 12px; font-weight: bold; border-right: 1px solid #333;">Training Framework</td>
213
+ <td style="padding: 12px;"><b>TRL</b></td>
214
+ </tr>
215
  </tbody>
216
  </table>
217
 
218
+ <h2 style="font-size: 1.8em; font-weight: 600; margin-top: 40px; border-bottom: 1px solid #333; padding-bottom: 8px; color: #FFFFFF;">Intended Use</h2>
219
+
220
+ <ul style="list-style: none; padding: 0; margin-top: 15px;">
221
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li>
222
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</li>
223
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</li>
224
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Content Moderation</b>: Supporting automated safety classification pipelines.</li>
225
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</li>
226
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Guardrail Development</b>: Researching structured safety classification and filtering workflows.</li>
227
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</li>
228
  </ul>
229
 
230
+ <h2 style="font-size: 1.8em; font-weight: 600; margin-top: 40px; border-bottom: 1px solid #333; padding-bottom: 8px; color: #FFFFFF;">Limitations</h2>
231
+
232
+ <ul style="list-style: none; padding: 0; margin-top: 15px;">
233
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li>
234
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</li>
235
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>False Negatives</b>: Unsafe content may occasionally be missed.</li>
236
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Context Sensitivity</b>: Classification performance depends on image quality, visual context, and the provided instruction.</li>
237
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Conservative Policy</b>: The model intentionally uses a strict classification threshold and may flag content that would not be considered NSFW under less restrictive moderation policies.</li>
238
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Visual Ambiguity</b>: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.</li>
239
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;"><span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span> <b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</li>
240
  </ul>
241
 
242
+ <h2 style="font-size: 1.8em; font-weight: 600; margin-top: 40px; border-bottom: 1px solid #333; padding-bottom: 8px; color: #FFFFFF;">Acknowledgements</h2>
243
+
244
+ <ul style="list-style: none; padding: 0; margin-top: 15px;">
245
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
246
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
247
+ <a href="https://huggingface.co/Qwen/Qwen3.5-4B" style="color: #FF4500; text-decoration: none;">Qwen/Qwen3.5-4B</a>: Base multimodal model used for this project.
248
+ </li>
249
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
250
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
251
+ <a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">ImageShield-Guardrail-Pro</a>: Content-safety guardrail dataset used for training VisionGuardrail-4B.
252
+ </li>
253
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
254
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
255
+ <b>TRL</b> – <a href="https://huggingface.co/docs/trl/en/index" style="color: #FF4500; text-decoration: none;">Transformers Reinforcement Learning</a>: TRL is a full-stack library providing tools to train transformer language models with methods including Supervised Fine-Tuning (SFT), Group Relative Policy Optimization (GRPO), Direct Preference Optimization (DPO), Reward Modeling, and more.
256
+ </li>
257
+ <li style="margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.5;">
258
+ <span style="position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: bold;">+</span>
259
+ <a href="https://huggingface.co/docs/transformers/en/index" style="color: #FF4500; text-decoration: none;">Transformers</a>: Transformers provides state-of-the-art machine learning models for text, computer vision, audio, video, and multimodal tasks, supporting both inference and training.
260
+ </li>
261
  </ul>
262
+
263
+ </div>