TostAI's nsfw-image-detection-large Hits 3.2M Downloads Replacing Costly Moderation APIs
A FocalNet-based image classifier sorts uploads into Safe, Questionable, and Unsafe buckets in under 100ms, hitting millions of downloads.
Takeaways
- TostAI's nsfw-image-detection-large passed 3.2M downloads on Hugging Face.
- Built on
microsoft/focalnet-base, classifies into Safe, Questionable, Unsafe at 512x512 input. - 87.1M parameters, sub-100ms per image on GPU, claimed 95%+ accuracy on benchmarks.
- Three-class output enables human-in-the-loop review for ambiguous uploads instead of hard thresholds.
- Licensed CC BY-NC-SA 4.0, so no commercial deployment without separate arrangement.
- Community fine-tunes already extend it with additional moderation datasets.
A three-class NSFW image classifier from TostAI has quietly become one of the most downloaded moderation models on Hugging Face, racking up over 3.2 million pulls without much fanfare. Built on Microsoft's FocalNet backbone, nsfw-image-detection-large is a compact 87M-parameter model aimed at teams that need to filter user-generated imagery without wiring up an external moderation API.
The middle bucket is what sets it apart. Most open NSFW detectors give you a binary safe-or-unsafe decision, which forces you to pick a threshold and live with the false positives. This one adds a Questionable tier so ambiguous uploads can route to human review instead of getting auto-blocked.
Three buckets, one FocalNet
The classifier is a fine-tune of microsoft/focalnet-base, a convolutional architecture that uses focal modulation instead of self-attention to aggregate context around each pixel. It sorts images into three categories, SAFE, QUESTIONABLE, and UNSAFE, after fine-tuning on a specialized NSFW dataset. The output labels map cleanly to a moderation pipeline:
- LABEL_0 (Safe): ship it through
- LABEL_1 (Questionable): send to a human reviewer or apply a soft blur
- LABEL_2 (Unsafe): block outright
Inputs are resized to 512x512 and normalized with ImageNet statistics. At 87.1M parameters in F32, the model runs comfortably on a single consumer GPU or even CPU for low-throughput workloads.