How AI NSFW detection works on Discord
An image model rates each picture, and your settings decide what happens next. This is what the model sees, where it gets things wrong and what is kept.
By SfwBot Team5 min read

AI NSFW detection means that an image model looks at each picture posted in your server and reports how much nudity it shows. The bot compares that result with the level you set and deletes the message or leaves it alone. This article follows one image through that process, using SfwBot as the example.
What the model does with an image

The model is a neural network that was trained on a large set of labelled pictures. It has no list of forbidden pictures to compare against. It has learned what the labelled examples have in common, so it can rate a picture it has never seen.
For each image it answers one question: which of four levels fits.
| Level | Name | Typical content |
|---|---|---|
| 0 | Everyday | Memes, screenshots, selfies |
| 1 | Revealing | Swimwear, underwear and similar outfits |
| 2 | Implied nudity | Nudity that is covered or hidden |
| 3 | Explicit | Visible nudity and sexual content |
The model only rates. It does not know your rules and does not decide anything.
Your level decides what is deleted
You choose the level where blocking starts, and everything from that level up is deleted. A new server starts at level 3, so only explicit content is removed. A server for a younger audience might start blocking at level 1.
This split matters when you tune the bot. If too much is removed, you raise the level where blocking starts. If too little is removed, you lower it. The model stays the same in both cases.
On the paid plans you can refine this: a separate level for illustrations and art (Plus), and a level of its own for single channels or categories (Pro). The pricing page lists what each plan includes.
What happens before the model is asked
Most images never reach the model. SfwBot checks three things first:
- Exemptions. Media in exempt channels and from exempt roles is skipped. Age-restricted channels are skipped by default.
- Fingerprints. The bot calculates a fingerprint of the image, a short value that stays nearly the same when the image is resized or recompressed. If the fingerprint is on your allow list, the image passes. If it is on a block list, it is removed. Neither needs a scan.
- Repeats. Identical media that was scanned in the last 24 hours is not scanned again.
Only what is left goes to the model. That scan uses credits.
GIFs and videos

A video is too long to rate as one picture, so the bot takes frames from it and rates those. By default it checks 10 frames of a video and 5 of a GIF. With the deep video scan on the Pro plan it checks 30 and 15.
Sampling has a consequence you should know: a few explicit frames in a long video can fall between the samples. If a clip gets through, add it to your block list so its fingerprint is caught the next time.
Files over 32 MB are not scanned.
Where the model is wrong
No image model is right every time. The usual mistakes are:
- Skin-coloured surfaces. Close-ups of hands, faces or food are sometimes rated too high.
- Art. Classical paintings, sculpture and drawn characters are harder to rate than photos.
- Borderline outfits. The line between level 0 and level 1 is the least certain, which is why few servers block from level 1.
- Small or cropped images. The less the model can see, the less reliable the rating.
SfwBot treats a wrong call as something that will happen. Each deletion goes to your log channel with a Report as wrong button that sends it to review. An image on your allow list is never removed on your server again. A deletion by the model costs the member no trust unless you switch that on, so one wrong call does not lead to a strike.
What happens to the image
The bot downloads the media to analyse it and discards it right after. What it keeps is the fingerprint. An image itself is kept only when a decision is reported for review, until the review is done and for 30 days at most.
Data taken from a message, such as the media link and the fingerprint, is deleted after 30 days. Fingerprints on your own lists stay until you remove them. The details are on the security and privacy page.
Frequently asked questions
Can AI detection replace human moderators?
No. It removes the obvious cases within a moment, at any hour. Your moderators still decide the reported cases and everything that depends on context.
Does the model learn from my server's images?
The bot does not keep the images it scans. An image is kept only when a decision is reported for review, for 30 days at most.
Does the AI read text messages?
No. The model rates images, GIFs and videos. Text is handled by separate filters for invites, spam and links, which use no credits.
What happens when the scan fails?
The message stays, and the credits for that scan are refunded.


