Skip to content
ModelListedExternal
Download

Legaldocuman Rfdetr

RF-DETR-Base fine-tuned for handwritten signature detection in legal documents. This model is the computer vision backbone of LegalDocuMan — a commercial document intelligence API for contract processing.

KindOtherBase modelroboflow/rf-detr-baseVersionRevision 4564bb6

Model source

Kind
Other
File size
122 MB
Base model
roboflow/rf-detr-base
Version
vRevision 4564bb6
Updated
Sep 27, 2026
Downloads
0
Tasks
Object detection
Source
Hugging Face

Source description

legaldocuman-rfdetr

RF-DETR-Base fine-tuned for handwritten signature detection in legal documents.
This model is the computer vision backbone of LegalDocuMan — a commercial document intelligence API for contract processing.


Model Details

FieldValue
Base architectureRF-DETR-Base
Parameters31.9M
Base checkpointRoboflow RF-DETR-Base (COCO pretrained)
TaskSingle-class object detection
Classsignature
Input resolution560px (square)
LicenseApache 2.0

Training Data

Three open-source datasets were merged, deduplicated, and cleaned before training.
Cross-split contamination was verified via perceptual hashing — zero overlap between train, val, and test confirmed.

DatasetImagesLicense
signatures-xc8up (Roboflow 100)~2,800CC BY 4.0
Signature Detector (TrueSign)772MIT
Signature Detection v3 (home)2,145CC BY 4.0

Final dataset size after cleaning: 3,996 images


Training Configuration

ParameterValue
Augmentation presetDocument (9 transforms)
AugmentationsPerspective distortion, grid distortion, JPEG compression artifacts, Gaussian blur, Gaussian noise, random brightness/contrast, CLAHE, sharpening, horizontal flip
Input resolution560px
Early stopping patience20 epochs
Stopped atEpoch 16
Best val mAP@500.9123 (epoch 11)
Frameworkrfdetr · PyTorch · PyTorch Lightning
HardwareNVIDIA RTX 4070 Ti Super 16GB

Evaluation

Evaluated on 168 held-out test images with zero contamination from training or validation sets.

Overall

MetricScore
mAP@500.7924
mAP@50:950.820
Precision@0.500.9490
Recall@0.500.8020
F1@0.500.8696

By Signature Size

SizeAPAR
Small0.2520.500
Medium0.8340.855
Large0.8280.845

Note on small signatures: Signatures smaller than ~32×32px after resizing have significantly lower recall.
For documents with initials or compact date-field signatures, human review is recommended.


Usage

from rfdetr import RFDETRBase
from PIL import Image

model = RFDETRBase(pretrain_weights="Mo-Awadalla/legaldocuman-rfdetr")

image = Image.open("contract_page.jpg")
detections = model.predict(image, threshold=0.45)
print(detections)

For PDF inputs, convert pages to images first using pdf2image:

from pdf2image import convert_from_path

pages = convert_from_path("contract.pdf", dpi=200)
for i, page in enumerate(pages):
    detections = model.predict(page, threshold=0.45)
    print(f"Page {i+1}: {detections}")

Intended Use

Designed for:

  • Detecting the presence and location of handwritten ink signatures in legal contract pages
  • Document intake pipelines processing PDF, DOCX, and scanned image inputs
  • Execution status classification (executed vs. draft) as part of a broader document intelligence pipeline

Out of scope:

  • Signature verification or authenticity determination
  • Forgery detection
  • Digital or electronic signature detection
  • Handwriting recognition or transcription

Limitations

  • Small signatures (initials, compact date-field signatures) have significantly lower recall (AP 0.252)
  • Performance may degrade on scans below 150 DPI
  • Not trained on non-Latin document layouts
  • Should not be used as the sole decision-maker for high-stakes legal determinations without human review in the loop

Part of LegalDocuMan

This model is one component of the LegalDocuMan pipeline:

Upload PDF/DOCX/Image
        ↓
Text extraction (pdfplumber · python-docx · Tesseract OCR)
        ↓
Document type classification (MSA · SOW · NDA · PO · Amendment · License · Contract)
        ↓
Execution status (Regex NLP + RF-DETR visual signature detection)
        ↓
Vendor · Dates · Retention extraction
        ↓
Structured filename + PostgreSQL persistence

→ GitHub: Mo-Awadalla/LegalDocuMan


Attribution

Training data includes datasets licensed under CC BY 4.0.
Per license requirements:

Sources

1 source
Hugging FacePrimaryVersion 4564bb60366fe472b83db5facf100a13b6bbaef2
huggingface.co/Mo-Awadalla/legaldocuman-rfdetr/tree/4564bb60366fe472b83db5facf100a13b6bbaef2

Verified Sep 27

Model artifacts

1 artifact

checkpoint_best_total.pth

pth · 122 MB · SHA-256 b7df9809935b…16c2 · Hugging Face

Download

Source excerpts

2 excerpts

--- license: apache-2.0 tags: - object-detection - signature-detection - legal - document-ai - rf-detr - contract base_model: roboflow/rf-detr-base datasets: - roboflow-100/signatures-xc8up - truesign/signature-detector-1rnsv - home-piqzr/signature-detection-xo4es language: - en --- # legaldocuman-rfdetr RF-DETR-Base fine-tuned for handwritten signature detection in legal documents. This model is the computer vision backbone of [LegalDocuMan](https://github.com/Mo-Awadalla/LegalDocuMan) — a commercial document intelligence API for contract processing. --- ## Model Details | Field | Value | |---|---| | Base architecture | RF-DETR-Base | | Parameters | 31.9M | | Base checkpoint | Roboflow RF-DETR-Base (COCO pretrained) | | Task | Single-class object detection | | Class | `signature` | | Input resolution | 560px (square) | | License | Apache 2.0 | --- ## Training Data Three open-source datasets were merged, deduplicated, and cleaned before training. Cross-split contamination was verified via perceptual hashing — zero overlap between train, val, and test confirmed. | Dataset | Images | License | |---|---|---| | [signatures-xc8up](https://universe.roboflow.com/roboflow-100/signatures-xc8up) (Roboflow 100) | ~2,800 | CC BY 4.0 | | [Signature Detector](https://universe.roboflow.com/truesign/signature-detector-1rnsv) (TrueSign) | 772 | MIT | | [Signature Detection v3](https://universe.roboflow.com/home-piqzr/signature-detection-xo4es/dataset/3) (home) | 2,145 | CC BY 4.0 | **Final dataset size after cleaning:** 3,996 images --- ## Training Configuration | Parameter | Value | |---|---| | Augmentation preset | Document (9 transforms) | | Augmentations | Perspective distortion, grid distortion, JPEG compression artifacts, Gaussian blur, Gaussian noise, random brightness/contrast, CLAHE, sharpening, horizontal flip | | Input resolution | 560px | | Early stopping patience | 20 epochs | | Stopped at | Epoch 16 | | Best val mAP\@50 | 0.9123 (epoch 11) | | Framework | rfdetr · PyTorch · PyTorch Lightning | | Hardware | NVIDIA RTX 4070 Ti Super 16GB | --- ## Evaluation Evaluated on **168 held-out test images** with zero contamination from training or validation sets. ### Overall | Metric | Score | |---|---| | mAP\@50 | **0.7924** | | mAP\@50:95 | 0.820 | | Precision\@0.50 | **0.9490** | | Recall\@0.50 | 0.8020 | | F1\@0.50 | 0.8696 | ### By Si...

Source context: 0 downloads · 0 likes · Pipeline object-detection · Repo Mo-Awadalla/legaldocuman-rfdetr