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

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +205 -183
README.md CHANGED
@@ -1,170 +1,186 @@
1
- <link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,400;0,500;0,700;1,400&family=Ubuntu+Mono&display=swap" rel="stylesheet">
2
 
3
  <style>
4
- .vg-container {
5
  font-family: 'Ubuntu', sans-serif;
6
  background-color: #000000;
7
  color: #FFFFFF;
8
  max-width: 920px;
9
  margin: 0 auto;
10
- padding: 32px 24px;
 
 
11
  line-height: 1.65;
12
- }
13
-
14
- .vg-header {
15
- border-bottom: 2px solid #222222;
16
- padding-bottom: 16px;
17
- margin-bottom: 24px;
18
  }
19
 
20
  .vg-title {
21
- font-size: 32px;
22
  font-weight: 700;
23
- color: #FFFFFF;
24
- margin: 0 0 12px 0;
25
  letter-spacing: -0.5px;
 
 
26
  }
27
 
28
- .vg-description {
29
- font-size: 15px;
30
  color: #FFFFFF;
31
- margin: 0;
32
  }
33
 
34
  .vg-link {
35
  color: #FF4500;
36
  text-decoration: none;
37
  font-weight: 500;
38
- transition: opacity 0.2s ease;
39
  }
40
 
41
  .vg-link:hover {
42
  text-decoration: underline;
43
- opacity: 0.85;
44
  }
45
 
46
- .vg-notice-panel {
47
- background-color: #000000;
48
- border: 1px solid #333333;
49
- border-radius: 8px;
 
 
50
  padding: 16px 20px;
51
- margin: 24px 0;
52
  font-size: 14px;
53
  color: #FFFFFF;
54
  }
55
 
56
- .vg-section-title {
57
- font-size: 20px;
58
  font-weight: 700;
59
  color: #FFFFFF;
60
  margin: 36px 0 16px 0;
61
- text-transform: uppercase;
62
- letter-spacing: 0.5px;
63
  display: flex;
64
  align-items: center;
 
65
  }
66
 
67
- .vg-section-title::after {
68
- content: "";
69
- flex: 1;
70
- height: 1px;
71
- background-color: #222222;
72
- margin-left: 16px;
73
- }
74
-
75
- .vg-plus-list {
76
  list-style: none;
77
- padding-left: 0;
78
  margin: 0 0 24px 0;
79
  }
80
 
81
- .vg-plus-list li {
82
  position: relative;
83
- padding-left: 24px;
84
  margin-bottom: 12px;
85
- font-size: 15px;
86
  color: #FFFFFF;
87
  }
88
 
89
- .vg-plus-list li::before {
90
  content: "+";
91
- color: #FF4500;
92
  position: absolute;
93
  left: 0;
 
 
94
  font-weight: 700;
95
- font-size: 18px;
96
- line-height: 1.2;
97
  }
98
 
99
- .vg-dropdown {
100
- border: 1px solid #333333;
 
101
  border-radius: 8px;
102
- margin-bottom: 24px;
103
  background-color: #000000;
 
104
  }
105
 
106
- .vg-dropdown-summary {
107
- padding: 14px 18px;
108
- font-size: 15px;
 
109
  font-weight: 700;
110
- cursor: pointer;
111
  color: #FFFFFF;
112
- outline: none;
113
- user-select: none;
114
  display: flex;
115
  justify-content: space-between;
116
  align-items: center;
 
 
 
 
117
  }
118
 
119
- .vg-dropdown-summary::-webkit-details-marker {
120
  display: none;
121
  }
122
 
123
- .vg-dropdown-summary::after {
 
 
 
 
 
 
 
 
124
  content: "+";
125
- color: #FF4500;
126
  font-size: 18px;
127
  font-weight: 700;
 
 
128
  }
129
 
130
- .vg-dropdown[open] .vg-dropdown-summary::after {
131
  content: "−";
132
  }
133
 
 
 
 
 
 
 
134
  .vg-code-wrapper {
135
  position: relative;
136
- border: 1px solid #222222;
 
137
  border-radius: 8px;
138
- background-color: #000000;
139
  margin-bottom: 20px;
140
  overflow: hidden;
141
  }
142
 
 
 
 
 
 
 
 
 
 
143
  .vg-code-label {
144
- padding: 8px 16px;
145
- background-color: #080808;
146
- border-bottom: 1px solid #222222;
147
- font-family: 'Ubuntu Mono', monospace;
148
  font-size: 12px;
 
 
 
149
  color: #FFFFFF;
150
  }
151
 
152
- .vg-copy-btn {
153
- position: absolute;
154
- top: 6px;
155
- right: 8px;
156
- background-color: #000000;
157
  color: #FFFFFF;
158
  border: 1px solid #333333;
159
  border-radius: 4px;
160
  padding: 4px 10px;
161
  font-family: 'Ubuntu', sans-serif;
162
- font-size: 11px;
163
  cursor: pointer;
164
- transition: border-color 0.2s ease;
165
  }
166
 
167
- .vg-copy-btn:hover {
 
168
  border-color: #555555;
169
  }
170
 
@@ -174,98 +190,104 @@
174
  overflow-x: auto;
175
  font-family: 'Ubuntu Mono', monospace;
176
  font-size: 13.5px;
 
177
  color: #FFFFFF;
178
- line-height: 1.5;
179
- background-color: #000000;
180
  }
181
 
182
- .vg-table-container {
183
- border: 1px solid #222222;
184
- border-radius: 8px;
185
- overflow: hidden;
186
- margin-bottom: 28px;
187
- }
188
-
189
- .vg-spec-table {
190
  width: 100%;
191
  border-collapse: collapse;
 
192
  font-size: 14px;
193
- background-color: #000000;
194
- text-align: left;
195
  }
196
 
197
- .vg-spec-table th,
198
- .vg-spec-table td {
199
- padding: 12px 18px;
200
- border-bottom: 1px solid #222222;
 
201
  color: #FFFFFF;
202
  }
203
 
204
- .vg-spec-table tr:last-child th,
205
- .vg-spec-table tr:last-child td {
206
- border-bottom: none;
 
207
  }
208
 
209
- .vg-spec-table th {
210
- width: 35%;
211
- font-weight: 700;
212
- background-color: #050505;
 
 
 
 
 
213
  }
214
 
215
- .vg-ack-container {
216
- margin-bottom: 16px;
 
 
 
217
  }
218
  </style>
219
 
220
- <div class="vg-container">
221
- <div class="vg-header">
222
- <h1 class="vg-title">VisionGuardrail-4B</h1>
223
- <p class="vg-description">
224
- <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" target="_blank" rel="noopener noreferrer">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.
225
- </p>
226
  </div>
227
 
228
- <div class="vg-notice-panel">
229
  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.
230
  </div>
231
 
232
- <div class="vg-section-title">Key Highlights</div>
233
- <ul class="vg-plus-list">
234
  <li><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</li>
235
  <li><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</li>
236
- <li><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" class="vg-link" target="_blank" rel="noopener noreferrer">prithivMLmods/ImageShield-Guardrail-Pro</a> content-safety guardrail dataset.</li>
237
  <li><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</li>
238
  <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>
239
- <li><b>Explicit &amp; Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</li>
240
  <li><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</li>
241
  <li><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</li>
242
- <li><b>Context &amp; Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</li>
243
  <li><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</li>
244
  <li><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</li>
245
  </ul>
246
 
247
- <div class="vg-section-title">Standard Instruction</div>
248
- <details class="vg-dropdown">
249
- <summary class="vg-dropdown-summary">View Guardrail Zero-Tolerance System Prompt</summary>
250
- <div class="vg-code-wrapper" style="border: none; border-top: 1px solid #222222; border-radius: 0; margin-bottom: 0;">
251
- <button class="vg-copy-btn" onclick="vgCopyCode(this)">Copy</button>
252
- <pre class="vg-code-block">You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
 
 
 
253
 
254
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
255
 
256
  STRICT ZERO-TOLERANCE CLASSIFICATION RULES:
257
 
258
- 1. Nudity &amp; Exposure: Any full or partial nudity, exposed breasts, cleavage, buttocks, groin, or visible pubic area MUST be classified as NSFW.
259
 
260
- 2. Underwear &amp; Swimwear: Thongs, G-strings, micro-bikinis, skimpy or revealing swimwear, bras, panties, lingerie, see-through clothing, or unbuttoned tops revealing undergarments or bare torsos MUST be classified as NSFW.
261
 
262
  3. Dress-Code Analysis: Carefully analyze clothing, coverage, transparency, exposure, and the overall dress code. Revealing or sexually provocative clothing MUST be classified as NSFW.
263
 
264
- 4. Poses &amp; Suggestiveness: Sexually suggestive poses, seductive modeling, cleavage-emphasizing framing, fetish content, or explicit erotic themes MUST be classified as NSFW.
265
 
266
- 5. Context &amp; Setting: Consider the visual setting, composition, framing, and contextual cues when evaluating potentially sensitive content.
267
 
268
- 6. Artwork &amp; Animation: Anime nudes, ecchi, hentai, suggestive illustrations, or 2D/3D stylized erotica MUST be classified as NSFW.
269
 
270
  7. Sensitive Visual Content: Explicit or highly suggestive visual content MUST be classified as NSFW even when presented in non-photorealistic or artistic formats.
271
 
@@ -280,22 +302,28 @@ Output strictly valid JSON with no extra conversational text, commentary, or mar
280
  "nsfw": 1 | 0,
281
  "safe": 1 | 0
282
  }</pre>
 
283
  </div>
284
  </details>
285
 
286
- <div class="vg-section-title">Quick Start with Transformers</div>
287
-
288
- <div class="vg-code-wrapper">
289
- <div class="vg-code-label">bash</div>
290
- <button class="vg-copy-btn" onclick="vgCopyCode(this)">Copy</button>
291
- <pre class="vg-code-block">pip install transformers
 
 
 
292
  pip install accelerate</pre>
293
- </div>
294
-
295
- <div class="vg-code-wrapper">
296
- <div class="vg-code-label">python</div>
297
- <button class="vg-copy-btn" onclick="vgCopyCode(this)">Copy</button>
298
- <pre class="vg-code-block">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
 
 
299
  import torch
300
 
301
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
@@ -347,28 +375,26 @@ output_text = processor.batch_decode(
347
  )
348
 
349
  print(output_text[0])</pre>
350
- </div>
351
-
352
- <div class="vg-section-title">Training Details</div>
353
- <div class="vg-table-container">
354
- <table class="vg-spec-table">
355
- <tbody>
356
- <tr><th>Setting</th><td>Value</td></tr>
357
- <tr><th>Base Model</th><td>Qwen/Qwen3.5-4B</td></tr>
358
- <tr><th>Model</th><td>VisionGuardrail-4B</td></tr>
359
- <tr><th>Model Type</th><td>Multimodal Content-Safety Classifier</td></tr>
360
- <tr><th>Training Dataset</th><td><a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" class="vg-link" target="_blank" rel="noopener noreferrer">prithivMLmods/ImageShield-Guardrail-Pro</a></td></tr>
361
- <tr><th>Training Objective</th><td>Content-safety guardrail classification</td></tr>
362
- <tr><th>Primary Classification</th><td>Safe / Unsafe</td></tr>
363
- <tr><th>Safety Focus</th><td>Not Safe for Work (NSFW) Sensual Content</td></tr>
364
- <tr><th>Visual Analysis</th><td>Dress Codes, Poses, Exposure &amp; Settings</td></tr>
365
- <tr><th>Training Framework</th><td>TRL</td></tr>
366
- </tbody>
367
- </table>
368
- </div>
369
 
370
- <div class="vg-section-title">Intended Use</div>
371
- <ul class="vg-plus-list">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  <li><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li>
373
  <li><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</li>
374
  <li><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</li>
@@ -378,8 +404,8 @@ print(output_text[0])</pre>
378
  <li><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</li>
379
  </ul>
380
 
381
- <div class="vg-section-title">Limitations</div>
382
- <ul class="vg-plus-list">
383
  <li><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li>
384
  <li><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</li>
385
  <li><b>False Negatives</b>: Unsafe content may occasionally be missed.</li>
@@ -389,56 +415,52 @@ print(output_text[0])</pre>
389
  <li><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</li>
390
  </ul>
391
 
392
- <div class="vg-section-title">Acknowledgements</div>
393
- <div class="vg-ack-container">
394
- <ul class="vg-plus-list">
395
- <li><a href="https://huggingface.co/Qwen/Qwen3.5-4B" class="vg-link" target="_blank" rel="noopener noreferrer">Qwen/Qwen3.5-4B</a>: Base multimodal model used for this project.</li>
396
- <li><a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" class="vg-link" target="_blank" rel="noopener noreferrer">ImageShield-Guardrail-Pro</a>: Content-safety guardrail dataset used for training VisionGuardrail-4B.</li>
397
- <li><b>TRL</b> – <a href="https://huggingface.co/docs/trl/en/index" class="vg-link" target="_blank" rel="noopener noreferrer">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>
398
- <li><a href="https://huggingface.co/docs/transformers/en/index" class="vg-link" target="_blank" rel="noopener noreferrer">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>
399
- </ul>
400
- </div>
401
  </div>
402
 
403
  <script>
404
- function vgCopyCode(btn) {
405
- var wrapper = btn.closest('.vg-code-wrapper');
406
- var codeElement = wrapper.querySelector('.vg-code-block');
407
- var textToCopy = codeElement.innerText;
408
-
 
409
  if (navigator.clipboard && window.isSecureContext) {
410
- navigator.clipboard.writeText(textToCopy).then(function() {
411
- showSuccess(btn);
412
- }).catch(function() {
413
- fallbackCopy(textToCopy, btn);
414
- });
415
  } else {
416
- fallbackCopy(textToCopy, btn);
417
  }
418
  }
419
 
420
- function fallbackCopy(text, btn) {
421
- var textArea = document.createElement("textarea");
422
  textArea.value = text;
423
  textArea.style.position = "fixed";
424
- textArea.style.left = "-999999px";
425
- textArea.style.top = "-999999px";
426
  document.body.appendChild(textArea);
427
  textArea.focus();
428
  textArea.select();
429
  try {
430
  document.execCommand('copy');
431
- showSuccess(btn);
432
  } catch (err) {
433
- btn.innerText = "Error";
 
434
  }
435
  document.body.removeChild(textArea);
436
  }
437
 
438
- function showSuccess(btn) {
439
- btn.innerText = "Copied!";
440
- setTimeout(function() {
441
- btn.innerText = "Copy";
 
442
  }, 2000);
443
  }
444
  </script>
 
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
 
 
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
 
278
  STRICT ZERO-TOLERANCE CLASSIFICATION RULES:
279
 
280
+ 1. Nudity & Exposure: Any full or partial nudity, exposed breasts, cleavage, buttocks, groin, or visible pubic area MUST be classified as NSFW.
281
 
282
+ 2. Underwear & Swimwear: Thongs, G-strings, micro-bikinis, skimpy or revealing swimwear, bras, panties, lingerie, see-through clothing, or unbuttoned tops revealing undergarments or bare torsos MUST be classified as NSFW.
283
 
284
  3. Dress-Code Analysis: Carefully analyze clothing, coverage, transparency, exposure, and the overall dress code. Revealing or sexually provocative clothing MUST be classified as NSFW.
285
 
286
+ 4. Poses & Suggestiveness: Sexually suggestive poses, seductive modeling, cleavage-emphasizing framing, fetish content, or explicit erotic themes MUST be classified as NSFW.
287
 
288
+ 5. Context & Setting: Consider the visual setting, composition, framing, and contextual cues when evaluating potentially sensitive content.
289
 
290
+ 6. Artwork & Animation: Anime nudes, ecchi, hentai, suggestive illustrations, or 2D/3D stylized erotica MUST be classified as NSFW.
291
 
292
  7. Sensitive Visual Content: Explicit or highly suggestive visual content MUST be classified as NSFW even when presented in non-photorealistic or artistic formats.
293
 
 
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(
 
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>
 
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>
 
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>