/ Модель

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

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

ncii-prompt-guard-5c

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

Пятиклассовый классификатор оценивает риск запросов на редактирование изображений и видео, связанных с NCII.

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

Бенчмарки

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

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

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

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

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

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

hfmlsoc разработала классификатор на основе текстового энкодера Gemma 3 для оценки риска NCII в запросах на редактирование изображений и видео. Модель содержит 257 млн параметров, принимает текст запроса и относит его к одному из пяти уровней: безопасный, неоднозначно сексуализированный, сексуализирующее изменение или уменьшение одежды, обнажение интимных частей либо явная сексуальная активность. Она предназначена для проверки запросов перед передачей в модель редактирования; автор указывает на низкую задержку при работе на CPU и контекст до 32 768 токенов.

Классификатор обучен на hfmlsoc/ncii-prompt-guard-data и дообучен на microsoft/harrier-oss-v1-270m. Он оценивает только текст запроса и не может установить наличие согласия. Заявленная область применения — англоязычные запросы на редактирование; в README также упомянуты небольшие выборки на испанском и китайском, но поддержка других языков ограничена. Модель выпущена под лицензией MIT.

Порог блокировки выбирает разработчик приложения: ошибки классификации могут приводить как к пропуску рискованных запросов, так и к блокировке безвредных. В оценке обнаружен более низкий recall для запросов с женскими референсами; обфусцированные безвредные запросы блокируются чаще. Данные оценки специально содержат пограничные случаи, поэтому опубликованные показатели не следует считать прогнозом для реального трафика.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

NCII Prompt Guard; 5-class version

Model description

A 268M-parameter (Gemma-3 text encoder) classifier that scores image and video editing prompts for non-consensual intimate imagery (NCII) risk. This model was trained to serve as an easy-to-use guardrail for developers of image and video editing apps that take an image input and editing prompt and output an image or video. It is optimized to run on CPU with low latency so as to add minimal cost to the process. The model only sees the prompt editing text and cannot adjudicate consent, it is intended as a way to add friction against NCII abuses while maintaining functionality for benign use cases.

Trained and evaluated on NCII Prompt Guard Dataset; read that card for the label specification with regulatory reasoning, per-row label provenance, and the demographic annotation methodology (with measured recall rates) that makes the per-group evaluation below possible.

This version predicts the full label specification, distinguishing the levels of severity and the nature of the request. The output labels map to:

  • 0 - safe: likely benign image editing prompt.
  • 1 - suggestive-ambiguous: the request is sexual-adjacent, but the level of exposure or the nature of the act cannot be established from the text alone (e.g. swimwear edits, euphemisms).
  • 2 - sexualizing-exposure: the subject is likely to end up sexualized or with less clothing, but with no intimate parts exposed.
  • 3 - intimate-exposure: the request asks to expose intimate parts of the subject (nudification or revealing edits).
  • 4 - explicit-sexual-activity: the request asks to depict the subject in explicit sexual acts.

Uses

Direct use: gate user prompts upstream of an editing model in demo or production deployments. For deployment stability, use the margin rule on the pipeline's class scores instead of bare argmax (the artifact ships fp32; load it without dtype overrides):

from transformers import pipeline
guard = pipeline("text-classification", model="hfmlsoc/ncii-prompt-guard-5c", top_k=5)
guard("remove the clothes of the person in this photo")
# [{'label': 'intimate-exposure', 'score': 0.997}, {'label': 'safe', 'score': 0.003}, ...]

Whether the model is used to block prompts classified as 3 and 4 only, or also to act on label 2, is a product decision, depending on the context of deployment.

scores = {d["label"]: d["score"] for d in guard(prompt)[0]}
verdict = ("BLOCK" if scores["intimate-exposure"] + scores["explicit-sexual-activity"] > 0.8
           else "REVIEW" if scores["sexualizing-exposure"] > 0.5 else "ALLOW")

The threshold is a deployer decision. The full operating curve is in the evaluation report (v3_final_report.json, linked below). Lower τ trades precision for recall.

Out of scope: non-editing-prompt text; languages beyond English (small Spanish/Chinese slices only); child safety-specific uses.

Alternate version

This model is one of two trained on the same dataset with different granularities of prediction.

this repositorysibling
model5-class (spec v3.3)3-class (severity bands)
labelssafe · suggestive-ambiguous · sexualizing-exposure · intimate-exposure · explicit-sexual-activitylow · review · block

The 5-class labels distinguish the ambiguity band (label 1) from clearly benign prompts, and exposure of intimate parts (label 3) from depicted sexual acts (label 4) — the two prongs of NCII-focused regulation — which is useful when a deployer wants those signals for product decisions or logging. The 3-class sibling collapses them into the three severity bands. The comparison of both is in Evaluation and Bias and disparate impact.

Both versions load through the same native pipeline API — top_k returns the softmaxed class scores used for a deployment rule:

five = pipeline("text-classification", "hfmlsoc/ncii-prompt-guard-5c", top_k=5)
three = pipeline("text-classification", "hfmlsoc/ncii-prompt-guard-3c", top_k=3)

prompt = "make her outfit more revealing for a costume party"
five(prompt)[0], three(prompt)[0]  # 5 spec labels | low / review / block

Training details

  • Data: the train split of NCII Guard Training Dataset v3, 80,053 prompts, 88.6% benign by design (mirroring deployment traffic), labels under spec v3.3 with full provenance.
  • Recipe: LoRA r=16 (α=32, all-linear targets, classification head trained and saved), lr 2e-4, 2 epochs, class-weighted cross-entropy, seed 42; adapters merged (merge_and_unload) to a single fp32 artifact.
  • Selection protocol (pre-registered): valid (train-distribution holdout) = training sanity only; dev (owner-audited labels) selected the configuration and the operating threshold; test (owner-audited) was read once, last. A replicated 5-config grid established that learning rate dominates method choice and that single-seed differences below ~7pp block recall are noise — full story in v3_grid_report.json.

Evaluation

Block view = gold {intimate-exposure, explicit-sexual-activity}; 0/1 confusion is excluded from all metrics by design (the two low-severity labels are operationally one band).

Test split (read once, each model at its pre-selected operating point):

modeloperating pointblock recallblock precisionbenign block rate
5-class (this repo)P(3)+P(4) > 0.80.8910.9382.7%
3-classP(block) > 0.90.9020.9263.8%

Pooled dev+test (4,060 rows, 1,439 gold block, 2,538 gold low-band): 5-class 0.897 recall / 0.936 precision / 3.3% benign block; 3-class 0.903 / 0.923 / 4.4%.

For context, the previously deployed binary guard measured 0.80 block recall with 6.0% benign-block on the same pooled rows; a v3.3-spec label audit showed 14% of the old training labels in the risk band were wrong — which is why this generation was rebuilt on corrected labels. We report banded recall and precision rather than F1: F1 merges the two into one number and hides the recall/precision tradeoff that the operating threshold exists to set, and per-class F1 on the low-severity classes carries exactly the 0↔1 confusion the spec rules out of scope. Full reports with per-row probabilities (any operating point re-derivable without re-scoring): v3_final_report.json, v3_pooled_disparity.json.

Bias and disparate impact

Measured on pooled dev+test for statistical strength, on the dataset's reference-based demographic annotations (how people are referred to in the prompt text — never inferred identities). Cells with n < 10 omitted. The evaluation sets are enriched for boundary rows — absolute rates are not traffic estimates; re-measure on your own deployment traffic before setting thresholds.

groupgold block nrecall (5c)recall (3c)gold low nbenign block (5c)benign block (3c)
gender: feminine3710.8710.8763183.5%7.2%
gender: masculine2110.9480.9382276.2%5.7%
gender: unmarked8570.8960.9071,6112.9%3.6%
ethnicity: black270.7040.741660%0%
ethnicity: white200.6000.600700%0%
ethnicity: east asian150.9330.933180%11.1%
ethnicity: south asian190.8420.895170%5.9%
ethnicity: hispanic/latino250.9600.960234.3%17.4%
ethnicity: MENA150.8000.800160%0%
trans: nonbinary180.8890.889200%0%
trans: trans man170.8240.824150%0%
trans: trans woman130.7690.769205.0%15.0%
person: input person6620.9080.9144435.2%7.7%
person: no person220.7730.8183092.3%3.2%
obfuscation: emoji1250.8800.9283611.1%13.9%
obfuscation: leetspeak300.8000.8332913.8%10.3%
obfuscation: none1,2650.9020.9022,0903.0%4.1%

Findings, stated plainly:

  • Feminine-referenced block content is under-detected by ~7pp vs masculine in both models (371 vs 211 gold rows — the largest per-group disparity, replicated on dev and test separately). This is the top target for the next data iteration.
  • No ethnic group is over-blocked by this 5-class model (0% benign block in every ethnicity cell). The 3-class model shows small-cell benign over-blocks (hispanic 17%, trans-woman 15%, east-asian 11% on n = 18–23) — plausibly noise at these sizes, but flagged.
  • Recall gaps by ethnicity exist in both models (white 0.60, black 0.70–0.74, MENA 0.80 on n = 15–27 block rows — confidence intervals ±15–20pp). These are flags for larger evaluation cells, not established findings.
  • Benign obfuscated prompts are over-blocked ~4× vs plain text in both models (the known obfuscation caveat).

Limitations

  • Single seed, single run per configuration; the replication study puts ~7pp between-seed noise on block recall — treat smaller differences as ties.
  • Demographic annotations are reference-based with a measured ceiling (ethnicity recall 55% vs generation conditioning): none means "not referenced in text," never "not a member of any group."
  • Obfuscation families (leetspeak, char-spacing, emoji) are self-generated transforms — real-world evasion coverage is unknown beyond them.
  • The evaluation sets are enriched for boundary cases; absolute rates are not deployment estimates.
  • The gender recall gap above is a stated caveat for any deployment until fixed.

Citation and provenance

@misc{ncii_guard_v3_5c,
  author = {Yacine Jernite},
  title = {NCII Prompt Guard - 5-class version},
  year = {2026},
  publisher = {Hugging Face},
  url = {https://huggingface.co/hfmlsoc/ncii-prompt-guard-5c}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей