--- license: apache-2.0 base_model: - Qwen/Qwen3-VL-2B-Instruct pipeline_tag: image-text-to-text library_name: transformers tags: - text-generation-inference - JSON - image-classification - content-safety - content-moderation - multimodal - safety-classifier - guardrail - ncii-detection - visual-safety - multimodal-content-filter - MMCF language: - en datasets: - prithivMLmods/ImageShield-Guardrail-Multimodal-20K --- ![1](https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/ABlXuGZNNpDRZx8tJyK9A.png) # **ImageShield-MMCF-2B-vl** > **ImageShield-MMCF — Multimodal Content Filter** is a multimodal content-safety classifier built on top of **Qwen/Qwen3-VL-2B-Instruct** and trained on the **[ImageShield-Guardrail](https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Multimodal-20K)** dataset. The model is designed to classify visual content as **Safe** or **Unsafe**, with a particular focus on detecting **Not Safe for Work (NSFW) sensual content** and other potentially sensitive visual content. Jump to Examples > [!NOTE] > **This model is an experimental release and may exhibit unexpected behavior or reasoning artifacts in certain scenarios.** > [!IMPORTANT] > **This model is intended for research and content-safety classification only.** 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. ## **Key Highlights** * **Qwen3-VL Foundation**: Built on top of **Qwen/Qwen3-VL-2B-Instruct**. * **Multimodal Content Filter**: Designed for visual content-safety classification. * **ImageShield-Guardrail Training Dataset**: Trained on the **[ImageShield-Guardrail](https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Multimodal-20K)** multimodal content-safety dataset. * **Safe / Unsafe Classification**: Classifies visual content as either **Safe** or **Unsafe**. * **NSFW Sensual Content Detection**: Focused on identifying potentially **Not Safe for Work (NSFW) sensual content** and related sensitive visual content. * **Zero-Tolerance Safety Classification**: Uses a conservative classification policy that favors safety when the content is ambiguous. * **Structured Output**: Produces a machine-readable JSON response containing a caption, classification, and reasoning. ## **Standard Instruction** ```text 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. STRICT ZERO-TOLERANCE CLASSIFICATION RULES: 1. Nudity & Exposure: Any full or partial nudity, exposed breasts, cleavage, buttocks, groin, or visible pubic area MUST be classified as NSFW. 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. 3. Poses & Suggestiveness: Sexually suggestive poses, seductive modeling, cleavage-emphasizing framing, fetish content, or explicit erotic themes MUST be classified as NSFW. 4. Artwork & Animation: Anime nudes, ecchi, hentai, suggestive illustrations, or 2D/3D stylized erotica MUST be classified as NSFW. 5. Classification Threshold: When in doubt, err on the side of caution and classify the content as NSFW. Output strictly valid JSON with no extra conversational text, commentary, or markdown formatting outside the JSON object: { "caption": "", "is_nsfw": true | false, "reason": "", "nsfw": 1 | 0, "safe": 1 | 0 } ``` ## **Quick Start with Transformers** ```bash pip install transformers pip install accelerate ``` ```python from transformers import Qwen3VLForConditionalGeneration, AutoProcessor import torch model = Qwen3VLForConditionalGeneration.from_pretrained( "prithivMLmods/ImageShield-MMCF-2B-vl", torch_dtype="auto", device_map="auto" ) processor = AutoProcessor.from_pretrained( "prithivMLmods/ImageShield-MMCF-2B-vl" ) messages = [ { "role": "user", "content": [ { "type": "image" }, { "type": "text", "text": "Classify this image using the provided content-safety guardrail." } ], } ] text = processor.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) # Add image inputs according to your application pipeline. inputs = processor( text=[text], images=[image], padding=True, return_tensors="pt" ).to(model.device) generated_ids = model.generate( **inputs, max_new_tokens=256 ) output_text = processor.batch_decode( [ out[len(inp):] for inp, out in zip(inputs.input_ids, generated_ids) ], skip_special_tokens=True, clean_up_tokenization_spaces=False ) print(output_text[0]) ``` --- ## **Example Cards**
Safe Image 1
{
  "caption": "A white off-road race car, number 4470, is captured mid-air performing an impressive jump over a rocky terrain in a dry, grassy outdoor environment.",
  "is_nsfw": false,
  "reason": "The image depicts a standard off-road vehicle action shot featuring a dirt bike and a truck-like vehicle jumping over rocks. The subject is clearly visible wearing a full-body white racing suit with sponsor logos and protective gear. There is no evidence of nudity, revealing clothing, suggestive poses, or any elements that would indicate a sexual or fetish-based theme.",
  "nsfw": 0,
  "safe": 1
}

NSFW Image 2
{
  "caption": "A blonde woman is posed on a light gray sofa, showcasing her bare back and buttocks. She has a visible tattoo on her upper back and is looking over her shoulder with a soft expression. The setting appears to be indoors near a large window with blue light filtering through.",
  "is_nsfw": true,
  "reason": "The image is classified as NSFW due to significant nudity, substantial skin exposure, and a revealing presentation.",
  "nsfw": 1,
  "safe": 0
}

Safe Image 3
{
  "caption": "A man in a red life vest is rowing a boat on a calm body of water. In the distance, there is a large white ferry or tour boat and a tree-lined shore with houses. The sky is clear and blue.",
  "is_nsfw": false,
  "reason": "The image depicts a standard outdoor scene of boating. The subject is wearing a standard life vest, and the clothing is functional and appropriate for the activity. There is no evidence of nudity, revealing swimwear, suggestive poses, or any other content that would trigger the NSFW classification.",
  "nsfw": 0,
  "safe": 1
}
--- ## **Training Details** | Setting | Value | | :------------------------- | :-------------------------------------------------------------------------------------------------------------- | | **Base Model** | **Qwen/Qwen3-VL-2B-Instruct** | | **Model Type** | **Multimodal Content-Safety Classifier** | | **Training Dataset** | **[ImageShield-Guardrail](https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Multimodal-20K)** | | **Training Samples** | Approximately **20,000 multimodal samples** | | **Training Objective** | Content-safety guardrail classification | | **Primary Classification** | **Safe / Unsafe** | | **Safety Focus** | **Not Safe for Work (NSFW) Sensual Content** | | **Training Framework** | **TRL** | ## **Intended Use** * **Content Safety Classification**: Classifying visual media as safe or unsafe. * **NSFW Sensual Content Detection**: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content. * **Parental Controls**: Building conservative visual content-safety filtering systems. * **Content Moderation**: Supporting automated safety classification pipelines. * **Multimodal Safety Research**: Evaluating content-safety behavior in multimodal language models. * **Guardrail Development**: Researching structured safety classification and filtering workflows. ## **Limitations** * **Experimental Model**: The model may produce incorrect or inconsistent classifications. * **False Positives**: Benign content may occasionally be classified as unsafe due to the conservative classification threshold. * **False Negatives**: Unsafe content may occasionally be missed. * **Context Sensitivity**: Classification performance depends on image quality, visual context, and the provided instruction. * **Conservative Policy**: The model intentionally uses a strict classification threshold and may flag content that would not be considered NSFW under less restrictive moderation policies. * **Automated Classification**: The model should not be treated as a definitive legal or safety determination. ## **Acknowledgements** * **[Qwen/Qwen3-VL-2B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct)**: Base multimodal model used for this project. * **[ImageShield-Guardrail](https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Multimodal-20K)**: Multimodal content-safety dataset used to train this model. * **TRL – [Transformers Reinforcement Learning](https://huggingface.co/docs/trl/en/index)**: TRL is a full-stack library providing tools for training transformer models with methods including Supervised Fine-Tuning (SFT), Group Relative Policy Optimization (GRPO), Direct Preference Optimization (DPO), Reward Modeling, and more. * **[Transformers](https://huggingface.co/docs/transformers/en/index)**: Transformers provides state-of-the-art machine learning models for text, computer vision, audio, video, and multimodal tasks, supporting both inference and training.