/ Модель

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

Лицензия
Своя лицензия
Библиотека
pytorch
Опубликована
8 ноя 2026

signature-similarity-convnext-tiny

Эмбеддинги изображенийИзображение → embedding3 профессии
0скачиваний за 30 дней0лайковвеса обновлены8 ноя 2026

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

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

Модель ConvNeXt-Tiny сравнивает две рукописные подписи и оценивает вероятность того, что они принадлежат одному автору.

Это модель сравнения рукописных подписей на основе ConvNeXt-Tiny, опубликованная izamscientist. Она получает изображения двух подписей и возвращает оценку от 0 до 1: насколько вероятно, что их написал один человек. Модель рассчитана на проверку подписей для авторов, не встречавшихся при обучении; репозиторий содержит веса PyTorch и скрипт inference.py с предобработкой и порогами решений.

В тестировании на парах подписей из HMS, CEDAR и BHSig260 модель показала точность 81,5% и ROC-AUC 0,902. Данные разделяли по авторам; тест включал 99 авторов, не использованных при обучении и настройке. Изображения приводятся к оттенкам серого, очищаются от фона и рамок, обрезаются и масштабируются до 224 × 224 пикселей.

Модель может ошибочно принимать подписи разных людей или отвергать подлинные совпадения: при основном пороге неверно принимались 21,8% пар разных авторов. На HMS English и HMS Bengali результаты слабее. Она обучена на сканах, поэтому качество на фотографиях, необычной бумаге и других письменностях может снижаться; её не следует использовать как единственное основание для значимых решений. Лицензия указана как other, конкретные условия использования в карточке не приведены.

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

  • проверка сходства двух рукописных подписей
  • предварительный скрининг подписей на подделку
  • сопоставление подписей в отсканированных документах

Ограничения

На основном пороге модель принимает 21,8% пар подписей разных авторов, а также может отвергать подлинные совпадения; её не следует использовать как единственное основание для значимых решений. Она обучена на сканах и показывает более слабые результаты для некоторых групп HMS, поэтому качество на фотографиях, необычной бумаге и других письменностях может снижаться.

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

Signature similarity: ConvNeXt-Tiny

A model that looks at two handwritten signatures and says how likely it is that the same person wrote both. It gives a score from 0 to 1 (1 = very likely the same person). It works on people it has never seen, which is what "writer-independent" means.

Headline result: 81.5% accuracy on the test set (95% range 78.8% to 84.2%), EER 18.5%, F1 0.821, ROC-AUC 0.902. The test writers were never used for training, validation or model selection. This is Kaggle version 19 of the kernel iscientist10/signature-similarity-train-vc-hamza (seed 7).

Quick start

pip install torch torchvision numpy pillow huggingface_hub
from huggingface_hub import snapshot_download
import sys
root = snapshot_download("izamscientist/signature-similarity-convnext-tiny")
sys.path.insert(0, root)
import inference

model = inference.load_model()
score = inference.compare(model, "signature_a.png", "signature_b.png")   # 0 to 1
print(score, inference.decide(score))   # ACCEPT / REJECT / REVIEW

inference.py preprocesses the pictures the same way as the training data, so you can give it ordinary scans or photos. Decisions use the thresholds chosen on the validation set only:

ThresholdValueMeaning
main0.7785one yes/no answer: at or above = same person
accept0.9106at or above = ACCEPT (kept false accepts at 1% or less on validation)
reject0.5376below = REJECT (kept false rejects at 1% or less on validation)

Scores between reject and accept mean REVIEW: a person should check.

Files in this repository

File or folderWhat it is
model/best.pt, model/config.jsonThe trained weights (112 MB) and the settings and thresholds
inference.pyCompare two pictures: preprocessing, model and decision
results/All evaluation numbers: all_evaluation_metrics.json, threshold_tradeoff_validation.csv, training_history.csv, locked test result, saved scores
figures/Every figure shown below
kaggle_version_19_train.pyThe exact file Kaggle ran to train this model
train_signature_v19.py, signature_similarity_shared_v19.ipynbThe same code, with the settings in a notebook cell, to reproduce the run on Kaggle or Colab
signature_similarity_colab_try_model_v19.ipynb, signature_similarity_kaggle_try_model_v19.ipynbTry the model on two of your own pictures
DATASET_STEPS_v3.md / .docxHow the dataset was built, step by step

Results on the test set

The test set has 3,000 pairs from 99 writers (HMS, CEDAR and BHSig260) that were never used for training, validation or choosing a model. The thresholds above were chosen on validation. The test was run once for the reported result, and has since been made public so that other models can be compared on it.

MetricTest
Accuracy81.5%
Balanced accuracy81.5%
Precision79.5%
Recall84.8%
F1 score0.8209
Specificity78.2%
False accept rate (FAR)21.8%
False reject rate (FRR)15.2%
MCC0.6314
ROC-AUC0.9017
Average precision0.9032
Equal error rate (EER)18.5%
mAP per writer0.9126

95% confidence range (resampling whole writers 1,000 times): accuracy 78.8% to 84.2%, EER 15.7% to 21.5%.

Confusion matrix (test)

Test confusion matrix

predicted differentpredicted same
truly different1173 (correct)327 (forgery or other person accepted)
truly same228 (genuine rejected)1272 (correct)

Reading it: of the 1500 different-person pairs, 21.8% were wrongly accepted. Of the 1500 same-person pairs, 15.2% were wrongly rejected. The model catches genuine matches better than it rejects forgeries.

Accuracy by data group

Accuracy by group

GroupValidation accuracyValidation EERTest accuracyTest EER
bhsig_bengali89.3%11.0%82.3%17.5%
bhsig_hindi85.0%16.5%86.3%12.9%
cedar82.9%16.7%81.4%16.9%
hms_bengali74.5%27.0%79.5%19.9%
hms_english75.4%23.6%76.4%22.6%
hms_s72.0%28.0%79.8%20.1%

The BHSig260 and CEDAR groups are strongest. The HMS groups (especially HMS English) are weaker and are below 80%.

Results on the validation set

Validation has 3,000 pairs from 96 writers and was used to pick the best epoch, the model settings and the thresholds, so these numbers are slightly optimistic compared with the test.

MetricValidation
Accuracy81.3%
Balanced accuracy81.3%
Precision80.3%
Recall82.9%
F1 score0.8160
Specificity79.7%
False accept rate (FAR)20.3%
False reject rate (FRR)17.1%
MCC0.6263
ROC-AUC0.8976
Average precision0.9000
Equal error rate (EER)19.0%
mAP per writer0.9019

Validation confusion matrix

All figures

Curves. ROC and DET curves for validation and test (the DET curve is the standard plot for biometric systems):

ROC and DET

Score distributions. The model gives higher scores to same-person pairs (green) than to different-person pairs (red). The overlap in the middle is where the mistakes come from. Lines mark the three thresholds:

Score distributions

Raising the threshold. A higher threshold accepts fewer forgeries but rejects more genuine signatures (validation):

Threshold trade-off

ThresholdFalse accept rateFalse reject rateAccuracy
0.50072.6%0.8%63.3%
0.55062.8%1.2%68.0%
0.60055.0%2.3%71.4%
0.65046.4%4.1%74.7%
0.70036.5%7.6%77.9%
0.75027.3%13.3%79.7%
0.80016.6%22.2%80.6%
0.8508.1%35.1%78.4%
0.9002.0%57.3%70.4%
0.9500.2%84.9%57.5%

Training curves. Training accuracy rises above validation accuracy after about epoch 8, which is the overfitting that early stopping guards against. The best epoch (12) was chosen by validation EER:

Training curves

How the model was made, step by step

1. The data

  • Sources: HMS (Mendeley Data; Bangla, English and "S" scripts), CEDAR (Latin script) and BHSig260 (Bengali and Hindi).
  • Training: 14,556 images from 452 writers. Validation: 3,118 images from 96 writers. Test: 3,199 images from 99 writers.
  • Split by writer, so no person appears in more than one split.
  • Full build description: DATASET_STEPS_v3.md.

2. Preprocessing (every image, the same steps)

  1. Transparent background to white; convert to grayscale.
  2. If the background is dark, invert so the ink is dark on white.
  3. Contrast stretch between the 1st and 90th percentile of brightness.
  4. Ink = pixels darker than 160 after the stretch; everything else becomes white.
  5. Remove printed box lines (rows and columns that are more than 40% ink).
  6. Crop tightly around the ink with a 4% margin.
  7. Pad to a square so the signature is not stretched.
  8. Resize to 224 x 224 (Lanczos) and save as a lossless PNG.

3. Cleaning

Exact copies, near copies (64-bit difference hash plus a pixel check), blank files and writers with too few images were removed. Two BHSig260 Hindi writers were excluded (one with no genuine samples, one with a mismatched count).

4. Training pairs

The model learns from pairs of signatures. Half are the same person (two different genuine signatures of one writer). Half are different: 70% a genuine signature against a skilled forgery of the same writer (the hard case), and 30% against a different writer. A different writer is never from the same group. Sources alternate so each is represented. Each epoch draws 8,000 fresh pairs.

5. The network

  • Backbone: ConvNeXt-Tiny pretrained on ImageNet (torchvision weights). Its 1,000-class layer is removed.
  • Head: dropout (0.2), then a linear layer that gives a 256-number embedding (a fingerprint of the signature).
  • Siamese: both signatures go through the same network. Each embedding is scaled to length 1, and the similarity is the cosine of the two embeddings rescaled to 0 to 1.

6. The loss

Contrastive loss with margin 0.3: same-person pairs are pushed toward similarity 1; different-person pairs are pushed below 0.3. Errors are squared, so large mistakes count more.

7. Optimisation and regularisation (these fight overfitting)

SettingValue
OptimiserAdamW, weight decay 5e-4
Learning ratehead 1e-4; backbone 0.03 x that (3e-6)
Schedulecosine decay over 30 planned epochs
Frozen layersthe stem and first stages of ConvNeXt stay frozen for the whole run; the whole backbone is frozen for epochs 1 and 2
Batch32 pairs; 8,000 fresh pairs per epoch
Augmentation (training only)small rotation (3 degrees), shift (3%), scale (5%); brightness and contrast jitter (0.2); light random erasing
Dropout0.2 on the embedding layer
Stoppingstop after 8 epochs without a better validation EER; keep the best epoch
Seed7
HardwareKaggle GPU, mixed precision

The run stopped after 20 epochs; the best was epoch 12 (validation accuracy 81.3%).

8. Choosing the thresholds

Thresholds were chosen on the validation set only: main gives the best balance of the two error types, accept keeps false accepts at 1% or less, and reject keeps false rejects at 1% or less.

9. Model selection history (nothing here used the test set)

ModelBackbone learning rate (x head)Validation accuracyTrain-validation gap
ResNet-18, full1.078.3%13.5 points
ResNet-180.178.7%5.9
ResNet-180.0378.8%4.8
ResNet-180.0178.1%3.5
ResNet-18, backbone frozen075.4%1.5
ResNet-340.0177.2%4.2
EfficientNet-B00.0376.0%1.2
ConvNeXt-Tiny, seed 42 (Kaggle version 18)0.0380.8%4.6
ConvNeXt-Tiny, seed 7 (Kaggle version 19, this model)0.0381.3%6.5

The seed-7 run was picked over seed 42 because its validation accuracy and EER were slightly higher.

What the metrics mean

  • Accuracy: share of pairs called correctly. Precision: of the pairs called "same", how many really were. Recall: of the really-same pairs, how many were found.
  • F1: the balance of precision and recall. Specificity: of the really-different pairs, how many were rejected.
  • FAR (false accept rate): share of different-person pairs wrongly accepted. FRR (false reject rate): share of same-person pairs wrongly rejected.
  • EER: the error rate at the point where FAR equals FRR; lower is better and it does not depend on the threshold.
  • MCC: a balanced score from -1 to 1 (0 is guessing). ROC-AUC / average precision: how well the scores rank same pairs above different pairs.
  • mAP per writer: average precision inside each writer's own pairs.

Limitations and responsible use

  • Not a sole decision-maker. At the main threshold about 21.8% of different-person pairs (including forgeries) are accepted. Use the three-way decision and keep a person in the loop for anything that matters.
  • Scans, not photos. It was trained on scanned signatures from three datasets. Phone photos, unusual paper or other scripts may score lower.
  • Weaker groups. HMS English and HMS Bengali are below 80% on the test set.
  • The confidence range is wide. The true accuracy could be just under 80% (78.8% to 84.2%).
  • Test set is public. It was used for this result and is now public, so honest testing of a new model needs new writers.
  • Privacy. Signatures are personal data; follow the law and the consent rules that apply to you.

Data and licences

Trained on HMS (Mendeley Data), CEDAR and BHSig260. Each source keeps its own terms, which also apply to this model and its use. The train and validation data are in izamscientist/signature-similarity-v3-train-val; the test set is in izamscientist/signature-similarity-v3-test.

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

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

GPU в ailist

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

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

Подбираем GPU…

Ревизия весов
e1f3bf7

0 моделей