Karez commited on
Commit
a557a0b
·
verified ·
1 Parent(s): 069ec5e

Update Urdu-HLR-Model/README.md

Browse files
Files changed (1) hide show
  1. Urdu-HLR-Model/README.md +79 -79
Urdu-HLR-Model/README.md CHANGED
@@ -1,79 +1,79 @@
1
- ---
2
- language:
3
- - ur
4
- license: cc-by-nc-4.0
5
- tags:
6
- - handwritten-text-recognition
7
- - urdu
8
- - pucit
9
- - densenet
10
- - transformer
11
- - transfer-learning
12
- - pytorch
13
- - safetensors
14
- datasets:
15
- - PUCIT
16
- - DASTNUS
17
- metrics:
18
- - cer
19
- - wer
20
- pipeline_tag: image-to-text
21
- ---
22
-
23
- # Urdu Handwritten Text Recognition: DenseNet121-Transformer (Fine-tuned on PUCIT)
24
-
25
- ## Model Description
26
- A lightweight DenseNet121-Transformer architecture for Urdu handwritten line recognition,
27
- pre-trained on the Kurdish DASTNUS dataset and fine-tuned on the PUCIT Urdu handwritten dataset.
28
- Uses a triple unified vocabulary covering Kurdish, Arabic, and Urdu scripts (192 tokens).
29
-
30
- ## Architecture
31
- - **CNN Backbone:** DenseNet-121 (pretrained on ImageNet)
32
- - **Encoder:** 3 Transformer encoder layers
33
- - **Decoder:** 3 Transformer decoder layers
34
- - **Attention Heads:** 8
35
- - **Hidden Size:** 256
36
- - **Parameters:** ~12.8M
37
- - **Vocabulary:** 192 tokens (Triple unified: Kurdish + Arabic + Urdu)
38
-
39
- ## Transfer Learning Pipeline
40
- 1. Pre-trained on Kurdish DASTNUS dataset (with unified vocabulary)
41
- 2. Fine-tuned on PUCIT Urdu handwritten line dataset
42
-
43
- ## Performance on PUCIT Test Set
44
- | Metric | Value |
45
- |--------|-------|
46
- | CER | 0.0932 |
47
- | WER | 0.2799 |
48
- | CRR | 90.68% |
49
-
50
- ## Training Data
51
- - **Pre-training:** DASTNUS Kurdish handwritten dataset
52
- - **Fine-tuning:** PUCIT Urdu handwritten dataset (5,554 training, 935 validation, 912 testing)
53
-
54
- ## Usage
55
- ```python
56
- from safetensors.torch import load_file
57
- import json
58
-
59
- # Load model weights
60
- state_dict = load_file("model.safetensors")
61
-
62
- # Load config
63
- with open("config.json", "r") as f:
64
- config = json.load(f)
65
-
66
- # Load vocabulary
67
- with open("vocab.json", "r", encoding="utf-8") as f:
68
- vocab = json.load(f)
69
-
70
- # Load full unified vocabulary info
71
- with open("unified_vocabulary.json", "r", encoding="utf-8") as f:
72
- unified_vocab = json.load(f)
73
- ```
74
-
75
- ## Citation
76
- []
77
-
78
- ## License
79
- This model is released for non-commercial scientific research purposes only.
 
1
+ ---
2
+ language:
3
+ - ur
4
+ license: cc-by-nc-4.0
5
+ tags:
6
+ - handwritten-text-recognition
7
+ - urdu
8
+ - pucit
9
+ - densenet
10
+ - transformer
11
+ - transfer-learning
12
+ - pytorch
13
+ - safetensors
14
+ datasets:
15
+ - PUCIT
16
+ - DASTNUS
17
+ metrics:
18
+ - cer
19
+ - wer
20
+ pipeline_tag: image-to-text
21
+ ---
22
+
23
+ # Urdu Handwritten Text Recognition: DenseNet121-Transformer (Fine-tuned on PUCIT)
24
+
25
+ ## Model Description
26
+ A lightweight DenseNet121-Transformer architecture for Urdu handwritten line recognition,
27
+ pre-trained on the Kurdish DASTNUS dataset and fine-tuned on the PUCIT Urdu handwritten dataset.
28
+ Uses a triple unified vocabulary covering Kurdish, Arabic, and Urdu scripts (192 tokens). The PUCIT-OHUL is publicly available at: http://faculty.pucit.edu.pk/nazarkhan/work/urdu_ohtr/pucit_ohul_dataset.html
29
+
30
+ ## Architecture
31
+ - **CNN Backbone:** DenseNet-121 (pretrained on ImageNet)
32
+ - **Encoder:** 3 Transformer encoder layers
33
+ - **Decoder:** 3 Transformer decoder layers
34
+ - **Attention Heads:** 8
35
+ - **Hidden Size:** 256
36
+ - **Parameters:** ~12.8M
37
+ - **Vocabulary:** 192 tokens (Triple unified: Kurdish + Arabic + Urdu)
38
+
39
+ ## Transfer Learning Pipeline
40
+ 1. Pre-trained on Kurdish DASTNUS dataset (with unified vocabulary)
41
+ 2. Fine-tuned on PUCIT Urdu handwritten line dataset
42
+
43
+ ## Performance on PUCIT Test Set
44
+ | Metric | Value |
45
+ |--------|-------|
46
+ | CER | 0.0932 |
47
+ | WER | 0.2799 |
48
+ | CRR | 90.68% |
49
+
50
+ ## Training Data
51
+ - **Pre-training:** DASTNUS Kurdish handwritten dataset
52
+ - **Fine-tuning:** PUCIT Urdu handwritten dataset (5,554 training, 935 validation, 912 testing)
53
+
54
+ ## Usage
55
+ ```python
56
+ from safetensors.torch import load_file
57
+ import json
58
+
59
+ # Load model weights
60
+ state_dict = load_file("model.safetensors")
61
+
62
+ # Load config
63
+ with open("config.json", "r") as f:
64
+ config = json.load(f)
65
+
66
+ # Load vocabulary
67
+ with open("vocab.json", "r", encoding="utf-8") as f:
68
+ vocab = json.load(f)
69
+
70
+ # Load full unified vocabulary info
71
+ with open("unified_vocabulary.json", "r", encoding="utf-8") as f:
72
+ unified_vocab = json.load(f)
73
+ ```
74
+
75
+ ## Citation
76
+ []
77
+
78
+ ## License
79
+ This model is released for non-commercial scientific research purposes only.