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 source
Source description
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.
Sources
1 sourceVerified Sep 27
Model artifacts
1 artifactSource excerpts
2 excerpts| 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 |
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 (Roboflow 100) | ~2,800 | CC BY 4.0 |
| Signature Detector (TrueSign) | 772 | MIT |
| Signature Detection v3 (home) | 2,145 | CC BY 4.0 |
Final dataset size after cleaning: 3,996 images
| 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 |
Evaluated on 168 held-out test images with zero contamination from training or validation sets.
| Metric | Score |
|---|---|
| mAP@50 | 0.7924 |
| mAP@50:95 | 0.820 |
| [email protected] | 0.9490 |
| [email protected] | 0.8020 |
| [email protected] | 0.8696 |
| Size | AP | AR |
|---|---|---|
| Small | 0.252 | 0.500 |
| Medium | 0.834 | 0.855 |
| Large | 0.828 | 0.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.
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}")
Designed for:
Out of scope:
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
Training data includes datasets licensed under CC BY 4.0.
Per license requirements:
--- 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