Skip to content

mdefrance/signature-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLOS for Handwritten Signature Detection

This repository hosts the code used to finetune YOLOS models to detect handwritten signatures in document images. The model is trained on the tech4humans/signature-detection dataset, built from real-world signature data across diverse document types.


Quick Usage

from datasets import load_dataset
from transformers import pipeline

# Load test image from dataset
dataset = load_dataset("samuellimabraz/signature-detection")
image = dataset["test"][0]["image"]

# Load the finetuned pipeline
yolos = pipeline(
    task="object-detection",
    model="mdefrance/yolos-base-signature-detection",
    device_map="auto"
)

# Run inference
prediction = yolos(image)

Performances

Metric yolos-base-signature-detection yolos-small-signature-detection yolos-tiny-signature-detection
Inference Time - CPU (s) 2.250 0.787 0.262
Inference Time - GPU (s) 1.464 0.023 0.014
Parameters 127.73M 30.65M 6.47M
mAP50 0.887 0.859 0.856
mAP50-95 0.495 0.421 0.395

Inference times are computed on a laptop with following specs:

  • CPU: Intel Core i7-9750H
  • GPU: NVIDIA GeForce GTX 1650

Setup & Usage (Local)

Requirements

  • Python 3.12.1 (not tested for other versions)
  • Poetry 2.1.3 for dependency management

Installation

  1. Clone the repo:
git clone https://github.com/mdefrance/signature-detection.git
cd signature-detection
  1. Install dependencies with Poetry:
pip install poetry==2.1.3
poetry install

Fine-Tuning Notebook

The notebook used to fine-tune YOLOS on the signature detection dataset is available here. It includes:

  • Dataset loading & preprocessing
  • YOLOS training configuration
  • Training with Pytorch Lightning Trainer
  • Evaluation & visualization of predictions

Training Data

Out-of-Scope Use

  • Forgery or Fraudulent Use: This model is for detection only, not signature generation or spoofing.
  • Non-Signature Detection: Not suitable for detecting other objects or text.
  • High-Stakes Automation: Use human verification in legal or financial applications.

Limitations & Ethical Use

  • Bias Risk: Limited performance on unseen signature styles or document types.
  • False Positives/Negatives: Manual review is recommended in production.
  • Image Quality: Model struggles with noisy, low-res, or poorly lit inputs.
  • Ethics: Respect privacy and regulatory compliance when deploying.

Citation

If you use this model, consider citing the original YOLOS paper:

BibTeX:

@article{DBLP:journals/corr/abs-2106-00666,
  author    = {Yuxin Fang and
               Bencheng Liao and
               Xinggang Wang and
               Jiemin Fang and
               Jiyang Qi and
               Rui Wu and
               Jianwei Niu and
               Wenyu Liu},
  title     = {You Only Look at One Sequence: Rethinking Transformer in Vision through
               Object Detection},
  journal   = {CoRR},
  volume    = {abs/2106.00666},
  year      = {2021},
  url       = {https://arxiv.org/abs/2106.00666},
  eprinttype = {arXiv},
  eprint    = {2106.00666},
  timestamp = {Fri, 29 Apr 2022 19:49:16 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2106-00666.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

Additional Resources

Author

Mario DEFRANCE

Data Scientist / AI Engineer

Responsibilities in this Project

  • 🔬 Model development and training
  • ⚙️ Performance evaluation
  • 📝 Technical documentation and model card

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages