Karez's picture
Upload folder using huggingface_hub
1a3cc45 verified
|
Raw
History Blame
2.15 kB
metadata
language:
  - ckb
license: cc-by-nc-4.0
tags:
  - handwritten-text-recognition
  - paragraph-recognition
  - ckb
  - densenet
  - transformer
  - pytorch
  - safetensors
datasets:
  - DASNUS
metrics:
  - cer
  - wer
pipeline_tag: image-to-text

DASNUS-Kurdish: DenseNet121-Transformer Paragraph HTR

Model Description

Kurdish handwritten paragraph recognition model fine-tuned on the external DASNUS dataset accessed through: https://data.mendeley.com/datasets/xdj9f55rkm/1. Pre-trained on 12,000 synthetic Kurdish paragraphs from DASTNUS, then fine-tuned on 1,843 reconstructed DASNUS paragraphs. Demonstrates cross-dataset transfer capability.

Architecture

  • CNN Backbone: DenseNet-121 (pretrained on ImageNet)
  • Horizontal Upsample: Yes
  • Encoder: 3 Transformer encoder layers
  • Decoder: 6 Transformer decoder layers
  • Attention Heads: 8
  • Hidden Size: 256
  • Feed-Forward Dim: 2048
  • Vocabulary Size: 116
  • Parameters: 22,746,927

Performance on DASNUS

Metric Value
CER (greedy) 0.0856
WER (greedy) 0.3148

Input Format

  • Image size: 600 x 1235 pixels
  • Preprocessing: Aspect-ratio-preserving resize, right-aligned on white canvas (RTL)
  • Normalization: ImageNet mean/std

Training

  • Pre-training: 12,000 synthetic paragraph images with curriculum learning
  • Fine-tuning: Real handwritten paragraphs from DASNUS
  • Two-stage strategy: Encoder frozen for first 10 epochs during fine-tuning

Usage

from safetensors.torch import load_file
import json

# Load model weights
state_dict = load_file("model.safetensors")

# Load config
with open("config.json", "r") as f:
    config = json.load(f)

# Load vocabulary
with open("vocab.json", "r") as f:
    vocab = json.load(f)

# Load reverse mapping
with open("idx_to_char.json", "r") as f:
    idx_to_char = json.load(f)

Citation

[Citation to be added upon publication]

License

This model is released under CC-BY-NC-4.0 for non-commercial research purposes only.