Skip to content
ModelListedExternal
Download

Lukejacob Nsfw Image Detector

This is an ONNX version of LukeJacob2023/nsfw-image-detector. It was automatically converted and uploaded using this Hugging Face Space.

KindOtherBase modelLukeJacob2023/nsfw-image-detectorVersionRevision 0a188e3

Model source

Kind
Other
File size
47.5–327 MB
Base model
LukeJacob2023/nsfw-image-detector
Version
vRevision 0a188e3
Updated
Sep 17, 2026
Downloads
8
Source
Hugging Face

Source description

nsfw-image-detector (ONNX)

This is an ONNX version of LukeJacob2023/nsfw-image-detector. It was automatically converted and uploaded using this Hugging Face Space.

Usage with Transformers.js

See the pipeline documentation for image-classification: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageClassificationPipeline


nsfw-image-detector

This model is a fine-tuned version of google/vit-base-patch16-224-in21k on the imagefolder dataset. It achieves the following results on the evaluation set:

  • Loss: 0.8138
  • Accuracy: 0.9316
  • Accuracy K: 0.9887

You can access 384 version on:

https://huggingface.co/LukeJacob2023/nsfw-image-detector-384

Model description

Labels: ['drawings', 'hentai', 'neutral', 'porn', 'sexy']

Intended uses & limitations

Training and evaluation data

A custom dataset about 28k images, if you need to improve your domain's accurate, you can contribute the dataset to me.

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 2e-05
  • train_batch_size: 32
  • eval_batch_size: 32
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_steps: 500
  • num_epochs: 10
  • mixed_precision_training: Native AMP

Training results

Training LossEpochStepValidation LossAccuracyAccuracy K
0.78361.07200.31880.90850.9891
0.24412.014400.23820.92570.9936
0.14123.021600.23340.93350.9932
0.08574.028800.29340.93470.9934
0.05695.036000.45000.93070.9927
0.03716.043200.55240.93570.9910
0.02327.050400.66910.93470.9913
0.028.057600.74080.93350.9917
0.01549.064800.81380.93160.9887

Framework versions

  • Transformers 4.36.2
  • Pytorch 2.0.0
  • Datasets 2.15.0
  • Tokenizers 0.15.0

Sources

1 source
Hugging FacePrimaryVersion 0a188e3d9fa7895f82f300f85496fb494b193bbc
huggingface.co/GamerYuan/lukejacob-nsfw-image-detector/tree/0a188e3d9fa7895f82f300f85496fb494b193bbc

Verified Sep 17

Model artifacts

8 artifacts

onnx/model_bnb4.onnx

onnx · 54.1 MB · SHA-256 739d172ab2d9…abc8 · Hugging Face

Download

onnx/model_fp16.onnx

onnx · 164 MB · SHA-256 93377d3fbca4…1ed8 · Hugging Face

Download

onnx/model_int8.onnx

onnx · 83.0 MB · SHA-256 9e6520870eb9…8758 · Hugging Face

Download

onnx/model_q4.onnx

onnx · 54.1 MB · SHA-256 739d172ab2d9…abc8 · Hugging Face

Download

onnx/model_q4f16.onnx

onnx · 47.5 MB · SHA-256 303da22f078a…521c · Hugging Face

Download

onnx/model_quantized.onnx

onnx · 83.0 MB · SHA-256 9e6520870eb9…8758 · Hugging Face

Download

onnx/model_uint8.onnx

onnx · 83.0 MB · SHA-256 de9c1b747a1f…15da · Hugging Face

Download

onnx/model.onnx

onnx · 327 MB · SHA-256 069ae20c7a3b…e5aa · Hugging Face

Download

Source excerpts

2 excerpts

--- license: apache-2.0 base_model: - LukeJacob2023/nsfw-image-detector tags: - generated_from_trainer datasets: - imagefolder metrics: - accuracy model-index: - name: nsfw-image-detector results: - task: name: Image Classification type: image-classification dataset: name: imagefolder type: imagefolder config: default split: train args: default metrics: - name: Accuracy type: accuracy value: 0.9315615772103526 library_name: transformers.js pipeline_tag: image-classification --- # nsfw-image-detector (ONNX) This is an ONNX version of [LukeJacob2023/nsfw-image-detector](https://huggingface.co/LukeJacob2023/nsfw-image-detector). It was automatically converted and uploaded using [this Hugging Face Space](https://huggingface.co/spaces/onnx-community/convert-to-onnx). ## Usage with Transformers.js See the pipeline documentation for `image-classification`: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageClassificationPipeline --- <!-- This model card has been generated automatically according to the information the Trainer had access to. You should probably proofread and complete it, then remove this comment. --> # nsfw-image-detector This model is a fine-tuned version of [google/vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k) on the imagefolder dataset. It achieves the following results on the evaluation set: - Loss: 0.8138 - Accuracy: 0.9316 - Accuracy K: 0.9887 You can access 384 version on: https://huggingface.co/LukeJacob2023/nsfw-image-detector-384 ## Model description Labels: ['drawings', 'hentai', 'neutral', 'porn', 'sexy'] ## Intended uses & limitations ## Training and evaluation data A custom dataset about 28k images, if you need to improve your domain's accurate, you can contribute the dataset to me. ## Training procedure ### Training hyperparameters The following hyperparameters were used during training: - learning_rate: 2e-05 - train_batch_size: 32 - eval_batch_size: 32 - seed: 42 - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 - lr_scheduler_type: linear - lr_scheduler_warmup_steps: 500 - num_epochs: 10 - mixed_precision_training: Native AMP ### Training results | Training Loss | Epoch | Step | Validation Loss | Accuracy | Accuracy K | |:-------------:|:-----:|:----:|:---------------:|:--------:|:----------:| | 0.7836 | 1.0 | 720 | 0....

Source context: 8 downloads · 0 likes · Pipeline image-classification · Library transformers.js · Repo GamerYuan/lukejacob-nsfw-image-detector