/ Модель

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

Лицензия
Apache 2.0
Архитектура
tinyfacenet · dense
Библиотека
pytorch
Опубликована
11 окт 2026

TinyFaceNet-300K-Smallplain

Эмбеддинги изображенийИзображение → embedding

Компактный энкодер лиц, преобразующий выровненный фрагмент 112 × 112 в 128-мерный эмбеддинг для сравнения лиц и поиска по отдельной галерее.

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

Бенчмарки

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

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

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

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

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

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

TinyFaceNet Smallplain 300K — компактная сверточная модель для создания эмбеддингов лиц, опубликованная sraivante. Модель обучена с нуля по доступной исходной схеме обучения 1M v2: 299 119 обучаемых параметров, из которых 231 781 приходится на развёртываемый энкодер. Она принимает выровненный цветной фрагмент лица размером 112 × 112 в порядке каналов BGR и выдаёт вектор признаков размерностью 128. Репозиторий содержит веса в формате safetensors и архитектуру для запуска на PyTorch.

Модель предназначена для сравнения лиц по эмбеддингам и может использоваться в системах проверки сходства или поиска по галерее, включая компактные CPU-устройства уровня Raspberry Pi 4 и 5. Для идентификации людей требуется отдельно подготовленная галерея с согласованными эталонными изображениями; сама модель не содержит имён, эмбеддингов регистрации или классификатора личностей. В тестах авторов энкодер работал быстрее моделей TinyFaceNet 1M на указанном CPU, однако приведённые результаты получены на отдельных наборах и устройствах и не гарантируют общего превосходства. Для RP2040 модель не помещается в доступную память даже после INT8-квантизации. Текстовые и речевые задачи не поддерживаются. Лицензия — Apache-2.0.

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

  • сравнение сходства двух лиц по эмбеддингам
  • поиск совпадений лица в галерее регистрации
  • извлечение признаков лица для последующего сопоставления
  • проверка лица на компактном CPU-устройстве
  • создание эмбеддингов для собственного пайплайна распознавания лиц

Ограничения

Нужны выровненные входные кадры лица BGR 112 × 112 и отдельная галерея для идентификации; сходство не является калиброванной вероятностью. По оценке авторов, модель не помещается в память микроконтроллера RP2040 даже при INT8-квантизации, а приведённые метрики ограничены описанными тестами и не подтверждают общее превосходство.

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

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

Открыть на Hugging Face

TinyFaceNet Smallplain 300K

downloads (30d) downloads (all time)

training parameters: 299119 inference parameters: 231781

Compact face embedding encoder trained from scratch with the available original 1M v2 training recipe. 299,119 training parameters; 231,781 deployed encoder parameters. The Hub auto-count may show about 239K stored floating-point values because it also counts batch-normalization buffers; the trainable encoder count is 231,781. Produces a 128-dimensional embedding from an aligned 112 x 112 BGR face crop. No text or spoken-language task is supported.

This release contains encoder weights, executable architecture, sanitized evaluation results and reproducible speed/metric scripts. No personal images, real identity names, identity mapping, enrollment embeddings, centroids or classification weights are included. Name1 through Name9 are anonymous report labels. The encoder needs a separately supplied, consented enrollment gallery to name anyone. Removing identity metadata is not a formal differential-privacy guarantee for trained weights.

Comparison with the published 1M models

Reference: TinyFaceNet-1M. Both downloaded v1/v2 public safetensors were tensor-by-tensor identical to the stripped local encoders used here.

ModelLFW BGR mean ± fold SDLegacy RGB LFWPrivate family (49)Private overall (59)
1M v172.02% ± 1.2162.57%97.96%88.14%
1M v273.22% ± 1.8463.62%95.92%89.83%
Remix69.10% ± 1.9066.25%89.80%84.75%
Remix265.75% ± 1.5062.25%85.71%76.27%
Smallplain73.60% ± 1.4763.17%95.92%91.53%

LFW uses all 6,000 official pairs, standard 10 contiguous folds, 600 pairs per fold. For each fold the cosine threshold is selected on the other 5,400 pairs, on a grid [-1, 1) with step .002. No model fitting on LFW. Existing five-point buffalo_l aligned funneled crops were used; no failed detections or discarded pairs. Standard deviation is across folds, not a confidence interval. Source pair/cache/checkpoint hashes and every fold result are provided in results/lfw_*.json.

Color-order correction: training uses BGR. The old published LFW numbers used RGB input (62.6% v1 / 63.6% v2). Both pipelines were rerun on every model; compare BGR with BGR, or RGB with RGB. Smallplain's BGR gain over 1M v2 is only 0.38 percentage points / 23 pairs; this does not establish general superiority. Under legacy RGB Smallplain is slightly below 1M v2. Teacher training overlap with LFW was not audited.

Anonymous per-member accuracy

IdentityHoldout count1M v11M v2RemixRemix2Smallplain
Name11100.00%100.00%100.00%100.00%100.00%
Name20Not measuredNot measuredNot measuredNot measuredNot measured
Name37100.00%85.71%85.71%42.86%85.71%
Name41190.91%90.91%90.91%90.91%90.91%
Name58100.00%100.00%87.50%87.50%100.00%
Name60Not measuredNot measuredNot measuredNot measuredNot measured
Name79100.00%100.00%100.00%100.00%100.00%
Name80Not measuredNot measuredNot measuredNot measuredNot measured
Name913100.00%100.00%84.62%92.31%100.00%
Background1040.00%60.00%60.00%30.00%70.00%

All private scores use the same 59 unmodified crops, nearest saved training centroid and argmax without rejection. The date holdout was reused every epoch for checkpoint selection and is not an untouched final test. Three identities have no holdout examples. Smallplain: 47/49 family, 7/10 background, 54/59 overall. Similarities are not calibrated probabilities. No identity gallery is published, so private-set evaluation cannot be reproduced from public files alone.

Speed

CPU threadsBatchModelMedian batch msp95 batch msImages/s
111M v114.62315.56668.4
111M v214.79216.38867.6
11Smallplain 300K6.7257.657148.7
1161M v1216.398274.20973.9
1161M v2215.540247.80374.2
116Smallplain 300K63.08070.210253.6
411M v110.92212.48291.6
411M v210.73412.05393.2
41Smallplain 300K7.1808.789139.3
4161M v177.83781.321205.6
4161M v277.56781.699206.3
416Smallplain 300K29.37731.938544.6

Measured on 13th Gen Intel(R) Core(TM) i7-1360P, 12 physical / 16 logical cores, Windows 11, PyTorch 2.12.0+cpu, CPU FP32. Preallocated synthetic input, eval + inference_mode, embedding plus L2 normalization; excludes face detection, crop alignment, I/O and gallery matching. Five shuffled model-order rounds with 10 warmup calls per model per round; 400 measured calls for batch 1 and 100 for batch 16. Median/p95 are batch latency, not end-to-end camera FPS.

At 4 threads, batch 1: Smallplain 7.18 ms vs 1M v2 10.73 ms (1.49x faster, 33.1% lower latency). Batch 16: 29.38 vs 77.57 ms (2.64x throughput). Thread count, CPU load and power/thermal state affect results. The one-thread v1 rounds varied substantially (6.23 to 15.12 ms mean); raw round means are preserved, and this is a single-machine benchmark, not a universal speed guarantee.

Raspberry Pi 4 Model B (4 GB), ONNX Runtime

CPU threadsBatchModelMedian msp90 msImages/s
111M v1167.00170.646.0
111M v2166.48170.486.0
11Remix52.6152.9819.0
11Remix252.8154.6918.9
11Smallplain 300K51.8253.3619.3
411M v168.2781.9214.6
411M v266.78113.6515.0
41Remix29.7941.7033.6
41Remix230.2941.9833.0
41Smallplain 300K29.2043.6334.2

Measured 2026-10-12 on Raspberry Pi 4 Model B Rev 1.4 (4 GB, Cortex-A72 @ 1.8 GHz), Raspberry Pi OS Bookworm (Debian 12, aarch64, kernel 6.12), Python 3.11, ONNX Runtime 1.31.0 CPU FP32, opset-17 exports of the same checkpoints (ONNX output verified against PyTorch to < 3e-6 max abs diff). Per model and thread count: 10 warmup calls then 50 measured single-image calls; preallocated synthetic input; same exclusions as above (no detection, alignment, I/O or gallery matching). The board was running its normal resident services during measurement (about 2.6 GB RAM in use), so these are realistic in-service numbers rather than idle-machine bests; SoC temperature 52 °C, no throttling observed. At 4 threads Smallplain runs a single face in 29.2 ms (about 34 fps), 2.3x faster than 1M v2 on this board.

Raspberry Pi 5 Model B (8 GB), ONNX Runtime

CPU threadsBatchModelMedian msp90 msImages/s
111M v121.3821.4246.8
111M v221.3721.4346.8
11Remix7.467.49134.1
11Remix27.497.51133.5
11Smallplain 300K7.297.32137.2
411M v18.568.61116.9
411M v28.678.78115.3
41Remix4.654.70214.8
41Remix24.704.75212.6
41Smallplain 300K4.484.52223.3

Measured 2026-10-12 on Raspberry Pi 5 Model B Rev 1.0 (8 GB, Cortex-A76 @ 2.4 GHz), Raspberry Pi OS Bookworm (aarch64), Python 3.11, ONNX Runtime 1.31.0 CPU FP32, identical method to the Pi 4 run above. Unlike the Pi 4 run this board was near idle (about 0.6 GB RAM in use); SoC temperature 44 °C, no throttling. At 4 threads Smallplain embeds a single face in 4.48 ms (about 223 fps), 1.9x faster than 1M v2 and roughly 6.5x faster than the same model on the in-service Pi 4.

Microcontrollers (RP2040)

Smallplain does not fit a Raspberry Pi Pico / RP2040 (264 KB SRAM), even fully INT8-quantized. The INT8 weights (~223 KB) fit the 2 MB flash, but the activation memory does not: the largest intermediate tensor is 135 KB and must coexist with the 37.6 KB input, so a TensorFlow Lite Micro tensor arena of roughly 230 KB would be needed (estimated from a measured ~58 KB TFLM arena overhead for a smaller model of the same operator mix on the same chip), against roughly 235 KB realistically available after stack, USB stdio and runtime globals. This is an arithmetic bound from a real on-device calibration run, not a guess; the smaller model used for calibration ran INT8 inference on an RP2040 at 133 MHz in about 1.09 s/face with 171 KB of arena. For microcontroller deployment a sub-128K-parameter architecture at reduced input resolution is required; this model targets Raspberry Pi 4/5-class CPUs and up.

Loading and use

pip install torch safetensors huggingface_hub numpy opencv-python
hf download sraivante/TinyFaceNet-300K-Smallplain --local-dir smallplain_model

Run from the downloaded directory (or add it to Python's module path):

import cv2, torch
import torch.nn.functional as F
from safetensors.torch import load_file
from model import TinyFaceNet
model = TinyFaceNet().eval()
model.load_state_dict(load_file('model.safetensors'), strict=True)
crop = cv2.imread('your_aligned_crop.png')  # BGR, already five-point aligned
assert crop is not None and crop.shape == (112, 112, 3)
x = torch.from_numpy(crop).permute(2,0,1).unsqueeze(0).float()/127.5-1
with torch.inference_mode():
    embedding = F.normalize(model(x), dim=1)

Detection/alignment and enrollment are separate tasks. Do not apply an RGB conversion to this BGR input. Cosine similarity thresholds need validation on the intended data. No liveness, spoof-resistance or reliable unknown-person rejection is established.

Download badges use the Hub's server-side statistics. The full-repository download above includes config.json, the default query file used for download counting. Counts are not unique-user counts, and cached loads need no new server request. See Hub download statistics. Matching 1M task/architecture/edge tags are retained; ONNX and INT8 tags are omitted because this release contains FP32 PyTorch/safetensors only. Raspberry Pi 4 FP32 latency has been measured directly (see Speed); other Raspberry Pi variants remain untested.

Training, snapshot and provenance

Versioned data provenance contains metadata only. Source archive SHA-256 c5e748126ec8b5a1548444ce748ca984149367a35fe11e181a432fb2657a86c5; saved split SHA-256 a0a8a755fd5c63009e8b00c6715db3f40fd358bce90c1659104e1c46d693b21c. 1,852 original training crops (1,252 family + 600 background), 59 holdout crops (49 + 10). Private images, labels, original filenames, teacher vectors and split row lists are deliberately withheld. This model has no precomputed remix expansion; augmentation happens online.

Width .715, seed 0, 40 epochs, batch 128, CPU 10 threads. AdamW max LR .002, weight decay .0005; OneCycleLR with 10% warmup. Inverse-square-root class-frequency replacement sampling, 1,852 draws/epoch. Random flip/affine/brightness/gamma/contrast/noise/grayscale/blur/cutout. Cross entropy with .1 label smoothing plus twice cosine distillation loss to existing 512-dimensional InsightFace buffalo_l targets. Initialization was random; teacher targets remain pretrained supervision. Highest family holdout accuracy selects the checkpoint, latest tie; selected epoch 40. Training epochs totaled 681.7 seconds. Exact-image train/holdout overlap check passed.

The manifest identifies the actual saved Smallplain source/split and reference-code hashes. It records the available historical recipe, not an asserted missing original 1M git revision. Training cannot be rerun exactly without the excluded private dataset and teacher assets.

License, credit and limits

Apache License 2.0 covers the author's original release contributions. Copyright (c) 2026 sraivante applies only to original material and original dataset selection/arrangement; it does not claim third-party photographs or model assets. Private data is not being distributed under this release.

Third-party terms remain separate: InsightFace code is MIT, but its pretrained model zoo (including the teacher/alignment assets used here) is offered for non-commercial research. See official model zoo terms. Those assets/targets are not included. This release does not grant rights to third-party assets or establish commercial clearance for this distilled model. LFW images and identity lists are not redistributed; obtain benchmark inputs from their original source subject to applicable terms.

Small, family-specific training data, possible label noise, reused private holdout, one seed and one speed-test machine limit conclusions. Public LFW performance is modest (73.60%); this is an experimental compact encoder, not validated for security-critical identification.

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

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

GPU в ailist

Универсальный рантайм · pytorch · image-feature-extraction

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

Архитектура tinyfacenet неизвестна transformers в образе рантайма.

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

0 моделей