Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
text-generation-inference
JSON
image-classification
content-safety
content-moderation
multimodal
safety-classifier
guardrail
ncii-detection
visual-safety
qwen3.5
multimodal-content-filter
conversational
Instructions to use prithivMLmods/ImageShield-MMCF-0.8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/ImageShield-MMCF-0.8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/ImageShield-MMCF-0.8B") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("prithivMLmods/ImageShield-MMCF-0.8B") model = AutoModelForMultimodalLM.from_pretrained("prithivMLmods/ImageShield-MMCF-0.8B", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/ImageShield-MMCF-0.8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/ImageShield-MMCF-0.8B" # 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/ImageShield-MMCF-0.8B", "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/ImageShield-MMCF-0.8B
- SGLang
How to use prithivMLmods/ImageShield-MMCF-0.8B 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/ImageShield-MMCF-0.8B" \ --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/ImageShield-MMCF-0.8B", "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/ImageShield-MMCF-0.8B" \ --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/ImageShield-MMCF-0.8B", "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/ImageShield-MMCF-0.8B with Docker Model Runner:
docker model run hf.co/prithivMLmods/ImageShield-MMCF-0.8B
Update README.md
Browse files
README.md
CHANGED
|
@@ -26,7 +26,7 @@ tags:
|
|
| 26 |
|
| 27 |
# **ImageShield-MMCF-0.8B**
|
| 28 |
|
| 29 |
-
> **ImageShield-MMCF — Multimodal Content Filter** is a multimodal content-safety classifier built on top of **Qwen/Qwen3.5-0.8B** and trained on approximately **28,000 content-safety guardrail samples**. The model is designed to classify visual content as **Safe** or **Unsafe**, with a particular focus on detecting **
|
| 30 |
|
| 31 |
<a href="#example-cards">
|
| 32 |
<img src="https://img.shields.io/badge/View-Example_Cards-blue?style=for-the-badge" alt="Jump to Examples" />
|
|
@@ -36,7 +36,7 @@ tags:
|
|
| 36 |
> **This model is an experimental release and may generate unexpected behaviors or reasoning artifacts in certain scenarios.**
|
| 37 |
|
| 38 |
> [!IMPORTANT]
|
| 39 |
-
> **This model is intended for research and content
|
| 40 |
|
| 41 |
## **Key Highlights**
|
| 42 |
|
|
@@ -44,7 +44,7 @@ tags:
|
|
| 44 |
* **Multimodal Content Filter**: Designed for visual content-safety classification.
|
| 45 |
* **28K Training Samples**: Trained on approximately **28,000 content-safety guardrail samples**.
|
| 46 |
* **Safe / Unsafe Classification**: Classifies visual content as either **Safe** or **Unsafe**.
|
| 47 |
-
* **
|
| 48 |
* **Zero-Tolerance Safety Classification**: Uses a conservative classification policy that favors safety when the content is ambiguous.
|
| 49 |
* **Structured Output**: Produces a machine-readable JSON response containing a caption, classification, and reasoning.
|
| 50 |
|
|
@@ -145,8 +145,9 @@ print(output_text[0])
|
|
| 145 |
## **Example Cards**
|
| 146 |
|
| 147 |
<div style="background-color: #000000; font-family: 'Courier New', Courier, monospace; color: #FFFFFF; padding: 24px; border-radius: 12px; border: 1px solid #333333; max-width: 800px; margin: 0 auto;">
|
| 148 |
-
|
| 149 |
<!-- Card 1 -->
|
|
|
|
| 150 |
<div style="margin-bottom: 32px;">
|
| 151 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222;">
|
| 152 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/yypVvKdEH3W5qcmt4E36R.jpeg" alt="Safe Image 1" style="width: 100%; height: auto; display: block;">
|
|
@@ -162,9 +163,11 @@ print(output_text[0])
|
|
| 162 |
</div>
|
| 163 |
|
| 164 |
<!-- Thin Line Bar -->
|
|
|
|
| 165 |
<hr style="border: 0; border-top: 1px solid #333333; margin: 0 0 32px 0;">
|
| 166 |
|
| 167 |
<!-- Card 2 (NSFW - Blurred) -->
|
|
|
|
| 168 |
<div style="margin-bottom: 32px;">
|
| 169 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222; position: relative;">
|
| 170 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/XI2Xc5WmZrxKTSkVxV13U.png" alt="NSFW Image 2" style="width: 100%; height: auto; display: block; filter: blur(40px) saturate(0.8) brightness(0.9); transform: scale(1.1);">
|
|
@@ -172,17 +175,19 @@ print(output_text[0])
|
|
| 172 |
<pre style="background-color: #0a0a0a; padding: 16px; border-radius: 8px; border: 1px solid #222; color: #e0e0e0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; margin: 0;">
|
| 173 |
{
|
| 174 |
"caption": "A blonde woman is shown from behind, wearing red thong-style underwear. She has long hair and a visible tattoo on her lower back. Her hands are positioned near her hips, holding the straps of the thong. The setting appears to be a modern living room with a window and a patterned sofa.",
|
| 175 |
-
"is_nsfw": <span style="color: #4ade80;">
|
| 176 |
-
"reason": "The image
|
| 177 |
"nsfw": <span style="color: #4ade80;">1</span>,
|
| 178 |
"safe": <span style="color: #4ade80;">0</span>
|
| 179 |
}</pre>
|
| 180 |
</div>
|
| 181 |
|
| 182 |
<!-- Thin Line Bar -->
|
|
|
|
| 183 |
<hr style="border: 0; border-top: 1px solid #333333; margin: 0 0 32px 0;">
|
| 184 |
|
| 185 |
<!-- Card 3 -->
|
|
|
|
| 186 |
<div>
|
| 187 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222;">
|
| 188 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/EX1Zg_-Up4va_44B3dONZ.jpeg" alt="Safe Image 3" style="width: 100%; height: auto; display: block;">
|
|
@@ -203,20 +208,20 @@ print(output_text[0])
|
|
| 203 |
|
| 204 |
## **Training Details**
|
| 205 |
|
| 206 |
-
| Setting | Value
|
| 207 |
-
| :------------------------- | :----------------------------------------- |
|
| 208 |
-
| **Base Model** | **Qwen/Qwen3.5-0.8B**
|
| 209 |
-
| **Model Type** | **Multimodal Content-Safety Classifier**
|
| 210 |
-
| **Training Samples** | Approximately **28,000**
|
| 211 |
-
| **Training Objective** | Content-safety guardrail classification
|
| 212 |
-
| **Primary Classification** | **Safe / Unsafe**
|
| 213 |
-
| **Safety Focus** | **
|
| 214 |
-
| **Training Framework** | **TRL**
|
| 215 |
|
| 216 |
## **Intended Use**
|
| 217 |
|
| 218 |
* **Content Safety Classification**: Classifying visual media as safe or unsafe.
|
| 219 |
-
* **
|
| 220 |
* **Parental Controls**: Building conservative visual content-safety filtering systems.
|
| 221 |
* **Content Moderation**: Supporting automated safety classification pipelines.
|
| 222 |
* **Multimodal Safety Research**: Evaluating content-safety behavior in multimodal language models.
|
|
@@ -228,6 +233,7 @@ print(output_text[0])
|
|
| 228 |
* **False Positives**: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.
|
| 229 |
* **False Negatives**: Unsafe content may occasionally be missed.
|
| 230 |
* **Context Sensitivity**: Classification performance depends on image quality, visual context, and the provided instruction.
|
|
|
|
| 231 |
* **Automated Classification**: The model should not be treated as a definitive legal or safety determination.
|
| 232 |
|
| 233 |
## **Acknowledgements**
|
|
|
|
| 26 |
|
| 27 |
# **ImageShield-MMCF-0.8B**
|
| 28 |
|
| 29 |
+
> **ImageShield-MMCF — Multimodal Content Filter** is a multimodal content-safety classifier built on top of **Qwen/Qwen3.5-0.8B** and trained on approximately **28,000 content-safety guardrail samples**. 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.
|
| 30 |
|
| 31 |
<a href="#example-cards">
|
| 32 |
<img src="https://img.shields.io/badge/View-Example_Cards-blue?style=for-the-badge" alt="Jump to Examples" />
|
|
|
|
| 36 |
> **This model is an experimental release and may generate unexpected behaviors or reasoning artifacts in certain scenarios.**
|
| 37 |
|
| 38 |
> [!IMPORTANT]
|
| 39 |
+
> **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.
|
| 40 |
|
| 41 |
## **Key Highlights**
|
| 42 |
|
|
|
|
| 44 |
* **Multimodal Content Filter**: Designed for visual content-safety classification.
|
| 45 |
* **28K Training Samples**: Trained on approximately **28,000 content-safety guardrail samples**.
|
| 46 |
* **Safe / Unsafe Classification**: Classifies visual content as either **Safe** or **Unsafe**.
|
| 47 |
+
* **NSFW Sensual Content Detection**: Focused on identifying potentially **Not Safe for Work (NSFW) sensual content** and related sensitive visual material.
|
| 48 |
* **Zero-Tolerance Safety Classification**: Uses a conservative classification policy that favors safety when the content is ambiguous.
|
| 49 |
* **Structured Output**: Produces a machine-readable JSON response containing a caption, classification, and reasoning.
|
| 50 |
|
|
|
|
| 145 |
## **Example Cards**
|
| 146 |
|
| 147 |
<div style="background-color: #000000; font-family: 'Courier New', Courier, monospace; color: #FFFFFF; padding: 24px; border-radius: 12px; border: 1px solid #333333; max-width: 800px; margin: 0 auto;">
|
| 148 |
+
|
| 149 |
<!-- Card 1 -->
|
| 150 |
+
|
| 151 |
<div style="margin-bottom: 32px;">
|
| 152 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222;">
|
| 153 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/yypVvKdEH3W5qcmt4E36R.jpeg" alt="Safe Image 1" style="width: 100%; height: auto; display: block;">
|
|
|
|
| 163 |
</div>
|
| 164 |
|
| 165 |
<!-- Thin Line Bar -->
|
| 166 |
+
|
| 167 |
<hr style="border: 0; border-top: 1px solid #333333; margin: 0 0 32px 0;">
|
| 168 |
|
| 169 |
<!-- Card 2 (NSFW - Blurred) -->
|
| 170 |
+
|
| 171 |
<div style="margin-bottom: 32px;">
|
| 172 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222; position: relative;">
|
| 173 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/XI2Xc5WmZrxKTSkVxV13U.png" alt="NSFW Image 2" style="width: 100%; height: auto; display: block; filter: blur(40px) saturate(0.8) brightness(0.9); transform: scale(1.1);">
|
|
|
|
| 175 |
<pre style="background-color: #0a0a0a; padding: 16px; border-radius: 8px; border: 1px solid #222; color: #e0e0e0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; margin: 0;">
|
| 176 |
{
|
| 177 |
"caption": "A blonde woman is shown from behind, wearing red thong-style underwear. She has long hair and a visible tattoo on her lower back. Her hands are positioned near her hips, holding the straps of the thong. The setting appears to be a modern living room with a window and a patterned sofa.",
|
| 178 |
+
"is_nsfw": <span style="color: #4ade80;">true</span>,
|
| 179 |
+
"reason": "The image is classified as NSFW due to revealing thong-style underwear, substantial skin exposure, and a suggestive presentation.",
|
| 180 |
"nsfw": <span style="color: #4ade80;">1</span>,
|
| 181 |
"safe": <span style="color: #4ade80;">0</span>
|
| 182 |
}</pre>
|
| 183 |
</div>
|
| 184 |
|
| 185 |
<!-- Thin Line Bar -->
|
| 186 |
+
|
| 187 |
<hr style="border: 0; border-top: 1px solid #333333; margin: 0 0 32px 0;">
|
| 188 |
|
| 189 |
<!-- Card 3 -->
|
| 190 |
+
|
| 191 |
<div>
|
| 192 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222;">
|
| 193 |
<img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/EX1Zg_-Up4va_44B3dONZ.jpeg" alt="Safe Image 3" style="width: 100%; height: auto; display: block;">
|
|
|
|
| 208 |
|
| 209 |
## **Training Details**
|
| 210 |
|
| 211 |
+
| Setting | Value |
|
| 212 |
+
| :------------------------- | :------------------------------------------- |
|
| 213 |
+
| **Base Model** | **Qwen/Qwen3.5-0.8B** |
|
| 214 |
+
| **Model Type** | **Multimodal Content-Safety Classifier** |
|
| 215 |
+
| **Training Samples** | Approximately **28,000** |
|
| 216 |
+
| **Training Objective** | Content-safety guardrail classification |
|
| 217 |
+
| **Primary Classification** | **Safe / Unsafe** |
|
| 218 |
+
| **Safety Focus** | **Not Safe for Work (NSFW) Sensual Content** |
|
| 219 |
+
| **Training Framework** | **TRL** |
|
| 220 |
|
| 221 |
## **Intended Use**
|
| 222 |
|
| 223 |
* **Content Safety Classification**: Classifying visual media as safe or unsafe.
|
| 224 |
+
* **NSFW Sensual Content Detection**: Supporting research into automated detection of potentially sensitive and sexually suggestive visual content.
|
| 225 |
* **Parental Controls**: Building conservative visual content-safety filtering systems.
|
| 226 |
* **Content Moderation**: Supporting automated safety classification pipelines.
|
| 227 |
* **Multimodal Safety Research**: Evaluating content-safety behavior in multimodal language models.
|
|
|
|
| 233 |
* **False Positives**: Benign content may occasionally be classified as unsafe due to the conservative classification threshold.
|
| 234 |
* **False Negatives**: Unsafe content may occasionally be missed.
|
| 235 |
* **Context Sensitivity**: Classification performance depends on image quality, visual context, and the provided instruction.
|
| 236 |
+
* **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.
|
| 237 |
* **Automated Classification**: The model should not be treated as a definitive legal or safety determination.
|
| 238 |
|
| 239 |
## **Acknowledgements**
|