/ Модель

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

Лицензия
AGPL 3.0
Базовая модель
YOLO26
Библиотека
ultralytics
Опубликована
13 ноя 2026

YOLO-face-detection320-ReLU

Поиск объектовИзображение → bounding_boxes3 профессии

Набор компактных YOLO-моделей с ReLU для обнаружения крупного лица на изображениях размером 320×320, рассчитанный в том числе на платформы с ограниченной поддержкой SiLU.

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

Бенчмарки

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

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

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

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

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

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

wesjos 发布的 YOLO 人脸检测模型组,包含 YOLOv5nu、YOLOv8n 和 YOLO11n 等 nano 级权重,采用 ReLU 激活函数,输入尺寸固定为 320×320,检测单一类别。它是 wesjos/YOLO-face-detection320 的 контролируемая абляция: обучающие данные, гиперпараметры, исходные веса и seed совпадают, меняется только активация SiLU на ReLU.

Модель предназначена для обнаружения одного крупного лица в кадре: например, на фото для удостоверения, аватаре, портрете или снимке с камеры контроля доступа. По README, она лучше подходит, когда лицо занимает значительную часть изображения; удалённые мелкие лица и плотные сцены с несколькими людьми не являются её целевым сценарием. Размер входа — 320×320. Лицензия репозитория — AGPL-3.0.

В сравнении с SiLU-вариантом все четыре проверенные архитектуры показали снижение mAP50–95 в среднем на 0,41 процентного пункта; заявленная в README оценка 95% доверительного интервала не включает ноль. На RTX 4090 заметного выигрыша в задержке не было. Автор указывает применение ReLU как вариант для целевой платформы, где SiLU затруднительно выполнить, например в некоторых NPU или INT8-конвейерах. Веса содержат имя класса item, поэтому при интеграции, зависящей от строки класса, его нужно сопоставить с face.

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

  • обнаружение лица на фотографии для удостоверения
  • поиск крупного лица на аватаре или портрете
  • обнаружение лица в кадре камеры контроля доступа
  • детекция лица на входном изображении 320×320
  • инференс детектора лиц на целевой NPU или INT8-конвейере

Ограничения

Фиксированный вход 320×320 и ориентация на одно крупное лицо ограничивают применение для мелких удалённых лиц и плотных многолюдных сцен. В сравнении, приведённом в README, ReLU-вариант уступает SiLU по mAP50–95 и не даёт выигрыша в скорости на RTX 4090.

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

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

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

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

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

Открыть на Hugging Face

YOLO-face-detection320-ReLU

Four nano-scale YOLO face detectors with a fixed 320×320 input and a single class. This repo is the SiLU → ReLU single-variable ablation of wesjos/YOLO-face-detection320: dataset, hyperparameters, initial weights and seed are identical — only the activation differs.

TL;DR — do not swap SiLU out for this

ComparisonΔ mAP50-95Significanceb32 latency
SiLU − ReLUSiLU +0.41 pp4/4 architectures significant0.280 vs 0.278 ms, no difference
SiLU − LeakyReLU(0.1)SiLU +0.28 pp3/4 significantno difference
ReLU − LeakyReLU(0.1)only +0.12 pp0/4 significantno difference
  1. The loss is real. All four architectures get worse, and the 95% CI from a 1000-round paired bootstrap does not cross zero for any of them.
  2. Changing the activation buys no speed here. On an RTX 4090 the activation is not the bottleneck — b1 / b32 / b64 all tie. "Use ReLU because it's faster" does not hold on this machine.
  3. The only legitimate use case is a target platform (NPU / INT8 pipeline) that cannot evaluate exp(), so SiLU has to go. In that case plain ReLU is enough — switching to LeakyReLU to "recover negative-side information" has no statistical support.

Demo images

Each panel is one image: the output of yolov8n-face320-relu.pt, the number on the box is the confidence. Params: imgsz=320, conf=0.25, iou=0.5, run on CPU with ultralytics 8.3.51 — no cherry-picking, no post-processing.

iu 188×268 · 1 face · conf 0.95

iu · 188×268 · 1 face · box covers 13.4% of the frame · conf 0.955

images 556×552 · 1 face · conf 0.93

images · 556×552 · 1 face · box covers 22.4% of the frame · conf 0.932

licensed-image 2048×1365 · 1 face · conf 0.93

licensed-image · 2048×1365 · 1 face · box covers 22.6% of the frame · conf 0.927 (downscaled to 320 for inference; the face still spans ~23% of the frame — the model's comfort zone)

lyf 381×524 · 1 face · conf 0.96

lyf · 381×524 · 1 face · box covers 15.9% of the frame · conf 0.957

talyor 452×678 · 1 face · conf 0.95

talyor · 452×678 · 1 face · box covers 12.8% of the frame · conf 0.947

Every image holds a single face. Re-running the same five images at conf=0.10 with yolov8n, yolo11n and yolov5nu returned exactly one box each. The exception is yolo26n, which adds a second low-confidence box on two images (images 0.30, licensed-image 0.14) — those are genuine extra candidates that the 0.25 threshold filters out, not rendering artifacts.

When to use it

These weights are built for small inputs where the face takes up a large share of the frame. The input is a fixed 320×320 and the intended subject is one face (or a head-and-shoulders shot) filling most of the image: ID photos, avatars, access-control / gate captures, cropped portraits. The demos above sit in the 13%–23% box-to-frame range, which is where the model is most reliable.

Conversely, tiny distant faces (ground-truth box < 0.4% of the frame) only reach ~0.73 recall — that is not what these weights are for. Tile large images and run 320 on each tile, or train a 640 model.

Results

Same val set as the SiLU baseline (5,797 images / 6,146 boxes), imgsz=320, conf=0.001, COCO-style 101-point interpolated AP:

FileParamsGFLOPsSizemAP50mAP50-95vs SiLU
yolov5nu-face320-relu.pt2.636 M1.935.25 MB0.98700.9036−0.0062
yolov8n-face320-relu.pt3.138 M2.196.18 MB0.98810.9080−0.0019
yolo11n-face320-relu.pt2.605 M1.635.24 MB0.98660.9056−0.0038
yolo26n-face320-relu.pt2.534 M1.355.20 MB0.98700.9050−0.0051
  • Accuracy: 101-point interpolated COCO AP computed in numpy — the same estimator as the baseline repo, so the two tables are directly comparable.
  • Params / GFLOPs / Size were re-measured on the released checkpoints here (ultralytics 8.4.211, .info(imgsz=320)), not copied from the baseline card.
  • Latency (in the TL;DR): RTX 4090, FP16, full predict path including pre/post-processing and NMS, median of 7 runs.
  • The SiLU baseline column behind vs SiLU is the control group of this same ablation run (0.9098 / 0.9098 / 0.9094 / 0.9101). It sits 0.3–0.4 pp below the numbers published in the SiLU repo (0.9138–0.9147), i.e. the two are not the same training run — compare deltas within this table, not absolute values across repos.
  • yolov5nu is Ultralytics' port of YOLOv5n (2.64 M params), not the 1.77 M model from the original YOLOv5 repo.

Inference

from ultralytics import YOLO

model = YOLO("yolo26n-face320-relu.pt")
results = model.predict("image.jpg", imgsz=320, conf=0.25, iou=0.5)
for b in results[0].boxes:
    print(b.xyxy.tolist(), float(b.conf))
python inference.py image.jpg          # bundled script, no config needed
yolo predict model=yolo26n-face320-relu.pt source=./images imgsz=320 conf=0.25

Caveats

  • Input must be 320. Running a 320-trained model at 640 drops mAP50-95 from ~0.91 to 0.775 — do not upscale the input.
  • The box is the face region (hairline to chin), excluding the back of the head and neck. If downstream needs a full-head box, redefine it there.
  • The class name inside these checkpoints is item, not face (model.names == {0: 'item'}, inherited from the training data yaml). It is a single-class model so nothing breaks, but if your code keys off the string face, map it yourself — this is what makes Ultralytics' built-in plot() label the boxes item.
  • Weak on small targets: recall ~0.73 for GT boxes < 0.4% of the frame, ~0.77 for 0.4–2%, 0.998 above 10%. For distant small faces, tile the image or train a 640 model.
  • The training set is dominated by single-face images (only 5.5% have multiple faces); dense crowds are out of distribution.
  • Weights are inference-only (optimizer and EMA state stripped, epoch=-1).

Training setup

Identical to the SiLU baseline except for the one row in bold.

ItemValue
epochs / batch / imgsz150 / 256 / 320
optimizerauto → MuSGD (iterations > 10000), lr0 0.01, cos_lr
augmentationmosaic 1.0 / scale 0.5 / fliplr 0.5, mosaic off for the last 10 epochs
seed / deterministic0 / True
cacheram (single process, serial)
activationnn.ReLU(inplace=True) — the only variable
stackUltralytics 8.4.211 / torch 2.11.0+cu130
Per-model training time≈41 min (RTX 4090)

Training data: 23,150 train images / 24,575 boxes, 5,797 val images / 6,146 boxes, 30,721 boxes total, natively 320×320, labels produced by an automatic detector and not hand-verified box by box.

Reproducing this is less obvious than it looks

Setting model.yaml['activation'], or only changing Conv.default_act in ultralytics/nn/modules/conv.py, both produce a mixed model: when DetectionModel.load() transfers the detection head it deep-copies the source model's cv3 / one2one_cv3 wholesale, and that source model was deserialized by YOLO(pt) — it never goes through parse_model, so its activations are still SiLU. The log only prints Transferred 696/708 items and reports no error.

The reliable way is to walk the already-built module tree and replace in place:

for mod in model.modules():
    for cname, child in list(mod.named_children()):
        if isinstance(child, (nn.SiLU, nn.ReLU, nn.LeakyReLU)):
            setattr(mod, cname, nn.ReLU(inplace=True))

What that gives, verified on the released files (zero SiLU left in any of them):

FileReLU slotsnn.Identity totalof which activation slots
yolov5nu-face320-relu.pt6900
yolov8n-face320-relu.pt5700
yolo11n-face320-relu.pt7744
yolo26n-face320-relu.pt105109 (the 10th is the DFL module)

The nn.Identity slots come from the source code's explicit act=False and cannot be replaced.

Files in this repo

FileSizePurpose
yolov5nu-face320-relu.pt5.25 MBYOLOv5nu port, ReLU
yolov8n-face320-relu.pt6.18 MBYOLOv8n, ReLU (the demo model)
yolo11n-face320-relu.pt5.24 MBYOLO11n, ReLU
yolo26n-face320-relu.pt5.20 MBYOLO26n, ReLU (default in inference.py)
inference.py1.1 KBself-contained predict script
metrics.json954 Bper-file byte size + activation counts
demo/*.jpg5 filesthe panels above

中文摘要

wesjos/YOLO-face-detection320 的 SiLU → ReLU 单变量消融:数据、超参、预训练权重、种子全同,只换激活。

  • 别用它替代 SiLU:4 个架构全部掉点,平均 0.41 pp,配对 bootstrap 1000 次 95% CI 不跨 0;RTX 4090 上延迟无差异。
  • 唯一正当用途:目标平台(NPU / INT8 管线)不支持 exp,必须去掉 SiLU;此时直接用 ReLU,为「补回负值信息」换 LeakyReLU 没有统计依据(两者差 0.12 pp,0/4 显著)。
  • 与 LeakyReLU 版的关系:本仓是 ReLU,姊妹仓是 YOLO-face-detection320-LeakyReLU。
  • 坑:权重里 model.names 是 item 而不是 face,单类不影响使用,但依赖字符串的下游要自己映射。

License

AGPL-3.0 (inherited from Ultralytics).

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

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

GPU в ailist

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

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

Модели Ultralytics YOLO требуют отдельного рантайма.

Ревизия весов
65228bc

0 моделей