prithivMLmods commited on
Commit
69504e2
·
verified ·
1 Parent(s): b1293c5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +98 -158
README.md CHANGED
@@ -1,104 +1,94 @@
1
- <div style="font-family: 'Ubuntu', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background-color: #000000; color: #FFFFFF; padding: 32px; border-radius: 12px; max-width: 900px; margin: 0 auto; line-height: 1.65; border: 1px solid #2E2E2E;">
2
-
3
- <style>
4
- @import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&family=Ubuntu+Mono:wght@400;700&display=swap');
5
-
6
- /* ---------- Header ---------- */
7
- .vg-header { padding-bottom: 18px; border-bottom: 1px solid #333333; margin-bottom: 22px; }
8
- .vg-title { font-size: 30px; font-weight: 700; color: #FFFFFF; margin: 0; letter-spacing: 0.5px; }
9
-
10
- /* ---------- Sections ---------- */
11
- .vg-h2 { display: flex; align-items: center; gap: 12px; color: #FFFFFF; font-size: 21px; font-weight: 700; margin: 36px 0 16px 0; }
12
- .vg-h2::after { content: ""; flex: 1; height: 1px; background: #333333; }
13
- .vg-num { font-family: 'Ubuntu Mono', 'Courier New', monospace; font-size: 12px; font-weight: 700; color: #FFFFFF; border: 1px solid #555555; background: #141414; padding: 2px 9px; border-radius: 3px; letter-spacing: 1px; }
14
-
15
- .vg-text { color: #FFFFFF; font-size: 15px; margin: 0 0 16px 0; }
16
- .vg-lead { color: #FFFFFF; font-size: 14px; margin: 0 0 12px 0; }
17
-
18
- /* ---------- Bullets (+ symbol) ---------- */
19
- .vg-bullet { list-style: none; padding: 0; margin: 0; }
20
- .vg-bullet li { position: relative; padding-left: 24px; margin-bottom: 11px; color: #FFFFFF; font-size: 14.5px; }
21
- .vg-bullet li::before { content: "+"; position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: 700; }
22
-
23
- /* ---------- Boxed Blockquote (plain, no highlight) ---------- */
24
- .vg-boxquote { border: 1px solid #FFFFFF; border-radius: 6px; padding: 18px 20px; margin: 24px 0; background: #000000; color: #FFFFFF; font-size: 14.5px; }
25
-
26
- /* ---------- Code Blocks with Header Bar + Copy ---------- */
27
- .vg-code-container { border: 1px solid #333333; border-radius: 6px; background: #0A0A0A; margin: 0 0 22px 0; overflow: hidden; }
28
- .vg-code-header { display: flex; justify-content: space-between; align-items: center; background: #161616; border-bottom: 1px solid #333333; padding: 8px 14px; }
29
- .vg-code-label { font-family: 'Ubuntu Mono', 'Courier New', monospace; font-size: 11px; color: #FFFFFF; letter-spacing: 2px; text-transform: uppercase; }
30
- .vg-copy-btn { background: #000000; color: #FFFFFF; border: 1px solid #555555; padding: 4px 14px; cursor: pointer; border-radius: 4px; font-family: 'Ubuntu', sans-serif; font-size: 12px; font-weight: 500; transition: background 0.2s, color 0.2s; }
31
- .vg-copy-btn:hover { background: #FFFFFF; color: #000000; }
32
- .vg-copy-btn.vg-copied { background: #FFFFFF; color: #000000; }
33
- .vg-code { margin: 0; padding: 16px 18px; overflow-x: auto; color: #FFFFFF; font-family: 'Ubuntu Mono', 'Courier New', monospace; font-size: 13.5px; line-height: 1.55; white-space: pre; }
34
-
35
- /* ---------- Table ---------- */
36
- .vg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
37
- .vg-table th { background: #161616; color: #FFFFFF; border: 1px solid #3A3A3A; padding: 10px 14px; text-align: left; text-transform: uppercase; font-size: 11.5px; letter-spacing: 1px; }
38
- .vg-table td { border: 1px solid #3A3A3A; padding: 10px 14px; color: #FFFFFF; }
39
- .vg-table tr:nth-child(even) td { background: #0C0C0C; }
40
- .vg-table-wrap { margin: 0 0 8px 0; }
41
-
42
- /* ---------- Links (ONLY orange element) ---------- */
43
- .vg-link { color: #FF4500; text-decoration: none; font-weight: 700; }
44
- .vg-link:hover { text-decoration: underline; }
45
- </style>
46
-
47
- <!-- ==================== HEADER ==================== -->
48
- <div class="vg-header">
49
- <h1 class="vg-title">VisionGuardrail-4B</h1>
50
- </div>
51
 
52
- <p class="vg-text">
53
- <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.
 
 
 
54
  </p>
55
 
56
- <div class="vg-boxquote">
57
  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.
58
  </div>
59
 
60
- <!-- ==================== 01 KEY HIGHLIGHTS ==================== -->
61
- <h2 class="vg-h2"><span class="vg-num">01</span> Key Highlights</h2>
62
- <ul class="vg-bullet">
63
  <li><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</li>
64
  <li><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</li>
65
  <li><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</li>
66
  <li><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</li>
67
  <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>
68
- <li><b>Explicit &amp; Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</li>
69
  <li><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</li>
70
  <li><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</li>
71
- <li><b>Context &amp; Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</li>
72
  <li><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</li>
73
  <li><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</li>
74
  </ul>
75
 
76
- <!-- ==================== 02 STANDARD INSTRUCTION ==================== -->
77
- <h2 class="vg-h2"><span class="vg-num">02</span> Standard Instruction</h2>
78
- <p class="vg-lead">Pass this guardrail instruction to the model to enforce strict zero-tolerance classification with structured JSON output.</p>
79
-
80
- <div class="vg-code-container">
81
- <div class="vg-code-header">
82
- <span class="vg-code-label">Prompt</span>
83
  <button class="vg-copy-btn" onclick="copyCode(this)">Copy</button>
84
- </div>
85
- <pre class="vg-code"><code>You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
86
 
87
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
88
 
89
  STRICT ZERO-TOLERANCE CLASSIFICATION RULES:
90
 
91
- 1. Nudity &amp; Exposure: Any full or partial nudity, exposed breasts, cleavage, buttocks, groin, or visible pubic area MUST be classified as NSFW.
92
 
93
- 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.
94
 
95
  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.
96
 
97
- 4. Poses &amp; Suggestiveness: Sexually suggestive poses, seductive modeling, cleavage-emphasizing framing, fetish content, or explicit erotic themes MUST be classified as NSFW.
98
 
99
- 5. Context &amp; Setting: Consider the visual setting, composition, framing, and contextual cues when evaluating potentially sensitive content.
100
 
101
- 6. Artwork &amp; Animation: Anime nudes, ecchi, hentai, suggestive illustrations, or 2D/3D stylized erotica MUST be classified as NSFW.
102
 
103
  7. Sensitive Visual Content: Explicit or highly suggestive visual content MUST be classified as NSFW even when presented in non-photorealistic or artistic formats.
104
 
@@ -107,32 +97,25 @@ STRICT ZERO-TOLERANCE CLASSIFICATION RULES:
107
  Output strictly valid JSON with no extra conversational text, commentary, or markdown formatting outside the JSON object:
108
 
109
  {
110
- "caption": "&lt;Detailed, objective visual description of the subject, clothing, exposure, pose, and setting&gt;",
111
  "is_nsfw": true | false,
112
- "reason": "&lt;Precise reason for classification based on clothing, exposure, pose, context, or other visual cues&gt;",
113
  "nsfw": 1 | 0,
114
  "safe": 1 | 0
115
- }</code></pre>
116
- </div>
117
-
118
- <!-- ==================== 03 QUICK START ==================== -->
119
- <h2 class="vg-h2"><span class="vg-num">03</span> Quick Start with Transformers</h2>
120
 
 
121
  <div class="vg-code-container">
122
- <div class="vg-code-header">
123
- <span class="vg-code-label">Terminal</span>
124
- <button class="vg-copy-btn" onclick="copyCode(this)">Copy</button>
125
- </div>
126
- <pre class="vg-code"><code>pip install transformers
127
- pip install accelerate</code></pre>
128
  </div>
129
 
130
  <div class="vg-code-container">
131
- <div class="vg-code-header">
132
- <span class="vg-code-label">Python</span>
133
- <button class="vg-copy-btn" onclick="copyCode(this)">Copy</button>
134
- </div>
135
- <pre class="vg-code"><code>from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
136
  import torch
137
 
138
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
@@ -183,29 +166,25 @@ output_text = processor.batch_decode(
183
  clean_up_tokenization_spaces=False
184
  )
185
 
186
- print(output_text[0])</code></pre>
187
- </div>
188
-
189
- <!-- ==================== 04 TRAINING DETAILS ==================== -->
190
- <h2 class="vg-h2"><span class="vg-num">04</span> Training Details</h2>
191
- <div class="vg-table-wrap">
192
- <table class="vg-table">
193
- <tr><th>Setting</th><th>Value</th></tr>
194
- <tr><td><b>Base Model</b></td><td><b>Qwen/Qwen3.5-4B</b></td></tr>
195
- <tr><td><b>Model</b></td><td><b>VisionGuardrail-4B</b></td></tr>
196
- <tr><td><b>Model Type</b></td><td><b>Multimodal Content-Safety Classifier</b></td></tr>
197
- <tr><td><b>Training Dataset</b></td><td><b>prithivMLmods/ImageShield-Guardrail-Pro</b></td></tr>
198
- <tr><td><b>Training Objective</b></td><td><b>Content-safety guardrail classification</b></td></tr>
199
- <tr><td><b>Primary Classification</b></td><td><b>Safe / Unsafe</b></td></tr>
200
- <tr><td><b>Safety Focus</b></td><td><b>Not Safe for Work (NSFW) Sensual Content</b></td></tr>
201
- <tr><td><b>Visual Analysis</b></td><td><b>Dress Codes, Poses, Exposure &amp; Settings</b></td></tr>
202
- <tr><td><b>Training Framework</b></td><td><b>TRL</b></td></tr>
203
- </table>
204
  </div>
205
 
206
- <!-- ==================== 05 INTENDED USE ==================== -->
207
- <h2 class="vg-h2"><span class="vg-num">05</span> Intended Use</h2>
208
- <ul class="vg-bullet">
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  <li><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li>
210
  <li><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</li>
211
  <li><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</li>
@@ -215,9 +194,8 @@ print(output_text[0])</code></pre>
215
  <li><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</li>
216
  </ul>
217
 
218
- <!-- ==================== 06 LIMITATIONS ==================== -->
219
- <h2 class="vg-h2"><span class="vg-num">06</span> Limitations</h2>
220
- <ul class="vg-bullet">
221
  <li><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li>
222
  <li><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</li>
223
  <li><b>False Negatives</b>: Unsafe content may occasionally be missed.</li>
@@ -227,48 +205,10 @@ print(output_text[0])</code></pre>
227
  <li><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</li>
228
  </ul>
229
 
230
- <!-- ==================== 07 ACKNOWLEDGEMENTS ==================== -->
231
- <h2 class="vg-h2"><span class="vg-num">07</span> Acknowledgements</h2>
232
- <ul class="vg-bullet">
233
- <li><a href="https://huggingface.co/Qwen/Qwen3.5-4B" class="vg-link">Qwen/Qwen3.5-4B</a>: Base multimodal model used for this project.</li>
234
- <li><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.</li>
235
- <li><b>TRL</b> – <a href="https://huggingface.co/docs/trl/en/index" class="vg-link">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>
236
- <li><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.</li>
237
- </ul>
238
-
239
- </div>
240
-
241
- <script>
242
- function copyCode(btn) {
243
- const container = btn.closest('.vg-code-container');
244
- const codeBlock = container.querySelector('code');
245
- const text = codeBlock.innerText;
246
-
247
- const done = () => {
248
- btn.innerText = 'Copied ✓';
249
- btn.classList.add('vg-copied');
250
- setTimeout(() => {
251
- btn.innerText = 'Copy';
252
- btn.classList.remove('vg-copied');
253
- }, 2000);
254
- };
255
-
256
- if (navigator.clipboard && navigator.clipboard.writeText) {
257
- navigator.clipboard.writeText(text).then(done).catch(() => copyFallback(text, done));
258
- } else {
259
- copyFallback(text, done);
260
- }
261
- }
262
 
263
- function copyFallback(text, done) {
264
- const textArea = document.createElement('textarea');
265
- textArea.value = text;
266
- textArea.style.position = 'fixed';
267
- textArea.style.opacity = '0';
268
- document.body.appendChild(textArea);
269
- textArea.select();
270
- document.execCommand('copy');
271
- document.body.removeChild(textArea);
272
- done();
273
- }
274
- </script>
 
1
+ <link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap" rel="stylesheet">
2
+ <style>
3
+ .vg-card { font-family: 'Ubuntu', sans-serif; background-color: #000000; color: #FFFFFF; padding: 30px; border-radius: 12px; max-width: 900px; margin: 0 auto; line-height: 1.6; }
4
+ .vg-h1 { font-size: 32px; font-weight: 700; margin-bottom: 15px; color: #FFFFFF; }
5
+ .vg-p { margin-bottom: 20px; font-size: 15px; color: #FFFFFF; }
6
+ .vg-a { color: #FF4500; text-decoration: none; font-weight: 500; }
7
+ .vg-a:hover { text-decoration: underline; }
8
+ .vg-box { border: 1px solid #333; border-radius: 8px; padding: 20px; margin-bottom: 25px; font-style: italic; color: #ccc; font-size: 14px; }
9
+ .vg-h2 { font-size: 22px; font-weight: 700; margin-top: 35px; margin-bottom: 15px; color: #FFFFFF; border-bottom: 1px solid #333; padding-bottom: 8px; }
10
+ .vg-list { list-style-type: none; padding-left: 5px; }
11
+ .vg-list li { margin-bottom: 10px; padding-left: 25px; position: relative; font-size: 15px; }
12
+ .vg-list li::before { content: "+"; color: #FF4500; position: absolute; left: 0; font-weight: bold; font-size: 18px; top: -2px; }
13
+ .vg-details { border: 1px solid #333; border-radius: 8px; margin-bottom: 25px; overflow: hidden; }
14
+ .vg-summary { padding: 15px 20px; cursor: pointer; font-size: 18px; font-weight: 700; color: #FFFFFF; background-color: #0a0a0a; user-select: none; }
15
+ .vg-summary:hover { background-color: #111; }
16
+ .vg-code-container { position: relative; background: #0a0a0a; border: 1px solid #222; border-radius: 8px; margin-bottom: 25px; }
17
+ .vg-copy-btn { position: absolute; top: 10px; right: 10px; background: #222; color: #fff; border: 1px solid #444; border-radius: 4px; padding: 5px 12px; cursor: pointer; font-family: 'Ubuntu', sans-serif; font-size: 12px; z-index: 10; transition: background 0.2s; }
18
+ .vg-copy-btn:hover { background: #333; }
19
+ .vg-code { padding: 15px; margin: 0; overflow-x: auto; color: #ddd; font-family: 'Courier New', Courier, monospace; font-size: 13px; white-space: pre; }
20
+ .vg-table { width: 100%; border-collapse: collapse; margin-bottom: 25px; font-size: 14px; }
21
+ .vg-table th, .vg-table td { border: 1px solid #333; padding: 12px 15px; text-align: left; }
22
+ .vg-table th { background-color: #0a0a0a; color: #FF4500; font-weight: 700; width: 35%; }
23
+ .vg-table td { color: #FFFFFF; }
24
+ .vg-ack { margin-bottom: 15px; font-size: 15px; }
25
+ </style>
26
+
27
+ <script>
28
+ function copyCode(btn) {
29
+ var codeBlock = btn.nextElementSibling;
30
+ var textArea = document.createElement("textarea");
31
+ textArea.value = codeBlock.innerText;
32
+ document.body.appendChild(textArea);
33
+ textArea.select();
34
+ try {
35
+ document.execCommand('copy');
36
+ btn.innerText = "Copied!";
37
+ } catch (err) {
38
+ btn.innerText = "Error";
39
+ }
40
+ document.body.removeChild(textArea);
41
+ setTimeout(function(){ btn.innerText = "Copy"; }, 2000);
42
+ }
43
+ </script>
 
 
 
 
 
 
 
44
 
45
+ <div class="vg-card">
46
+ <h1 class="vg-h1">VisionGuardrail-4B</h1>
47
+
48
+ <p class="vg-p">
49
+ <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-a">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.
50
  </p>
51
 
52
+ <div class="vg-box">
53
  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.
54
  </div>
55
 
56
+ <h2 class="vg-h2">Key Highlights</h2>
57
+ <ul class="vg-list">
 
58
  <li><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</li>
59
  <li><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</li>
60
  <li><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</li>
61
  <li><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</li>
62
  <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>
63
+ <li><b>Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</li>
64
  <li><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</li>
65
  <li><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</li>
66
+ <li><b>Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</li>
67
  <li><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</li>
68
  <li><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</li>
69
  </ul>
70
 
71
+ <details class="vg-details">
72
+ <summary class="vg-summary">Standard Instruction</summary>
73
+ <div class="vg-code-container">
 
 
 
 
74
  <button class="vg-copy-btn" onclick="copyCode(this)">Copy</button>
75
+ <pre class="vg-code">You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
 
76
 
77
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
78
 
79
  STRICT ZERO-TOLERANCE CLASSIFICATION RULES:
80
 
81
+ 1. Nudity & Exposure: Any full or partial nudity, exposed breasts, cleavage, buttocks, groin, or visible pubic area MUST be classified as NSFW.
82
 
83
+ 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.
84
 
85
  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.
86
 
87
+ 4. Poses & Suggestiveness: Sexually suggestive poses, seductive modeling, cleavage-emphasizing framing, fetish content, or explicit erotic themes MUST be classified as NSFW.
88
 
89
+ 5. Context & Setting: Consider the visual setting, composition, framing, and contextual cues when evaluating potentially sensitive content.
90
 
91
+ 6. Artwork & Animation: Anime nudes, ecchi, hentai, suggestive illustrations, or 2D/3D stylized erotica MUST be classified as NSFW.
92
 
93
  7. Sensitive Visual Content: Explicit or highly suggestive visual content MUST be classified as NSFW even when presented in non-photorealistic or artistic formats.
94
 
 
97
  Output strictly valid JSON with no extra conversational text, commentary, or markdown formatting outside the JSON object:
98
 
99
  {
100
+ "caption": "<Detailed, objective visual description of the subject, clothing, exposure, pose, and setting>",
101
  "is_nsfw": true | false,
102
+ "reason": "<Precise reason for classification based on clothing, exposure, pose, context, or other visual cues>",
103
  "nsfw": 1 | 0,
104
  "safe": 1 | 0
105
+ }</pre>
106
+ </div>
107
+ </details>
 
 
108
 
109
+ <h2 class="vg-h2">Quick Start with Transformers</h2>
110
  <div class="vg-code-container">
111
+ <button class="vg-copy-btn" onclick="copyCode(this)">Copy</button>
112
+ <pre class="vg-code">pip install transformers
113
+ pip install accelerate</pre>
 
 
 
114
  </div>
115
 
116
  <div class="vg-code-container">
117
+ <button class="vg-copy-btn" onclick="copyCode(this)">Copy</button>
118
+ <pre class="vg-code">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
 
 
 
119
  import torch
120
 
121
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
 
166
  clean_up_tokenization_spaces=False
167
  )
168
 
169
+ print(output_text[0])</pre>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  </div>
171
 
172
+ <h2 class="vg-h2">Training Details</h2>
173
+ <table class="vg-table">
174
+ <tr><th>Setting</th><td>Value</td></tr>
175
+ <tr><th>Base Model</th><td>Qwen/Qwen3.5-4B</td></tr>
176
+ <tr><th>Model</th><td>VisionGuardrail-4B</td></tr>
177
+ <tr><th>Model Type</th><td>Multimodal Content-Safety Classifier</td></tr>
178
+ <tr><th>Training Dataset</th><td>prithivMLmods/ImageShield-Guardrail-Pro</td></tr>
179
+ <tr><th>Training Objective</th><td>Content-safety guardrail classification</td></tr>
180
+ <tr><th>Primary Classification</th><td>Safe / Unsafe</td></tr>
181
+ <tr><th>Safety Focus</th><td>Not Safe for Work (NSFW) Sensual Content</td></tr>
182
+ <tr><th>Visual Analysis</th><td>Dress Codes, Poses, Exposure & Settings</td></tr>
183
+ <tr><th>Training Framework</th><td>TRL</td></tr>
184
+ </table>
185
+
186
+ <h2 class="vg-h2">Intended Use</h2>
187
+ <ul class="vg-list">
188
  <li><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li>
189
  <li><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</li>
190
  <li><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</li>
 
194
  <li><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</li>
195
  </ul>
196
 
197
+ <h2 class="vg-h2">Limitations</h2>
198
+ <ul class="vg-list">
 
199
  <li><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li>
200
  <li><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</li>
201
  <li><b>False Negatives</b>: Unsafe content may occasionally be missed.</li>
 
205
  <li><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</li>
206
  </ul>
207
 
208
+ <h2 class="vg-h2">Acknowledgements</h2>
209
+ <div class="vg-ack"><a href="https://huggingface.co/Qwen/Qwen3.5-4B" class="vg-a">Qwen/Qwen3.5-4B</a>: Base multimodal model used for this project.</div>
210
+ <div class="vg-ack"><a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" class="vg-a">ImageShield-Guardrail-Pro</a>: Content-safety guardrail dataset used for training VisionGuardrail-4B.</div>
211
+ <div class="vg-ack"><a href="https://huggingface.co/docs/trl/en/index" class="vg-a">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>
212
+ <div class="vg-ack"><a href="https://huggingface.co/docs/transformers/en/index" class="vg-a">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>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
 
214
+ </div>