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 files6 unmodified lines7891011121311 unmodified lines252627282930313233343536373839404142434445464748495030 unmodified lines8182838485868788899091929394959697989910048 unmodified lines1491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202217 unmodified lines2292302312322332342352366 unmodified lines.vg-code, .vg-code * {font-family: 'Ubuntu Mono', 'Courier New', monospace !important;line-height: 1.5;}</style>11 unmodified lines<h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Key Highlights</h2><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>NSFW Sensual Content Detection</b>: Focused on identifying potentially <b>Not Safe for Work (NSFW) sensual content</b> and related sensitive visual material.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</span></div><details style="border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden; background-color: #000000;"><summary style="padding: 12px 16px; cursor: pointer; color: #FFFFFF !important; font-weight: 500; background-color: #111111; list-style: none; display: flex; justify-content: space-between; font-family: 'Ubuntu', sans-serif;">Standard Instruction</summary><div style="background-color: #000000; border: none; border-radius: 0; margin: 0; overflow: hidden;"><div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; font-size: 12px; color: #888888; display: flex; justify-content: space-between; align-items: center; font-family: 'Ubuntu', sans-serif;"><span>text</span><button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button></div><pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-size: 14px;">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.30 unmodified lines<h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Quick Start with Transformers</h2><div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;"><div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; font-size: 12px; color: #888888; display: flex; justify-content: space-between; align-items: center; font-family: 'Ubuntu', sans-serif;"><span>bash</span><button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button></div><pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-size: 14px;">pip install transformerspip install accelerate</pre></div><div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;"><div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; font-size: 12px; color: #888888; display: flex; justify-content: space-between; align-items: center; font-family: 'Ubuntu', sans-serif;"><span>python</span><button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button></div><pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-size: 14px;">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessorimport torchmodel = Qwen3_5ForConditionalGeneration.from_pretrained(48 unmodified lines</div><h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Training Details</h2><div style="border: 1px solid #333333; border-radius: 4px; overflow: hidden; margin: 20px 0;"><table style="width: 100%; border-collapse: collapse; color: #FFFFFF;"><tbody><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; width: 35%; color: #FFFFFF; border-bottom: 1px solid #333333; border-right: 1px solid #333333;">Base Model</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333;">Qwen/Qwen3.5-4B</td></tr><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333; border-right: 1px solid #333333;">Model</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333;">VisionGuardrail-4B</td></tr><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333; border-right: 1px solid #333333;">Model Type</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333;">Multimodal Content-Safety Classifier</td></tr><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333; border-right: 1px solid #333333;">Training Dataset</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333;">prithivMLmods/ImageShield-Guardrail-Pro</td></tr><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333; border-right: 1px solid #333333;">Training Objective</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333;">Content-safety guardrail classification</td></tr><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333; border-right: 1px solid #333333;">Primary Classification</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333;">Safe / Unsafe</td></tr><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333; border-right: 1px solid #333333;">Safety Focus</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333;">Not Safe for Work (NSFW) Sensual Content</td></tr><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-bottom: 1px solid #333333; border-right: 1px solid #333333;">Visual Analysis</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF; border-bottom: 1px solid #333333;">Dress Codes, Poses, Exposure & Settings</td></tr><tr><td style="padding: 12px 16px; background-color: #111111; font-weight: 500; color: #FFFFFF; border-right: 1px solid #333333;">Training Framework</td><td style="padding: 12px 16px; background-color: #000000; color: #FFFFFF;">TRL</td></tr></tbody></table></div><h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Intended Use</h2><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Content Moderation</b>: Supporting automated safety classification pipelines.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Guardrail Development</b>: Researching structured safety classification and filtering workflows.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</span></div><h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Limitations</h2><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>False Negatives</b>: Unsafe content may occasionally be missed.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Context Sensitivity</b>: Classification performance depends on image quality, visual context, and the provided instruction.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Conservative Policy</b>: The model intentionally uses a strict classification threshold and may flag content that would not be considered NSFW under less restrictive moderation policies.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Visual Ambiguity</b>: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</span></div><h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Acknowledgements</h2><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><a href="https://huggingface.co/Qwen/Qwen3.5-4B" style="color: #FF4500; text-decoration: none;">Qwen/Qwen3.5-4B</a>: Base multimodal model used for this project.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">ImageShield-Guardrail-Pro</a>: Content-safety guardrail dataset used for training VisionGuardrail-4B.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>TRL</b> – <a href="https://huggingface.co/docs/trl/en/index" style="color: #FF4500; text-decoration: none;">Transformers Reinforcement Learning</a>: TRL is a full-stack library providing tools to train transformer language models with methods including Supervised Fine-Tuning (SFT), Group Relative Policy Optimization (GRPO), Direct Preference Optimization (DPO), Reward Modeling, and more.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><a href="https://huggingface.co/docs/transformers/en/index" style="color: #FF4500; text-decoration: none;">Transformers</a>: Transformers provides state-of-the-art machine learning models for text, computer vision, audio, video, and multimodal tasks, supporting both inference and training.</span></div></div>7 unmodified linestry {document.execCommand('copy');btn.innerText = 'Copied!';setTimeout(() => {btn.innerText = 'Copy';}, 2000);} catch (err) {console.error('Failed to copy text: ', err);6 unmodified lines78910111211 unmodified lines242526272829303132333435363738394041424344454647484930 unmodified lines808182838485868788899091929394959697989948 unmodified lines1481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152167 unmodified lines2242252262272282292302312322332342356 unmodified lines.vg-code, .vg-code * {font-family: 'Ubuntu Mono', 'Courier New', monospace !important;}</style>11 unmodified lines<h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Key Highlights</h2><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Qwen 3.5 Foundation</b>: Built on <b>Qwen/Qwen3.5-4B</b>.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Multimodal Content Filter</b>: Designed for visual content-safety classification.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>ImageShield-Guardrail-Pro Training</b>: Fine-tuned on the <b>prithivMLmods/ImageShield-Guardrail-Pro</b> content-safety guardrail dataset.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Safe / Unsafe Classification</b>: Classifies visual content as either <b>Safe</b> or <b>Unsafe</b>.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>NSFW Sensual Content Detection</b>: Focused on identifying potentially <b>Not Safe for Work (NSFW) sensual content</b> and related sensitive visual material.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Explicit & Sensitive Content Detection</b>: Excels at identifying explicit, revealing, provocative, and otherwise potentially sensitive visual content.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Dress-Code Analysis</b>: Performs detailed analysis of clothing, dress codes, exposure, and revealing garments.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Pose Analysis</b>: Analyzes body poses, positioning, framing, and potentially suggestive presentation.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Context & Setting Analysis</b>: Considers different visual settings and contextual cues when determining content safety.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</span></div><details style="border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden; background-color: #000000;"><summary style="padding: 14px 16px; cursor: pointer; color: #FFFFFF; font-weight: 500; background-color: #111111; list-style: none; display: flex; justify-content: space-between; align-items: center; font-family: 'Ubuntu', sans-serif;">Standard Instruction</summary><div style="background-color: #000000; border: none; margin: 0; overflow: hidden;"><div style="background-color: #111111; padding: 8px 16px; border-bottom: 1px solid #333333; display: flex; justify-content: space-between; align-items: center;"><span style="font-size: 13px; color: #888888; font-family: 'Ubuntu', sans-serif;">text</span><button onclick="copyCode(this)" style="background-color: #222222; color: #FFFFFF; border: 1px solid #444444; padding: 4px 12px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button></div><pre style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; white-space: pre-wrap; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px; line-height: 1.5;">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.30 unmodified lines<h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Quick Start with Transformers</h2><div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;"><div style="background-color: #111111; padding: 8px 16px; border-bottom: 1px solid #333333; display: flex; justify-content: space-between; align-items: center;"><span style="font-size: 13px; color: #888888; font-family: 'Ubuntu', sans-serif;">bash</span><button onclick="copyCode(this)" style="background-color: #222222; color: #FFFFFF; border: 1px solid #444444; padding: 4px 12px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button></div><pre style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; white-space: pre-wrap; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px; line-height: 1.5;">pip install transformerspip install accelerate</pre></div><div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;"><div style="background-color: #111111; padding: 8px 16px; border-bottom: 1px solid #333333; display: flex; justify-content: space-between; align-items: center;"><span style="font-size: 13px; color: #888888; font-family: 'Ubuntu', sans-serif;">python</span><button onclick="copyCode(this)" style="background-color: #222222; color: #FFFFFF; border: 1px solid #444444; padding: 4px 12px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button></div><pre style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; white-space: pre-wrap; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px; line-height: 1.5;">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessorimport torchmodel = Qwen3_5ForConditionalGeneration.from_pretrained(48 unmodified lines</div><h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Training Details</h2><table style="width: 100%; border-collapse: collapse; margin: 24px 0; color: #FFFFFF; background-color: #000000; border: 1px solid #333333; border-radius: 4px; overflow: hidden; font-family: 'Ubuntu', sans-serif;"><tr style="border-bottom: 1px solid #333333;"><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; width: 40%; border-right: 1px solid #333333; background-color: #000000;">Base Model</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #000000;"><b>Qwen/Qwen3.5-4B</b></td></tr><tr style="border-bottom: 1px solid #333333;"><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; border-right: 1px solid #333333; background-color: #0a0a0a;">Model</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #0a0a0a;"><b>VisionGuardrail-4B</b></td></tr><tr style="border-bottom: 1px solid #333333;"><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; border-right: 1px solid #333333; background-color: #000000;">Model Type</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #000000;"><b>Multimodal Content-Safety Classifier</b></td></tr><tr style="border-bottom: 1px solid #333333;"><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; border-right: 1px solid #333333; background-color: #0a0a0a;">Training Dataset</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #0a0a0a;"><b>prithivMLmods/ImageShield-Guardrail-Pro</b></td></tr><tr style="border-bottom: 1px solid #333333;"><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; border-right: 1px solid #333333; background-color: #000000;">Training Objective</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #000000;"><b>Content-safety guardrail classification</b></td></tr><tr style="border-bottom: 1px solid #333333;"><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; border-right: 1px solid #333333; background-color: #0a0a0a;">Primary Classification</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #0a0a0a;"><b>Safe / Unsafe</b></td></tr><tr style="border-bottom: 1px solid #333333;"><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; border-right: 1px solid #333333; background-color: #000000;">Safety Focus</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #000000;"><b>Not Safe for Work (NSFW) Sensual Content</b></td></tr><tr style="border-bottom: 1px solid #333333;"><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; border-right: 1px solid #333333; background-color: #0a0a0a;">Visual Analysis</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #0a0a0a;"><b>Dress Codes, Poses, Exposure & Settings</b></td></tr><tr><td style="padding: 14px 16px; color: #AAAAAA; font-weight: 500; border-right: 1px solid #333333; background-color: #000000;">Training Framework</td><td style="padding: 14px 16px; color: #FFFFFF; background-color: #000000;"><b>TRL</b></td></tr></table><h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Intended Use</h2><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>NSFW Sensual Content Detection</b>: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Parental Controls</b>: Building conservative visual content-safety filtering systems.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Content Moderation</b>: Supporting automated safety classification pipelines.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Multimodal Safety Research</b>: Evaluating content-safety behavior in multimodal language models.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Guardrail Development</b>: Researching structured safety classification and filtering workflows.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Visual Safety Analysis</b>: Analyzing clothing, dress codes, poses, framing, and visual settings for content-safety signals.</span></div><h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Limitations</h2><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Experimental Model</b>: The model may produce incorrect or inconsistent classifications.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>False Positives</b>: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>False Negatives</b>: Unsafe content may occasionally be missed.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Context Sensitivity</b>: Classification performance depends on image quality, visual context, and the provided instruction.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Conservative Policy</b>: The model intentionally uses a strict classification threshold and may flag content that would not be considered NSFW under less restrictive moderation policies.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Visual Ambiguity</b>: Clothing, poses, artistic styles, and contextual cues may sometimes be difficult to interpret accurately.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>Automated Classification</b>: The model should not be treated as a definitive legal or safety determination.</span></div><h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Acknowledgements</h2><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><a href="https://huggingface.co/Qwen/Qwen3.5-4B" style="color: #FF4500; text-decoration: none;">Qwen/Qwen3.5-4B</a>: Base multimodal model used for this project.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">ImageShield-Guardrail-Pro</a>: Content-safety guardrail dataset used for training VisionGuardrail-4B.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><b>TRL</b> – <a href="https://huggingface.co/docs/trl/en/index" style="color: #FF4500; text-decoration: none;">Transformers Reinforcement Learning</a>: TRL is a full-stack library providing tools to train transformer language models with methods including Supervised Fine-Tuning (SFT), Group Relative Policy Optimization (GRPO), Direct Preference Optimization (DPO), Reward Modeling, and more.</span></div><div style="display: flex; align-items: flex-start; margin-bottom: 10px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold; line-height: 1.5;">+</span><span style="line-height: 1.5;"><a href="https://huggingface.co/docs/transformers/en/index" style="color: #FF4500; text-decoration: none;">Transformers</a>: Transformers provides state-of-the-art machine learning models for text, computer vision, audio, video, and multimodal tasks, supporting both inference and training.</span></div></div>7 unmodified linestry {document.execCommand('copy');btn.innerText = 'Copied!';btn.style.backgroundColor = '#FF4500';btn.style.borderColor = '#FF4500';setTimeout(() => {btn.innerText = 'Copy';btn.style.backgroundColor = '#222222';btn.style.borderColor = '#444444';}, 2000);} catch (err) {console.error('Failed to copy text: ', err);
README.md+86-87