nsfw-image-detection-384

Maintained By
Marqo

nsfw-image-detection-384

PropertyValue
AuthorMarqo
Model TypeVision Transformer (ViT)
Base Architecturetimm/vit_tiny_patch16_384
Input Size384x384 pixels
Hugging FaceModel Repository

What is nsfw-image-detection-384?

nsfw-image-detection-384 is a highly efficient image classification model designed specifically for detecting Not Safe For Work (NSFW) content. Built by Marqo, this model stands out for its remarkable 98.56% accuracy while maintaining a significantly smaller footprint - approximately 18-20x smaller than comparable open-source alternatives. The model processes images at 384x384 pixels using 16x16 pixel patches, striking an optimal balance between accuracy and computational efficiency.

Implementation Details

The model was trained on a comprehensive dataset of 220,000 images, equally split between NSFW and SFW content (100,000 each) for training, with an additional 20,000 images for testing. It's built upon the ViT architecture and fine-tuned from the timm/vit_tiny_patch16_384.augreg_in21k_ft_in1k base model.

  • Training utilized advanced augmentation techniques including mixup, cutmix, and color jitter
  • Implements AdamW optimizer with cosine learning rate scheduling
  • Incorporates dropout (0.1) and drop path (0.05) for regularization
  • Uses label smoothing (0.1) for better generalization

Core Capabilities

  • Binary classification between NSFW and SFW content
  • Handles diverse content types including photos, drawings, Rule 34, memes, and AI-generated images
  • Adjustable confidence thresholds for precision-recall trade-offs
  • Efficient processing with lightweight architecture
  • Easy integration through the timm library

Frequently Asked Questions

Q: What makes this model unique?

The model's primary strength lies in its exceptional efficiency-to-accuracy ratio. While being 18-20x smaller than alternatives, it maintains high accuracy (98.56%) and can process a wide range of content types, making it ideal for production deployments where resource utilization is crucial.

Q: What are the recommended use cases?

The model is suitable for content moderation systems, user-generated content filtering, and automated content classification pipelines. However, users should note that NSFW classification can be subjective and contextual, so it's recommended to experiment with different confidence thresholds for specific use cases.

🍰 Interesting in building your own agents?
PromptLayer provides Huggingface integration tools to manage and monitor prompts with your whole team. Get started here.