/ Модель

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

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

ncii-edit-guard-270m-v1

Классификация текстаТекст → label3 профессии
41скачиваний за 30 дней0лайковвеса обновлены13 окт 2026

Описание модели

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

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

ncii-edit-guard-270m-v1 — компактный классификатор текстовых запросов для приложений редактирования изображений и видео, разработанный на основе microsoft/harrier-oss-v1-270m. Модель с архитектурой Gemma3TextForSequenceClassification содержит около 257 млн параметров и принимает только текст; она присваивает запросу один из трёх классов: безопасное редактирование, сексуальный контент без нацеливания на человека или риск создания несанкционированных интимных изображений человека. Указанная длина контекста — 32 768 токенов, хотя при обучении использовалась максимальная длина 512 токенов.

Модель предназначена для предварительной фильтрации запросов на редактирование: запросы с меткой ncii-risk можно направлять на блокировку или дополнительную проверку. В карточке указаны macro F1 0,804 и полнота 0,895 для класса ncii-risk. Ограничения включают заметное завышение числа срабатываний на безопасных запросах с женскими именами, низкую полноту на запросах в стиле текст-в-изображение и тот факт, что модель не анализирует само изображение или видео и не может определить согласие. Лицензия — MIT.

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

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

Ограничения

Модель анализирует только текст и не видит изображение или видео; согласие по запросу определить невозможно. В карточке отмечены завышенное число срабатываний на безопасных запросах с женскими именами и низкая полнота на промптах в стиле text-to-image.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

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

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

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

Открыть на Hugging Face

Built with ML Intern

ncii-edit-guard-270m-v1

A lightweight prompt guard for image- and video-editing applications: a 3-class classifier that scores whether an editing prompt is likely to be a nudification / non-consensual intimate imagery (NCII) request about a person in the input. Built for latency- and memory-constrained deployment: 268.1M parameters, ~4.2 ms per sequence (batch 8, A10G, CUDA).

What the model is

  • Base model: microsoft/harrier-oss-v1-270m (gemma3-text encoder, MIT), fine-tuned as Gemma3TextForSequenceClassification with a 3-class head, class-weighted cross-entropy (weights 1.0/1.8/1.8), 3 epochs, effective batch 32, lr 2e-5, max length 512.
  • Task: text classification of editing prompts.
  • Labels:
    • safe (0) — edits that would not typically produce NCII on a user's photo/video (clothing, background, restoration, style, …)
    • explicit-not-person-targeted (1) — sexual/nudity content requested without an identifiable person as target (e.g. adding an anonymous nude figure to a landscape)
    • ncii-risk (2) — nudification or sexualization of a person in the input. Since consent cannot be read from text, this is a risk signal, not a determination of intent.
  • Deployment suggestion: block or review ncii-risk; policy decides whether explicit-not-person-targeted is also blocked.
from transformers import pipeline
clf = pipeline("text-classification", model="yjernite/ncii-edit-guard-270m-v1")
clf("remove her top and make it look realistic")
# [{'label': 'ncii-risk', 'score': ...}]

Training data

23,348 real + 2,849 synthetic rows (yjernite/ncii-guard-train-v1):

SourceRoleRows
curated-splits (train rows of ncii-guard-splits-v3-2k)real edit prompts, 15,336 safe + 1,200 ncii16,536
sd-prompts (Gustavosta/Stable-Diffusion-Prompts)real generic T2I prompts (sexual-keyword filtered) as safe negatives3,355
synthetic (ncii-guard-synth-v1, Qwen2.5-7B-generated, clearly marked)1,700 ncii-risk + 499 explicit + 800 contrastive safe2,849
i2p (AIML-TUDA/i2p, MIT)real T2I prompts; sexual→explicit or ncii (person mention); label-2 ×4 and label-1 ×2 oversampled in train only1,671
gedit-bench (stepfun-ai/GEdit-Bench, MIT)real editing instructions as safe negatives1,018

Dev (model selection) = held-out real rows + the val rows of ncii-guard-splits-v3-2k + 150 synthetic rows, so selection sees all three ncii distributions.

Evaluation

Eval set: yjernite/ncii-guard-eval-v1 — 3,078 rows, leakage-controlled (no train/dev prompt appears in eval; the one synthetic row that overlapped was removed). Composition: curated-splits-test 969 (its own test split — in-distribution for the binary baseline, never seen by this model), synthetic 949, sd-prompts 601, xstest 250, gedit-bench 171, i2p 138. Full per-row predictions: eval/predictions.parquet.

Overall: accuracy 0.892 · macro F1 0.804 · weighted F1 0.893 · per-class F1: safe 0.938 / explicit 0.619 / ncii 0.856 · recall on ncii-risk 0.895 · FPR on safe 0.077.

Disaggregated performance (95% Wilson CIs in results.json)

Demographic attributes are proxies inferred from names in the prompt (census-based ethnicity groups; gender-guesser for gender; relationship terms for orientation) — they are not self-identification and slices mix real and synthetic rows.

NCII-risk recall by gender proxy (named slices): female 0.928 [0.893–0.952] · male 0.914 [0.877–0.940] — no significant recall gap. FPR on safe by gender proxy: female 0.170 [0.110–0.253] vs male 0.051 [0.026–0.097] — a significant ~3× over-flagging of prompts that name women. This is the headline disparate-performance finding and a known harm-amplification risk (real NCII targets skew female; see arXiv 2606.27234).

NCII-risk recall by ethnicity proxy: white 0.888 [0.831–0.927] · api 0.922 [0.869–0.955] · black 0.928 [0.875–0.959] · hispanic 0.934 [0.882–0.964] — CIs overlap. FPR on safe by ethnicity proxy: white 0.040 [0.020–0.077] · api 0.074 [0.048–0.115] · black 0.098 [0.043–0.210] · hispanic 0.173 [0.094–0.297] — a rising trend, highest for the hispanic-proxy slice (borderline significant vs white).

By orientation proxy: recall partner-female 0.954 vs partner-male 0.946 (CIs overlap, no gap); FPR 0.0 on both (very small n: 10 and 6 safe rows).

By source (recall on ncii-risk): synthetic 0.938 · real (curated-splits-test) 0.743 [0.630–0.831] · i2p-style T2I prompts 0.333 [0.186–0.522] — a real domain gap on T2I tag-soup-style prompts. By media: image 0.940 · video 0.930 (synthetic slices); safe-side FPR ~0.09–0.10 on both. Over-refusal: XSTest safe prompts FPR 0.156 [0.116–0.206]; generic sd-prompts FPR 0.108 [0.086–0.136]; real edit instructions (gedit) 0.012.

Baseline comparison

hfmlsoc/ncii-light-guard-v01 (binary, same base model, trained on the same split family) on the binary-comparable subset of this eval: recall on ncii-risk 0.729 overall / 0.814 on real rows, FPR 0.074. On the real-ncii slice it is stronger than this model (its test split is in-distribution for it) — see baseline_lightguard_results.json. This model's added value: the explicit-not-person-targeted class (F1 0.619), the demographic disaggregation, and better synthetic-slice recall.

Latency

268.1M parameters. Measured: 4.2 ms/sequence (batch 8, A10G, CUDA, bf16). CPU (fp32) measured 3.9 s/sequence on the eval job's 4-vCPU container — treat as an unoptimized upper bound and measure on your target hardware; the model runs comfortably on CPU-class hardware with a tuned runtime.

Limitations

  • Text only — it never sees the input image/video; identity and context are unknown.
  • Demographic slices are proxies (name-based); results should be read as disparity screening, not attribution.
  • Synthetic slices are LLM-generated (Qwen2.5-7B-Instruct) and marked source=synthetic; real-world recall is best estimated from the real rows (0.743 on held-out real ncii prompts).
  • i2p/T2I-style prompts are a known weak spot (recall 0.33); the training ncii distribution is editing-style.
  • Consent is unknowable from text; a safe score is not a guarantee, and an ncii-risk score is not proof of intent.
  • The Grok real-NCII request dataset (Mtechlaw/TfGBV-Grok-NCII-Dataset, manual gate pending) was not included; the build hook will fold it into a future version.
  • Not a legal or safety guarantee. EU deployer obligations (e.g. around generative-editing nudification) require more than a text classifier.

Data policy

Training/eval code and seeds: generation seeds in ncii-guard-synth-v1/seeds_used.json; build scripts kept with the datasets. Sources: i2p (MIT), GEdit-Bench (MIT), XSTest (CC-BY-4.0), Gustavosta prompts, ncii-guard-splits-v3-2k (author-provided). Non-redistributable sources (CC-BY-NC-ND MMA-Diffusion) were deliberately excluded from the shipped set.

Citation

Base model: microsoft/harrier-oss-v1-270m. Evaluation instruments: I2P (arXiv:2211.05105), XSTest (arXiv:2308.01263). Baseline model and split family: hfmlsoc/ncii-light-guard-v01.


Update (v3 comparison)

Status: deprecated — v3 outperforms this model on every automated metric measured (overall and disaggregated). Kept public as the baseline for the published results; prefer v3 (or the 4-class variant) for deployment.

A third iteration is now available: yjernite/ncii-edit-guard-270m-v3, trained with real NCII requests (TfGBV-Grok), taxonomy-conditioned generation (clothing-replacement/JSON-spec families), and contrastive demographic examples. On the current 3,699-row eval (this model scored on the same set): v2 ncii recall 0.725 → v3 0.923; real held-out recall 0.743 → 0.786 (splits-test) and 0.909 (grok); FPR on safe 0.042 → 0.038; macro F1 0.782 → 0.841; female-vs-male FPR gap further narrowed; LGBT over-refusal FPR 0.016–0.038 → 0.000–0.031. The deployed binary baseline hfmlsoc/ncii-light-guard-v01 scores 0.633 recall / 0.074 FPR on the same set and fails on the clothing-replacement/JSON abuse style (recall 0.31). Full disaggregated tables: v3 model card and each repo's eval/results.json.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей