← all repositories
yahoo/open_nsfw

Yahoo’s NSFW classifier: narrow scope, thin ResNet, zero illusions

A thin ResNet-50 Caffe model from Yahoo that scores photos for pornographic content, openly admitting it ignores cartoons, violence, and text.

6k stars Python Computer VisionML Frameworks
open_nsfw
Not currently ranked — collecting fresh signals.
star history

What it does The repository provides a pretrained Caffe deep neural network that ingests an image and emits a probability score between 0 and 1. Scores below 0.2 suggest the photo is likely safe for work, while scores above 0.8 flag probable pornographic content; the middle ground is left for developers to bin according to their own tolerance. It is essentially a reference implementation for preliminary filtering, not a finished moderation product.

The interesting bit Instead of claiming to solve all offensive content, the authors deliberately narrowed the scope to photographic pornography and are refreshingly blunt about the model’s limitations. They also shrank a ResNet-50 to half its filters per layer—trading a small accuracy hit for lighter compute and memory—then trained it on Hadoop and Spark clusters via CaffeOnSpark.

Key highlights

  • Outputs a continuous 0–1 probability score rather than a hard label, letting operators set their own thresholds.
  • Explicitly excludes sketches, cartoons, graphic violence, and text from its detection scope.
  • Built on a “thin” ResNet-50 1by2 architecture pretrained on ImageNet, then fine-tuned on an undisclosed editorially labelled dataset.
  • Yahoo recommends fitting a ROC curve to your own evaluation set and keeping humans in the loop for edge cases.
  • Licensed under the BSD 2-clause license inherited from the Caffe project.

Caveats

  • Yahoo does not release the training dataset or any accuracy benchmarks, and explicitly disclaims guarantees on output.
  • The README warns that errors are inevitable given the subjective nature of the problem, and advises fine-tuning for your own definition of safe content.
  • Human moderation is recommended for edge cases; the model is intended as preliminary filtering only, not a standalone solution.

Verdict Teams already using Caffe who need a reference scorer for photographic pornography may find this a useful starting point. Those expecting turnkey accuracy or broad detection of non-photographic NSFW content should expect to invest heavily in fine-tuning and human review.

Frequently asked

What is yahoo/open_nsfw?
A thin ResNet-50 Caffe model from Yahoo that scores photos for pornographic content, openly admitting it ignores cartoons, violence, and text.
Is open_nsfw open source?
Yes — yahoo/open_nsfw is open source, released under the BSD-2-Clause license.
What language is open_nsfw written in?
yahoo/open_nsfw is primarily written in Python.
How popular is open_nsfw?
yahoo/open_nsfw has 6k stars on GitHub.
Where can I find open_nsfw?
yahoo/open_nsfw is on GitHub at https://github.com/yahoo/open_nsfw.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.