Downloads · 30 days
35
8% of all-time downloads
electrohead/vit-fetish-nsfw-detector
vit-fetish-nsfw-detector is a image classification model from electrohead. Use it when you need a label for an image. It is set up for transformers. The card lists the license as apache-2.0.
A Vision Transformer (ViT) for binary NSFW/SFW image classification, specifically trained to handle fetish content and a wide variety of image styles including artwork, illustrations, and AI-generated imagery.
Downloads · 30 days
35
8% of all-time downloads
All-time downloads
463
Public
Parameters
86.1M
344 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors344 MB · 100%
From the Hugging Face model README
A Vision Transformer (ViT) for binary NSFW/SFW image classification, specifically trained to handle fetish content and a wide variety of image styles including artwork, illustrations, and AI-generated imagery.
This model is a fine-tuned version of AdamCodd/vit-base-nsfw-detector, further trained on a curated dataset to improve detection of fetish-specific NSFW content and to generalize across diverse image types.
The base model (AdamCodd/vit-base-nsfw-detector) was primarily trained on photographic content. This fine-tune extends its capabilities to better handle:
This makes the model more robust for content moderation systems that need to handle mixed media sources.
sfw, nsfw)| Metric | Validation | Test (Held-Out) |
|---|---|---|
| Accuracy | 93.95% | 92.44% |
| F1 Score | 93.95% | 92.44% |
| Precision | 93.97% | 92.45% |
| Recall | 93.95% | 92.44% |
| Label | Total | Train | Val | Test |
|---|---|---|---|---|
| NSFW | 1,351 | 947 | 202 | 202 |
| SFW | 1,305 | 915 | 195 | 195 |
The dataset includes a balanced mix of photographic content, AI-generated images, digital illustrations, drawings, and 3D renders across both classes.
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
import torch
# Load model and processor
model_name = "electrohead/vit-fetish-nsfw-detector"
processor = AutoImageProcessor.from_pretrained(model_name)
model = AutoModelForImageClassification.from_pretrained(model_name)
# Load and process image
image = Image.open("your_image.jpg")
inputs = processor(images=image, return_tensors="pt")
# Get prediction
with torch.no_grad():
outputs = model(**inputs)
predicted_class = outputs.logits.argmax(-1).item()
label = model.config.id2label[predicted_class]
print(f"Prediction: {label}")
# Get probabilities
probs = torch.nn.functional.softmax(outputs.logits, dim=-1)
print(f"SFW: {probs[0][0]:.2%}, NSFW: {probs[0][1]:.2%}")
Or using the pipeline API:
from transformers import pipeline
classifier = pipeline("image-classification", model="electrohead/vit-fetish-nsfw-detector")
result = classifier("your_image.jpg")
print(result)
This model is designed for:
sfw or nsfw.This model is intended for legitimate content moderation purposes. Please use responsibly.
Not intended for: