Qwen3.5 Signature Detection & Visual Grounding Suite

Fine-tuned Qwen3.5 vision-language models (9B and 4B) specialized in document signature verification, signer role attribution, counting, and normalized [0, 1000] bounding-box localization.

Trained using Unsloth on Vishva007/signature-detection-sft, this model family outputs deterministic, Pydantic-validated JSON across single-role queries, hard-negative checks, full-page open discovery, and document VQA.

Recommended Checkpoint: Vishva007/Qwen3.5-9B-Signature (and its W4A16 quantized release) delivers the strongest spatial precision, role disambiguation, and hard-negative rejection performance across complex multi-signer forms and vouchers.


Model Family & Available Artifacts

All checkpoints are grouped in the Qwen3.5 Signature Detection & Visual Grounding Collection:

Repository Base Model Format / Precision Recommended Use Case
Vishva007/Qwen3.5-9B-Signature Qwen/Qwen3.5-9B Merged BF16 Best overall accuracy, fine-grained bounding boxes, and downstream quantization
Vishva007/Qwen3.5-9B-Signature-W4A16 Qwen/Qwen3.5-9B W4A16 Quantized High-throughput production serving on single-GPU setups via vLLM
Vishva007/Qwen3.5-9B-Signature-Adapter Qwen/Qwen3.5-9B LoRA Adapter (r=16, alpha=16) Lightweight adapter loading or multi-LoRA serving
Vishva007/Qwen3.5-4B-Signature Qwen/Qwen3.5-4B Merged BF16 Low-latency / constrained-VRAM document extraction
Vishva007/Qwen3.5-4B-Signature-Adapter Qwen/Qwen3.5-4B LoRA Adapter (r=16, alpha=32) Lightweight 4B adapter deployment

Capabilities & Supported Tasks

The models are trained across four complementary document-understanding tasks:

  1. Positive Grounding (positive_grounding): Verifies whether a specific role (e.g., Director, Secretary, Applicant, Authorized Signatory) has signed the document and returns exact [x1, y1, x2, y2] coordinates.
  2. Hard-Negative Rejection (hard_negative_grounding): Accurately returns "is_present": false and "signatures": [] when queried for plausible roles that are absent from the page, suppressing false-positive hallucinations.
  3. Open Discovery (open_discovery): Scans the entire page ("Identify and locate all signatures present on this document.") and extracts every signature alongside its associated role label and bounding box.
  4. Document VQA (pure_vqa): Answers signature count and signer-role inventory questions in the unified JSON schema.

Output JSON Schema

Every response strictly conforms to the following Pydantic schema:

{
  "answer": "Yes, the Director signature is present on this document.",
  "is_present": true,
  "count": 2,
  "signatures": [
    {
      "role": "Director",
      "bbox_2d": [730, 309, 914, 377]
    },
    {
      "role": "Director",
      "bbox_2d": [788, 809, 942, 882]
    }
  ]
}
  • answer (str): Natural-language summary answering the prompt.
  • is_present (bool): true if at least one matching signature is detected; false otherwise.
  • count (int): Total number of items in signatures.
  • signatures (list[dict]):
  • role (str): Signer role, title, or label associated with the signature.
  • bbox_2d (list[int]): [xmin, ymin, xmax, ymax] normalized to [0, 1000] relative to the upright image width and height.

Serving & Inference

1. High-Throughput Serving with vLLM

Option A: Serving Merged or Quantized Checkpoints (Recommended)

vllm serve Vishva007/Qwen3.5-9B-Signature-W4A16 \
  --host 0.0.0.0 \
  --port 8000 \
  --trust-remote-code \
  --max-model-len 16384 \
  --enable-prefix-caching \
  --default-chat-template-kwargs '{"enable_thinking": false}'

Option B: Serving the LoRA Adapter on Top of the Base Model

vllm serve Vishva007/Qwen3.5-9B-W4A16-AutoRound-GPTQ \
  --host 0.0.0.0 \
  --port 8000 \
  --enable-lora \
  --lora-modules signature-adapter=Vishva007/Qwen3.5-9B-Signature-Adapter \
  --max-lora-rank 16 \
  --max-loras 1 \
  --trust-remote-code \
  --max-model-len 16384 \
  --enable-prefix-caching \
  --default-chat-template-kwargs '{"enable_thinking": false}'

Note: When serving with --lora-modules, pass (the registered adapter name) in your OpenAI SDK requests instead of the base model ID. For the 4B adapter, swap the base model and path to Qwen/Qwen3.5-4B and Vishva007/Qwen3.5-4B-Signature-Adapter.

2. Structured Extraction with OpenAI SDK & Pydantic

Important: Ensure input images are EXIF-transposed and rotated upright (0°) before inference, as all training coordinates are normalized to upright page orientations.

import base64
from io import BytesIO
from openai import OpenAI
from PIL import Image, ImageOps
from pydantic import BaseModel, ConfigDict


class SignatureItem(BaseModel):
    model_config = ConfigDict(extra="forbid")
    role: str
    bbox_2d: list[int]


class SignatureResponse(BaseModel):
    model_config = ConfigDict(extra="forbid")
    answer: str
    is_present: bool
    count: int
    signatures: list[SignatureItem]


def encode_upright_image(image_path: str) -> tuple[str, int, int]:
    img = ImageOps.exif_transpose(Image.open(image_path)).convert("RGB")
    width, height = img.size
    buf = BytesIO()
    img.save(buf, format="JPEG", quality=95)
    b64 = base64.b64encode(buf.getvalue()).decode("utf-8")
    return b64, width, height


client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
b64_img, width, height = encode_upright_image("document.jpg")

completion = client.chat.completions.parse(
    model="Vishva007/Qwen3.5-9B-Signature-W4A16",
    temperature=0.0,
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{b64_img}"}},
                {"type": "text", "text": "Identify and locate all signatures present on this document."},
            ],
        }
    ],
    response_format=SignatureResponse,
)

result: SignatureResponse = completion.choices[0].message.parsed
print(result.model_dump_json(indent=2))

# Convert normalized [0, 1000] coordinates back to pixel coordinates
for sig in result.signatures:
    x1, y1, x2, y2 = sig.bbox_2d
    pixel_box = [
        int(x1 / 1000 * width),
        int(y1 / 1000 * height),
        int(x2 / 1000 * width),
        int(y2 / 1000 * height),
    ]
    print(f"Role: {sig.role} | Pixel Box: {pixel_box}")

Training Details

Both model variants were fine-tuned with Unsloth (gradient_checkpointing: unsloth, train_on_completions: true) on Vishva007/signature-detection-sft (12,000 training examples / 2,530 validation examples across orientation-corrected document scans), updating both vision and language layers (q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj):

Hyperparameter Qwen3.5-9B Configuration Qwen3.5-4B Configuration
Max Sequence Length 8192 8192
Epochs 1 1
Effective Batch Size 16 (batch_size=4, grad_accum=4) 16 (batch_size=2, grad_accum=8)
Learning Rate 5e-5 (Cosine, 40 warmup steps) 1e-4 (Cosine, 40 warmup steps)
Optimizer & Weight Decay adamw_8bit, 0.05 adamw_8bit, 0.02
LoRA Rank / Alpha r=16, alpha=16 (use_rslora=true) r=16, alpha=32 (use_rslora=true)
LoRA Dropout 0.1 0.05
Fine-Tuned Modules Vision + Language (Attention & MLP) Vision + Language (Attention & MLP)

🚀 Deploy on RunPod

One-click launch environments pre-configured with PyTorch, CUDA, and dependencies for fine-tuning or quantization.

🎁 Need GPU compute? Sign up via RunPod and get $5–$500 in free credits when you add your first $10.

PyTorch 2.15

Template CUDA Version Docker Image Template ID Deploy
PyTorch 2.15 (CUDA 13.2) 13.2 vishva123/cuda-13.2-pytorch-2.15-runpod 0rsw686010 Deploy to RunPod
PyTorch 2.15 (CUDA 13.4) 13.4 vishva123/cuda-13.4-pytorch-2.15-runpod 0s0rhdfaqy Deploy to RunPod

PyTorch 2.14

Template CUDA Version Docker Image Template ID Deploy
PyTorch 2.14 (CUDA 12.6) 12.6 vishva123/cuda-12.6-pytorch-2.14-runpod d7lxsa4w9m Deploy to RunPod
PyTorch 2.14 (CUDA 13.0) 13.0 vishva123/cuda-13.0-pytorch-2.14-runpod yk0y6j6rpg Deploy to RunPod
PyTorch 2.14 (CUDA 13.2) 13.2 vishva123/cuda-13.2-pytorch-2.14-runpod gsp4gwx0nw Deploy to RunPod

PyTorch 2.13

Template CUDA Version Docker Image Template ID Deploy
PyTorch 2.13 (CUDA 12.6) 12.6 vishva123/cuda-12.6-pytorch-2.13-runpod gmlupxnxfk Deploy to RunPod
PyTorch 2.13 (CUDA 13.0) 13.0 vishva123/cuda-13.0-pytorch-2.13-runpod y3j8xvk4f4 Deploy to RunPod
PyTorch 2.13 (CUDA 13.2) 13.2 vishva123/cuda-13.2-pytorch-2.13-runpod vigpissn5w Deploy to RunPod

PyTorch 2.12

Template CUDA Version Docker Image Template ID Deploy
PyTorch 2.12 (CUDA 12.6) 12.6 vishva123/cuda-12.6-pytorch-2.12-runpod ctmz86zmf0 Deploy to RunPod
PyTorch 2.12 (CUDA 13.0) 13.0 vishva123/cuda-13.0-pytorch-2.12-runpod qjko5yiwzi Deploy to RunPod
PyTorch 2.12 (CUDA 13.2) 13.2 vishva123/cuda-13.2-pytorch-2.12-runpod ifg6xmye0f Deploy to RunPod

Limitations & Recommendations

  • Page Orientation: Bounding boxes are trained exclusively on upright (0°) images. For rotated or scanned PDFs, run an orientation classifier (e.g., PaddleOCR PP-LCNet_x1_0_doc_ori) prior to inference.
  • Role Label Supervision: Signer role annotations in the underlying training split were generated via VLM teacher distillation and may occasionally normalize rare institutional titles to standard role names.
  • Model Selection: Use Qwen3.5-9B-Signature (or Qwen3.5-9B-Signature-W4A16) for production banking/legal documents; use the 4B variant only when strict edge-memory or latency budgets apply.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Vishva007/Qwen3.5-4B-Signature-Adapter

Finetuned
Qwen/Qwen3.5-4B
Finetuned
(1,732)
this model

Dataset used to train Vishva007/Qwen3.5-4B-Signature-Adapter

Collection including Vishva007/Qwen3.5-4B-Signature-Adapter