veilq-signature-v3
A handwritten-signature detector for document images, screenshots and
photos, fine-tuned by nuetzliches from
mdefrance/yolos-tiny-signature-detection
(revision b788cf7376464453c3dea1e5ee8589adcaa0c634, Apache-2.0). This is
a modification of the base model: its weights were trained further so that
it finds signatures, also one written on a photo, and leaves photos, web
pages of photo cards and headlines, diagonal watermarks, stamps and logos,
which the base model took for signatures.
It is the signature detector of veilq
(ADR-0048), which fills the signatures it finds black. veilq pins this file
by its SHA-256 and fetches it with veilq models fetch signature. It
follows veilq-signature-v2.
Model
- Input
pixel_values: float32[1, 3, 640, 640], RGB scaled to 0..1, normalised with mean[0.485, 0.456, 0.406]and deviation[0.229, 0.224, 0.225], the picture resized to 640 x 640. - Outputs
logits:[1, 100, 2](signature, nothing; softmax), andpred_boxes:[1, 100, 4](centre x, centre y, width, height as shares of the input). - Opset 17. SHA-256 of
model.onnx:9be7393f97d7feb5b1d4585ea8ce456a4204fa5c323b96c0f064f89800bb3105.
Changes to the base model
Data: 2,000 synthetic pictures, none of a real person's signature:
- letters and screenshots of letters beside an application window or a web page, with signatures in handwriting fonts (Caveat, Dancing Script, Great Vibes, Homemade Apple, Reenie Beanie, Allura, Sacramento, Kalam, Nothing You Could Do; from google/fonts, OFL or Apache-2.0) and drawn strokes, sometimes across the printed name or role; diagonal watermarks (often across the signature), stamps, logos, tables and rules, with printed text in Lato, Open Sans and Source Sans 3;
- letters photographed on a desk (turned, light falling off, noise, JPEG);
- web pages in a browser (photo cards with headlines, adverts of large text on colour, lists with icons, charts, weather), now and then with a signed photo in a card, and photos alone without a signature;
- photos signed on their face (an autograph, a painter's name in a corner), 14 % of the pictures, in an ink that stands out from what lies under it (white or gold on dark, black, blue or red on light).
The photos are 777 pictures from Wikimedia Commons under CC0 or in the public domain, chosen by topic (food, places, things, animals, art); seven with handwriting or a signature were taken out by hand. Every sixth photo was kept for validation only. Invented names and places only.
Training: 16 epochs on a CPU, batch 8, AdamW at 2e-5, the patch embeddings and the first 6 of 12 encoder layers kept as they were; the best epoch (16) chosen on 300 held-out synthetic pictures by the mean recall over the kinds of picture that hold signatures, less false boxes per picture, read the way veilq reads a picture (whole, and in squares of the shorter side when far from square; score 0.5; boxes from 40 px wide).
Measured
On the 300 held-out pictures (170 signatures), read by veilq's reading in ONNX Runtime, signatures found and false boxes:
| Kind | Pictures | veilq-signature-v2 | veilq-signature-v3 |
|---|---|---|---|
| Letter without a watermark | 73 | 49/51, 3 false | 49/51, 1 false |
| Letter with a watermark | 80 | 53/57, 9 false | 54/57, 3 false |
| Letter photographed | 27 | 17/17, 2 false | 17/17, 1 false |
| Photo signed on its face | 40 | 9/40, 0 false | 15/40, 1 false |
| Web page (5 signed photos) | 58 | 0/5, 5 false | 2/5, 4 false |
| Photo | 22 | 1 false | 0 false |
The base model on the same pictures (as the training measures it): 109/170 found, 2,048 false boxes.
24 further letters of another generator (white, cream, grey, photographed, scanned, beside a dark window): v2 and v3 find all 24. A reported screenshot of a news page with photos (kept on its owner's machine): no box (v1: 19).
Limits
Trained on synthetic data: real signatures, scans and photos vary more. A signature written on a photo is still missed more often than found. It finds where a signature is; it does not verify or compare signatures. A watermark can still give a small false box.
Licence
Apache-2.0 (see LICENSE), as the base model. The base model was fine-tuned
on tech4humans/signature-detection
(Tobacco800, Roboflow signatures-xc8up); see its card. The photos used in
training are CC0 or public domain; none is published with this model.