prithivMLmods commited on
Commit
0f8a1ff
·
verified ·
1 Parent(s): a7fa5e5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +83 -371
README.md CHANGED
@@ -1,277 +1,38 @@
1
- <link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Ubuntu+Mono:wght@400;700&display=swap" rel="stylesheet">
2
-
3
- <style>
4
- .vg-wrap {
5
- font-family: 'Ubuntu', sans-serif;
6
- background-color: #000000;
7
- color: #FFFFFF;
8
- max-width: 920px;
9
- margin: 0 auto;
10
- padding: 36px 30px;
11
- border: 1px solid #1a1a1a;
12
- border-radius: 14px;
13
- line-height: 1.65;
14
- box-sizing: border-box;
15
- }
16
-
17
- .vg-title {
18
- font-size: 34px;
19
- font-weight: 700;
20
- letter-spacing: -0.5px;
21
- margin: 0 0 18px 0;
22
- color: #FFFFFF;
23
- }
24
-
25
- .vg-lead {
26
- font-size: 15.5px;
27
- color: #FFFFFF;
28
- margin-bottom: 24px;
29
- }
30
-
31
- .vg-link {
32
- color: #FF4500;
33
- text-decoration: none;
34
- font-weight: 500;
35
- }
36
-
37
- .vg-link:hover {
38
- text-decoration: underline;
39
- }
40
-
41
- /* Blockquote as structured isolated box */
42
- .vg-notice-box {
43
- background: #000000;
44
- border: 1px solid #292929;
45
- border-left: 4px solid #444444;
46
- border-radius: 6px;
47
- padding: 16px 20px;
48
- margin: 24px 0 32px 0;
49
- font-size: 14px;
50
- color: #FFFFFF;
51
- }
52
-
53
- .vg-section-head {
54
- font-size: 21px;
55
- font-weight: 700;
56
- color: #FFFFFF;
57
- margin: 36px 0 16px 0;
58
- display: flex;
59
- align-items: center;
60
- gap: 8px;
61
- }
62
-
63
- /* Plus-style list formatting */
64
- .vg-bullet-list {
65
- list-style: none;
66
- padding: 0;
67
- margin: 0 0 24px 0;
68
- }
69
-
70
- .vg-bullet-list li {
71
- position: relative;
72
- padding-left: 22px;
73
- margin-bottom: 12px;
74
- font-size: 14.5px;
75
- color: #FFFFFF;
76
- }
77
-
78
- .vg-bullet-list li::before {
79
- content: "+";
80
- position: absolute;
81
- left: 0;
82
- top: 0;
83
- color: #FFFFFF;
84
- font-weight: 700;
85
- font-size: 16px;
86
- line-height: 1.4;
87
- }
88
-
89
- /* Expandable / Dropdown sections */
90
- .vg-accordion {
91
- border: 1px solid #222222;
92
- border-radius: 8px;
93
- margin-bottom: 22px;
94
- background-color: #000000;
95
- overflow: hidden;
96
- }
97
-
98
- .vg-accordion-summary {
99
- list-style: none;
100
- padding: 16px 20px;
101
- font-size: 16px;
102
- font-weight: 700;
103
- color: #FFFFFF;
104
- cursor: pointer;
105
- display: flex;
106
- justify-content: space-between;
107
- align-items: center;
108
- user-select: none;
109
- background: #080808;
110
- border-bottom: 1px solid transparent;
111
- transition: background 0.2s;
112
- }
113
-
114
- .vg-accordion-summary::-webkit-details-marker {
115
- display: none;
116
- }
117
-
118
- .vg-accordion-summary:hover {
119
- background: #111111;
120
- }
121
-
122
- .vg-accordion[open] .vg-accordion-summary {
123
- border-bottom: 1px solid #222222;
124
- }
125
-
126
- .vg-accordion-summary::after {
127
- content: "+";
128
- font-size: 18px;
129
- font-weight: 700;
130
- color: #FFFFFF;
131
- transition: transform 0.2s ease;
132
- }
133
-
134
- .vg-accordion[open] .vg-accordion-summary::after {
135
- content: "−";
136
- }
137
-
138
- .vg-accordion-content {
139
- padding: 18px;
140
- background: #000000;
141
- }
142
-
143
- /* Code block shells & actions */
144
- .vg-code-wrapper {
145
- position: relative;
146
- background: #000000;
147
- border: 1px solid #242424;
148
- border-radius: 8px;
149
- margin-bottom: 20px;
150
- overflow: hidden;
151
- }
152
-
153
- .vg-code-topbar {
154
- display: flex;
155
- justify-content: space-between;
156
- align-items: center;
157
- background: #090909;
158
- padding: 8px 14px;
159
- border-bottom: 1px solid #1c1c1c;
160
- }
161
-
162
- .vg-code-label {
163
- font-size: 12px;
164
- font-family: 'Ubuntu Mono', monospace;
165
- text-transform: uppercase;
166
- letter-spacing: 0.8px;
167
- color: #FFFFFF;
168
- }
169
-
170
- .vg-copy-trigger {
171
- background: #181818;
172
- color: #FFFFFF;
173
- border: 1px solid #333333;
174
- border-radius: 4px;
175
- padding: 4px 10px;
176
- font-family: 'Ubuntu', sans-serif;
177
- font-size: 12px;
178
- cursor: pointer;
179
- transition: background 0.2s, border-color 0.2s;
180
- }
181
-
182
- .vg-copy-trigger:hover {
183
- background: #252525;
184
- border-color: #555555;
185
- }
186
-
187
- .vg-code-block {
188
- margin: 0;
189
- padding: 16px;
190
- overflow-x: auto;
191
- font-family: 'Ubuntu Mono', monospace;
192
- font-size: 13.5px;
193
- line-height: 1.55;
194
- color: #FFFFFF;
195
- white-space: pre;
196
- background: #000000;
197
- }
198
-
199
- /* Table styling */
200
- .vg-specs-table {
201
- width: 100%;
202
- border-collapse: collapse;
203
- margin: 10px 0 28px 0;
204
- font-size: 14px;
205
- }
206
-
207
- .vg-specs-table th,
208
- .vg-specs-table td {
209
- border: 1px solid #222222;
210
- padding: 12px 16px;
211
- text-align: left;
212
- color: #FFFFFF;
213
- }
214
-
215
- .vg-specs-table th {
216
- background-color: #080808;
217
- width: 32%;
218
- font-weight: 700;
219
- }
220
-
221
- .vg-specs-table td {
222
- background-color: #000000;
223
- }
224
-
225
- .vg-ack-entry {
226
- font-size: 14.5px;
227
- margin-bottom: 14px;
228
- color: #FFFFFF;
229
- line-height: 1.5;
230
- }
231
-
232
- .vg-divider {
233
- border: 0;
234
- height: 1px;
235
- background: #222222;
236
- margin: 32px 0;
237
- }
238
- </style>
239
-
240
- <div class="vg-wrap">
241
- <div class="vg-title">VisionGuardrail-4B</div>
242
-
243
- <div class="vg-lead">
244
- <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" class="vg-link">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.
245
- </div>
246
-
247
- <div class="vg-notice-box">
248
- 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.
249
  </div>
250
 
251
- <div class="vg-section-head">Key Highlights</div>
252
- <ul class="vg-bullet-list">
253
- <li><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</li>
254
- <li><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</li>
255
- <li><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</li>
256
- <li><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</li>
257
- <li><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>
258
- <li><b>Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</li>
259
- <li><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</li>
260
- <li><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</li>
261
- <li><b>Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</li>
262
- <li><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</li>
263
- <li><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</li>
264
  </ul>
265
 
266
- <details class="vg-accordion">
267
- <summary class="vg-accordion-summary">Standard Instruction</summary>
268
- <div class="vg-accordion-content">
269
- <div class="vg-code-wrapper">
270
- <div class="vg-code-topbar">
271
- <span class="vg-code-label">System Prompt &amp; Schema</span>
272
- <button class="vg-copy-trigger" onclick="handleCopy(this)">Copy</button>
273
- </div>
274
- <pre class="vg-code-block">You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
275
 
276
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
277
 
@@ -301,29 +62,21 @@ Output strictly valid JSON with no extra conversational text, commentary, or mar
301
  "reason": "&lt;Precise reason for classification based on clothing, exposure, pose, context, or other visual cues&gt;",
302
  "nsfw": 1 | 0,
303
  "safe": 1 | 0
304
- }</pre>
305
- </div>
306
  </div>
307
  </details>
308
 
309
- <details class="vg-accordion">
310
- <summary class="vg-accordion-summary">Quick Start with Transformers</summary>
311
- <div class="vg-accordion-content">
312
- <div class="vg-code-wrapper">
313
- <div class="vg-code-topbar">
314
- <span class="vg-code-label">Bash Installation</span>
315
- <button class="vg-copy-trigger" onclick="handleCopy(this)">Copy</button>
316
- </div>
317
- <pre class="vg-code-block">pip install transformers
318
- pip install accelerate</pre>
319
- </div>
320
 
321
- <div class="vg-code-wrapper">
322
- <div class="vg-code-topbar">
323
- <span class="vg-code-label">Python Inference</span>
324
- <button class="vg-copy-trigger" onclick="handleCopy(this)">Copy</button>
325
- </div>
326
- <pre class="vg-code-block">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
327
  import torch
328
 
329
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
@@ -374,93 +127,52 @@ output_text = processor.batch_decode(
374
  clean_up_tokenization_spaces=False
375
  )
376
 
377
- print(output_text[0])</pre>
378
- </div>
379
- </div>
380
- </details>
381
 
382
- <div class="vg-section-head">Training Details</div>
383
- <table class="vg-specs-table">
384
- <tr><th>Setting</th><td>Value</td></tr>
385
- <tr><th>Base Model</th><td>Qwen/Qwen3.5-4B</td></tr>
386
- <tr><th>Model</th><td>VisionGuardrail-4B</td></tr>
387
- <tr><th>Model Type</th><td>Multimodal Content-Safety Classifier</td></tr>
388
- <tr><th>Training Dataset</th><td>prithivMLmods/ImageShield-Guardrail-Pro</td></tr>
389
- <tr><th>Training Objective</th><td>Content-safety guardrail classification</td></tr>
390
- <tr><th>Primary Classification</th><td>Safe / Unsafe</td></tr>
391
- <tr><th>Safety Focus</th><td>Not Safe for Work (NSFW) Sensual Content</td></tr>
392
- <tr><th>Visual Analysis</th><td>Dress Codes, Poses, Exposure &amp; Settings</td></tr>
393
- <tr><th>Training Framework</th><td>TRL</td></tr>
 
394
  </table>
395
 
396
- <div class="vg-section-head">Intended Use</div>
397
- <ul class="vg-bullet-list">
398
- <li><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li>
399
- <li><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</li>
400
- <li><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</li>
401
- <li><b>Content Moderation</b>: Supporting automated safety classification pipelines.</li>
402
- <li><b>Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</li>
403
- <li><b>Guardrail Development</b>: Researching structured safety classification and filtering workflows.</li>
404
- <li><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</li>
405
  </ul>
406
 
407
- <div class="vg-section-head">Limitations</div>
408
- <ul class="vg-bullet-list">
409
- <li><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li>
410
- <li><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</li>
411
- <li><b>False Negatives</b>: Unsafe content may occasionally be missed.</li>
412
- <li><b>Context Sensitivity</b>: Classification performance depends on image quality, visual context, and the provided instruction.</li>
413
- <li><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>
414
- <li><b>Visual Ambiguity</b>: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.</li>
415
- <li><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</li>
416
  </ul>
417
 
418
- <hr class="vg-divider">
419
-
420
- <div class="vg-section-head">Acknowledgements</div>
421
- <div class="vg-ack-entry"><a href="https://huggingface.co/Qwen/Qwen3.5-4B" class="vg-link">Qwen/Qwen3.5-4B</a>: Base multimodal model used for this project.</div>
422
- <div class="vg-ack-entry"><a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" class="vg-link">ImageShield-Guardrail-Pro</a>: Content-safety guardrail dataset used for training VisionGuardrail-4B.</div>
423
- <div class="vg-ack-entry"><a href="https://huggingface.co/docs/trl/en/index" class="vg-link">TRL</a> – Transformers Reinforcement Learning: 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.</div>
424
- <div class="vg-ack-entry"><a href="https://huggingface.co/docs/transformers/en/index" class="vg-link">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.</div>
425
- </div>
426
-
427
- <script>
428
- function handleCopy(button) {
429
- const codeBlock = button.closest('.vg-code-wrapper').querySelector('.vg-code-block');
430
- if (!codeBlock) return;
431
-
432
- const textToCopy = codeBlock.innerText;
433
-
434
- if (navigator.clipboard && window.isSecureContext) {
435
- navigator.clipboard.writeText(textToCopy).then(() => setSuccessState(button)).catch(() => fallbackCopy(textToCopy, button));
436
- } else {
437
- fallbackCopy(textToCopy, button);
438
- }
439
- }
440
-
441
- function fallbackCopy(text, button) {
442
- const textArea = document.createElement("textarea");
443
- textArea.value = text;
444
- textArea.style.position = "fixed";
445
- textArea.style.opacity = "0";
446
- document.body.appendChild(textArea);
447
- textArea.focus();
448
- textArea.select();
449
- try {
450
- document.execCommand('copy');
451
- setSuccessState(button);
452
- } catch (err) {
453
- button.innerText = "Failed";
454
- setTimeout(() => { button.innerText = "Copy"; }, 2000);
455
- }
456
- document.body.removeChild(textArea);
457
- }
458
 
459
- function setSuccessState(button) {
460
- const originalText = button.innerText;
461
- button.innerText = "Copied!";
462
- setTimeout(() => {
463
- button.innerText = originalText;
464
- }, 2000);
465
- }
466
- </script>
 
1
+ <link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap" rel="stylesheet">
2
+ <div style="font-family: 'Ubuntu', sans-serif; background-color: #000000; color: #FFFFFF; padding: 30px; border-radius: 12px; max-width: 900px; margin: 0 auto; border: 1px solid #333333; line-height: 1.6;">
3
+
4
+ <h1 style="font-size: 32px; font-weight: 700; margin-top: 0; color: #FFFFFF; border-bottom: 1px solid #333; padding-bottom: 15px;">VisionGuardrail-4B</h1>
5
+
6
+ <p style="font-size: 16px; color: #FFFFFF;">
7
+ <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.
8
+ </p>
9
+
10
+ <div style="border: 1px solid #333333; padding: 16px; border-radius: 8px; margin: 24px 0; background-color: #0a0a0a;">
11
+ <p style="margin: 0; font-size: 14px; color: #FFFFFF; line-height: 1.5;">
12
+ 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.
13
+ </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  </div>
15
 
16
+ <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Key Highlights</h2>
17
+ <ul style="list-style: none; padding-left: 0; font-size: 15px; line-height: 1.8;">
18
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</li>
19
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</li>
20
+ <li style="margin-bottom: 10px;"><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>
21
+ <li style="margin-bottom: 10px;"><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>
22
+ <li style="margin-bottom: 10px;"><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>
23
+ <li style="margin-bottom: 10px;"><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>
24
+ <li style="margin-bottom: 10px;"><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>
25
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</li>
26
+ <li style="margin-bottom: 10px;"><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>
27
+ <li style="margin-bottom: 10px;"><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>
28
+ <li style="margin-bottom: 10px;"><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>
29
  </ul>
30
 
31
+ <details style="background-color: #0d0d0d; border: 1px solid #333333; border-radius: 8px; padding: 16px; margin-top: 32px; cursor: pointer;">
32
+ <summary style="font-size: 20px; font-weight: bold; color: #FFFFFF; outline: none;">Standard Instruction</summary>
33
+ <div style="margin-top: 16px; position: relative; border: 1px solid #333; border-radius: 8px; background-color: #000000;">
34
+ <span style="position: absolute; top: 8px; right: 12px; background-color: #222; color: #aaa; padding: 4px 10px; border-radius: 4px; font-size: 12px; border: 1px solid #444; pointer-events: none;">Copy</span>
35
+ <pre style="padding: 16px; margin: 0; overflow-x: auto; font-family: 'Courier New', Courier, monospace; font-size: 13px; color: #FFFFFF; white-space: pre-wrap;"><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": "&lt;Precise reason for classification based on clothing, exposure, pose, context, or other visual cues&gt;",
63
  "nsfw": 1 | 0,
64
  "safe": 1 | 0
65
+ }</code></pre>
 
66
  </div>
67
  </details>
68
 
69
+ <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Quick Start with Transformers</h2>
70
+
71
+ <div style="position: relative; margin-top: 16px; border: 1px solid #333; border-radius: 8px; background-color: #000000;">
72
+ <span style="position: absolute; top: 8px; right: 12px; background-color: #222; color: #aaa; padding: 4px 10px; border-radius: 4px; font-size: 12px; border: 1px solid #444; pointer-events: none;">Copy</span>
73
+ <pre style="padding: 16px; margin: 0; overflow-x: auto; font-family: 'Courier New', Courier, monospace; font-size: 13px; color: #FFFFFF; white-space: pre-wrap;"><code>pip install transformers
74
+ pip install accelerate</code></pre>
75
+ </div>
 
 
 
 
76
 
77
+ <div style="position: relative; margin-top: 16px; border: 1px solid #333; border-radius: 8px; background-color: #000000;">
78
+ <span style="position: absolute; top: 8px; right: 12px; background-color: #222; color: #aaa; padding: 4px 10px; border-radius: 4px; font-size: 12px; border: 1px solid #444; pointer-events: none;">Copy</span>
79
+ <pre style="padding: 16px; margin: 0; overflow-x: auto; font-family: 'Courier New', Courier, monospace; font-size: 13px; color: #FFFFFF; white-space: pre-wrap;"><code>from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
 
 
 
80
  import torch
81
 
82
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
 
127
  clean_up_tokenization_spaces=False
128
  )
129
 
130
+ print(output_text[0])</code></pre>
131
+ </div>
 
 
132
 
133
+ <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Training Details</h2>
134
+ <table style="width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px;">
135
+ <tbody>
136
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Base Model</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;"><a href="https://huggingface.co/Qwen/Qwen3.5-4B" style="color: #FF4500; text-decoration: none;">Qwen/Qwen3.5-4B</a></td></tr>
137
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Model</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;">VisionGuardrail-4B</td></tr>
138
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Model Type</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;">Multimodal Content-Safety Classifier</td></tr>
139
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Training Dataset</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;"><a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">prithivMLmods/ImageShield-Guardrail-Pro</a></td></tr>
140
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Training Objective</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;">Content-safety guardrail classification</td></tr>
141
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Primary Classification</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;">Safe / Unsafe</td></tr>
142
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Safety Focus</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;">Not Safe for Work (NSFW) Sensual Content</td></tr>
143
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Visual Analysis</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;">Dress Codes, Poses, Exposure & Settings</td></tr>
144
+ <tr><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF; font-weight: bold;">Training Framework</td><td style="border: 1px solid #333; padding: 12px; color: #FFFFFF;"><a href="https://huggingface.co/docs/trl/en/index" style="color: #FF4500; text-decoration: none;">TRL</a></td></tr>
145
+ </tbody>
146
  </table>
147
 
148
+ <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Intended Use</h2>
149
+ <ul style="list-style: none; padding-left: 0; font-size: 15px; line-height: 1.8;">
150
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li>
151
+ <li style="margin-bottom: 10px;"><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>
152
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</li>
153
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Content Moderation</b>: Supporting automated safety classification pipelines.</li>
154
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</li>
155
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Guardrail Development</b>: Researching structured safety classification and filtering workflows.</li>
156
+ <li style="margin-bottom: 10px;"><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>
157
  </ul>
158
 
159
+ <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Limitations</h2>
160
+ <ul style="list-style: none; padding-left: 0; font-size: 15px; line-height: 1.8;">
161
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li>
162
+ <li style="margin-bottom: 10px;"><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>
163
+ <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>False Negatives</b>: Unsafe content may occasionally be missed.</li>
164
+ <li style="margin-bottom: 10px;"><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>
165
+ <li style="margin-bottom: 10px;"><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>
166
+ <li style="margin-bottom: 10px;"><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>
167
+ <li style="margin-bottom: 10px;"><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>
168
  </ul>
169
 
170
+ <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Acknowledgements</h2>
171
+ <ul style="list-style: none; padding-left: 0; font-size: 15px; line-height: 1.8;">
172
+ <li style="margin-bottom: 10px;"><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>
173
+ <li style="margin-bottom: 10px;"><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>
174
+ <li style="margin-bottom: 10px;"><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>
175
+ <li style="margin-bottom: 10px;"><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>
176
+ </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
 
178
+ </div>