Skip to content
imaged

NSFW classification

NSFW binary classifier

Score whether an uploaded image is safe or not safe for work.

Apache-2.0
Explore model

About this model

A binary NSFW classifier built on a ViT-B/16 fine-tuned by Falconsai. The build is the int8 ONNX export from onnx-community, around 83 MB on disk. Output is P(nsfw) in [0, 1] with a default 0.5 threshold for the safe vs nsfw label.

Use it to filter user uploads before display, or to flag uploads for human review. CPU warm runs land at 48 ms on M1 Max. CoreML cannot load the int8 ViT graph today.

What you can build

  • Filter user uploads before they reach a public feed.
  • Flag images for manual review at a 10% threshold.
  • Tag user-generated content in a private moderation queue.
  • Block uploads with high P(nsfw) on a community platform.

Variants & downloads

Choose the build for your app

Model files are being prepared.

Explore the model’s examples, source links, and integration notes while download variants are added.

Performance

Results depend on the device, runtime, and test conditions. Each measurement keeps its own context.

M1 Max, macOS 15, ONNX Runtime 1.17

See original catalog hardware notes · CPU

47.9 ms

Warm inference

Catalog reference · variant unspecifiedCold start (ms): 48.22

Reference result from the existing catalog; conversion variant and measurement date were not recorded.

RTX 2060, Ubuntu 24.04, ONNX Runtime 1.24.3

See original catalog hardware notes · CUDA

75.1 ms

Warm inference

Catalog reference · variant unspecified

Reference result from the existing catalog; conversion variant and measurement date were not recorded.

Integration examples

Vision SDK integration

cpp

#include "imaged/sdk.hpp"
#include "imaged/families/content_moderation/content_moderation_family.hpp"

imaged::SDK::AI ai;
auto& config = ai.getOptions();
config.set("nsfw.model", "weights/nsfw.onnx");
config.set("nsfw.inference.provider", "cpu");

imaged::SDK::ContentModerationFamily family;
family.load(config);

imaged::SDK::Image image;
image.load("user_upload.jpg");

auto result = family.run(&image);
auto* cr = std::get_if<imaged::SDK::ClassificationResult>(&result);
if (cr->score > 0.5) {
    // Block or queue for review
}