Skip to content
Other

cvrl_s1_l2sp_replay

детектор поддельных отпечатков пальцев

2 min readupdated

Модель решает задачу Presentation Attack Detection (PAD — выявление атак предъявления) и определяет по изображению, является ли отпечаток пальца живым (live) или поддельным муляжом (spoof). В основе лежит компактная свёрточная архитектура DenseNet-121 (веса занимают всего 28 МБ), дообученная методом L2-SP (регуляризация против катастрофического забывания) с повтором чистых данных. Модель экспортирована в формат TorchScript FP32 (.pt), поэтому загружается напрямую в PyTorch без исходного кода архитектуры. Подойдёт разработчикам биометрических систем контроля доступа и платежных сервисов, которым нужна лёгкая локальная защита от подделки отпечатков.

Ключевые особенности

  • Автономный формат TorchScript: файл .pt весом ~29,1 МБ поддерживает динамический размер батча и запускается без сторонних определений классов.
  • Точная конвертация: максимальное расхождение (max_abs_diff) с оригинальной моделью PyTorch FP32 составляет 0.0 при batch = 1 и batch = 5.
  • Высокие метрики на LivDet: на тесте LivDet 2015 (23 материала подделок) точность (ACC) достигает 99.08% при ROC-AUC 0.9996.
  • Прозрачная спецификация: в репозиторий включены manifest.json с описанием тензоров и контрольные суммы SHA256SUMS.

Что можно сделать

  • Встроить в биометрический сканер: подключить проверку подлинности отпечатка перед этапом распознавания личности на CPU или GPU через PyTorch.
  • Использовать схему adaptive_multipatch: подавать 5 кропов одного отпечатка батчем, усреднять логиты и отсекать подделки по порогу score_spoof >= 0.50.
  • Проверить устойчивость к генеративным фейкам: использовать как базовый детектор против синтетических подделок (на наборе LayerStack V10 модель ловит 98.18% атак).

Пример

import torch

model = torch.jit.load("cvrl_densenet121_s1_l2sp_replay_224_torchscript_fp32.pt", map_location="cpu").eval()
x = torch.randn(5, 3, 224, 224, dtype=torch.float32)  # RGB-кропы после нормализации ImageNet
with torch.no_grad():
    probs = torch.softmax(model(x).mean(dim=0), dim=-1)
    pred = "spoof" if float(probs[1]) >= 0.50 else "live"
print(pred, float(probs[1]))
ПодробнееБенчмарк LivDet 2009–2013 (29 892 фото, 11 сенсоров): ACC 97.01%, ACER 3.00%, ROC-AUC 0.9955.
Бенчмарк LivDet 2015 Testing (10 443 фото, 4 сенсора): ACC 99.08%, APCER 0.64%, BPCER 1.29%, ACER 0.96%.
Бенчмарк LayerStack V10 (2 473 синтетические подделки): обнаружение 98.18% (98.71% на CrossMatch, 97.40% на GreenBit).
Вход: float32 тензор [batch, 3, 224, 224] в RGB с нормализацией ImageNet; выход: логиты [batch, 2].
Discuss Telegram 0

Will it run?

Runs in FP32

Fits without quantisation.

  • FP32weights 0.0 GB · ready files0.5 GB
  • BF16weights 0.0 GB0.5 GB
  • FP8 / INT8recommendedweights 0.0 GB0.5 GB
  • 4-bitweights 0.0 GB0.5 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · FP32 — from RTX 2060

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # SonNX24042005/fringerprint-pad
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download SonNX24042005/fringerprint-pad --local-dir ~/models/fringerprint-pad
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to fringerprint-pad
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of fringerprint-pad (quants, finetunes, LoRAs) will show up under the bell.

No known relatives of this model yet. All derivatives on Hugging Face

About the model

SonNX24042005/fringerprint-pad
Author
SonNX24042005
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments

Other

Eraser

Eraser