/ Модель

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

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

ncii-prompt-guard-3c

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

Трёхклассовый классификатор hfmlsoc для проверки англоязычных запросов на редактирование изображений и видео на риск создания неконсенсуальных интимных изображений.

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

Бенчмарки

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

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

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

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

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

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

hfmlsoc разработала классификатор на 257 млн параметров для оценки риска NCII в текстовых запросах на редактирование изображений и видео. Модель основана на текстовой архитектуре Gemma 3 и дообучена на microsoft/harrier-oss-v1-270m. Она принимает только текст запроса и относит его к одному из трёх классов: low — вероятно безопасное редактирование, review — запрос может привести к уменьшению количества одежды, block — запрос на обнажение или явную сексуализацию человека. Модель предназначена для предварительной проверки запросов перед передачей их в систему редактирования; авторы отмечают низкую задержку при работе на CPU. Контекст — до 32 768 токенов. Лицензия MIT.

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

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

NCII Prompt Guard; 3-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 was trained as a 3-class classifier by collapsing the two safer labels and the two riskier labels. The output labels map to:

  • 0 - low: likely benign image editing prompt.
  • 1 - review: the image editing prompt is likely to have the subject end up with less clothing, but no full nudity or sexual acts.
  • 2 - block: the image editing prompt requests nudification or explicit sexualization of the subject

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-3c", top_k=3)
guard("remove the clothes of the person in this photo")
# [{'label': 'block', 'score': 0.9999}, {'label': 'low', 'score': 0.0001}, {'label': 'review', ...}]

Whether the model is used to block prompts classified as 2 only or 1 and 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["block"] > 0.9
           else "REVIEW" if scores["review"] > 0.5 else "ALLOW")

The threshold is a deployer decision. The full operating curve is in the evaluation report (v3_3c_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
model3-class (severity bands)5-class (spec v3.3)
labelslow · review · blocksafe · suggestive-ambiguous · sexualizing-exposure · intimate-exposure · explicit-sexual-activity

The 3-class labels are the severity bands used throughout the project's evaluations: low = {safe, suggestive-ambiguous} → allow; review = sexualizing-exposure → warn/human review; block = {intimate-exposure, explicit-sexual-activity} → block. Deployers who want the finer ambiguity and exposure/act signals should use the 5-class sibling; 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", "yjernite/ncii-prompt-guard-5c", top_k=5)
three = pipeline("text-classification", "yjernite/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, labels collapsed to bands {0∪1, 2, 3∪4}.
  • 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 operating threshold; test (owner-audited) was read once, last, after the selection report was pushed.

Evaluation

Block view = gold {intimate-exposure, explicit-sexual-activity} (dataset labels 3–4); 0/1 confusion is internal to the low class by construction.

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

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

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

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_3c_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 the 5-class model (0% benign block in every ethnicity cell). This 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_3c,
  author = {Yacine Jernite},
  title = {NCII Prompt Guard - 3-class version},
  year = {2026},
  publisher = {Hugging Face},
  url = {https://huggingface.co/hfmlsoc/ncii-guard-v3-harrier-3c}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей