/ Модель

Характеристики

Лицензия
Своя лицензия
Базовая модель
dinov3-vith16plus-pretrain-lvd1689m
Опубликована
30 окт 2026

Ageis-image-safety-classifier-dinov3

Классификация изображенийИзображение → label3 профессии

Ageis — дообученный на DINOv3 классификатор для оценки вероятности NSFW-контента на изображениях и их фильтрации.

243скачиваний за 30 дней1лайквеса обновлены6 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Ageis — бинарный классификатор изображений для фильтрации контента 18+ и модерации. Модель разработана автором репозитория masterofaudio2077 на основе DINOv3 ViT-H+/16 от Meta AI: дообучены последние 16 из 32 блоков трансформера, а классификационная голова использует CLS-токен и среднее представление патчей. Она оценивает вероятность NSFW-контента и подходит для очистки наборов данных, первичной проверки пользовательских загрузок и направления подозрительных изображений на ручную проверку.

В README приведены результаты сравнения на отложенном наборе примерно из 100 тысяч изображений; автор сообщает ROC-AUC 0,9996 и долю ложных срабатываний 0,034% при целевой полноте 95% для текущих весов. Порог следует настраивать на собственных данных и правилах модерации: понятие NSFW зависит от контекста, а модель предназначена только для бинарной оценки NSFW/безопасно и не заменяет проверку человеком в важных случаях. Модель не генерирует изображения. Она распространяется на условиях лицензии DINOv3, указанной в README как лицензия DINO Materials; метаданные Hugging Face обозначают лицензию как other.

Сценарии применения

  • очистка веб-собранных наборов изображений от контента 18+
  • первичная автоматическая модерация изображений
  • проверка изображений при загрузке пользователями
  • отбор изображений для последующей проверки человеком

Ограничения

Модель специализирована на бинарной классификации NSFW и чистых изображений; определение NSFW зависит от культурного контекста и политики площадки. Настраивайте порог на своих данных и используйте ручную проверку для решений с высокими последствиями.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Ageis: Image Safety Classifier for Content Moderation (DINOv3 ViT-H+/16)

Ageis is a binary image classifier that works as a safety guardrail in image pipelines. It scores each image with the probability that it contains NSFW (Not Safe for Work) content, so that such images can be filtered out, blocked, or sent to human review. It is a classifier only and does not generate images.

It is a partial fine-tune of DINOv3 ViT-H+/16: the last 16 of 32 transformer blocks are trained, with a linear head on the concatenation of the CLS token and the mean of the patch tokens, using a BCE loss.

Built with DINOv3. The backbone weights are Meta's and are distributed under the DINOv3 License. This fine-tune is a derivative work of the DINO Materials and ships under the same terms.

Intended Uses & Limitations

Intended uses

  • Dataset cleaning: removing NSFW images from large web-scraped corpora at a chosen recall / false-positive operating point.
  • Automated content moderation: a first-pass filter in trust-and-safety pipelines, ahead of human review.
  • Upload screening: blocking sensitive images before they are stored or shown.

Limitations

  • Domain specificity: the model is specialised for NSFW vs. clean classification. It is not a general-purpose image classifier.
  • Cultural context: what counts as NSFW varies between communities. Calibrate the threshold to your own content policy.
  • Not a final decision-maker: use human review for high-stakes decisions.
  • BF16 saturation / calibration: the head is scaled by 1/6 (see "Post-release head scaling") and the final backbone LayerNorm is scaled by the reliability edit (see "Post-release backbone edit"). The current weights use 0.9959 for 95% recall and 0.7892 for 99% recall on the benchmark below; calibrate on your own data if the domain differs.

Evaluation

Ageis was compared with Falconsai/nsfw_image_detection_26 on about 100,000 held-out images. Training and validation shards were chosen with a fixed random seed (train 42, bench 43); the benchmark rebuilds those selections and uses only shards never seen in training or validation.

Test set composition:

slicecontentlabelimages
explicit photosexplicit photographic contentNSFW20,000
suggestive photossuggestive print scansNSFW20,000
explicit illustrationsexplicit illustrated contentNSFW10,000
LAION humansphotos of people, filtered cleanclean20,000
ImageNet-21kgeneral photographsclean15,000
Safeboorusafe illustration and anime artworkclean15,000

FPR at a given recall is the fraction of clean images wrongly flagged when the threshold is set to catch that fraction of NSFW images. The table below is the original release benchmark; see "Post-release head scaling" for the current weights.

metricAgeisFalconsai-26
ROC-AUC0.99850.9646
PR-AUC0.99740.9671
FPR at 95% recall0.23%20.40%
FPR at 99% recall0.51%42.01%

At 95% recall Falconsai-26 wrongly flags about 1 in 5 clean images and Ageis about 1 in 443. At 99% recall the original Ageis threshold was 0.859; the head-only scaled weights use 0.570 (see below), and the current backbone-edited weights use 0.7892 (see "Post-release backbone edit").

Per-slice results, each model at its own 95%-recall threshold (1.0 for Ageis, 0.0154 for Falconsai-26). For NSFW slices the number is recall (higher is better); for clean slices it is the false-positive rate (lower is better):

slicetypeAgeisFalconsai-26
ImageNet-21kclean, FPR0.007%3.73%
LAION humansclean, FPR0.11%4.76%
Safebooruclean, FPR0.60%57.92%
explicit photosrecall99.40%97.30%
suggestive photosrecall98.96%92.98%
explicit illustrationsrecall94.82%94.48%

Post-release head scaling (BF16 fix)

The original head produced logits large enough that the BF16 sigmoid saturated at 1.0. At the benchmark's 95%-recall target the ROC therefore jumped from 91.6% to 98.3% recall at threshold 1.0, so the "FPR@95" point actually operated at 98.3% recall and threshold tuning below 1.0 was impossible. The current weights divide head.weight and head.bias by 6 and round to BF16. No retraining was performed.

On the current benchmark snapshot:

metricoriginal head (BF16 path)scaled head
ROC-AUC0.99870.9996
PR-AUC0.99790.9996
FPR @ 95% recall0.180%0.034%
actual recall at that point98.30%95.16%
FPR @ 98.3% recall0.180%0.184%
FPR @ 99% recall0.410%0.410%

The scaled head gives a true 95% operating point (0.034% FPR) instead of a 98.3% point. At equal recall the two heads are effectively tied (0.180% vs 0.184% at 98.3%; both 0.410% at 99%); the practical gain is that the scaled head can actually hit 95% recall instead of jumping from 91.6% to 98.3%. The AUC gain comes from breaking BF16 score ties. The recommended thresholds for the head-only weights are 0.914 at 95% recall and 0.570 at 99% recall. The backbone edit below changes the logit scale; for the current weights use 0.9959 at 95% recall and 0.7892 at 99% recall. The 1/6 factor was selected on a 25% validation split; the held-out 25% test split gives AUC 0.9995 and FPR@95 0.032% (its FPR@99 is 0.608%, based on only 12.5k clean images and therefore noisy). The full benchmark is the headline above.

The benchmark's earlier saved numbers (AUC 0.9985, PR 0.9974, FPR@95 0.23%, FPR@99 0.51%) were produced with the original head and a slightly different LAION shard snapshot. The five non-LAION slices reproduce to four decimals on the current snapshot; the current LAION slice has no false positives at the 95% point. Do not attribute the 0.51% to 0.41% change to the head scaling: on the current snapshot the original head also scores 0.41% at 99% recall.

Per-slice rates on the current snapshot at 99% recall are essentially unchanged by the edit (explicit photos 99.7%, suggestive photos 99.4%, explicit illustrations 96.8%, Safebooru FPR 1.33%, ImageNet-21k FPR 0.03%, LAION humans FPR 0.00%). At 95% recall the scaled head reports the actual 95% operating point: explicit photos 97.1%, suggestive photos 97.2%, explicit illustrations 87.1%, Safebooru FPR 0.11%, ImageNet-21k 0.00%, LAION humans 0.00%.

A note on label noise. Visual audit of the tail errors shows that many lowest-scoring nsfw_cartoon/ns_slight_nsfw images are safe images labelled NSFW, and many highest-scoring clean_cartoon images are explicit or highly suggestive. Rank-one and sparse head-edit directions selected on a validation split did not improve FPR@99 robustly across five random splits. The remaining benchmark errors are therefore dominated by label noise, not by an obvious linear head deficiency. Audit the top-scoring "clean" images before quoting FPR to four digits.

Artifacts: bench_results.json (summary, per-slice rates, notes), bench_scores.csv (the earlier head-only per-image scores), norm_edit.npz (the fitted a), edit.json (edit metadata), and backbone_seed_robustness.json (five-seed split check).

Post-release backbone edit (final LayerNorm reliability scaling)

The current weights also contain a backbone-only edit. For each of the 1,280 hidden dimensions, the 50% edit split gives

e_j = (mu1_j - mu0_j) / sd_j
a_j = 1 + (e_j - mean(e)) / rms(e)

where mu1_j and mu0_j are the mean per-dimension contributions to the head logit for the NSFW and clean halves, and sd_j is the pooled within-class standard deviation. backbone.norm.weight and backbone.norm.bias are multiplied by a_j and rounded to BF16. No gradients were used and no retraining was performed.

Centering e makes mean(a) = 1, so the edit changes relative per-dimension reliability rather than applying a global feature scale. On this fit, rms(e) = 1.03 and a ranges from -3.26 to 4.08 (mean 1.0). The final LayerNorm is the only backbone parameter changed; all transformer blocks, embeddings, and the head are untouched.

On the same 100,683-image benchmark snapshot:

metrichead edit only+ backbone edit
ROC-AUC0.9995570.999615
PR-AUC0.9995920.999650
FPR @ 95% recall0.0335%0.0237%
FPR @ 99% recall0.4104%0.3709%
test ROC-AUC0.9994610.999543
test FPR @ 99% recall0.6235%0.5840%

Per-slice rates on the full snapshot. For NSFW slices the number is recall; for clean slices it is false-positive rate.

slicetypebase @95edit @95base @99edit @99
explicit photosrecall97.01%97.17%99.705%99.690%
suggestive photosrecall97.17%97.39%99.400%99.485%
explicit illustrationsrecall86.86%86.05%96.800%96.650%
SafebooruFPR0.112%0.079%1.343%1.224%
ImageNet-21kFPR0.000%0.000%0.033%0.020%
LAION humansFPR0.000%0.000%0.000%0.000%

The overall trade is lower false positives at both operating points and lower explicit-illustration recall: 86.86% -> 86.05% at 95% and 96.80% -> 96.65% at 99% on the full snapshot. On the held-out 25% test split, illustration recall at 95% is unchanged (87.64%), at 99% falls from 96.72% to 96.60%, and Safebooru FPR at 99% falls from 2.04% to 1.90%. The illustration drop is the main cost of the edit. A non-centered variant (mean(a) = 1.73) preserved more illustration recall but had worse overall AUC/FPR, so it was not released.

The edit was checked on five split seeds (42-45 and 2026): test ROC-AUC improves on all five (+4.5e-5 to +8.1e-5), FPR@95 improves by 0.8-1.6 basis points, and FPR@99 improves on four of five (the fifth is 0.8 basis points worse). Full-snapshot AUC is stable at about +5.8e-5. The edit is stored in norm_edit.npz (a, e, mu1, mu0, sd), with a summary in edit.json.

Training Details

  • Backbone: facebook/dinov3-vith16plus-pretrain-lvd1689m with RoPE train-time jitter disabled. Blocks 0-15 and the embeddings are frozen (stored in bf16). Blocks 16-31, the final norm, and the head are trained.
  • Head: Linear(2 x hidden -> 1) on [CLS; mean of patch tokens], BCE-with-logits.
  • Data: each batch is half positive, half clean (batch 300 at 224px). The clean half is 30% ImageNet-21k, 30% clean illustrations, 40% filtered LAION humans. The positive half mixes photographic and illustrated sources.
  • Optimizer: Lion. Backbone LR 8e-6 with layer-wise decay 0.75, head LR 2e-4, weight decay 0.1 on 2D parameters only, betas (0.9, 0.99), gradient clipping 1.0.
  • Schedule: 1k warmup steps, then cosine decay.
  • Augmentations: RandomResizedCrop (scale 0.65-1.0), horizontal flip, random downscale-upscale (p=0.25), JPEG re-encode at quality 30-90 (p=0.35). No colour jitter, because skin tone is part of the signal.
  • bf16 autocast and torch.compile on a single RTX 6000 Pro (96 GB).

Hardware Requirements

0.84B parameters, 1.68 GB of weights in bf16. At 224x224 it runs on a single T4 (16 GB) in fp16 with batch size 768. Use bf16 on Ampere and newer; the T4 (Turing) has no bf16 tensor cores, so use fp16 there.

How to Use

The repo contains the full model: the frozen DINOv3 backbone merged with the fine-tuned blocks, the head, and the normalisation constants. One download; no separate backbone access is needed.

import torch, torch.nn as nn
from huggingface_hub import PyTorchModelHubMixin
from transformers import AutoConfig, AutoModel

class NSFWClassifier(nn.Module, PyTorchModelHubMixin):
    def __init__(self, backbone_config: dict):
        super().__init__()
        self.backbone = AutoModel.from_config(AutoConfig.for_model(**backbone_config))
        self.n_reg = self.backbone.config.num_register_tokens
        self.register_buffer("mean", torch.zeros(1, 3, 1, 1))
        self.register_buffer("std", torch.ones(1, 3, 1, 1))
        self.head = nn.Linear(self.backbone.config.hidden_size * 2, 1)

    def forward(self, x):                       # x: (B,3,224,224) uint8 RGB
        x = (x.to(self.mean.dtype) / 255 - self.mean) / self.std
        h = self.backbone(pixel_values=x).last_hidden_state
        feat = torch.cat([h[:, 0], h[:, 1 + self.n_reg:].mean(1)], dim=1)
        return torch.sigmoid(self.head(feat).squeeze(1).float())    # p(nsfw)
        # current weights: p >= 0.9959 -> 95% recall; p >= 0.7892 -> 99% recall

# on a T4 or other Turing GPU use .to(torch.float16) instead of bfloat16.
model = NSFWClassifier.from_pretrained("masterofaudio2077/Ageis-image-safety-classifier-dinov3").to("cuda").to(torch.bfloat16).eval()

Preprocessing is a resize of the short side to 256 followed by a 224 center crop, RGB uint8. Normalisation happens inside the model:

from PIL import Image
import numpy as np

def preprocess(path, size=224):
    im = Image.open(path).convert("RGB")
    s = 256 / min(im.size)
    im = im.resize((round(im.width * s), round(im.height * s)), Image.BILINEAR)
    l, t = (im.width - size) // 2, (im.height - size) // 2
    a = np.asarray(im.crop((l, t, l + size, t + size)), dtype=np.uint8)
    return torch.from_numpy(a).permute(2, 0, 1)

with torch.no_grad():
    p = model(preprocess("image.jpg").unsqueeze(0).to("cuda"))
print(f"p(nsfw) = {p.item():.4f}")

Sufficiency heatmap (interpretability)

heatmap.py shows where in an image the classifier finds enough evidence on its own. It shows one small window at a time on a blank gray canvas, reads the logit, and averages the logit per pixel over sliding windows. Red means that region alone is enough to flag the image; blue means it looks clean on its own.

python heatmap.py image.jpg
python heatmap.py https://example.com/image.jpg --win 48 --stride 16 --out out.png

Requires matplotlib. The README preprocessing and this script use the same short-side-256 resize and 224 center crop, so the heatmap matches the scores above. Read the colors as relative evidence, not calibrated logits; logit 0 (p = 0.5) is only the blue/red display boundary, not the production threshold.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Архитектура ? неизвестна transformers в образе рантайма.

Ревизия весов
022b500

0 моделей