Image Classification
Transformers
Safetensors
English
siglip
SigLIP2
ImageShield
90M
Guardrail

You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

1

ImageShield-SUPER-90M

ImageShield-SUPER-90M is a vision-language image classification model based on google/siglip2-base-patch16-224, trained on 100K samples from the ImageShield-Guardrail Safe and Unsafe Images dataset. Built on the SiglipForImageClassification architecture, the model is designed to classify visual content as Safe or Unsafe for content moderation and media filtering.

SigLIP 2: Multilingual Vision-Language Encoders with Improved Semantic Understanding, Localization, and Dense Features https://arxiv.org/pdf/2502.14786

This model is experimental. Expert VLMs are coming soon: ImageShield Multimodal SFT Collection.

Label Space: 2 Classes

The model classifies each image into one of the following content categories:

Class 0: "Safe"
Class 1: "Unsafe"

Install Dependencies

pip install transformers torch torchvision pillow gradio

Inference Code

import gradio as gr
from transformers import AutoImageProcessor, SiglipForImageClassification
from PIL import Image
import torch

# Load model and processor
model_name = "prithivMLmods/ImageShield-SUPER-90M"
model = SiglipForImageClassification.from_pretrained(model_name)
processor = AutoImageProcessor.from_pretrained(model_name)

# ID to Label mapping
id2label = {
    "0": "Safe",
    "1": "Unsafe"
}

def classify_image(image):
    image = Image.fromarray(image).convert("RGB")
    inputs = processor(images=image, return_tensors="pt")

    with torch.no_grad():
        outputs = model(**inputs)
        logits = outputs.logits
        probs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()

    prediction = {
        id2label[str(i)]: round(probs[i], 3)
        for i in range(len(probs))
    }

    return prediction

# Gradio Interface
iface = gr.Interface(
    fn=classify_image,
    inputs=gr.Image(type="numpy"),
    outputs=gr.Label(
        num_top_classes=2,
        label="Predicted Content Type"
    ),
    title="ImageShield-SUPER-90M",
    description="Classifies images as Safe or Unsafe."
)

if __name__ == "__main__":
    iface.launch()

Intended Use

This model is intended for applications such as:

  • Content Moderation: Identify unsafe visual content.
  • Parental Controls: Support AI-based media filtering.
  • Dataset Preprocessing: Categorize and filter safe and unsafe images.
  • Online Platforms: Assist with content safety and upload moderation.
  • AI Image Applications: Provide an additional safety layer for image generation and editing workflows.

Classification Report

Training vs Evaluation Loss / Accuracy

Training vs Evaluation Loss and Accuracy

Precision / Recall / F1-score per Class

Per-Class Precision, Recall, and F1-score

Confusion Matrix

Confusion Matrix

Test Set Class Distribution

Test Set Class Distribution

Overall Prediction Accuracy

Overall Prediction Accuracy

Misalignment Distribution by True Class

Misalignment Distribution by True Class

Acknowledgements

  • Transformers: Transformers provides state-of-the-art machine learning models for text, computer vision, audio, video, and multimodal tasks, supporting both inference and training.

  • SigLIP 2: Multilingual vision-language encoders with improved semantic understanding, localization, and dense feature representations.

Downloads last month
-
Safetensors
Model size
92.9M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for prithivMLmods/ImageShield-SUPER-90M

Finetuned
(125)
this model

Datasets used to train prithivMLmods/ImageShield-SUPER-90M

Collection including prithivMLmods/ImageShield-SUPER-90M

Paper for prithivMLmods/ImageShield-SUPER-90M