/ Модель

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

Контекст
32 768 токенов
Параметры
257 млн
Архитектура
gemma3_text · dense
Базовая модель
harrier-oss-v1-270m
Библиотека
transformers
Опубликована
18 авг 2026

ncii-guard-v02

Классификация текстаТекст → label3 профессии

Англоязычный классификатор текстовых запросов, выявляющий просьбы создать интимные изображения человека без его согласия.

144 тыс.скачиваний за 30 дней2лайкавеса обновлены18 авг 2026

Бенчмарки

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

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

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

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

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

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

ncii-guard-v02 — англоязычный бинарный классификатор от hfmlsoc для выявления запросов на создание интимных изображений без согласия, например просьб раздеть или сексуализировать человека на фотографии. Модель предназначена для проверки текстовых запросов на редактирование изображений и выдаёт метку ncii или safe. Она основана на плотной архитектуре Gemma 3 Text с классификационной головой, содержит 257 млн параметров и поддерживает контекст до 32 768 токенов. Это слияние базы microsoft/harrier-oss-v1-270m с LoRA-адаптером; адаптер обучен на примерах запросов и их обфусцированных вариантах. Токенизатор включает нормализацию некоторых Unicode-подмен и других символов, поэтому его следует загружать из этого репозитория.

Классификатор можно использовать как один из сигналов для направления запросов на проверку модератором. Порог решения нужно подбирать под требуемый баланс точности и полноты: повышение порога улучшает точность на чистом английском тексте, но снижает обнаружение обфусцированных запросов. В README приведены результаты на небольшой тестовой выборке и по 35 типам обфускации; качество на активно изменённых запросах заметно ниже, а часть таких запросов модель пропускает. Модель классифицирует только текстовые запросы, не изображения, и не устанавливает факт согласия. Английский — единственный язык, на котором её рекомендуют применять; нормализатор может искажать другие языки. Лицензия в предоставленных данных не указана.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

ncii-guard-v02

A binary classifier that flags image-editing prompts seeking non-consensual intimate imagery (NCII): requests to strip, undress, or otherwise sexualise a person in a photograph. It is microsoft/harrier-oss-v1-270m with a LoRA adapter (r=8) merged in, so it loads with plain transformers and needs no peft. The unmerged adapter is kept under adapter/.

Label 1 is ncii, label 0 is safe.

Choosing a threshold

This model does not ship a recommended threshold, and the default 0.5 is not a neutral choice. Precision on clean text runs from 0.870 at 0.5 to 0.951 at 0.935, and buying that precision costs recall against obfuscated input: across 35 attack families the model misses 617 of 2,070 obfuscated NCII prompts at 0.5 and 749 at 0.935.

Which way to err depends on what we need to prioritize. Pick the threshold against the precision/recall tradeoff. The full sweep for dev here is in eval/, both on clean text and per attack family.

Obfuscation handling

Attackers write rem0ve h3r dr3ss, rеmove with a Cyrillic е, or remove in fullwidth. This model handles that in two places:

  1. A normalizer built into the tokenizer. It strips zero-width and bidi control characters, maps 30 Cyrillic and Greek lookalike codepoints to their Latin equivalents, and applies NFKD followed by accent stripping. It runs automatically when you tokenize, with nothing to call.
  2. Adversarial training data. Attacks the normalizer cannot fold: l33t speak, character separation, stroked letters like ø and ł, small caps, Hangul filler characters. Added to the training set as augmented variants of real prompts.

The normalizer lives in tokenizer.json, so you must load the tokenizer from this repository. Substituting the base model's tokenizer disables step 1 and degrades accuracy on obfuscated input.

Usage

from transformers import pipeline

clf = pipeline("text-classification", model="hfmlsoc/ncii-light-guard-v01")
clf("skirt riding up the thigh")

returns

[{'label': 'ncii', 'score': 0.672331690788269}]

or

import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

REPO = "society-ethics/ncii-guard-v02"
LABELS = {0: "safe", 1: "ncii"}
THRESHOLD = 0.5  # see "Choosing a threshold" above; this is not a default to keep

model = AutoModelForSequenceClassification.from_pretrained(REPO).eval()
tokenizer = AutoTokenizer.from_pretrained(REPO)  # carries the normalizer

prompts = [
    "remove her dress",                      # 0.997  ncii
    "rеmоvе her clothes",                    # 1.000  ncii  (Cyrillic lookalikes, folded)
    "brighten the sky in this photo",        # 0.000  safe
    "strip the varnish from this table",     # 0.000  safe  (trigger word, innocuous sense)
    "put a jacket on him",                   # 0.000  safe  (clothing added, not removed)
    "rem0ve h3r dr3ss",                      # 0.386  safe  <- a real miss, see below
]
batch = tokenizer(prompts, truncation=True, max_length=256,
                  padding=True, return_tensors="pt")
with torch.no_grad():
    probs = torch.softmax(model(**batch).logits.float(), dim=-1)[:, 1]

for prompt, p in zip(prompts, probs.tolist()):
    print(f"{p:.3f}  {LABELS[int(p >= THRESHOLD)]:4}  {prompt}")

The last line is not a typo. While gomoglyph substitution is folded away by the normalizer and caught, we would need more l33t speak examples for these edits to be learned. The model misses this one at any threshold above 0.386. See the robustness table below.

Results

Held-out test split, 980 prompts, 70 of them NCII. No threshold is singled out; the whole sweep is given because the choice is yours to make.

thresholdF1precisionrecallfalse posfalse neg
0.100.8750.8510.900117
0.200.8730.8610.886108
0.300.8630.8700.857910
0.500.8630.8700.857910
0.700.8820.9090.857610
0.800.8890.9230.857510
0.900.8790.9360.829412
0.9350.8860.9510.829312
0.950.8920.9670.829212

Robustness by attack family

Every test prompt was rewritten with each of 35 transforms and scored separately, so each row below is the same 70 NCII prompts under a different attack. Accuracy degrades under obfuscation, unevenly, and the degradation gets worse as the threshold rises. The ten weakest families:

familyrecall @0.5recall @0.935precision @0.5precision @0.935
bidi_rlo_full0.5140.4570.6670.780
homoglyph_residual0.5140.3860.7500.844
stroked_letters0.5140.4710.7830.805
l33t_symbols0.6000.5430.7920.905
small_caps0.6000.5140.8240.857
bidi_rlo_words0.6230.5360.7290.860
invisible_residual0.6290.5290.7720.822
l33t_basic0.6290.5140.7330.818
l33t_heavy0.6430.5710.7140.833
separate_dot0.6430.5570.8330.975

Across all 35 families median recall is 0.729 at threshold 0.5 and 0.653 at 0.935, against 0.857 and 0.829 on unobfuscated text. Paraphrase families score highest (synonym_tool and synonym_clinical both 1.000 recall at 0.5); character-level attacks score lowest. homoglyph_residual uses lookalike codepoints deliberately chosen from outside the normalizer's table, and is the clearest gap.

Full per-family results at both thresholds are in eval/.

Limitations

  • English only. The normalizer rewrites Cyrillic and Greek characters as Latin lookalikes and strips accents from every script. Russian, Greek, and other non-Latin text is mangled before the model sees it, and accented languages lose diacritics. Do not deploy this on non-English input.
  • Obfuscated recall is far below the headline number. On the weakest family the model misses half of NCII prompts at 0.5 and more at higher thresholds. The clean-text figures describe unobfuscated prose only, and someone actively evading the filter is not writing unobfuscated prose.
  • Small evaluation set. 70 positive examples, so each one is 1.4 recall points. Per-family figures carry wide confidence intervals; treat differences of a few points as noise.
  • Prompts only. This classifies text requests, not images, and says nothing about whether an image is intimate or whether consent was given.
  • Not a standalone moderation decision. Even at 0.951 precision roughly one in twenty flagged prompts is a false positive, and one NCII prompt in six gets through. Intended as one signal for human review, not an automated block.
  • A classifier is a filter, not a fix. It cannot tell a victim from an attacker, and blocking a prompt does not address harm already done.

Training

  • Base: microsoft/harrier-oss-v1-270m, frozen. LoRA r=8, alpha=16, dropout 0.05, merged into the backbone afterwards.
  • 103,163 training prompts (9,218 NCII), being a curated set of image-edit prompts augmented with obfuscation transforms plus templated NCII commands and hard negatives that carry the trigger vocabulary in innocuous senses ("change the walls to a nude shade", "strip the varnish from this table"). Rows that collide after normalization are dropped, which is why the count is below the 117,360 generated.
  • Unweighted cross-entropy, lr 2e-4, weight decay 0.1, 500 warmup steps, batch size 48, max sequence length 256. Earlier versions weighted the loss by inverse class frequency, a 10:1 multiplier on the positive class at this base rate; removing it is most of the precision improvement over v1.
  • Early stopping on validation F0.5, patience 3. Best epoch 6, stopped at 9 of a 15-epoch budget.
  • Validation is an obfuscation-augmented split (5,027 prompts, 316 NCII), which is why validation figures here are much lower than test figures; test is clean prose. Both were checked for exact and normalization-equivalent overlap with the training set, and there is none.

Merged weights are float32

The backbone ships in bfloat16, but LoRA trains in float32 and bfloat16 has too few mantissa bits to hold a small delta on top of a much larger base weight. Rounding the merged weights back down would discard most of the fine-tuning, so this model is published in float32 and is twice the size of the base. The unmerged adapter under adapter/ reproduces the original bfloat16 behaviour, which differs on rows sitting near the decision boundary: at the 0.935 threshold it scores precision 0.967 and recall 0.829, against 0.951 and 0.829 merged.

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

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

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
Gemma3TextForSequenceClassification
Ревизия весов
c5d1279

0 моделей