Mubsir v2: Arabic HTR Fine-Tune

Arabic Handwriting VLM Logo

Mubsir v2 is a vision-language model fine-tuned specifically for Arabic Handwritten Text Recognition (HTR) and OCR. This iteration upgrades the base architecture and resolves a critical gradient dilution bug that prevented convergence in v1.

Model Details

  • Base Model: Qwen/Qwen2.5-VL-7B-Instruct
  • Dataset: johnlockejrr/KHATT_v1.0_dataset (full dataset, clean line-level crops with proper train/val/test splits).
  • Full Model: Hatim2221/Mubsir-Qwen2.5-7B-VL-v2
  • Adapter Only: Hatim2221/Mubsir-vl-arabic-htr-adapter-v2

Changelog & Improvements (v1 to v2)

  • Architecture Upgrade: Shifted from Qwen2-VL-2B-Instruct to Qwen2.5-VL-7B-Instruct. The newer generation provides materially stronger foundational OCR and handwriting recognition capabilities prior to fine-tuning.
  • Dataset Quality: Replaced the noisy full-page images from a 5k subset of eDaraty/Handwritten_Khatt with the clean, line-level crops of the KHATT v1.0 dataset.
  • Critical Training Fix (Data Collator): In v1, the data collator only masked pad tokens in the labels. This error left the prompt and all image tokens as training targets, severely diluting the gradient on every step and causing the loss to plateau around 4.5. v2 fixes this by masking everything except the assistant's transcript tokens, ensuring proper loss convergence.
  • Hardware & Precision: Training now utilizes a single L4 GPU (24GB) with native bfloat16 support, bypassing the fp16 instability and workarounds required on older T4 infrastructure.

Use Cases

Case 1: Zero-Shot Image Transcription & Translation

Input: Raw image only hand write Prompt: <image>
VLM Output:

The image contains handwritten text in Arabic. The text reads: "من جد وجد وصن زرع جعد" This translates to English as: "From grandpa and grandpa And sown by grandpa" It appears to be a poetic or reflective statement, possibly expressing gratitude or a lineage connection.

Case 2: Directed Arabic OCR Prompting

Input: Image containing Arabic calligraphy hand write Prompt: ايش مكتوب في هذي الصوره
VLM Output:

الصورة تحتوي على نص باللغة العربية يُكتب "الخط العربي".

Downloads last month
227
Safetensors
Model size
8B params
Tensor type
BF16
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Hatim2221/Mubsir-Qwen2.5-7B-VL-v2

Quantized
(152)
this model

Dataset used to train Hatim2221/Mubsir-Qwen2.5-7B-VL-v2