{
  "id": "nsfw-image-detection",
  "identity": {
    "family": "vit",
    "display_name": "Falconsai NSFW image detection (ViT)",
    "hub_id": "Falconsai/nsfw_image_detection",
    "api_name": null,
    "revision": null,
    "variants": [],
    "license": "Apache-2.0",
    "commercial_use": true,
    "commercial_use_note": "Apache-2.0 on the repo; a community fine-tune of a ViT base, with no published training-data audit.",
    "release_date": "2023-10",
    "paper_url": "https://arxiv.org/abs/2010.11929",
    "repo_url": "https://huggingface.co/Falconsai/nsfw_image_detection"
  },
  "task": {
    "category": "classification",
    "modalities_in": [
      "image",
      "video"
    ],
    "modalities_out": [
      "labels",
      "scores"
    ],
    "best_at": "Fast binary normal/nsfw screening of images, and of video by the max score over sparse sampled frames.",
    "worst_at": "Graded or policy-specific safety (violence, drugs, suggestive but allowed content): it has two labels only; one bad frame between samples can be missed."
  },
  "io": {
    "input": {
      "image": {
        "resolution": "224x224 (ViTImageProcessor)",
        "color": "RGB"
      },
      "video": "sparse frames sampled by engine.inference.frame_sampling"
    },
    "output": {
      "labels": [
        "normal",
        "nsfw"
      ],
      "scores": "nsfw_score in [0, 1]; is_nsfw = nsfw_score >= threshold (default 0.5)"
    }
  },
  "mixpeek_wiring": {
    "extractors": [],
    "feature_uris": [],
    "vector_indexes": [],
    "retriever_stages": [
      "classify"
    ],
    "composes_with": [
      "classify task=nsfw calls mixpeek/content-classifier-v1 per document (image or video URL); text documents go to the DistilBERT text classifier in the same app"
    ]
  },
  "run": {
    "status": "served",
    "status_reason": "Image and video half of the mixpeek__content_classifier_v1 Serve app.",
    "serve_apps": [
      "mixpeek__content_classifier_v1"
    ],
    "runtime": "transformers pipeline(\"image-classification\") (ViTForImageClassification)",
    "weights_format": "safetensors",
    "trust_remote_code": false,
    "size_on_disk_mb": 343,
    "params_millions": 85.8,
    "preprocessing": "Flatten to RGB, pipeline image processor (resize 224, normalize); video sampled to sparse frames.",
    "postprocessing": "Softmax over both labels (top_k=None); nsfw_score is the max over labels matching nsfw/unsafe/porn/explicit/questionable, max over frames for video.",
    "serving_shape": "realtime",
    "batch_size": null,
    "serve_batch": null,
    "scale_to_zero": {
      "min_replicas": 0,
      "max_replicas": 4,
      "idle_timeout_s": 300,
      "memory_gb": 2,
      "num_cpus": 2,
      "num_gpus": 0,
      "cold_start_s": {
        "warm_node_s": null,
        "new_node_s": null,
        "source": null
      },
      "cpu_fallback": true
    }
  },
  "cost": {
    "unmeasured": true,
    "measured": null,
    "note": "No committed throughput or cost measurement for this model."
  },
  "evidence": {
    "unmeasured": true,
    "items": []
  },
  "refs": [
    "hf://Falconsai/nsfw_image_detection@96cb0d0342c7afb80cab76ecc58b265fa44da256"
  ],
  "formats": [
    {
      "ref": "hf://Falconsai/nsfw_image_detection@96cb0d0342c7afb80cab76ecc58b265fa44da256",
      "format": "safetensors",
      "file": "model.safetensors",
      "loader": "transformers / open_clip from_pretrained; Mixpeek Hub import (api/models/huggingface.py)",
      "supported_today": true
    },
    {
      "ref": "hf://Falconsai/nsfw_image_detection@96cb0d0342c7afb80cab76ecc58b265fa44da256",
      "format": "pytorch_bin",
      "file": "pytorch_model.bin",
      "loader": "torch.load (pickle); Mixpeek refuses pickle weights (shared/security/torch_pickle.py)",
      "supported_today": false
    },
    {
      "ref": "hf://Falconsai/nsfw_image_detection@96cb0d0342c7afb80cab76ecc58b265fa44da256",
      "format": "pytorch_pt",
      "file": "2 files, e.g. falconsai_yolov9_nsfw_model_quantized.pt",
      "loader": "torch.load (pickle); Mixpeek refuses pickle weights (shared/security/torch_pickle.py)",
      "supported_today": false
    }
  ],
  "use_cases": [
    "moderation",
    "classification"
  ],
  "recommended": {
    "value": true,
    "for": [
      "moderation"
    ],
    "reason": "Served CPU-only image safety classifier behind the content classifier app."
  },
  "demos": [],
  "seo": {
    "title": "Falconsai NSFW image detection (ViT): classification model",
    "description": "Falconsai NSFW image detection (ViT) is a image and video classification model (Apache-2.0). Served on Mixpeek, scaling to zero when idle.",
    "keywords": [
      "Falconsai NSFW image detection (ViT)",
      "vit",
      "classification",
      "Falconsai/nsfw_image_detection",
      "moderation"
    ],
    "faqs": [
      {
        "q": "What is Falconsai NSFW image detection (ViT) best at?",
        "a": "Fast binary normal/nsfw screening of images, and of video by the max score over sparse sampled frames."
      },
      {
        "q": "What are the limits of Falconsai NSFW image detection (ViT)?",
        "a": "Graded or policy-specific safety (violence, drugs, suggestive but allowed content): it has two labels only; one bad frame between samples can be missed."
      },
      {
        "q": "Can Falconsai NSFW image detection (ViT) be used commercially?",
        "a": "Yes. Apache-2.0 on the repo; a community fine-tune of a ViT base, with no published training-data audit."
      },
      {
        "q": "How does Falconsai NSFW image detection (ViT) run on Mixpeek?",
        "a": "Image and video half of the mixpeek__content_classifier_v1 Serve app."
      }
    ]
  },
  "last_verified": "2026-11-05",
  "sources": [
    "https://huggingface.co/Falconsai/nsfw_image_detection",
    "https://huggingface.co/api/models/Falconsai/nsfw_image_detection",
    "https://arxiv.org/abs/2010.11929",
    "server/engine/inference/nsfw/services.py",
    "server/shared/inference/nsfw/models.py",
    "server/shared/retrievers/stages/enrich/classify/services.py"
  ],
  "registry": {
    "mixpeek__content_classifier_v1": {
      "deployment": "mixpeek__content_classifier_v1",
      "service_id": "mixpeek/content-classifier-v1",
      "routes": "engine/inference/nsfw/routes.py",
      "route_prefix": "/mixpeek_content_classifier/v1",
      "enabled": true,
      "description": "Multimodal content (NSFW) classifier. Classifies text, images, and video (via sparse frame sampling) as safe/unsafe. Powers the tenant upload gate and the retriever 'classify' stage. CPU-only, no GPU required.",
      "capabilities": {
        "category": "classification",
        "modality_input": [
          "text",
          "image",
          "video"
        ],
        "modality_output": "structured",
        "supports_batch": false,
        "reranking_mode": null
      },
      "vector_config": null,
      "serve": {
        "min_replicas": 0,
        "max_replicas": 4,
        "idle_timeout_s": 300,
        "target_ongoing_requests": 5,
        "num_cpus": 2,
        "num_gpus": 0,
        "memory_gb": 2,
        "pinnable": false,
        "placement": "worker",
        "enabled": true
      },
      "interactive_twin": false,
      "interactive_serve": null,
      "schemas": {
        "input": "shared.inference.nsfw.models.InferenceRequest",
        "output": "shared.inference.nsfw.models.InferenceResponse",
        "config": "shared.inference.nsfw.models.InferenceConfigs"
      }
    }
  },
  "templates": [],
  "usage": {
    "namespaces": null,
    "collections": null,
    "uncounted": true,
    "templates": 0,
    "counted_at": null,
    "source": null
  },
  "facets": {
    "status": "served",
    "category": "classification",
    "family": "vit",
    "license": "Apache-2.0",
    "commercial_use": true,
    "modalities_in": [
      "image",
      "video"
    ],
    "modalities_out": [
      "labels",
      "scores"
    ],
    "use_cases": [
      "moderation",
      "classification"
    ],
    "recommended": true,
    "release_date": "2023-10",
    "params_millions": 85.8,
    "size_on_disk_mb": 343,
    "vector_dims": null,
    "vector_distance": null,
    "weights_format": "safetensors",
    "formats": [
      "pytorch_bin",
      "pytorch_pt",
      "safetensors"
    ],
    "loadable_today": true,
    "trust_remote_code": false,
    "cpu_fallback": true,
    "num_gpus": 0,
    "memory_gb": 2,
    "min_replicas": 0,
    "serving_shape": "realtime",
    "served": true,
    "ref_schemes": [
      "hf"
    ],
    "has_evidence": false,
    "cost_measured": false,
    "template_count": 0,
    "usage_namespaces": null,
    "usage_collections": null,
    "usage_uncounted": true,
    "has_demo": false,
    "rank_score": 4
  },
  "rank_score": 4
}
