prithivMLmods commited on
Commit
0bfb34e
·
verified ·
1 Parent(s): 4c85e41

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +121 -148
README.md CHANGED
@@ -1,54 +1,38 @@
1
- ---
2
- tags:
3
- - text-generation-inference
4
- ---
5
- <style>
6
- @import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&family=Ubuntu+Mono:wght@400;700&display=swap');
7
-
8
- .vg-container, .vg-container * {
9
- font-family: 'Ubuntu', sans-serif;
10
- }
11
-
12
- .vg-code, .vg-code * {
13
- font-family: 'Ubuntu Mono', 'Courier New', monospace !important;
14
- line-height: 1.45 !important;
15
- }
16
- </style>
17
-
18
- <div class="vg-container" style="background-color: #000000; color: #FFFFFF; padding: 24px; max-width: 900px; margin: 0 auto; line-height: 1.6; border-radius: 8px;">
19
 
20
- <h1 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 0;">VisionGuardrail-4B</h1>
21
 
22
  <p style="color: #FFFFFF;">
23
- <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.
24
  </p>
25
 
26
- <div style="border: 1px solid #444444; padding: 16px; margin: 20px 0; color: #FFFFFF; background-color: #000000; border-radius: 4px;">
27
- 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.
 
 
28
  </div>
29
 
30
- <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Key Highlights</h2>
31
-
32
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</span></div>
33
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</span></div>
34
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</span></div>
35
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</span></div>
36
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>NSFW Sensual Content Detection</b>: Focused on identifying potentially <b>Not Safe for Work (NSFW) sensual content</b> and related sensitive visual material.</span></div>
37
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</span></div>
38
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</span></div>
39
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</span></div>
40
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</span></div>
41
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</span></div>
42
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</span></div>
43
-
44
- <details style="border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden; background-color: #000000;">
45
- <summary style="padding: 12px 16px; cursor: pointer; color: #FFFFFF !important; font-weight: 500; background-color: #111111; list-style: none; display: flex; justify-content: space-between; font-family: 'Ubuntu', sans-serif;">Standard Instruction</summary>
46
- <div style="background-color: #000000; border: none; border-radius: 0; margin: 0; overflow: hidden;">
47
- <div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; font-size: 12px; color: #888888; display: flex; justify-content: space-between; align-items: center; font-family: 'Ubuntu', sans-serif;">
48
- <span>text</span>
49
- <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
50
- </div>
51
- <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px;">You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
52
 
53
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
54
 
@@ -78,27 +62,22 @@ Output strictly valid JSON with no extra conversational text, commentary, or mar
78
  "reason": "<Precise reason for classification based on clothing, exposure, pose, context, or other visual cues>",
79
  "nsfw": 1 | 0,
80
  "safe": 1 | 0
81
- }</pre>
 
82
  </div>
83
  </details>
84
 
85
- <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Quick Start with Transformers</h2>
86
 
87
- <div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;">
88
- <div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; font-size: 12px; color: #888888; display: flex; justify-content: space-between; align-items: center; font-family: 'Ubuntu', sans-serif;">
89
- <span>bash</span>
90
- <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
91
- </div>
92
- <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px;">pip install transformers
93
- pip install accelerate</pre>
94
  </div>
95
 
96
- <div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;">
97
- <div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; font-size: 12px; color: #888888; display: flex; justify-content: space-between; align-items: center; font-family: 'Ubuntu', sans-serif;">
98
- <span>python</span>
99
- <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
100
- </div>
101
- <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px;">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
102
  import torch
103
 
104
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
@@ -149,96 +128,90 @@ output_text = processor.batch_decode(
149
  clean_up_tokenization_spaces=False
150
  )
151
 
152
- print(output_text[0])</pre>
153
  </div>
154
 
155
- <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Training Details</h2>
156
-
157
- <div style="border: 1px solid #333333; border-radius: 4px; margin: 20px 0; overflow: hidden;">
158
- <table style="width: 100%; border-collapse: collapse; color: #FFFFFF;">
159
- <tbody>
160
- <tr>
161
- <td style="padding: 12px; background-color: #111111; font-weight: 500; width: 35%; color: #FFFFFF; border-bottom: 1px solid #333333;">Base Model</td>
162
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333; border-left: 1px solid #333333;">Qwen/Qwen3.5-4B</td>
163
- </tr>
164
- <tr>
165
- <td style="padding: 12px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333;">Model</td>
166
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333; border-left: 1px solid #333333;">VisionGuardrail-4B</td>
167
- </tr>
168
- <tr>
169
- <td style="padding: 12px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333;">Model Type</td>
170
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333; border-left: 1px solid #333333;">Multimodal Content-Safety Classifier</td>
171
- </tr>
172
- <tr>
173
- <td style="padding: 12px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333;">Training Dataset</td>
174
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333; border-left: 1px solid #333333;">prithivMLmods/ImageShield-Guardrail-Pro</td>
175
- </tr>
176
- <tr>
177
- <td style="padding: 12px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333;">Training Objective</td>
178
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333; border-left: 1px solid #333333;">Content-safety guardrail classification</td>
179
- </tr>
180
- <tr>
181
- <td style="padding: 12px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333;">Primary Classification</td>
182
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333; border-left: 1px solid #333333;">Safe / Unsafe</td>
183
- </tr>
184
- <tr>
185
- <td style="padding: 12px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333;">Safety Focus</td>
186
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333; border-left: 1px solid #333333;">Not Safe for Work (NSFW) Sensual Content</td>
187
- </tr>
188
- <tr>
189
- <td style="padding: 12px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333;">Visual Analysis</td>
190
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333; border-left: 1px solid #333333;">Dress Codes, Poses, Exposure & Settings</td>
191
- </tr>
192
- <tr>
193
- <td style="padding: 12px; background-color: #111111; font-weight: 500; color: #FFFFFF;">Training Framework</td>
194
- <td style="padding: 12px; background-color: #000000; color: #FFFFFF; border-left: 1px solid #333333;">TRL</td>
195
- </tr>
196
- </tbody>
197
- </table>
198
- </div>
199
-
200
- <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Intended Use</h2>
201
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</span></div>
202
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</span></div>
203
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</span></div>
204
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Content Moderation</b>: Supporting automated safety classification pipelines.</span></div>
205
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</span></div>
206
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Guardrail Development</b>: Researching structured safety classification and filtering workflows.</span></div>
207
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</span></div>
208
-
209
- <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Limitations</h2>
210
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</span></div>
211
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</span></div>
212
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>False Negatives</b>: Unsafe content may occasionally be missed.</span></div>
213
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Context Sensitivity</b>: Classification performance depends on image quality, visual context, and the provided instruction.</span></div>
214
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><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.</span></div>
215
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Visual Ambiguity</b>: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.</span></div>
216
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</span></div>
217
-
218
- <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Acknowledgements</h2>
219
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><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.</span></div>
220
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><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.</span></div>
221
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><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.</span></div>
222
- <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><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.</span></div>
223
-
224
- </div>
225
-
226
- <script>
227
- function copyCode(btn) {
228
- const codeBlock = btn.parentElement.nextElementSibling;
229
- const textArea = document.createElement('textarea');
230
- textArea.value = codeBlock.innerText;
231
- document.body.appendChild(textArea);
232
- textArea.select();
233
- try {
234
- document.execCommand('copy');
235
  btn.innerText = 'Copied!';
236
- setTimeout(() => {
237
- btn.innerText = 'Copy';
238
- }, 2000);
239
- } catch (err) {
240
- console.error('Failed to copy text: ', err);
241
  }
242
- document.body.removeChild(textArea);
243
- }
244
- </script>
 
1
+ <div style="font-family: 'Ubuntu', 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #000000; color: #FFFFFF; padding: 24px; border: 1px solid #333333; max-width: 800px; margin: 0 auto; line-height: 1.6;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
+ <h1 style="color: #FFFFFF; margin-top: 0; border-bottom: 1px solid #333333; padding-bottom: 10px;">VisionGuardrail-4B</h1>
4
 
5
  <p style="color: #FFFFFF;">
6
+ <b>VisionGuardrail-4B</b> is a multimodal content-safety classifier based on <a href="https://huggingface.co/Qwen/Qwen3.5-4B" style="color: #FF4500; text-decoration: none;">Qwen/Qwen3.5-4B</a> 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.
7
  </p>
8
 
9
+ <div style="border: 1px solid #444444; padding: 15px; margin: 20px 0; background-color: #111111;">
10
+ <p style="margin: 0; color: #FFFFFF;">
11
+ 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.
12
+ </p>
13
  </div>
14
 
15
+ <h2 style="color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 5px;">Key Highlights</h2>
16
+ <ul style="list-style: none; padding-left: 0; color: #FFFFFF;">
17
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</li>
18
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</li>
19
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</li>
20
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</li>
21
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>NSFW Sensual Content Detection</b>: Focused on identifying potentially <b>Not Safe for Work (NSFW) sensual content</b> and related sensitive visual material.</li>
22
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</li>
23
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</li>
24
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</li>
25
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</li>
26
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</li>
27
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</li>
28
+ </ul>
29
+
30
+ <details style="background-color: #111111; border: 1px solid #333333; margin-bottom: 20px;">
31
+ <summary style="color: #FFFFFF; cursor: pointer; padding: 10px; font-weight: bold;">Standard Instruction</summary>
32
+ <div style="padding: 15px; border-top: 1px solid #333333;">
33
+ <div style="position: relative; background-color: #0a0a0a; border: 1px solid #333333; padding: 15px; margin-top: 10px;">
34
+ <button onclick="copyCode(this)" style="position: absolute; top: 5px; right: 5px; background: #333333; color: #FFFFFF; border: 1px solid #555555; padding: 4px 8px; cursor: pointer; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
35
+ <pre style="margin: 0; white-space: pre-wrap; color: #FFFFFF;"><code>You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
 
36
 
37
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
38
 
 
62
  "reason": "<Precise reason for classification based on clothing, exposure, pose, context, or other visual cues>",
63
  "nsfw": 1 | 0,
64
  "safe": 1 | 0
65
+ }</code></pre>
66
+ </div>
67
  </div>
68
  </details>
69
 
70
+ <h2 style="color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 5px;">Quick Start with Transformers</h2>
71
 
72
+ <div style="position: relative; background-color: #0a0a0a; border: 1px solid #333333; padding: 15px; margin-bottom: 20px;">
73
+ <button onclick="copyCode(this)" style="position: absolute; top: 5px; right: 5px; background: #333333; color: #FFFFFF; border: 1px solid #555555; padding: 4px 8px; cursor: pointer; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
74
+ <pre style="margin: 0; white-space: pre-wrap; color: #FFFFFF;"><code>pip install transformers
75
+ pip install accelerate</code></pre>
 
 
 
76
  </div>
77
 
78
+ <div style="position: relative; background-color: #0a0a0a; border: 1px solid #333333; padding: 15px; margin-bottom: 20px;">
79
+ <button onclick="copyCode(this)" style="position: absolute; top: 5px; right: 5px; background: #333333; color: #FFFFFF; border: 1px solid #555555; padding: 4px 8px; cursor: pointer; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
80
+ <pre style="margin: 0; white-space: pre-wrap; color: #FFFFFF;"><code>from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
 
 
 
81
  import torch
82
 
83
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
 
128
  clean_up_tokenization_spaces=False
129
  )
130
 
131
+ print(output_text[0])</code></pre>
132
  </div>
133
 
134
+ <h2 style="color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 5px;">Training Details</h2>
135
+
136
+ <table style="width: 100%; border-collapse: collapse; margin-bottom: 20px; color: #FFFFFF; border: 1px solid #333333;">
137
+ <tr style="background-color: #111111;">
138
+ <th style="border: 1px solid #333333; padding: 8px; text-align: left;">Setting</th>
139
+ <th style="border: 1px solid #333333; padding: 8px; text-align: left;">Value</th>
140
+ </tr>
141
+ <tr>
142
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Base Model</b></td>
143
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Qwen/Qwen3.5-4B</b></td>
144
+ </tr>
145
+ <tr>
146
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Model</b></td>
147
+ <td style="border: 1px solid #333333; padding: 8px;"><b>VisionGuardrail-4B</b></td>
148
+ </tr>
149
+ <tr>
150
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Model Type</b></td>
151
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Multimodal Content-Safety Classifier</b></td>
152
+ </tr>
153
+ <tr>
154
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Training Dataset</b></td>
155
+ <td style="border: 1px solid #333333; padding: 8px;"><b>prithivMLmods/ImageShield-Guardrail-Pro</b></td>
156
+ </tr>
157
+ <tr>
158
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Training Objective</b></td>
159
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Content-safety guardrail classification</b></td>
160
+ </tr>
161
+ <tr>
162
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Primary Classification</b></td>
163
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Safe / Unsafe</b></td>
164
+ </tr>
165
+ <tr>
166
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Safety Focus</b></td>
167
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Not Safe for Work (NSFW) Sensual Content</b></td>
168
+ </tr>
169
+ <tr>
170
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Visual Analysis</b></td>
171
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Dress Codes, Poses, Exposure & Settings</b></td>
172
+ </tr>
173
+ <tr>
174
+ <td style="border: 1px solid #333333; padding: 8px;"><b>Training Framework</b></td>
175
+ <td style="border: 1px solid #333333; padding: 8px;"><b>TRL</b></td>
176
+ </tr>
177
+ </table>
178
+
179
+ <h2 style="color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 5px;">Intended Use</h2>
180
+ <ul style="list-style: none; padding-left: 0; color: #FFFFFF;">
181
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li>
182
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</li>
183
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</li>
184
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Content Moderation</b>: Supporting automated safety classification pipelines.</li>
185
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</li>
186
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Guardrail Development</b>: Researching structured safety classification and filtering workflows.</li>
187
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</li>
188
+ </ul>
189
+
190
+ <h2 style="color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 5px;">Limitations</h2>
191
+ <ul style="list-style: none; padding-left: 0; color: #FFFFFF;">
192
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li>
193
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</li>
194
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>False Negatives</b>: Unsafe content may occasionally be missed.</li>
195
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Context Sensitivity</b>: Classification performance depends on image quality, visual context, and the provided instruction.</li>
196
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</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>
197
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Visual Ambiguity</b>: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.</li>
198
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</li>
199
+ </ul>
200
+
201
+ <h2 style="color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 5px;">Acknowledgements</h2>
202
+ <ul style="list-style: none; padding-left: 0; color: #FFFFFF;">
203
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</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>
204
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</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>
205
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><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.</li>
206
+ <li style="margin-bottom: 8px;"><span style="color: #FFFFFF; margin-right: 10px;">+</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>
207
+ </ul>
208
+
209
+ <script>
210
+ function copyCode(btn) {
211
+ const code = btn.nextElementSibling.innerText;
212
+ navigator.clipboard.writeText(code);
 
213
  btn.innerText = 'Copied!';
214
+ setTimeout(() => btn.innerText = 'Copy', 2000);
 
 
 
 
215
  }
216
+ </script>
217
+ </div>