# vit-base-nsfw-detector by AdamCodd: Open-Weight Model
Source: https://savrn.com/models/vit-base-nsfw-detector
Markdown alternate of the page above; the site index is https://savrn.com/llms.txt

---

## Runs On

What it takes to serve vit-base-nsfw-detector (86M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

| Precision | Weights | Memory needed | Cheapest setup | Per hour | Also fits |
| --- | --- | --- | --- | --- | --- |
| 16-bit | 0.2 GB | 0.2 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/mi325x) $2.00 |
| 8-bit | 0.1 GB | 0.1 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/mi325x) $2.00 |
| 4-bit | 0.0 GB | 0.1 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/mi325x) $2.00 |

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the [SAVRN Index](https://savrn.com/ai-index/pricing/gpus), read Oct 24, 2026.

[vit-base-nsfw-detector on every accelerator the SAVRN Index prices, at every precision](https://savrn.com/models/vit-base-nsfw-detector/gpus)

## SAVRN's Notes on vit-base-nsfw-detector

Screening uploads before they hit a feed or a training set is the job here, and at 86 million parameters it barely registers on a GPU. The 16-bit weights take 0.2 GB and the run needs 0.2 GB of memory, so the cheapest slot in our table, one MI300X with 192 GB at $1.85 an hour on demand, is far more card than the model needs. Park it beside a larger model rather than give it a card of its own. It ships as safetensors and ONNX and targets transformers.js, so a browser deployment is possible.

Apache 2.0 allows commercial use, modification and redistribution provided the notices travel with it. The publisher fine-tuned google/vit-base-patch16-384 on about 25,000 drawings and photos with no generated images, and says it does worse on generated content, pointing to a separate model, AdamCodd/vit-nsfw-stable-diffusion, for that. And the last update was December 2024, so pin the checkpoint you tested.

SAVRN Research, 2026-09-18

## Model Card

By AdamCodd, published under apache-2.0, revision 8587de998f44.

This model is a fine-tuned version of [vit-base-patch16-384](https://huggingface.co/google/vit-base-patch16-384) on around 25_000 images (drawings, photos...). It achieves the following results on the evaluation set: - Loss: 0.0937 - Accuracy: 0.9654

New [07/30]: I created a new ViT model specifically to detect NSFW/SFW images for stable diffusion usage (read the disclaimer below for the reason): [AdamCodd/vit-nsfw-stable-diffusion](https://huggingface.co/AdamCodd/vit-nsfw-stable-diffusion).

Disclaimer: This model wasn't made with generative images in mind! There is no generated image in the dataset used here, and it performs significantly worse on generative images, which will require another ViT model specifically trained on generative images. Here are the model's actual scores for generative images to give you an idea: - Loss: 0.3682 (↑ 292.95%) - Accuracy: 0.8600 (↓ 10.91%) - F1: 0.8654 - AUC: 0.9376 (↓ 5.75%) - Precision: 0.8350 - Recall: 0.8980

### Model description

[Read the full model card (681 words)](https://savrn.com/models/vit-base-nsfw-detector/card)

## Configuration

Architecture

ViTForImageClassification

Layers

12

Hidden size

768

Feed-forward size

3,072

Attention heads

12

Stored precision

float32

Model type

vit

## Identity and Version

Repository

AdamCodd/vit-base-nsfw-detector

Publisher

AdamCodd

Task

Image classification

Modality

Image

Library

transformers.js

Parameters

86M parameters

Languages

nlp, vit

Revision

8587de998f441aac03fdd57a85d2e4cb808c7d64

First published

2024-01-03

Last updated

2024-12-03

## Files and Weights

16 files, 1.3 GB in total. The weights are 9 files totalling 1.3 GB in onnx, safetensors.

Weights9 files · 1.3 GB

Configuration4 files · 2.0 KB

Documentation1 file · 6.0 KB

Other1 file · 39.2 KB

Repository1 file · 1.5 KB

Every file

| File | Type | Size | SHA-256 |
| --- | --- | --- | --- |
| model.safetensors | Weights | 344.4 MB | 266efb8bf67c |
| onnx/model.onnx | Weights | 344.6 MB | dce8f5af8509 |
| onnx/model_bnb4.onnx | Weights | 52.6 MB | 5a5e12ed3400 |
| onnx/model_fp16.onnx | Weights | 172.4 MB | e9693884a06a |
| onnx/model_int8.onnx | Weights | 88.5 MB | d25aa73fe1ee |
| onnx/model_q4.onnx | Weights | 57.9 MB | a76b59a27ffa |
| onnx/model_q4f16.onnx | Weights | 50.3 MB | 8402aaf2e181 |
| onnx/model_quantized.onnx | Weights | 88.5 MB | 432763a6899e |
| onnx/model_uint8.onnx | Weights | 88.5 MB | 432763a6899e |
| config.json | Configuration | 715 B | — |
| onnx/config.json | Configuration | 691 B | — |
| onnx/preprocessor_config.json | Configuration | 327 B | — |
| preprocessor_config.json | Configuration | 232 B | — |
| README.md | Documentation | 6.0 KB | — |
| confusion_matrix.png | Other | 39.2 KB | — |
| .gitattributes | Repository | 1.5 KB | — |

## License and Download

License

apache-2.0

Access

Open weights, no gate

Download size

1.3 GB

[Download from AdamCodd](https://huggingface.co/AdamCodd/vit-base-nsfw-detector)

Released by AdamCodd through its official repository on Hugging Face. [Read the license](https://www.apache.org/licenses/LICENSE-2.0).

## Built From

- Derived from google/vit-base-patch16-384
- Quantized from google/vit-base-patch16-384

## Memory Requirements

| Precision | Weights in memory |
| --- | --- |
| As published | 1.3 GB |
| 16-bit | 0.2 GB |
| 8-bit | 0.1 GB |
| 4-bit | 0.0 GB |

Weights only, from the published parameter count; the key-value cache and runtime add to this.

## Questions About vit-base-nsfw-detector

### How much GPU memory does vit-base-nsfw-detector need?

About 0.2 GB at 16-bit and 0.1 GB at 4-bit: the weights (86M parameters) plus a working margin. A long context needs more.

### What is the cheapest GPU to run vit-base-nsfw-detector on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

### Can I use vit-base-nsfw-detector commercially?

Yes. vit-base-nsfw-detector is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

## Similar Models

Model · Image classification

### [nsfw_image_detector](https://savrn.com/models/nsfw-image-detector)

[Freepik](https://savrn.com/model-publishers/freepik)

This model is a vision transformer based on the EVA architecture, fine-tuned for NSFW content classification. It has been trained to detect four categories (neutral, low, medium, high) of visual content using 100,000 synthetically labeled images. The model can be used as a binary (true/false) classifier if desired, or you can obtain the full output probabilities.. It outperforms other excellent publicly available models such as Falconsai/nsfwimagedetection or AdamCodd/vit-base-nsfw-detector in our internal benchmarks adding the enrichment of being able to select the NSFW level that suits your use case. You can try this model directly in your browser through our Hugging Face Space. Upload…

Open weights mit 86M parameters transformers

[View model](https://savrn.com/models/nsfw-image-detector)

Model · Image classification

### [vit-base-oxford-iiit-pets](https://savrn.com/models/vit-base-oxford-iiit-pets)

[Ilias Strub](https://savrn.com/model-publishers/isxodin)

This model is a fine-tuned version of google/vit-base-patch16-224 on the pcuenq/oxford-pets dataset. It achieves the following results on the evaluation set: This model is a fine-tuned version of a pre-trained Vision Transformer (google/vit-base-patch16-224) for image classification on the Oxford-IIIT Pet Dataset. It uses transfer learning to adapt a generic vision model to identify 37 different cat and dog breeds. The model head is adjusted to output the number of classes in the dataset, and it is trained end-to-end using standard classification loss. - Educational demos on transfer learning and fine-tuning vision models. - Pet breed classification in structured datasets similar to Oxford…

Open weights apache-2.0 86M parameters transformers

[View model](https://savrn.com/models/vit-base-oxford-iiit-pets)

Model · Image classification

### [fairface_age_image_detection](https://savrn.com/models/fairface-age-image-detection)

[Dmytro Iakubovskyi](https://savrn.com/model-publishers/dima806)

Detects age group with about 59% accuracy based on an image. See https://www.kaggle.com/code/dima806/age-group-image-classification-vit for details.

Open weights apache-2.0 86M parameters transformers

[View model](https://savrn.com/models/fairface-age-image-detection)

Model · Image classification

### [vit-age-classifier](https://savrn.com/models/vit-age-classifier)

[Nate Raw](https://savrn.com/model-publishers/nateraw)

A vision transformer finetuned to classify the age of a given person's face.

Open weights 86M parameters transformers

[View model](https://savrn.com/models/vit-age-classifier)

Model · Image classification

### [nsfw-classifier](https://savrn.com/models/nsfw-classifier)

[Giacomo Arienti](https://savrn.com/model-publishers/giacomoarienti)

In today's digital world, user-generated content is a double-edged sword. While it fosters creativity and engagement, it also opens the door to inappropriate or illegal content being shared. Our NSFW Image Classifier is specifically designed to identify and filter out explicit images, including pornography, hentai, and sexually suggestive content, ensuring your platform remains safe, secure, and legally compliant. With more than 2M downloads, our NSFW Image Classifier has become the go-to solution for platforms looking to maintain a clean and safe environment for their users. Many developers and companies have already chosen our solution to protect their communities—will you be next? 1.…

Open weights cc-by-nc-nd-4.0 86M parameters transformers

[View model](https://savrn.com/models/nsfw-classifier)

Model · Image classification

### [nsfw_image_detection](https://savrn.com/models/nsfw-image-detection)

[Falcons.ai](https://savrn.com/model-publishers/falconsai)

The Fine-Tuned Vision Transformer (ViT) is a variant of the transformer encoder architecture, similar to BERT, that has been adapted for image classification tasks. This specific model, named "google/vit-base-patch16-224-in21k," is pre-trained on a substantial collection of images in a supervised manner, leveraging the ImageNet-21k dataset. The images in the pre-training dataset are resized to a resolution of 224x224 pixels, making it suitable for a wide range of image recognition tasks. During the training phase, meticulous attention was given to hyperparameter settings to ensure optimal model performance. The model was fine-tuned with a judiciously chosen batch size of 16. This choice not…

Open weights apache-2.0 86M parameters transformers

[View model](https://savrn.com/models/nsfw-image-detection)

## AdamCodd

[All models and datasets](https://savrn.com/model-publishers/adamcodd)

## Versions

- [8587de998f44](https://savrn.com/models/vit-base-nsfw-detector/versions/8587de998f44) · current 2026-09-18

## Explore More

- [All image classification models](https://savrn.com/models/tasks/image-classification)
- [All models under apache-2.0](https://savrn.com/models/licenses/apache-2-0)
- [Model comparisons](https://savrn.com/models/comparisons)
- [The model directory](https://savrn.com/models)
- [Open model prices by host](https://savrn.com/ai-index/pricing/open-models)

## Source

- Repository metadata, read 2026-10-19.
- [Hugging Face record](https://huggingface.co/AdamCodd/vit-base-nsfw-detector)
- [How the hub is built](https://savrn.com/model-hub/methodology)
