Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
text-generation-inference
VisionGuardrail
JSON
image-classification
content-safety
content-moderation
multimodal
safety-classifier
guardrail
visual-safety
multimodal-content-filter
mmcf
v1.0
conversational
Run this model with HF Jobs
Run prithivMLmods/VisionGuardrail-4B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/prithivMLmods/VisionGuardrail-4B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/prithivMLmods/VisionGuardrail-4B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/prithivMLmods/VisionGuardrail-4B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/prithivMLmods/VisionGuardrail-4B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use prithivMLmods/VisionGuardrail-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/VisionGuardrail-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/VisionGuardrail-4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("prithivMLmods/VisionGuardrail-4B") model = AutoModelForMultimodalLM.from_pretrained("prithivMLmods/VisionGuardrail-4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/VisionGuardrail-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/VisionGuardrail-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/VisionGuardrail-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/prithivMLmods/VisionGuardrail-4B
- SGLang
How to use prithivMLmods/VisionGuardrail-4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "prithivMLmods/VisionGuardrail-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/VisionGuardrail-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "prithivMLmods/VisionGuardrail-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/VisionGuardrail-4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use prithivMLmods/VisionGuardrail-4B with Docker Model Runner:
docker model run hf.co/prithivMLmods/VisionGuardrail-4B
Update README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248123456789101112131415251252253254255256257258259260261262263161718192021222324252627282930266267268269270271272273274313233343536373823 unmodified lines62636430430565666768309310311312313314315316317318319697071727374757632132232332432532677787980818244 unmodified lines127128129377378379380130131132382383384385386387388389390391392393133134135136137138139140141142143144145146147396397398399400401402403404148149150151152153154155156157158407408409410411412413414415159160161162163164165166167168169418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457170171172173174175176177459460461462463464465466178<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">
<style> .vg-wrap { font-family: 'Ubuntu', sans-serif; background-color: #000000; color: #FFFFFF; max-width: 920px; margin: 0 auto; padding: 36px 30px; border: 1px solid #1a1a1a; border-radius: 14px; line-height: 1.65; box-sizing: border-box; }
.vg-title { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; margin: 0 0 18px 0; color: #FFFFFF; }
.vg-lead { font-size: 15.5px; color: #FFFFFF; margin-bottom: 24px; }
.vg-link { color: #FF4500; text-decoration: none; font-weight: 500; }
.vg-link:hover { text-decoration: underline; }
/* Blockquote as structured isolated box */ .vg-notice-box { background: #000000; border: 1px solid #292929; border-left: 4px solid #444444; border-radius: 6px; padding: 16px 20px; margin: 24px 0 32px 0; font-size: 14px; color: #FFFFFF; }
.vg-section-head { font-size: 21px; font-weight: 700; color: #FFFFFF; margin: 36px 0 16px 0; display: flex; align-items: center; gap: 8px; }
/* Plus-style list formatting */ .vg-bullet-list { list-style: none; padding: 0; margin: 0 0 24px 0; }
.vg-bullet-list li { position: relative; padding-left: 22px; margin-bottom: 12px; font-size: 14.5px; color: #FFFFFF; }
.vg-bullet-list li::before { content: "+"; position: absolute; left: 0; top: 0; color: #FFFFFF; font-weight: 700; font-size: 16px; line-height: 1.4; }
/* Expandable / Dropdown sections */ .vg-accordion { border: 1px solid #222222; border-radius: 8px; margin-bottom: 22px; background-color: #000000; overflow: hidden; }
.vg-accordion-summary { list-style: none; padding: 16px 20px; font-size: 16px; font-weight: 700; color: #FFFFFF; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; background: #080808; border-bottom: 1px solid transparent; transition: background 0.2s; }
.vg-accordion-summary::-webkit-details-marker { display: none; }
.vg-accordion-summary:hover { background: #111111; }
.vg-accordion[open] .vg-accordion-summary { border-bottom: 1px solid #222222; }
.vg-accordion-summary::after { content: "+"; font-size: 18px; font-weight: 700; color: #FFFFFF; transition: transform 0.2s ease; }
.vg-accordion[open] .vg-accordion-summary::after { content: "−"; }
.vg-accordion-content { padding: 18px; background: #000000; }
/* Code block shells & actions */ .vg-code-wrapper { position: relative; background: #000000; border: 1px solid #242424; border-radius: 8px; margin-bottom: 20px; overflow: hidden; }
.vg-code-topbar { display: flex; justify-content: space-between; align-items: center; background: #090909; padding: 8px 14px; border-bottom: 1px solid #1c1c1c; }
.vg-code-label { font-size: 12px; font-family: 'Ubuntu Mono', monospace; text-transform: uppercase; letter-spacing: 0.8px; color: #FFFFFF; }
.vg-copy-trigger { background: #181818; color: #FFFFFF; border: 1px solid #333333; border-radius: 4px; padding: 4px 10px; font-family: 'Ubuntu', sans-serif; font-size: 12px; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.vg-copy-trigger:hover { background: #252525; border-color: #555555; }
.vg-code-block { margin: 0; padding: 16px; overflow-x: auto; font-family: 'Ubuntu Mono', monospace; font-size: 13.5px; line-height: 1.55; color: #FFFFFF; white-space: pre; background: #000000; }
/* Table styling */ .vg-specs-table { width: 100%; border-collapse: collapse; margin: 10px 0 28px 0; font-size: 14px; }
.vg-specs-table th, .vg-specs-table td { border: 1px solid #222222; padding: 12px 16px; text-align: left; color: #FFFFFF; }
.vg-specs-table th { background-color: #080808; width: 32%; font-weight: 700; }
.vg-specs-table td { background-color: #000000; }
.vg-ack-entry { font-size: 14.5px; margin-bottom: 14px; color: #FFFFFF; line-height: 1.5; }
.vg-divider { border: 0; height: 1px; background: #222222; margin: 32px 0; }</style>
<div class="vg-wrap"> <div class="vg-title">VisionGuardrail-4B</div>
<div class="vg-lead"> <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. </div>
<div class="vg-notice-box"> 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.<link href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap" rel="stylesheet"><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;">
<h1 style="font-size: 32px; font-weight: 700; margin-top: 0; color: #FFFFFF; border-bottom: 1px solid #333; padding-bottom: 15px;">VisionGuardrail-4B</h1> <p style="font-size: 16px; color: #FFFFFF;"> <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. </p>
<div style="border: 1px solid #333333; padding: 16px; border-radius: 8px; margin: 24px 0; background-color: #0a0a0a;"> <p style="margin: 0; font-size: 14px; color: #FFFFFF; line-height: 1.5;"> 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. </p> </div>
<div class="vg-section-head">Key Highlights</div> <ul class="vg-bullet-list"> <li><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</li> <li><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</li> <li><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</li> <li><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</li> <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> <li><b>Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</li> <li><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</li> <li><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</li> <li><b>Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</li> <li><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</li> <li><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</li> <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Key Highlights</h2> <ul style="list-style: none; padding-left: 0; font-size: 15px; line-height: 1.8;"> <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> <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> <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> <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> <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> <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> <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> <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> <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> <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> <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> </ul>
<details class="vg-accordion"> <summary class="vg-accordion-summary">Standard Instruction</summary> <div class="vg-accordion-content"> <div class="vg-code-wrapper"> <div class="vg-code-topbar"> <span class="vg-code-label">System Prompt & Schema</span> <button class="vg-copy-trigger" onclick="handleCopy(this)">Copy</button> </div> <pre class="vg-code-block">You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media. <details style="background-color: #0d0d0d; border: 1px solid #333333; border-radius: 8px; padding: 16px; margin-top: 32px; cursor: pointer;"> <summary style="font-size: 20px; font-weight: bold; color: #FFFFFF; outline: none;">Standard Instruction</summary> <div style="margin-top: 16px; position: relative; border: 1px solid #333; border-radius: 8px; background-color: #000000;"> <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> <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.
Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
23 unmodified lines "reason": "<Precise reason for classification based on clothing, exposure, pose, context, or other visual cues>", "nsfw": 1 | 0, "safe": 1 | 0}</pre> </div>}</code></pre> </div> </details>
<details class="vg-accordion"> <summary class="vg-accordion-summary">Quick Start with Transformers</summary> <div class="vg-accordion-content"> <div class="vg-code-wrapper"> <div class="vg-code-topbar"> <span class="vg-code-label">Bash Installation</span> <button class="vg-copy-trigger" onclick="handleCopy(this)">Copy</button> </div> <pre class="vg-code-block">pip install transformerspip install accelerate</pre> </div> <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Quick Start with Transformers</h2> <div style="position: relative; margin-top: 16px; border: 1px solid #333; border-radius: 8px; background-color: #000000;"> <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> <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 transformerspip install accelerate</code></pre> </div>
<div class="vg-code-wrapper"> <div class="vg-code-topbar"> <span class="vg-code-label">Python Inference</span> <button class="vg-copy-trigger" onclick="handleCopy(this)">Copy</button> </div> <pre class="vg-code-block">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor <div style="position: relative; margin-top: 16px; border: 1px solid #333; border-radius: 8px; background-color: #000000;"> <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> <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, AutoProcessorimport torch
model = Qwen3_5ForConditionalGeneration.from_pretrained(44 unmodified lines clean_up_tokenization_spaces=False)
print(output_text[0])</pre> </div> </div> </details>print(output_text[0])</code></pre> </div>
<div class="vg-section-head">Training Details</div> <table class="vg-specs-table"> <tr><th>Setting</th><td>Value</td></tr> <tr><th>Base Model</th><td>Qwen/Qwen3.5-4B</td></tr> <tr><th>Model</th><td>VisionGuardrail-4B</td></tr> <tr><th>Model Type</th><td>Multimodal Content-Safety Classifier</td></tr> <tr><th>Training Dataset</th><td>prithivMLmods/ImageShield-Guardrail-Pro</td></tr> <tr><th>Training Objective</th><td>Content-safety guardrail classification</td></tr> <tr><th>Primary Classification</th><td>Safe / Unsafe</td></tr> <tr><th>Safety Focus</th><td>Not Safe for Work (NSFW) Sensual Content</td></tr> <tr><th>Visual Analysis</th><td>Dress Codes, Poses, Exposure & Settings</td></tr> <tr><th>Training Framework</th><td>TRL</td></tr> <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Training Details</h2> <table style="width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 14px;"> <tbody> <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> <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> <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> <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> <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> <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> <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> <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> <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> </tbody> </table>
<div class="vg-section-head">Intended Use</div> <ul class="vg-bullet-list"> <li><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</li> <li><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</li> <li><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</li> <li><b>Content Moderation</b>: Supporting automated safety classification pipelines.</li> <li><b>Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</li> <li><b>Guardrail Development</b>: Researching structured safety classification and filtering workflows.</li> <li><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</li> <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Intended Use</h2> <ul style="list-style: none; padding-left: 0; font-size: 15px; line-height: 1.8;"> <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> <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> <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> <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>Content Moderation</b>: Supporting automated safety classification pipelines.</li> <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> <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> <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> </ul>
<div class="vg-section-head">Limitations</div> <ul class="vg-bullet-list"> <li><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</li> <li><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</li> <li><b>False Negatives</b>: Unsafe content may occasionally be missed.</li> <li><b>Context Sensitivity</b>: Classification performance depends on image quality, visual context, and the provided instruction.</li> <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> <li><b>Visual Ambiguity</b>: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.</li> <li><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</li> <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Limitations</h2> <ul style="list-style: none; padding-left: 0; font-size: 15px; line-height: 1.8;"> <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> <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> <li style="margin-bottom: 10px;"><span style="color: #FFFFFF; margin-right: 10px;">+</span><b>False Negatives</b>: Unsafe content may occasionally be missed.</li> <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> <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> <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> <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> </ul>
<hr class="vg-divider">
<div class="vg-section-head">Acknowledgements</div> <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> <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> <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> <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></div>
<script> function handleCopy(button) { const codeBlock = button.closest('.vg-code-wrapper').querySelector('.vg-code-block'); if (!codeBlock) return; const textToCopy = codeBlock.innerText; if (navigator.clipboard && window.isSecureContext) { navigator.clipboard.writeText(textToCopy).then(() => setSuccessState(button)).catch(() => fallbackCopy(textToCopy, button)); } else { fallbackCopy(textToCopy, button); } }
function fallbackCopy(text, button) { const textArea = document.createElement("textarea"); textArea.value = text; textArea.style.position = "fixed"; textArea.style.opacity = "0"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { document.execCommand('copy'); setSuccessState(button); } catch (err) { button.innerText = "Failed"; setTimeout(() => { button.innerText = "Copy"; }, 2000); } document.body.removeChild(textArea); } <h2 style="font-size: 24px; color: #FFFFFF; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Acknowledgements</h2> <ul style="list-style: none; padding-left: 0; font-size: 15px; line-height: 1.8;"> <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> <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> <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> <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> </ul>
function setSuccessState(button) { const originalText = button.innerText; button.innerText = "Copied!"; setTimeout(() => { button.innerText = originalText; }, 2000); }</script></div>README.md+83-371