Next Article in Journal
A Hybrid ACO–Ensemble Learning Framework for Predicting Student Forum Consumption Behaviour
Previous Article in Journal
YOLOv8-FLEO: Fuzzy-Label Emotion Orthogonalization for Real-Time Facial-Expression Recognition Implementation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Synthetic Data-Driven Transformer OCR for Kurdish Sorani via Dynamic Line Generation and Script-Aware Normalization

Department of Software Engineering, College of Engineering, Salahaddin University-Erbil, Erbil 44002, Kurdistan Region, Iraq
Algorithms 2026, 19(9), 795; https://doi.org/10.3390/a19090795
Submission received: 5 August 2026 / Revised: 11 September 2026 / Accepted: 14 September 2026 / Published: 16 September 2026

Abstract

OCR for low-resource languages is still held back by the same small number of issues: too little labeled image-text data, too few benchmarks, and thin language-specific tooling. Kurdish Sorani is a particularly awkward case. It is written in a modified Arabic script, runs right to left, and has orthographic habits that standard Arabic OCR engines handle poorly. This paper describes a transformer OCR system for Sorani trained almost entirely on synthetic data, meaning line images rendered on the fly from a text corpus rather than manually transcribed scans. The pipeline has three parts: corpus-driven line synthesis, a deterministic script-aware normalization step based on character-level transliteration, and a TrOCR encoder–decoder recognizer. Text lines are rendered with randomly sampled fonts and sizes, then passed through stochastic augmentation to mimic realistic distortions. The system is evaluated twice. On an in-distribution synthetic set of 200 rendered lines, the best model reaches a character error rate of 0.0434, a word error rate of 0.1246, and 64.0% exact matches. More importantly, on a real-world test set of 19 scanned Kurdish documents (467 lines, 28,468 characters) processed end-to-end through detection and recognition, it reaches a character error rate of 0.0305 and a word error rate of 0.1770, beating both Arabic and Kurdish Tesseract baselines and an existing Kurdish TrOCR model while being considerably smaller than the latter. A controlled ablation, in which eight variants are trained under one shared budget and scored on identical images, then isolates what each design choice contributes. The label space is the largest design effect, and the reason is concrete: the decoder’s pre-trained tokenizer has no representation for seven common Sorani graphemes, which cover 14.7% of the corpus and place a floor under any model trained on native-script labels. Corpus size dominates overall and behaves as a threshold, font diversity helps with diminishing returns, and stochastic augmentation buys robustness at a small cost in in-distribution accuracy. Aligning detected lines against the transcribed ones further shows that line detection contributes under 1% of the reported character error on this material. The broader point, at least for Sorani, is that the synthetic training data and the label space in which the model predicts have to be designed together: a compact recognizer built that way outperforms a substantially larger released Kurdish model on genuine document images.

1. Introduction

Optical character recognition sits underneath a good deal of practical language technology: document digitization, archival access, search, and most NLP pipelines that start from scanned material. Over the past decade, the field has moved away from segmentation-heavy pipelines toward end-to-end neural recognizers, and more recently toward transformer encoder–decoder systems that drop many of the brittle assumptions classical on which OCR relied [1,2,3]. Tesseract is still probably the most widely used open-source engine [4]; on the transformer side, TrOCR established a strong formulation for both printed and handwritten recognition [1].
That progress has not been spread evenly, and OCR for low-resource languages lags well behind. The gap has real downstream costs, since OCR quality feeds directly into machine translation and corpus construction, and recent benchmarking work has argued for having both real and synthetic evaluation data in these settings [5]. Kurdish Sorani fits the low-resource profile almost exactly. It is written in an adapted Persian-Arabic script, rendered right to left, and inherits the segmentation and visual-ambiguity problems of Arabic-script OCR while adding graphemes and orthographic conventions of its own [6,7]. Most prior Kurdish OCR work has revolved around rule-based methods or Tesseract adaptation rather than end-to-end transformer recognition [8,9,10].
Much of the difficulty comes from the script itself. Sorani, like Arabic, is cursive and context-sensitive: a letter takes a different shape depending on where it sits in the word (isolated, initial, medial, or final), and neighboring characters join along a shared baseline, so the boundaries that a segmentation-based recognizer needs are simply not present in the image. Several letters differ only in the number or placement of their dots, which makes them easy to confuse, and diacritics add another layer of ambiguity. These properties motivate the two central design choices in this work: an end-to-end recognizer that never segments characters, and a deterministic transliteration label space that folds the noisiest script-level distinctions into a cleaner symbol inventory.
Architecture is only half the problem, though. The other half is data. A few Kurdish image datasets have appeared recently, but they target handwriting or scene text, not printed documents, so benchmark-quality annotated corpora for printed Sorani line OCR remain scarce, and that scarcity constrains training and evaluation alike. In this situation, synthetic data is less a convenience than the only practical route to supervision at scale. OCR research has shown repeatedly that synthetic rendering works well, provided the generated images capture the typography, spacing variation, and degradations that actually show up at test time [11,12,13].
The system studied here is built on exactly that idea. There is no pre-collected image dataset. Instead, paired supervision is constructed on the fly: Kurdish text lines are read from a corpus, rendered into synthetic images, transliterated into a deterministic Latin-coded label representation, and fed to a sequence-to-sequence recognizer trained on those generated pairs. The novelty is not a new backbone. It is a synthetic training pipeline shaped around what Sorani OCR actually needs.
There is also a plainly practical motivation. Digitization initiatives across the Kurdistan Region are raising the demand for tools that turn printed Kurdish documents into searchable, machine-readable text, and the OCR infrastructure behind that demand is thin. A reliable printed-text recognizer would help with government record digitization, library and newspaper archiving, and the construction of Kurdish corpora for downstream tasks like search, information extraction, and machine translation [5].
The main contributions of this paper are as follows:
  • A scalable synthetic line-image generation pipeline for Sorani Kurdish, built from a large text corpus and an archive of over a thousand fonts;
  • A deterministic transliteration-based normalization scheme that simplifies decoder tokenization while staying reversible at inference time;
  • A script-orientation normalization step that horizontally flips each rendered right-to-left Sorani line into the left-to-right reading order for which the TrOCR encoder–decoder was pre-trained, enabling a recognition architecture developed for left-to-right scripts to be transferred to a right-to-left script without any structural modification;
  • A benchmark against Arabic and Kurdish Tesseract variants and a released Kurdish TrOCR model;
  • Evidence that a smaller TrOCR variant can beat a much larger Kurdish TrOCR baseline when it is backed by a better-matched synthetic data pipeline.
It is worth being precise about what is and is not new here, since every individual ingredient (rendering text with random fonts, augmenting the result, fine-tuning an encoder–decoder) is by now standard practice. Synthetic-data OCR works such as [11,12,13] established that rendering breadth matters more than sample count, but these were developed for scripts the recognizer could already represent: in those settings, the label space is a solved problem and only the image side needs designing. Kurdish OCR work, meanwhile, has concentrated on adapting an existing engine to the language  [8,9,10]. Neither line of work confronts the situation studied here, in which the image side and the label side are broken at the same time. The specific claim of this paper is that for Sorani the two have to be designed together. The pre-trained decoder cannot represent seven common Sorani graphemes at all: they cover 14.7% of corpus characters and tokenize the unknown symbol (Section 3.3). Synthetic images alone would train a model unable to spell the language, however good the rendering. The transliteration is therefore not a tokenization convenience but the precondition that makes a pre-trained recognizer applicable to the script; the orientation normalization plays the same enabling role on the image side, letting an encoder–decoder pre-trained on left-to-right text be reused for a right-to-left one without touching the architecture. Section 5.1 measures each of these components separately, under a shared training budget, so that the improvement can be attributed rather than assumed.

2. Related Work

2.1. Classical and Neural OCR

Classical OCR systems chain together layout analysis, segmentation, feature extraction, and recognition. Tesseract is the canonical open-source example and still serves as a standard baseline in OCR studies [4]. The later LSTM-based versions improved it considerably, though performance still hinges on how relevant the training data is to the target script [7,9].
Neural OCR then dropped explicit character segmentation in favor of sequence models, and transformer OCR pushed further by treating recognition as direct sequence generation conditioned on image features. TrOCR is the most relevant example for this paper: a vision transformer encoder paired with an autoregressive decoder, with the benefit of pre-training on synthetic and labeled data [1]. Systems such as NRTR [2], ViTSTR [3], and MaskOCR [14] round out the picture, having established transformer-based text recognition as a strong direction in its own right.

2.2. Synthetic Data for OCR

Synthetic data has become the default answer to low-resource OCR, mostly because manual image transcription is slow and expensive. Rendering-based generation can supply large-scale supervision as long as the generated images resemble realistic typography and distortions [11,12]. SynthTIGER later made a related point: what matters in synthetic generation is the breadth of font, texture, and perturbation coverage, not raw sample count [13]. Both lessons apply directly to Kurdish Sorani, where the bottleneck is not just model design but the near-absence of benchmark-quality annotated OCR corpora for printed documents, recent progress on handwritten and scene-text resources notwithstanding.

2.3. Kurdish and Neighboring Arabic-Script OCR

The Kurdish OCR literature is thin. Yaseen and Hassani examined segmentation in the Persian-Arabic script setting and found that mixed font styles hurt recognition [8]. Idrees and Hassani approached the data-scarcity problem from a different angle, adapting Tesseract LSTM through script-similarity transfer, with Arabic data as the base and a smaller Sorani dataset for adaptation [9]. More recent work on historical Kurdish publications again leaned on Tesseract as the main engine, and again flagged the lack of public Kurdish OCR data [10]. The pattern across these studies is clear enough: Kurdish OCR has so far been about adapting existing engines, not about training end-to-end transformer recognizers on large synthetic corpora. Beyond recognition, Kurdish text-processing research has produced transliteration and orthographic-normalization tools that are directly relevant to the label representation adopted in this work [15,16,17].
Looking across the prior work, a few constraints keep recurring: most systems adapt a general-purpose engine like Tesseract rather than train a recognizer tailored to Sorani; many handle only isolated characters, digits, or words rather than full text lines; and nearly all of them are limited by the shortage of line-level printed training data. This is the gap at which this paper is aimed: a printed-line Sorani recognizer trained at scale through corpus-driven synthetic supervision, instead of yet another adaptation of an existing engine.
LetterSpace=-3.0Results from neighboring Arabic-script languages point in the same direction. Transformer-based OCR has done well on Arabic [18], Farsi [19], Urdu [20], and Uyghur [21], which suggests that connected scripts with heavy glyph variation respond well to end-to-end sequence models once the data pipeline actually fits the target language. Table 1 summarizes these representative approaches and how they relate to the present work.
Since 2024 the Kurdish OCR landscape has moved quickly, though activity has concentrated on handwriting and scene text rather than printed documents. New annotated corpora include a Kurdish standard EMNIST-like character dataset [22], the KSTRV1 scene-text dataset [23], the large-scale Kurdish Handwritten Lines Dataset (KHLD) [24], and a recent comprehensive analysis survey of deep-learning approaches to Kurdish handwriting digitization [25]. On the modeling side, transformer recognizers have reached Kurdish cursive handwriting: first a ResNet–Vision-Transformer system trained on the DASNUS line corpus [26], then a DenseNet121–Transformer system that, like the present work, pairs synthetic line generation with an encoder–decoder recognizer [27]. Table 2 lists these resources. What matters here is what they do not cover: all of them target handwritten or scene text, and a public benchmark for printed Sorani document-line OCR still does not exist. This is the gap that this work addresses.
Of these, the closest method to the present system is the DenseNet121–Transformer recognizer of Hamad and Shareef [27], which also combines synthetic line generation with a transformer for Kurdish. The two differ both in task and in how the synthetic lines are built. Their system targets handwritten recognition and assembles synthetic lines by concatenating real handwritten word images under uniqueness, single-writer, and leakage-free constraints. The system here targets printed recognition, synthesizes lines on the fly by rendering corpus text with randomized fonts, and trains over a deterministic transliteration label space. The two approaches are complementary rather than competitive.

3. Materials and Methods

Before the individual components are described, it helps to see how they fit together and where they depart from a standard TrOCR system. Figure 1 sets the two side by side. A conventional TrOCR pipeline consumes manually transcribed line images and predicts in a script the pre-trained tokenizer already covers; neither condition holds for printed Sorani. The system here therefore leaves the TrOCR backbone untouched and builds five components around it. On the label side, a script-aware normalization rewrites Kurdish graphemes into a Latin label space (Section 3.3), and a label-recovery step maps the decoded sequence back to Kurdish-standard codepoints afterwards (Section 3.4). On the image side, lines are synthesized on the fly from a plain text corpus (Section 3.1 and Section 3.2), reoriented so that right-to-left text is presented in the reading order the encoder was pre-trained for (Section 3.2), and perturbed by stochastic augmentation (Section 3.5). The contribution is the ring of components, not the recognizer in the middle.

3.1. Source Text Corpus and Training Subset

Synthetic line generation starts from a single large Kurdish Sorani text file. The corpus holds 538,939 non-empty lines; the average line is about 52.1 characters long, the median is 51, and the longest observed line runs to 754 characters. A training run does not consume the whole corpus at once. In the configuration reported here, up to 70,000 lines are loaded per run.
The loaded lines are partitioned at the text-line level into an 80% training set and a 20% held-out test set, so that no line used for evaluation appears anywhere in training. A small portion of the training set is further reserved as a validation set for monitoring and checkpoint selection during training. This held-out synthetic partition also supplies an in-distribution check in the form of a fixed set of 200 rendered lines. This paper’s primary evaluation, however, is deliberately out-of-distribution: it is carried out on a separate benchmark of real scanned Kurdish documents (Section 4), on which every system, the proposed model, and each baseline are scored identically, which keeps the comparison paired across systems.

3.2. Font Archive and Synthetic Line Rendering

The font archive is unusually large for a low-resource OCR project: 1006 TTF and OTF files. No font is hard-coded anywhere in the renderer; one is drawn at random for every line, which pushes typographic variability well beyond what low-resource OCR datasets normally provide. Section 5.1 quantifies what that breadth is worth.
Text lines are rendered into synthetic images on demand rather than stored as pre-generated samples. Rendering runs in right-to-left mode, which is non-negotiable for Sorani, and produces RGB images with black text on a white background. Because the TrOCR encoder–decoder was pre-trained on left-to-right scripts, each rendered line image is horizontally flipped so that the right-to-left Sorani text is presented in the left-to-right reading order the model assumes. This orientation normalization is applied consistently at both training and inference time, allowing an unmodified encoder–decoder to be transferred directly to a right-to-left script; the model thereby learns to recognize the reoriented images without any change to the underlying architecture. Font size is drawn at random between 5 and 30 points. Padding stays fixed unless stated otherwise.
There is also a small spacing perturbation stage: with low probability, extra spaces are slipped in between adjacent words. This introduces mild irregularity without making the rendered lines look artificial. The lower branch of Figure 1 shows this construction workflow end to end.
The corpus and rendering parameters that define the synthetic data distribution are collected in Table 3.

3.3. Text Normalization and Label Representation

The most distinctive design choice in the pipeline is a deterministic transliteration layer. Before tokenization, Kurdish characters written in the Arabic-based script are mapped onto Latin symbols; after decoding, the predicted Latin sequence is mapped back into Kurdish script. In effect, the Latin coding acts as a normalized intermediate label space.
Three things make this worthwhile:
  • This cuts the dependence on Arabic-script tokenization behavior;
  • The decoder gets a cleaner symbol inventory, one that follows Kurdish graphemes more directly;
  • The mapping stays reversible, so final outputs can still be returned in native Kurdish script.
How much simplification this buys can be measured directly on the source corpus. Taking the smallest symbol set that covers 99.9% of all character tokens, the inventory the decoder has to model drops from 157 distinct Arabic-script symbols to 102 Latin ones, a 35.0% reduction. The effect is concentrated in the graphemes the map actually rewrites: 65 distinct Arabic-script graphemes collapse onto 52 Latin symbols, a 20.0% reduction within that subset. Typical many-to-one merges include the two visually near-identical kaf forms (U + 06A9 and U + 0643 → k), the yeh forms (U + 06CC, U + 064A and U + 0649 → y), and the Arabic-Indic and Extended-Arabic digit blocks, which both fold onto ASCII 0–9. Table 4 collects these figures. A few of the merges are lossy in the sense that the decoder cannot tell the merged graphemes apart. Reversibility is handled by sending each merged class back to its Kurdish-standard codepoint (k, for instance, is reconstructed as keheh rather than Arabic kaf), so the reconstruction comes out correct for Sorani. The two heh forms (U + 0647, U + 06BE) remain a small exception, since Kurdish uses both.
Symbol economy, though, is the smaller half of the argument. The harder constraint comes from the decoder the system inherits. TrOCR’s small configuration ships with an XLM-RoBERTa SentencePiece vocabulary of 64,002 pieces, and that vocabulary was not built with Sorani in mind. Seven of the thirty-four graphemes in ordinary Sorani use have no piece in it at all: they tokenize to <unk> and are gone before the label ever reaches the loss. They are not marginal characters. Table 5 lists them with their corpus frequencies; together, they cover 14.7% of all characters in the corpus, and the schwa ae (U + 06D5) alone covers 8.7%. Training the decoder directly in the native script would therefore not merely be awkward, but would be lossy at the source: no model trained that way could emit a well-formed Sorani word containing any of the seven. The transliteration is what makes the pre-trained decoder usable for this script at all, which is a stronger claim than the tokenization-convenience argument the reduction figures alone would support.
Two further consequences fall out of the same measurement. The Latin labels are markedly shorter, at 24.0 tokens per line against 39.1 in the native script, or 0.53 against 0.86 tokens per character, a 38.6% reduction. That leaves more headroom under the fixed 128-token cap and shortens the autoregressive decode at inference time. And the two label spaces can be compared without training anything: push corpus text through the label space and straight back out, then score the result as though a perfect recognizer had produced it. Whatever error survives that round trip is a ceiling on any model trained in that space. In the native script, that ceiling sits at a character error rate of 0.2084 and a word error rate of 0.7335: three quarters of all words come back malformed before any image is even involved. Through the Latin label space, the same text returns at 0.0403 and 0.2563. Almost the whole gap is the seven missing graphemes.
The mapping itself is given in Table 6. Each row lists a target Latin symbol together with the Kurdish grapheme (or graphemes) that map onto it; letter case is used to widen the Latin inventory so that most graphemes keep a one-to-one code. Graphemes are named and identified by Unicode codepoint rather than rendered, to keep the source encoding unambiguous. The rows with more than one source grapheme are exactly the many-to-one merges that drive the label-space reduction in Table 4: the two kaf forms, the three yeh forms, the two heh forms, and the two Arabic digit blocks. Reconstruction at inference inverts this table, sending each merged class back to its Kurdish-standard codepoint (for example, k to keheh, U + 06A9, rather than Arabic kaf, U + 0643).

3.4. Reconstruction and Where It Fails

Because the decoder predicts in the Latin space, every output has to be mapped back before it is of any use, and that inverse step deserves scrutiny rather than assumption: a map that reconstructs the wrong codepoint inflates the measured error without any recognition failure behind it. The whole corpus was therefore pushed through the label space and straight back (transliterate, then invert) with no model in the loop, so that whatever fails to return is a property of the label space alone.
Over all 538,939 lines (28,095,287 characters), the corrected inverse map returns 50.1% of lines byte-identical and 90.8% identical under the script-aware normalization used for scoring, at a character error rate of 0.0352 raw and 0.0083 normalized. The earlier inverse map, the one that reconstructed k as Arabic kaf, returns only 38.1% of lines byte-identical and scores 0.0422 raw. The two are indistinguishable once normalization is applied, which is the important point: the merges that the map cannot undo on its own (kaf, the yeh forms, alef variants, the two digit blocks) are exactly the ones the scoring normalization unifies anyway, so they never reach the reported metric. The fragility the inverse step appears to introduce is, for these classes, absorbed by the evaluation protocol.
What does not get absorbed is smaller and more specific. It accounts for 0.793% of corpus characters and has three sources: the genuinely lossy heh merge (heh-doachashmee, U + 06BE, reconstructed as heh, U + 0647; 0.118%), the Latin comma, which the forward map sends to the Arabic comma and which therefore cannot be distinguished from it (0.066%); and embedded Latin-script text, which the inverse map converts into Kurdish letters because the label space uses those same Latin symbols for Kurdish graphemes (roughly 0.4% in total, spread across e, a, n, t, o, r and the rest). The last of these is inherent: a reversible character-level map cannot serve two scripts with one alphabet.
Auditing the forward direction as well turned up two defects worth reporting, since both leak non-ASCII characters into the label where the SentencePiece vocabulary then discards them. The Arabic-Indic digit block is only partly covered: U + 0661, the digit one, is missing, while its neighbours are present. The zero-width non-joiner (U + 200C), meanwhile, is passed through untouched even though it has no glyph and therefore leaves no visual trace a recognizer could learn from. Together, they make up 2.84% of label characters; the non-joiner alone makes up 2.03%. A hardened map that completes the digit blocks, strips the zero-width and bidirectional control marks and the tatweel, and normalizes the residual punctuation reduces that leakage to 0.016% and lowers the label-space ceiling from 0.0403 to 0.0173 CER and from 0.2563 to 0.0784 WER, reductions of 57% and 69% respectively. The models reported in this paper were trained before that audit and use the original map, so the results below are, if anything, pessimistic; the hardened map is released with the code and is the recommended configuration for future training runs.
One caveat keeps these figures in proportion. They are measured on the raw web corpus, which carries a good deal of embedded Latin text, stray punctuation and formatting marks. On edited Kurdish prose of the kind the real-scan benchmark contains, the same audit gives a ceiling of 0.0021 CER and 0.0124 WER under the original map, and 0.0006/0.0041 under the hardened one. In the register that matters for document OCR, in other words, the reconstruction step contributes well under a tenth of the error the system actually makes.

3.5. Augmentation Pipeline

The augmentation system goes well beyond a simple blur-or-rotate recipe. It covers image-processing transforms, camera-like transforms, noise, blur, warp, and geometry operations. In the main synthetic renderer, each sample is left untouched with probability 0.1; otherwise, it receives one randomly chosen augmentation family and one randomly chosen operation within that family.
This is a stochastic augmentation framework rather than a fixed recipe: no sample receives a prescribed sequence of operations, and the distribution over transformations, not any individual transformation, is what the model sees. Section 5.3 shows what that distribution buys, namely, coverage of the real-scan domain, and Section 5.1 measures what removing it costs.

3.6. Model Architecture

The recognizer follows the TrOCR design [1]: a vision transformer encoder reads the rendered line image, and an autoregressive decoder emits the normalized output sequence one token at a time. This suits Sorani well, since it sidesteps explicit character segmentation, which is precisely the step that connected Arabic-based scripts make so difficult. Figure 2 shows the recognition pipeline.
The overall system is best thought of as a TrOCR-style VisionEncoderDecoder pipeline. Several checkpoint families were tried during development, but every final benchmark number reported here comes from the refined small-stage checkpoint family, which has 61.6 million parameters.

3.7. Training and Inference Procedure

Training itself is plain paired supervised OCR learning on synthetic samples. Each batch element comes from rendering a text line to an image, running the image through the TrOCR processor, transliterating the source text into its Latin-coded form, and tokenizing that normalized label sequence. Maximum text length is 128 tokens.
The main training settings are the following:
  • Sequence-to-sequence training with a TrOCR processor and model;
  • Batch preprocessing with dynamic image generation;
  • Mixed-precision training;
  • A batch size of 8 for both training and evaluation;
  • 100 training epochs;
  • A checkpoint saved every 1000 steps.
Table 7 gives the full configuration for the final reported model.
Algorithm 1 summarizes the training loop. Each element of a batch is generated on the fly: a Kurdish text line is transliterated into its Latin label, rendered into a right-to-left image with a randomly sampled font and size, flipped to the left-to-right orientation, and stochastically augmented before being paired with its tokenized label.
Inference simply runs the path in reverse: encode the image, decode the normalized text sequence autoregressively, and convert the result back into Kurdish script.
Algorithm 1 Synthetic-data training of the Sorani TrOCR recognizer
  • Require: corpus C , font archive F , model M θ , image processor P, tokenizer T
  • Require: intact probability p = 0.1 , batch size B
  1:
( C train , C test ) S PLIT ( C , 0.8 / 0.2 )                 ▹disjoint text lines
  2:
while not converged do
  3:
      X , Y
  4:
     for  b = 1 to B do
  5:
          x S MPLE L INE ( C train )                ▹native Kurdish Sorani line
  6:
          y T RANSLITERATE ( x )               ▹ deterministic Kurdish → Latin label
  7:
          I R ENDER R T L x , R AND F ONT ( F ) , R AND S IZE ( 5 , 30 )
  8:
          I F LIP H ORIZONTAL ( I )                    ▹ right-to-left → left-to-right
  9:
         if  R AND ( ) > p  then
10:
            I A UGMENT ( I )                            ▹ stochastic distortion
11:
         end if
12:
          X X { P ( I ) } , Y Y { T ( y ) }
13:
     end for
14:
      L C ROSS E NTROPY M θ ( X ) , Y
15:
      θ O PTIMIZERSTEP ( θ , θ L )                           ▹ mixed precision
16:
end while
17:
return  M θ
At deployment, the full system operates on a complete document page: a text-line detection model localizes each line as a polygon, every detected line is cropped and perspective-rectified from its polygon coordinates, its background is removed and the crop is converted to grayscale, and the line is flipped left-to-right before being passed to the recognizer; the decoded Latin label is finally mapped back to native Sorani script. Algorithm 2 states this full-page procedure, and Figure 3 illustrates it on one detected line. Table 8 summarizes the components of the method and the purpose of each.
Algorithm 2 Full-page inference
  • Require: page image G, line-detection model D, recognizer M θ , image processor P
  1:
G T o R G B ( G )
  2:
Q D ETECT L INES ( D , G )                       ▹ polygon line regions
  3:
out [ ]
  4:
for each polygon Q Q  do
  5:
     I C ROP R ECTIFY ( G , Q )       ▹ polygon crop, perspective rectify, white background
  6:
     I F LIP H ORIZONTAL T o R G B ( I )                 ▹ grayscale applied inside P
  7:
     y ^ D ECODE M θ . G ENERATE ( P ( I ) )                        ▹ Latin label
  8:
     A PPEND out , I NVERSE T RANSLITERATE ( y ^ )                ▹ Latin → Kurdish
  9:
end for
10:
return  J OIN ( out , newline )

4. Experimental Setup

The primary evaluation is carried out on a curated benchmark of real scanned Kurdish Sorani documents rather than on rendered lines, so that the reported numbers reflect performance on genuine printed material. The benchmark consists of 19 real document pages (administrative and legal texts, including several statutes), each manually transcribed to provide ground truth, for a total of roughly 28,500 reference characters. Because the material is real scans, evaluation exercises the full-page inference pipeline from Section 3.7 (Algorithm 2): a Surya-based text-line detector localizes each line; the line is cropped and perspective-rectified from its polygon, flipped, and recognized; and the decoded Latin sequence is mapped back to Kurdish script. Predictions and references are then compared under the same script-aware normalization used for the label space: the two kaf forms, the yeh forms, and the Arabic and Extended-Arabic digit blocks are each unified, and editorial placeholders and ellipses are stripped from both sides, so that differences reflect recognition rather than encoding convention. This normalization is applied identically to every system, keeping the comparison encoding-fair as well as paired.
Table 9 profiles the benchmark, and Figure 4 shows how its text volume is distributed across pages. The set is deliberately mixed: 15 of the 19 pages are administrative and legal correspondence of varying scan quality, and the remaining 4 are cleanly printed statutes, which lets the results separate performance on messy everyday documents from performance on well-set legal text. Across the 19 pages, the ground truth comprises 467 text lines, 4131 words and 28,468 characters, so, although the page count is small, the character volume on which CER is computed is substantial. Pages average 24.6 lines and 1498 characters, with roughly 61 characters and 8.8 words per line. Scan resolution is modest, a median of 980 × 1241 pixels and 1.38 megapixels on average, which is representative of routine office scanning rather than archival-grade capture.
All systems were run on an NVIDIA RTX A5000 GPU with 24 GB of VRAM. Six systems are compared:
  • small7-refined-2500;
  • small7-1580k;
  • A released Kurdish TrOCR baseline (trocr-base-ckb);
  • Tesseract Arabic (tesseract-ara);
  • Tesseract Kurdish standard (tesseract-ckbLayer);
  • Tesseract Kurdish fast (tesseract-ckbLayer_fast).
The metrics are character error rate, word error rate, exact-match rate, latency, and throughput—a set that captures both recognition quality and operational cost [28,29]. CER and WER are defined through the Levenshtein edit distance between the predicted and reference sequences:
CER = S c + D c + I c N c , WER = S w + D w + I w N w ,
where S, D, and I count the substitutions, deletions, and insertions needed to turn the prediction into the reference; N is the number of reference characters (CER) or words (WER); and the subscripts c and w mark character- and word-level counts. Exact match is the share of samples whose prediction equals the reference once surrounding whitespace is trimmed; at the whole-page granularity of this benchmark, it is essentially zero for every system, so granular quality is characterized through the per-page CER distribution and a cumulative-accuracy curve instead. Every system is scored on the same 19 real pages, so the per-sample scores are paired across systems, and that pairing is what makes the statistical analysis in Section 5.5 possible. Unless stated otherwise, confidence intervals and p-values are computed with a fixed random seed (20240629) for reproducibility.

5. Results

5.1. Controlled Ablation of the Pipeline

The pipeline has five moving parts, and the benchmark comparison in Section 5.4 cannot say which of them matters. This section isolates them one at a time.

5.1.1. Protocol

Eight systems were trained: the full pipeline, and one variant per factor that differs from it in exactly one respect. Three factors are binary (the transliteration label space, the right-to-left to left-to-right orientation normalization, and stochastic augmentation), and two are swept over three points each, so that the trend rather than just the endpoint is visible: the font archive at 1006, 50 and 5 faces, and the corpus at 70,000, 7000 and 700 lines.
Everything else is held fixed. Every variant starts from the same public checkpoint (microsoft/trocr-small-stage1, the initialization behind the reported models), sees the same number of optimization steps at the same batch size with the same learning-rate schedule, uses the same random seed, and is scored on the same frozen evaluation images. The corpus subsets are nested (the 700-line set is contained in the 7000-line set, which is contained in the 70,000-line set), and all three are disjoint from the evaluation text, which is drawn from a held-out 20% partition fixed once and never re-drawn. Duplicate lines were removed before splitting, so no evaluation string appears in any training set.
Two evaluation sets were rendered once and stored, so that no variant is ever scored on images another variant did not see: a clean set of 1000 rendered lines with the full font archive and no augmentation, and a hard set of the same 1000 lines with one augmentation family applied per image. Only the horizontal flip is applied per variant at scoring time, since the no-flip system is trained on unmirrored input; the flip is content-preserving, so the two orientations are equally difficult. (Augmentation is baked into the stored hard-set images before that flip, whereas training augments after it. The augmentation operators are drawn independently of image content, so this changes nothing about difficulty, and it guarantees that every variant sees pixel-identical inputs.) Every system is scored in native Kurdish script, with predictions from the transliterating variants inverse-mapped first, under the script-aware normalization in Section 3.3, so no variant is advantaged by its own label convention.
One property of this design should be stated plainly. The budget is shared but reduced: training eight variants for the 1.58 million steps behind the reported model was not feasible, so the ablation ranks the components and sizes their effects relative to one another rather than reproducing the absolute error rates in Section 5.4. Each variant is also trained once, so the differences carry no run-to-run variance estimate, and the discussion below stays with the large, ordered effects rather than reading small gaps.

5.1.2. Findings

Table 10 reports every variant on both evaluation sets, and Figure 5 shows the same numbers as changes relative to the full system. Before reading them, note one calibration: scored on these same frozen images, the model actually reported in this paper reaches 0.0559 CER on the clean set and 0.0922 on the hard set, against 0.1131 and 0.1981 for the reduced-budget reference system here. The ablation therefore sits about a factor of two above the deployed system, which is the price of the shared 12,000-step budget, and its numbers should be read against each other rather than against Section 5.4.
The components separate cleanly, and not in the order the design intuition behind the pipeline would have predicted.
Corpus size dominates, but as a threshold rather than a gradient. Cutting the corpus from 70,000 lines to 7000 costs 0.0207 CER, which is real but modest; cutting it to 700 costs 0.6453 and the model essentially fails to learn the script at all (CER 0.7584). Between those two points, the system does not degrade gracefully: it collapses. The practical reading is that the pipeline needs a few thousand distinct lines to work at all, and that beyond that additional text buys steadily less.
The label space is the largest single design effect. Training the decoder on native-script labels costs 0.1481 CER, and the result is worth setting beside the ceiling computed in Section 3.3: the native-script variant reaches 0.2611, while the label space in which it predicts has a floor of 0.2084. The variant has learned nearly everything its label space permits, and almost all of the gap to the full system is the label space rather than the model. Two independent measurements, one requiring no training at all, agree on this.
Typographic diversity matters, with diminishing returns. Five faces cost 0.1193 CER, fifty cost 0.0296, and a thousand is the reference. Most of the benefit is already captured by a few dozen well-chosen faces, but the first handful is not nearly enough, which supports the observation in earlier Kurdish OCR work that mixed font styles are where recognition breaks down [8].
Augmentation buys robustness and costs a little accuracy. It is the only component whose removal improves the clean score, by 0.0094. On the augmented set, the same removal costs 0.3369, nearly tripling the error. This is the clearest confirmation of the domain analysis in Section 5.3: augmentation is not a regularizer here so much as a way of moving the training distribution onto the deployment distribution, and it is correctly paid for in in-distribution accuracy.
The orientation normalization matters least. Removing the right-to-left to left-to-right flip costs 0.0091 CER on the clean set and 0.0060 on the hard set, an order of magnitude below the label space. The expectation going in was that this would behave like the transliteration, since both exist to reconcile the model with a pre-trained prior; however, it does not. The honest interpretation is that a vision encoder can learn mirrored text given enough examples, so the flip mainly saves training effort rather than enabling anything; at a budget closer to the 1.58 million steps of the deployed model, its contribution may well shrink further. It is retained because it costs nothing, but the manuscript no longer presents it as one of the load-bearing components.
Two properties of this design bound what the table can support. The budget is shared but reduced, so the ablation ranks components and sizes their effects relative to one another rather than reproducing deployed accuracy. And each variant is trained once, so there is no run-to-run variance estimate; the discussion above therefore rests on the large, ordered effects and not on the gap between, say, lines_7k and fonts_50.

5.2. Synthetic (In-Distribution) Evaluation

Before turning to real documents, all six systems were scored on the held-out synthetic partition in Section 3.1: 200 rendered lines produced by the same pipeline used for training, so this measurement is in-distribution by construction. Table 11 reports the result. The refined model leads on every metric, with a CER of 0.0434, a WER of 0.1246 and 64.0% of lines reproduced exactly; its base checkpoint follows at 0.0607 / 0.2174 / 56.5%, and the external systems trail well behind.
Two qualifications attach to these figures. First, they measure the internal consistency of the synthetic pipeline rather than deployed accuracy: the test images come from the same renderer as the training images, so the setting inherently favors models trained on that renderer, and every claim about practical performance in this paper rests on the real-world test that follows. Second, they are not merely an easier version of that test. The synthetic CER is in fact higher than the real-scan CER reported below (0.0434 against 0.0305), because the renderer samples aggressively across 1006 fonts, font sizes down to five points, and stochastic distortions, whereas the real pages are cleanly printed office documents. The synthetic set therefore stresses the recognizer harder than the target domain.

5.3. How Far Is the Synthetic Data from Real Scans?

The whole approach rests on an assumption that has so far been asserted rather than measured: rendered lines resemble scanned ones closely enough for training on the former to transfer to the latter. This can be checked directly. Forty real pages (the four ground-truth administrative pages plus thirty-six drawn at random from a separate archive of scanned books) were passed through the deployed detector and the same polygon crop-and-rectify step used at inference, yielding 948 genuine line crops. Against these, 800 lines were rendered by the training pipeline with augmentation and 800 without. Both populations were then described by the same six low-level statistics, computed on the grayscale crop: ink coverage, stroke width from the distance transform of the ink mask, crop height, ink-to-paper contrast, background noise, and sharpness as the variance of the Laplacian.
The question worth asking of these distributions is not whether their means coincide, which they need not, but whether the training distribution contains the deployment domain. Table 12 therefore reports, for each statistic, the share of real crops that fall inside the 5th–95th percentile band of the synthetic population. Figure 6 shows the distributions themselves.
Three things come out of this. First, un-augmented renders are systematically too clean: less ink, thinner strokes, quieter backgrounds and, most starkly, roughly five times the sharpness of a real scan (median 254 against 54). A model trained only on them would be learning a crisper world than the one into which it is deployed. Second, augmentation does not merely add variety. Rather, it moves the synthetic distribution onto the real one: mean coverage of the real domain rises from 71% to 93%, and on sharpness, the statistic with the worst mismatch, from 18% to 99%. This is the mechanism behind the augmentation ablation in Section 5.1, and it is a more specific claim than the usual appeal to regularization.
Third, one gap survives augmentation untouched. Real line crops are taller than rendered ones (median 55 px against 40 px), and coverage on line height stays at 66% whether augmentation is applied or not, because every augmentation operator preserves scale. The renderer samples font sizes between 5 and 30 points, which under-covers the upper end of what routine office scanning produces. This is a concrete, actionable mismatch rather than a vague one: widening the sampled size range, or resampling crops to a common height before recognition, should close it; this is the first change a follow-up study ought to make.

5.4. Real-World Test on Scanned Documents

The remainder of this section evaluates the same six systems on the 19-page real-scan benchmark from Section 4, which is this paper’s measure of practical, deployed performance: genuine office scans, processed end-to-end through detection, cropping and recognition rather than fed as pre-segmented ideal lines. Table 13 reports the comparison.
The refined small-stage transformer is the most accurate system on the real documents by a wide margin, with a corpus-level CER of 0.0305 and WER of 0.1770. This is less than half the error of its own larger-corpus base checkpoint (small7-1580k, 0.0618/0.3355), and far below every external system. The two Kurdish Tesseract layers follow at a CER near 0.074; Arabic Tesseract is much weaker (0.2962); and, on genuine document images, the released Kurdish TrOCR model is in fact the weakest system of all (0.4252), behind even Arabic Tesseract, a reversal from synthetic single-line settings, underlining how sensitive that model is to real page layout. Corpus-level and per-page-mean averaging agree closely: the proposed model’s per-page mean CER is 0.0293 (Table 14), essentially its 0.0305 micro value.

5.5. Statistical Significance

The benchmark is modest in size (19 pages), so point estimates alone would be easy to over-read. Table 14 therefore reports the per-page mean CER and WER for every system, together with 95% confidence intervals from the non-parametric bootstrap resampling of the 19 per-page scores ( B = 10,000 resamples). The proposed model’s intervals do not overlap those of any other system, including its own base checkpoint small7-1580k, so those gaps are not sampling noise.
Because every system is scored on the identical 19 pages, each comparison against a baseline is paired. Table 15 reports, for both CER and WER, the mean per-page error reduction with a paired-bootstrap 95% confidence interval and a two-sided Wilcoxon signed-rank p-value. The proposed model beats every baseline: against all four external systems, it wins on all 19 pages, reaching the smallest p attainable at this sample size ( p = 3.8 × 10 6 ). Against its own base checkpoint small7-1580k, the margin is smaller and document-dependent: the refined model wins 15 of the 19 pages, which is still significant ( p < 10 3 ) but not overwhelming, reflecting that the refinement helps most on varied administrative scans while the base is already near-ceiling on the cleanest statutes. Because several baselines are compared, these p-values are not adjusted for multiple comparisons; all remain significant under standard corrections such as Holm–Bonferroni. This paper’s central comparative claim therefore rests on paired data, not on point estimates alone.

5.6. Error Distribution and Difficulty

Averages can hide skew, so Table 16 shows the per-page CER distribution instead. The proposed model has both the lowest median (0.026) and by far the tightest spread of any system: its inter-quartile range, 0.022–0.037, lies entirely below 0.05, and even its worst page sits at 0.051. Its base checkpoint has a comparable but higher median and roughly three times the dispersion, while the Tesseract layers and the released Kurdish TrOCR model sit at markedly higher medians. Figure 7 visualizes the distributions.
The cumulative accuracy curve gives a complementary view: the fraction of pages recognized at or below a given CER threshold (Table 17, Figure 8). The proposed model already has 89.5% of pages under a CER of 0.05 and every page under 0.10, well clear of every baseline at every threshold.

5.7. Error Analysis

Table 18 breaks the proposed model’s errors on the real pages down into substitutions, deletions, and insertions. Unlike the clean single-line case, the three operations are of comparable magnitude: substitutions are 41% of character errors, but deletions (27%) and insertions (32%) together form the majority. This is a signature of the full-page pipeline rather than of the recognizer. The detection and line-cropping stage occasionally splits or merges lines, and the ground truth carries typographic tatweel elongation and editorial punctuation that the recognizer does not reproduce; both register as deletions and insertions. At the word level, substitutions still dominate (79%), consistent with a recognizer that places words correctly but sometimes misreads a glyph inside them.
Because predictions and references are compared under the script-aware normalization in Section 3.3, which unifies the kaf forms, the yeh forms, and the digit blocks, the substitutions that remain (Table 19) are genuine visual confusions rather than encoding mismatches. The correctness of the inverse map matters here: an earlier version reconstructed the Latin symbol k as Arabic kaf (U + 0643) instead of Sorani keheh (U + 06A9), which alone would have manufactured a large block of spurious substitutions; every result reported here uses the corrected map. Two patterns dominate the residual. The single most frequent substitution, by a wide margin, is heh (U + 0647), written as the schwa ae (U + 06D5); the two are used interchangeably for the word-final schwa in Sorani orthography, so most of these 103 cases are a convention mismatch between ground truth and model rather than a misread. Next come the genuinely hard confusions: the Kurdish diacritic letters that differ from a plain base only by a small mark, chiefly lam-with-v (U + 06B5) losing its mark to become lam (57 cases) and reh-with-v (U + 0695) becoming reh (16 cases).
Grouping the character errors by cause is revealing. About 40% of them are not recognition failures at all but script-convention or typographic mismatches: the heh/schwa alternation above, the tatweel elongation character (the single most-deleted symbol, 80 times), which is a justification glyph carrying no phonetic content, and the occasional stray quotation mark or parenthesis. If these were folded into the normalization, as a stricter Sorani-specific scheme reasonably could, the corpus CER would fall from 0.0305 to roughly 0.018. The genuinely hard residue is then dominated by word spacing (splits and merges make up about a fifth of character errors) and by numerals, where the digit 1 is the single most-dropped real character (37 times). This decomposition also explains why word error rate (0.177) so far exceeds character error rate (0.031): 79% of the misrecognized words differ from their reference by at most two characters, and more than half by exactly one, so a single lost diacritic or a heh/schwa swap is enough to fail an otherwise correct word.

5.8. Accuracy and Efficiency Trade-Off

The transformer models are far slower than Tesseract, and far more accurate. Tesseract handles roughly 20 to 24 images per second; the refined transformer manages 0.61. Where throughput is the priority, that difference matters. For archival digitization and other high-value OCR, though, the accuracy gap is wide enough that the slower pipeline earns its cost. Table 20 reports the full per-image latency distribution rather than the mean alone. The proposed model’s latency profile is stable, with a median of 1636.6 ms and a 95th percentile of 2171.3 ms. The other small model is slower at every percentile, and the larger trocr-base-ckb, despite a lower mean, drags a heavy upper tail (p99 of 4956.8 ms), a symptom of variable decoding length.

5.9. Deployment Settings and the Speed of the Recognizer

The latency figures above describe one configuration, the one used for the benchmark, and they leave the impression that the accuracy of a transformer has to be paid for in throughput. Much of that cost turns out to be recoverable without retraining anything. Table 21 sweeps the four settings a deployment would actually change, on identical images, and reports what each costs in accuracy.
Three observations arise. Half precision alone nearly doubles throughput at unchanged accuracy. Greedy decoding is not merely cheaper than four-beam search but very slightly better here (0.0644 against 0.0651), which is unsurprising given the length penalty the beam search carries; the beams are buying nothing on short printed lines. And batching dominates everything else: at a batch of eight, the recognizer runs at 22.3 line images per second against 2.85 in the reported configuration, a 7.8-fold speed-up at equal or better accuracy. Beyond eight, the gain reverses, because padding to the longest line in the batch starts to waste more computation than batching saves.
This changes the practical conclusion in Section 5.4. Compared like for like on cropped lines, the gap to Tesseract is not architectural but a matter of precision and batching, and, for archival digitization, where pages are processed offline and in bulk, throughput rather than single-image latency is the metric that matters.

5.10. Robustness to Degraded Input

The benchmark pages are routine office scans, so they say little about how the system behaves as scan quality falls. Because the ground truth is fixed, this can be probed directly: each page is degraded before detection, by six operators at three severities, and rescored. Table 22 and Figure 9 give the result.
The system is markedly more robust to some defects than others, and the ordering is useful operationally. Skew up to five degrees, additive noise, contrast reduction and JPEG compression down to quality 5 leave the error essentially where it started, between 0.026 and 0.033. Downscaling to a quarter of the original resolution nearly triples it, and blur is the one genuine failure mode: at a three-pixel radius, the error reaches 0.1289, five times the undegraded figure.
This is consistent with the domain analysis in Section 5.3 rather than in tension with it. Sharpness was the statistic on which rendered lines diverged most from real ones, and augmentation moved the synthetic coverage of the real sharpness range from 18% to 99%; what the degradation curve adds is that the augmented range still does not extend to heavily blurred input. The concrete implication for anyone deploying the system is that scan resolution and focus are worth controlling, while compression settings and small skew are not.

5.11. How Far Does the Domain Reach? A Handwriting Probe

Everything above concerns printed documents, which is what the system was built for. The natural question is how sharply that boundary falls off, and it can be answered rather than asserted. The recognizer was run, unchanged and without any adaptation, on the Kurdish Handwritten Lines Dataset (KHLD) [24], which suits the purpose because it is line-level, Central Kurdish, and publicly available. The images drop into the existing pipeline without re-segmentation, so print versus handwriting is the only variable that changes.
Two details keep the measurement honest. KHLD stores ten handwriting variants for each sentence, so the evaluation samples two variants from each of 1000 sentence sets rather than many variants of a few sentences. And 3292 of the 47,944 line images carry sentences that also occur in the corpora on which this system was trained; these were removed first, so the probe runs on text the model has never seen in any form, not merely on images it has never seen. Table 23 gives the result.
The result is a clean boundary. Character error rises from 0.0257 on printed scans to 0.3117 on handwriting, a factor of twelve, and only 1.2% of lines come back exactly right. That is roughly where Arabic Tesseract sits on printed Sorani (0.2962, Table 13), which is a useful way to read it: the model has not stopped recognizing Sorani script; instead, it has degraded to about the level of an engine built for the wrong variety of it. Systems trained on Kurdish handwriting report character error near 0.035 to 0.059 on their own corpora, so the gap to a purpose-built handwriting recognizer is roughly an order of magnitude.
The spread across writers is as informative as the average. Per-sentence-set character error has a median of 0.2969 but ranges from 0.1098 at the 5th percentile to 0.5536 at the 95th: on the neatest hands, the system is merely poor; on the least constrained, it fails. This is the expected consequence of the design rather than a surprise. The supervision comes from fonts, and a font is a good model of printing and a bad model of a person’s handwriting; nothing in the pipeline has ever seen a stroke that was not drawn by a typeface.
What the probe does establish is that the transferable parts of the method are the script-specific ones. The Latin label space, the tokenizer argument behind it (Table 5), the orientation normalization and the label-recovery step are all properties of Sorani rather than of printing, and they apply unchangedly to handwriting. What does not transfer is the source of supervision. Adapting the approach would mean either handwriting-like synthesis or real handwritten line corpora, both of which now exist for Kurdish  [24,26]; that is a different study, and this measurement is offered as the boundary marker for the present one.

5.12. Where the Error Comes from: Detection or Recognition?

The headline benchmark scores whole pages through detection, cropping and recognition together, so it cannot on its own say how much of the error belongs to the recognizer. Because the ground truth is transcribed line by line, the two can be separated: the detected lines are aligned to the ground-truth lines by sequence alignment, with the similarity of two lines defined as one minus their character error rate, and only the matched pairs are scored for recognition. Unmatched ground-truth lines are detection misses and unmatched hypotheses are spurious or split detections. Table 24 reports the outcome.
Consider one point of bookkeeping before the numbers are read. The figures in Table 24, and those in Section 5.10 and Section 5.11, are page means computed under the stricter normalization adopted for the ablation, which additionally removes the tatweel, the zero-width marks and the Arabic harakat. They are therefore lower than the headline figures in Section 5.4 by a scoring convention rather than by any change to the system. Scored instead under the protocol in Section 4, this same re-run reproduces the published benchmark: corpus-level CER 0.0305 and WER 0.1777 against the 0.0305 and 0.1770 in Table 13, and a per-page mean of 0.0293, matching Table 14. The reported result is thus reproduced independently here, and the attribution below, being a ratio between two scores computed the same way, is unaffected by which convention is used.
The detector is close to perfect on this material: all 467 ground-truth lines are matched, none are missed, and 13 spurious regions appear across the 19 pages. Recognition-only error is 0.0255 against 0.0257 end-to-end, so line detection and cropping account for under one percent of the character error. On these documents, the reported page-level figure is very nearly the recognizer’s own error, and the concern that the two are conflated does not materially affect the comparison in Section 5.4.
This conclusion is specific to cleanly laid-out office scans, and it is worth saying for what it is not. Repeating the same measurement on synthetic pages, where the line boxes are known exactly rather than aligned, attributes 19% of the character error to detection; those pages are set with tighter leading than the benchmark documents, and the detector merges adjacent lines more often. Denser typesetting, multi-column layout or marginalia would move the balance back toward detection.

5.13. A Kurdish Language Model in Decoding

Section 5.7 observed that many residual word errors differ from their reference by a single character, which suggests lexical context should help. This can be tested cheaply. A character 6-g language model was estimated on training-corpus text only, in the same Latin label space in which the decoder predicts, and used to rescore the recognizer’s own 8-best list under score ( y ) = log P OCR ( y ) + α log P LM ( y ) + β | y | . The weights were tuned on one half of the evaluation set and applied unchanged to the other half.
Rescoring lowers the character error rate from 0.0756 to 0.0710, a 6.1% relative reduction, and the word error rate from 0.2728 to 0.2608. The n-best oracle, the best hypothesis the beam already contains, sits at 0.0605, so the rescoring captures roughly a third of the headroom that is present in the beam, and two thirds remains unclaimed. A 6-g over characters is a deliberately weak model, and the gap it leaves is the argument for a stronger one: a word-level or neural Kurdish language model, fused during decoding rather than applied afterwards, is the obvious next step. This is reported as a preliminary result and is not counted among the contributions of this paper.

5.14. What the Benchmark Implies

Two conclusions follow from the benchmark. In this setting, the design of the synthetic data pipeline weighs at least as heavily as raw model size, since the compact refined model beats a released Kurdish TrOCR model with roughly four times the parameters, and language-specific adaptation is not optional. Among the engines not adapted to Sorani, Arabic Tesseract trails badly, which is no surprise given how much Sorani differs from Arabic in grapheme inventory and orthographic convention; the Kurdish Tesseract layers do markedly better, though they remain well behind the refined TrOCR model. The released Kurdish TrOCR baseline fares worst of all on these real pages, a reversal from clean single-line settings, which shows that a recognizer tuned on different data and layout assumptions does not automatically transfer to this document domain.

6. Discussion

The ablation in Section 5.1 lets three claims (that the first version of this paper could only assert) be stated with numbers behind them, and it corrects one of them.
First, the design of the synthetic data does drive the result, and the largest single lever is the one that costs nothing to compute: the size of the text corpus. Reducing it from 70,000 lines to 700 raises the character error rate by 0.6453, and the failure is a collapse rather than a slope. For a low-resource language, this is an encouraging finding, because plain text is the one resource that is comparatively easy to obtain; a few thousand distinct lines are enough to get the pipeline working, and no transcribed image is needed at any point.
Second, the label space is the largest design effect, at 0.1481 CER, and its role is now understood rather than merely observed. The decoder’s pre-trained vocabulary has no piece for seven Sorani graphemes covering 14.7% of corpus characters (Table 5), which puts a floor of 0.2084 CER under any model trained on native-script labels. The ablated variant reaches 0.2611, close to that floor: it has learned nearly everything its label space allows, and the deficit is the representation rather than the model. The transliteration is therefore not the convenience the original manuscript described but the step that makes a pre-trained recognizer usable for this script at all.
Third, font diversity carries real weight, though with diminishing returns: five faces cost 0.1193 CER and fifty cost 0.0296. Earlier Kurdish OCR studies singled out mixed font styles as a difficulty [8], and the pipeline turns that difficulty into training signal, but most of the benefit is available from a few dozen faces rather than a thousand.
The correction concerns augmentation and orientation. Augmentation is not a general accuracy improvement: removing it lowers clean-set error by 0.0094 while raising augmented-set error by 0.3369. It buys robustness and pays for it in in-distribution accuracy, exactly as the domain analysis in Section 5.3 predicts. And the orientation normalization, which might have been expected to behave like the transliteration since both reconcile the model with a pre-trained prior, turns out to be the smallest effect in this study (0.0091 CER). A vision encoder evidently learns mirrored text readily enough on its own. It is kept because it is free, but it is no longer presented as a load-bearing component.
It is worth being careful about why the smaller model wins, because “‘smaller model beats larger model’" invites the wrong reading. The comparison against trocr-base-ckb is not a controlled test of scale: the two systems differ in training data, label space and rendering pipeline, as well as in parameter count, so nothing here shows that 61.6 M parameters are intrinsically better than 241.1 M for this task. The literature on knowledge transfer between large and small models makes the same point from the other direction. Reviews of distillation and teacher–student learning report that a compact student’s performance is governed by how effectively knowledge is transferred and how the representation and training strategy are designed, not by the compression ratio on its own [30]. Read this way, the results here are about the transfer path rather than about size. The recognizer starts from a publicly pre-trained TrOCR checkpoint, so almost all of its visual competence is inherited; what the pipeline supplies is the two things that decide whether that inheritance survives contact with Sorani. The label space decides whether the pre-trained decoder can express the target language at all (in the native script, its own tokenizer discards 14.7% of the characters—Table 5), and the synthetic distribution decides whether the pre-trained encoder’s features are exercised on inputs resembling the deployment domain. Section 5.3 shows augmentation is what actually achieves this. The ablation is consistent with the observations that the components that change the error most are the ones that govern transfer, not the ones that add data volume. Explicit distillation from a larger Kurdish or multilingual recognizer is a natural next step and would test the same idea more directly, but it is orthogonal to, and would build on, the label-space and data design established here.
The contribution is algorithmic rather than merely applicative. No new transformer backbone is claimed. What this paper offers is a reproducible training strategy that assembles corpus-driven synthetic rendering, deterministic script normalization, and a compact transformer recognizer into one coherent OCR pipeline for a low-resource script.
The approach also sketches a path that other low-resource, Arabic-script languages could follow. Supervision here comes from plain text plus font files, not from manually transcribed images, so in principle the pipeline can be retargeted to any language that has a text corpus and a font archive. That lowers the entry cost of building OCR for under-served scripts considerably.

7. Limitations and Threats to Validity

Several limitations bound what the results above support, and they are worth stating in the open.
  • Benchmark size and diversity.
The real-scan benchmark is 19 pages, roughly 28,500 reference characters, drawn from administrative and legal documents of one broad register. This is enough for the paired tests in Section 5.5, where the gaps over every external baseline survive, as does the gap over the base checkpoint, but it is a small and narrow sample, and no amount of statistical care fixes narrowness. This revision adds two kinds of evidence that do not require new ground truth: a controlled degradation study (Section 5.10) and a domain analysis over 948 line crops taken from a different document source (Section 5.3). Neither substitutes a larger transcribed benchmark. Building one, spanning more document types, worse scans and more than one register, remains the single most useful contribution for a follow-up study.
  • Ablation budget.
The ablation in Section 5.1 trains eight variants under a budget far smaller than the 1.58 million steps behind the reported model. It therefore ranks the components and sizes their effects relative to one another; its absolute error rates are not comparable with Section 5.4. Each variant is also trained once, so no run-to-run variance is available, and small differences between neighboring configurations should not be read as real.
  • Error attribution.
The headline benchmark scores whole pages through the full detection-and-recognition pipeline, so the reported error folds in the line-detection stage: some of the deletions and insertions in Table 18 come from lines being split or merged rather than from the recognizer. Section 5.12 separates the two by aligning detected lines to the transcribed ones, and finds that detection and cropping account for under 1% of the character error on this material, with all 467 ground-truth lines recovered. The error analysis adds that roughly 40% of the residual character error is script-convention or typographic (the heh/schwa alternation, tatweel, punctuation) rather than misrecognition. The recognizer’s intrinsic error is therefore lower than the headline figure suggests, but the headline figure is the one that matters for deployment, so it is the one reported.
  • The label space is not lossless.
The transliteration merges distinct Arabic-script codepoints, and reconstruction depends on sending each merged class back to its Kurdish-standard codepoint. Section 3.4 quantifies what this costs: 0.793% of corpus characters do not survive the round trip even after script-aware normalization, from the heh merge, the Latin comma, and embedded Latin-script text that the inverse map cannot distinguish from Kurdish. The last of these is inherent rather than a bug, since a reversible character-level map cannot serve two scripts with one alphabet, meaning the system should not be relied on for mixed Kurdish–Latin material without a script-detection step in front of it.
  • Printed text only.
This study covers printed Sorani, and Section 5.11 measures how sharply that boundary falls off rather than leaving it as a caution: applied to Kurdish handwriting without adaptation, character error rises from 0.0257 to 0.3117, about twelve-fold, and an order of magnitude above what systems trained on handwriting report. The conclusions drawn here therefore should not be carried to handwriting or to badly degraded historical scans. It is worth being specific about which parts would carry over. The script-specific machinery would because of the transliteration label space, the reason for it (the tokenizer gap in Table 5 is a property of Sorani, not of printing), the orientation normalization, and the label-recovery step. What would not carry over is the supervision itself. The pipeline’s central advantage, that it needs only a text corpus and font files but never a transcribed image, rests on fonts being a good model of the glyphs, and fonts are not a good model of handwriting. Adapting the approach would mean either handwriting-like synthesis or real handwritten line corpora, and both now exist for Kurdish [24,26]; the closest published system to this one takes exactly that route, assembling synthetic lines from real handwritten word images [27].
  • A residual domain gap.
One mismatch between the synthetic and real distributions survives augmentation untouched. Real line crops are taller than rendered ones, a median of 55 pixels against 40, and coverage on line height stays at 66% whether augmentation is applied or not, because every augmentation operator preserves scale (Section 5.3). The renderer samples font sizes between 5 and 30 points, which under-covers the upper end of routine office scanning.
  • Implementation.
The artifacts span several experimental branches, including large, base and small TrOCR variants. The benchmark results reported here should be read as the authoritative numbers, while the data-generation pipeline remains the methodological contribution.
None of this undercuts the main result, but it marks the boundary of what the present evidence supports and what a stronger follow-up study would have to supply [5,10].

8. Conclusions

This paper describes a Kurdish Sorani OCR system built on four pieces: synthetic supervision, transliteration-based normalization, stochastic line rendering, and TrOCR-style sequence generation. The system reads Kurdish text straight from corpus files, renders right-to-left line images with randomized typography, augments them on the fly, and trains a sequence-to-sequence model on the resulting pairs.
Evaluated on real scanned Kurdish documents, the final system posts large gains over the Tesseract-based baselines and over a released Kurdish TrOCR model, with a much smaller model footprint than the latter. The lesson, for Sorani at least, is that careful synthetic data design is not a workaround for low-resource conditions. It is a modeling strategy in its own right, and one that here transfers from synthetic training to genuine document images.
The controlled ablation in Section 5.1 says which parts of that design carry the result. Corpus size is the largest lever and behaves as a threshold: 700 lines fail outright while 7000 nearly suffice. The label space is the largest design effect, and the reason is now measured rather than argued, since the pre-trained decoder cannot represent seven common Sorani graphemes at all. Font diversity matters with diminishing returns. Augmentation buys robustness at a small cost in in-distribution accuracy. The orientation normalization, the component this study expected to matter most after the label space, turns out to have the smallest effect of all.
Several directions follow. The most useful is a larger and more varied transcribed benchmark: the 19 pages here support the comparisons drawn from them, but they are one register of one document type. On the modeling side, the preliminary rescoring experiment in Section 5.13 recovers about a third of the headroom sitting in the recognizer’s own n-best list, so a stronger Kurdish language model fused during decoding rather than applied afterwards is the obvious next step, as related Arabic-script recognition suggests [27]. The degradation curves point at the other clear weakness, blur and resolution loss, which the current augmentation range does not cover far enough. Beyond that, moving from isolated lines to paragraph-level parsing, and folding in handwritten and historical material, would probe the boundaries this study has deliberately left alone.

Funding

This research received no external funding.

Data Availability Statement

The synthetic-generation, training, and evaluation code, the benchmark configuration, and the derived evaluation outputs supporting the findings of this study are available from the corresponding author upon reasonable request. A full public release of the trained checkpoints and of the underlying document material is not possible: the recognizer and the data assembled around it are in production use in a commercial product, and part of the scanned material was provided under confidentiality terms. To keep the work reproducible in spite of that restriction, the pipeline is specified here in full rather than by reference: the corpus statistics and split protocol (Table 3), the complete transliteration table (Table 6), the training configuration (Table 7), the ablation protocol and its shared budget (Section 5.1), and the training and full-page inference procedures as pseudocode (Algorithms 1 and 2). Everything needed to rebuild the system from a Kurdish text corpus and a font archive is therefore in the paper, without access to the author’s artifacts.

Acknowledgments

The author gratefully acknowledges Gigant Technology Company for its technical support and for providing access to the computational resources utilized in this work.

Conflicts of Interest

The author declares no conflicts of interest.

References

  1. Li, M.; Lv, T.; Chen, J.; Cui, L.; Lu, Y.; Florencio, D.; Zhang, C.; Li, Z.; Wei, F. TrOCR: Transformer-Based Optical Character Recognition with Pre-Trained Models. Proc. AAAI Conf. Artif. Intell. 2023, 37, 13094–13102. [Google Scholar] [CrossRef] [Scilit]
  2. Sheng, F.; Chen, Z.; Xu, B. NRTR: A No-Recurrence Sequence-to-Sequence Model for Scene Text Recognition. In Proceedings of the 2019 International Conference on Document Analysis and Recognition (ICDAR); IEEE: New York, NY, USA, 2019; pp. 781–786. [Google Scholar] [CrossRef] [Scilit]
  3. Atienza, R. Vision Transformer for Fast and Efficient Scene Text Recognition. In Proceedings of the Document Analysis and Recognition—ICDAR 2021 Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2021; pp. 319–334. [Google Scholar] [CrossRef] [Scilit]
  4. Smith, R. An Overview of the Tesseract OCR Engine. In Proceedings of the Ninth International Conference on Document Analysis and Recognition (ICDAR 2007); IEEE: New York, NY, USA, 2007; pp. 629–633. [Google Scholar] [CrossRef] [Scilit]
  5. Ignat, O.; Maillard, J.; Chaudhary, V.; Guzmán, F. OCR Improves Machine Translation for Low-Resource Languages. In Proceedings of the Findings of the Association for Computational Linguistics: ACL 2022; Association for Computational Linguistics: Stroudsburg, PA, USA, 2022; pp. 1164–1174. [Google Scholar] [CrossRef] [Scilit]
  6. Esmaili, K.S. Challenges in Kurdish Text Processing. arXiv 2012, arXiv:1212.0074. [Google Scholar] [CrossRef] [Scilit]
  7. Faizullah, S.; Ayub, M.S.; Hussain, S.; Khan, M.A. A Survey of OCR in Arabic Language: Applications, Techniques, and Challenges. Appl. Sci. 2023, 13, 4584. [Google Scholar] [CrossRef] [Scilit]
  8. Yaseen, R.; Hassani, H. Kurdish Optical Character Recognition. UKH J. Sci. Eng. 2018, 2, 18–27. [Google Scholar] [CrossRef] [Scilit]
  9. Idrees, S.; Hassani, H. Exploiting Script Similarities to Compensate for the Large Amount of Data in Training Tesseract LSTM: Towards Kurdish OCR. Appl. Sci. 2021, 11, 9752. [Google Scholar] [CrossRef] [Scilit]
  10. Yaseen, B.; Hassani, H. Making Old Kurdish Publications Processable by Augmenting Available Optical Character Recognition Engines. arXiv 2024, arXiv:2404.06101. [Google Scholar] [CrossRef] [Scilit]
  11. Krishnan, P.; Jawahar, C.V. Generating Synthetic Data for Text Recognition. arXiv 2016, arXiv:1608.04224. [Google Scholar] [CrossRef] [Scilit]
  12. Etter, D.; Rawls, S.; Carpenter, C.; Sell, G. A Synthetic Recipe for OCR. In Proceedings of the 2019 International Conference on Document Analysis and Recognition (ICDAR); IEEE: New York, NY, USA, 2019; pp. 864–869. [Google Scholar] [CrossRef] [Scilit]
  13. Yim, M.; Kim, Y.; Cho, H.C.; Park, S. SynthTIGER: Synthetic Text Image Generator Towards Better Text Recognition Models. In Proceedings of the Document Analysis and Recognition—ICDAR 2021; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2021; pp. 109–124. [Google Scholar] [CrossRef] [Scilit]
  14. Lyu, P.; Zhang, C.; Liu, S.; Qiao, M.; Xu, Y.; Wu, L.; Yao, K.; Han, J.; Ding, E.; Wang, J. MaskOCR: Text Recognition with Masked Encoder-Decoder Pretraining. arXiv 2022, arXiv:2206.00311. [Google Scholar] [CrossRef] [Scilit]
  15. Ahmadi, S. A Rule-Based Kurdish Text Transliteration System. ACM Trans. Asian Low.-Resour. Lang. Inf. Process. 2019, 18, 1–8. [Google Scholar] [CrossRef] [Scilit]
  16. Ahmadi, S. KLPT–Kurdish Language Processing Toolkit. In Proceedings of the Second Workshop for NLP Open Source Software (NLP-OSS), Online, 19 November 2020; pp. 72–84. [Google Scholar] [CrossRef] [Scilit]
  17. Jaf, S. A Simple Approach to Unifying Ambiguously Encoded Kurdish Characters. In Proceedings of the Second International Conference on Computational Linguistics in Bulgaria (CLIB 2016), Sofia, Bulgaria, 9 September 2016; pp. 86–94. [Google Scholar]
  18. Mortadi, A.; Mohamed, A.; Talima, A.; Alkhattip, A.; Ibrahim, A.; Osman, A.; Hifny, Y. ALNASIKH: An Arabic OCR System Based on Transformers. In Proceedings of the 2023 International Mobile, Intelligent, and Ubiquitous Computing Conference (MIUCC), Cairo, Egypt, 27–28 September 2023; pp. 74–81. [Google Scholar] [CrossRef] [Scilit]
  19. Asadi-Zeydabadi, F.; Shabaninia, E.; Nezamabadi-Pour, H.; Shojaee, M. Farsi Optical Character Recognition Using a Transformer-Based Model. In Proceedings of the 2023 13th International Conference on Computer and Knowledge Engineering (ICCKE), Mashhad, Iran, 1–2 November 2023; pp. 293–299. [Google Scholar] [CrossRef] [Scilit]
  20. Rahman, A.; Ghosh, A.; Arora, C. UTRNet: High-Resolution Urdu Text Recognition in Printed Documents. In Proceedings of the Document Analysis and Recognition—ICDAR 2023, Cham, Switzerland, 21–26 August 2023; Volume 14191, pp. 305–324. [Google Scholar] [CrossRef] [Scilit]
  21. You, Z.; Li, Q.; Liu, C. An End-to-End Model for Printed Uyghur Text Recognition. In Proceedings of the 2022 International Conference on Automation, Robotics and Computer Engineering (ICARCE), Wuhan, China, 16–17 December 2022; pp. 1–5. [Google Scholar] [CrossRef] [Scilit]
  22. Majeed, H.D.; Nariman, G.S.; Azeez, R.S.; Abdulqadir, B.B. Kurdish Standard EMNIST-Like Character Dataset. Data Brief. 2024, 52, 110038. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  23. Salih, S.O.; Jacksi, K. KSTRV1: A Scene Text Recognition Dataset for Central Kurdish in (Arabic-Based) Script. Data Brief. 2025, 60, 111648. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  24. Ibrahim, M.S.; Ahmed, H.; Hussein, Y.; Rashid, T.A.; Fattah, P. KHLD: A Large-Scale Benchmark of the Kurdish Handwritten Lines Dataset for Low-Resource Central Kurdish (Sorani). Mendeley Data. 2026. Available online: https://data.mendeley.com/datasets/ffjb8kfb7m/2 (accessed on 4 August 2026).
  25. Hamad, K.A.; Shareef, S.M. Towards the Digitization of Kurdish Handwritten Script Using Deep Learning: A Comprehensive Analysis. Int. J. Doc. Anal. Recognit. 2025, 29, 703–730. [Google Scholar] [CrossRef] [Scilit]
  26. Salih, F.M.; Al-talabani, A.K. A Modified Vision Transformer for Kurdish Cursive RTL Handwritten Text Recognition. Res. Sq. 2026, preprint. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  27. Hamad, K.A.; Shareef, S.M. Kurdish Handwritten Text Recognition: A DenseNet121-Transformer Architecture with Constrained Synthetic Line Generation. ARO-Sci. J. Koya Univ. 2026, 14, 404–415. [Google Scholar] [CrossRef] [Scilit]
  28. Saber, S.; Ahmed, A.; Hadhoud, M. Robust Metrics for Evaluating Arabic OCR Systems. In Proceedings of the 2014 International Image Processing, Applications and Systems Conference (IPAS); IEEE: New York, NY, USA, 2014; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  29. Alghamdi, M.; Teahan, W. Experimental Evaluation of Arabic OCR Systems. PSU Res. Rev. 2017, 1, 229–241. [Google Scholar] [CrossRef] [Scilit]
  30. Li, X.; Li, L.; Li, M.; Yan, P.; Feng, T.; Luo, H.; Zhao, Y.; Yin, S. Knowledge Distillation and Teacher–Student Learning in Medical Imaging: Comprehensive Overview, Pivotal Role, and Future Directions. Med. Image Anal. 2026, 107, 103819. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Figure 1. The proposed framework against a standard TrOCR pipeline. (a) Standard TrOCR needs manually transcribed line images, and its target script is already covered by the pre-trained tokenizer. (b) The proposed system replaces annotated images with corpus-driven synthesis and inserts a reversible Latin label space, so that the encoder–decoder itself is unmodified. Numbered blocks are the five contributed components; the line images shown beneath blocks 2–4 are genuine intermediate outputs of the pipeline for the phrase Kurdish Sorani writing, rendered here at a larger point size than training uses so that the glyphs stay legible. The augmented sample shows one operator (blur with sensor noise); training draws a family and an operation at random for every line. The Kurdish phrase in the sample images means Kurdish Sorani writing, and nwwsyny kwrdy sorany is its transliteration into the Latin label space that the decoder predicts in.
Figure 1. The proposed framework against a standard TrOCR pipeline. (a) Standard TrOCR needs manually transcribed line images, and its target script is already covered by the pre-trained tokenizer. (b) The proposed system replaces annotated images with corpus-driven synthesis and inserts a reversible Latin label space, so that the encoder–decoder itself is unmodified. Numbered blocks are the five contributed components; the line images shown beneath blocks 2–4 are genuine intermediate outputs of the pipeline for the phrase Kurdish Sorani writing, rendered here at a larger point size than training uses so that the glyphs stay legible. The augmented sample shows one operator (blur with sensor noise); training draws a family and an operation at random for every line. The Kurdish phrase in the sample images means Kurdish Sorani writing, and nwwsyny kwrdy sorany is its transliteration into the Latin label space that the decoder predicts in.
Algorithms 19 00795 g001
Figure 2. Architecture of the proposed transformer-based Kurdish Sorani OCR system. A TrOCR-style recognition pipeline in which an input line image is split into patches and encoded by a vision transformer, then decoded autoregressively by a transformer decoder. The decoder emits the transliterated Latin-coded label sequence, which is converted back to Kurdish script at inference time. The input line image contains a Sorani sentence meaning Kurdistan is our homeland, and the output tokens are its transliteration into the Latin label space, which together spell kwrdstan wLaty Komane.
Figure 2. Architecture of the proposed transformer-based Kurdish Sorani OCR system. A TrOCR-style recognition pipeline in which an input line image is split into patches and encoded by a vision transformer, then decoded autoregressively by a transformer decoder. The decoder emits the transliterated Latin-coded label sequence, which is converted back to Kurdish script at inference time. The input line image contains a Sorani sentence meaning Kurdistan is our homeland, and the output tokens are its transliteration into the Latin label space, which together spell kwrdstan wLaty Komane.
Algorithms 19 00795 g002
Figure 3. End-to-end inference pipeline of the proposed system, illustrated on one detected line (meaning “Kurdish Sorani writing”). (1) A complete document page is processed by a text-line detection model, which localizes each line as a polygon; one line is highlighted and traced through the remaining stages. (2) The detected line is cropped and perspective-rectified from its polygon coordinates. (3) Its background is removed by compositing onto white and the crop is converted to grayscale. (4) The line is mirrored left-to-right into the orientation the TrOCR encoder expects. (5) TrOCR decodes the image autoregressively into the deterministic Latin label space. (6) The inverse transliteration restores the native Sorani script to produce the final output. The label nwwsyny kwrdy sorany in stage 5 is the Latin transliteration of the traced line, and the other lines on the page in stage 1 are sample Sorani sentences included only to illustrate line detection.
Figure 3. End-to-end inference pipeline of the proposed system, illustrated on one detected line (meaning “Kurdish Sorani writing”). (1) A complete document page is processed by a text-line detection model, which localizes each line as a polygon; one line is highlighted and traced through the remaining stages. (2) The detected line is cropped and perspective-rectified from its polygon coordinates. (3) Its background is removed by compositing onto white and the crop is converted to grayscale. (4) The line is mirrored left-to-right into the orientation the TrOCR encoder expects. (5) TrOCR decodes the image autoregressively into the deterministic Latin label space. (6) The inverse transliteration restores the native Sorani script to produce the final output. The label nwwsyny kwrdy sorany in stage 5 is the Latin transliteration of the traced line, and the other lines on the page in stage 1 are sample Sorani sentences included only to illustrate line detection.
Algorithms 19 00795 g003
Figure 4. Reference characters per page across the 19-page real-scan benchmark, colored by document type. Page length varies by more than a factor of three (816–2781 characters), so corpus-level (character-weighted) and per-page averages are both reported in Section 5.4.
Figure 4. Reference characters per page across the 19-page real-scan benchmark, colored by document type. Page length varies by more than a factor of three (816–2781 characters), so corpus-level (character-weighted) and per-page averages are both reported in Section 5.4.
Algorithms 19 00795 g004
Figure 5. Effect of removing or reducing each component, as the increase in character error rate relative to the full system. Bars to the right of zero mean the ablated system is worse. Augmentation is the only component whose removal helps on the clean set, and it is also the one whose removal hurts most on the augmented set.
Figure 5. Effect of removing or reducing each component, as the increase in character error rate relative to the full system. Bars to the right of zero mean the ablated system is worse. Augmentation is the only component whose removal helps on the clean set, and it is also the one whose removal hurts most on the augmented set.
Algorithms 19 00795 g005
Figure 6. Distribution of six low-level image statistics over 948 real line crops and 800 synthetic lines per condition. Un-augmented renders (green outline) are systematically cleaner than real scans; augmentation (shaded) widens the synthetic distribution until it brackets the real one. Sharpness is drawn on a logarithmic axis because of its heavy right tail.
Figure 6. Distribution of six low-level image statistics over 948 real line crops and 800 synthetic lines per condition. Un-augmented renders (green outline) are systematically cleaner than real scans; augmentation (shaded) widens the synthetic distribution until it brackets the real one. Sharpness is drawn on a logarithmic axis because of its heavy right tail.
Algorithms 19 00795 g006
Figure 7. Per-page CER distribution for each system on the 19-page real-scan benchmark. The proposed model (highlighted) combines the lowest median with the smallest dispersion.
Figure 7. Per-page CER distribution for each system on the 19-page real-scan benchmark. The proposed model (highlighted) combines the lowest median with the smallest dispersion.
Algorithms 19 00795 g007
Figure 8. Cumulative accuracy: fraction of the 19 pages with CER at or below the threshold on the horizontal axis. The proposed model dominates all baselines across the full range, clearing every page by a CER of 0.10.
Figure 8. Cumulative accuracy: fraction of the 19 pages with CER at or below the threshold on the horizontal axis. The proposed model dominates all baselines across the full range, clearing every page by a CER of 0.10.
Algorithms 19 00795 g008
Figure 9. End-to-end character error rate on the 19 real pages as each degradation is applied more strongly. Blur and resolution loss are what threaten the system; compression, noise, contrast loss and skew are absorbed almost entirely.
Figure 9. End-to-end character error rate on the 19 real pages as each degradation is applied more strongly. Blur and resolution loss are what threaten the system; compression, noise, contrast loss and skew are absorbed almost entirely.
Algorithms 19 00795 g009
Table 1. Summary of representative prior OCR approaches relevant to Kurdish Sorani.
Table 1. Summary of representative prior OCR approaches relevant to Kurdish Sorani.
StudyScript/LanguageApproach and Key Point
Smith [4]GeneralTesseract engine; standard open-source OCR baseline
Li et al. [1]GeneralTrOCR encoder–decoder; transformer OCR with pre-training
Yaseen & Hassani [8]Kurdish SoraniSegmentation analysis; mixed fonts degrade recognition
Idrees & Hassani [9]Kurdish SoraniTesseract LSTM with Arabic-to-Sorani script-similarity transfer
Yaseen & Hassani [10]Historical KurdishTesseract-based; stresses lack of public Kurdish OCR data
Mortadi et al. [18]ArabicTransformer OCR (ALNASIKH)
Asadi-Zeydabadi et al. [19]FarsiTransformer-based recognition
Rahman et al. [20]UrduUTRNet high-resolution printed-text recognition
You et al. [21]UyghurEnd-to-end printed-text recognition
Table 2. Recent Kurdish OCR datasets and recognition systems (2024–2026). These target handwritten or scene text; printed Sorani document-line OCR still lacks a public benchmark.
Table 2. Recent Kurdish OCR datasets and recognition systems (2024–2026). These target handwritten or scene text; printed Sorani document-line OCR still lacks a public benchmark.
Resource/SystemYearTypeScope and Key Detail
EMNIST-like set [22]2024CharactersStandard Kurdish isolated-character dataset
KSTRV1 [23]2025Scene text1420 images, 19,872 word crops; Sorani, Badini, Arabic, English
KHLD [24]2026Handwritten lines47,944 line images across 4802 sentence sets
DASNUS / ResNet–ViT [26]2026Handwritten lines11,475 lines, 867 writers; CER 3.47%, WER 17.37%
DenseNet121–Transformer [27]2026Handwritten linesSynthetic line generation; CER 0.0593 (0.0534 with 8-g LM)
IJDAR analysis [25]2025SurveyComprehensive analysis of Kurdish handwriting digitization
Table 3. Source corpus and synthetic line-rendering statistics.
Table 3. Source corpus and synthetic line-rendering statistics.
PropertyValue
Total non-empty corpus lines538,939
Mean line length (characters)52.1
Median line length (characters)51
Maximum line length (characters)754
Lines loaded per training run70,000
Train/test split (disjoint text lines)80%/20%
Validation setHeld out from training set
In-distribution check set200 rendered lines (from test split)
Primary evaluation set19 real scanned pages (Section 4)
Font files in archive (TTF/OTF)1006
Font size sampling range (points)5–30
Render modeRight-to-left, RGB
Background/text colorWhite/black
Unaugmented (intact) probability0.1
Table 4. Effect of the Arabic-script → Latin transliteration on the decoder label space, measured over the full 538,939-line corpus. The core inventory is the smallest symbol set covering 99.9% of character tokens.
Table 4. Effect of the Arabic-script → Latin transliteration on the decoder label space, measured over the full 538,939-line corpus. The core inventory is the smallest symbol set covering 99.9% of character tokens.
QuantityArabic ScriptAfter Translit.
Core inventory (99.9% coverage)157102
Rewritten graphemes (many→one)6552
Full distinct codepoints12571193
Core reduction: 35.0%    Rewritten-set collapse: 20.0%
Table 5. Sorani graphemes with no piece in the pre-trained XLM-RoBERTa SentencePiece vocabulary used by the TrOCR decoder. Each tokenizes to <unk>, so a decoder trained on native-script labels cannot emit it. Frequencies are over all 28,095,287 characters of the source corpus.
Table 5. Sorani graphemes with no piece in the pre-trained XLM-RoBERTa SentencePiece vocabulary used by the TrOCR decoder. Each tokenizes to <unk>, so a decoder trained on native-script labels cannot emit it. Frequencies are over all 28,095,287 characters of the source corpus.
GraphemeNameOccurrencesShare of Corpus
ەae, schwa (U + 06D5)2,456,7938.75%
ێyeh-with-v (U + 06CE)662,9082.36%
ۆoe (U + 06C6)445,4891.59%
ڵlam-with-v (U + 06B5)246,1980.88%
ڕreh-with-v (U + 0695)184,1460.66%
ژjeh (U + 0698)122,1600.44%
ڤveh (U + 06A4)24,4820.09%
Total (7 of 34 Sorani graphemes)4,142,17614.74%
Table 6. Deterministic Kurdish-script → Latin transliteration used as the decoder label space. Each Latin symbol is listed with its source grapheme(s), named by Unicode codepoint. Rows with multiple sources are the lossy many-to-one merges quantified in Table 4.
Table 6. Deterministic Kurdish-script → Latin transliteration used as the decoder label space. Each Latin symbol is listed with its source grapheme(s), named by Unicode codepoint. Rows with multiple sources are the lossy many-to-one merges quantified in Table 4.
LatinSource Grapheme(s)LatinSource Grapheme(s)
Consonants
aا alef (U + 0627) *gگ gaf (U + 06AF)
Uء hamza (U + 0621)lل lam (U + 0644)
uؤ waw-hamza (U + 0624)Lڵ lam-with-v (U + 06B5)
bب beh (U + 0628)mم meem (U + 0645)
pپ peh (U + 067E)nن noon (U + 0646)
tت teh (U + 062A)hه heh (U + 0647), ھ heh-doachashmee (U + 06BE)
Tط tah (U + 0637)wو waw (U + 0648)
Mة teh-marbuta (U + 0629)Aئ yeh-hamza (U + 0626)
jج jeem (U + 062C)qق qaf (U + 0642)
Cچ tcheh (U + 0686)kك kaf (U + 0643), ک keheh (U + 06A9)
Hح hah (U + 062D)Qع ain (U + 0639)
Kخ khah (U + 062E)Gغ ghain (U + 063A)
dد dal (U + 062F)fف feh (U + 0641)
Dذ thal (U + 0630)vڤ veh (U + 06A4)
rر reh (U + 0631)sس seen (U + 0633)
Rڕ reh-with-v (U + 0695)Sش sheen (U + 0634)
zز zain (U + 0632)Xص sad (U + 0635)
Zژ jeh (U + 0698)
Vowels/semivowels
eە ae, schwa (U + 06D5)Eێ yeh-with-v (U + 06CE)
oۆ oe (U + 06C6)yی farsi-yeh (U + 06CC), ي yeh (U + 064A),
ى alef-maksura (U + 0649)
Digits and punctuation
09٠١٢٣٤٥٦٧٨٩ (U + 0660–U + 0669),,، Arabic comma (U + 060C)
۰۱۲۳۴۵۶۷۸۹ (U + 06F0–U + 06F9);؛ Arabic semicolon (U + 061B)
%٪ Arabic percent (U + 066A)
* alef also absorbs the madda/hamza-carrier variants U + 0622, U + 0623, U + 0625.
Table 7. Training and implementation configuration for the final reported model.
Table 7. Training and implementation configuration for the final reported model.
SettingValue
ArchitectureTrOCR-style VisionEncoderDecoder
Final model parameters61.6 M
Maximum target length128 tokens
PrecisionMixed precision
Train/evaluation batch size8
Training epochs100
Checkpoint interval1000 steps
Evaluation samples200
GPUNVIDIA RTX A5000 (24 GB)
Table 8. Method summary.
Table 8. Method summary.
ComponentImplementation ChoicePurpose
Corpus sourceLarge Kurdish Sorani text corpusProvide large-scale text supervision for synthetic rendering
RenderingDynamic right-to-left line-image generationReplace manually collected OCR image-text pairs
TypographyRandom font selection from 1006 TTF and OTF filesIncrease shape and style diversity
Label spaceDeterministic Arabic-script to Latin transliterationSimplify decoder prediction space
AugmentationOne-stage stochastic augmentation with intact probability 0.1Improve robustness to distortions
RecognizerTrOCR-style encoder–decoder transformerEnd-to-end sequence recognition without explicit segmentation
Output recoveryLatin-coded prediction mapped back to Kurdish scriptPreserve native-script OCR output
Table 9. Profile of the real-scan evaluation benchmark (19 pages of ground-truth-transcribed Kurdish Sorani documents).
Table 9. Profile of the real-scan evaluation benchmark (19 pages of ground-truth-transcribed Kurdish Sorani documents).
QuantityTotalMeanMedianRange
Pages19
   administrative/legal scans15
   statutes4
Text lines46724.62314–37
Words4131217.4208116–423
Characters28,4681498.31468816–2781
Characters per line61.0
Words per line8.8
Image width (px)980709–1275
Image height (px)1241899–1755
Image size (megapixels)1.380.64–2.18
Table 10. Controlled ablation of the synthetic-data pipeline. Every variant differs from the full system in exactly one factor and is trained from the same public checkpoint under an identical budget (12,000 steps, batch 48), then scored on the same frozen evaluation sets. Δ is the change in error relative to the full system; positive means the ablated system is worse. All systems are scored in native Kurdish script after inverse transliteration, under the same script-aware normalization.
Table 10. Controlled ablation of the synthetic-data pipeline. Every variant differs from the full system in exactly one factor and is trained from the same public checkpoint under an identical budget (12,000 steps, batch 48), then scored on the same frozen evaluation sets. Δ is the change in error relative to the full system; positive means the ablated system is worse. All systems are scored in native Kurdish script after inverse transliteration, under the same script-aware normalization.
Clean Evaluation SetAugmented (Hard) Set
FactorConfigurationCERΔCERWERCERΔCERWER
ReferenceFull system (all components)0.11310.46200.19810.5792
Label space– transliteration (native-script labels)0.2611+0.14810.86830.3276+0.12940.8943
Orientation– orientation normalization (no RTL→LTR flip)0.1222+0.00910.49170.2042+0.00600.5773
Font diversityfont archive reduced to 500.1427+0.02960.54220.2237+0.02560.6309
font archive reduced to 50.2323+0.11930.72170.3402+0.14200.8528
Augmentation– stochastic augmentation0.1037−0.00940.43400.5350+0.33690.9498
Corpus sizecorpus reduced to 7000 lines0.1338+0.02070.53350.2206+0.02240.6284
corpus reduced to 700 lines0.7584+0.64531.08680.7832+0.58511.1172
Table 11. Synthetic in-distribution evaluation on 200 rendered lines drawn from the held-out test split. Exact match is meaningful at this granularity because each sample is a single line.
Table 11. Synthetic in-distribution evaluation on 200 rendered lines drawn from the held-out test split. Exact match is meaningful at this granularity because each sample is a single line.
ModelModel SizeCERWERExact Match
small7-refined-250061.6 M0.04340.124664.0%
small7-1580k61.6 M0.06070.217456.5%
trocr-base-ckb241.1 M0.52600.74372.0%
tesseract-ara1.4 MB tessdata0.73961.07990.0%
tesseract-ckbLayer5.5 MB tessdata0.60620.84606.5%
tesseract-ckbLayer_fast3.6 MB tessdata0.61310.84816.0%
Table 12. Synthetic–real domain comparison over 948 real line crops (40 scanned pages, detected and cropped by the deployed pipeline) and 800 rendered lines per synthetic condition. Coverage is the share of real crops falling inside the 5th–95th percentile band of the synthetic population; this measures whether the training distribution actually contains the deployment domain.
Table 12. Synthetic–real domain comparison over 948 real line crops (40 scanned pages, detected and cropped by the deployed pipeline) and 800 rendered lines per synthetic condition. Coverage is the share of real crops falling inside the 5th–95th percentile band of the synthetic population; this measures whether the training distribution actually contains the deployment domain.
Real ScansSynthetic MedianCoverage
StatisticMedian[P5, P95]No Aug.With Aug.No Aug. → Aug.
Ink coverage0.114[0.082, 0.225]0.0840.15182% → 97%
Stroke width (px)2.901[2.017, 4.467]2.1012.57186% → 98%
Line height (px)55[16, 64]404066% → 66%
Ink/paper contrast0.773[0.714, 1.000]0.8980.912100% → 100%
Background noise ( σ )12.9[3.5, 17.3]11.214.974% → 95%
Sharpness (Laplacian var.)53.9[33.7, 933.6]254.4230.018% → 99%
Mean coverage of the real domain71% → 93%
Table 13. Benchmark comparison on the real-scan evaluation set (19 pages). CER and WER are corpus-level (micro-averaged over characters and words). Latency and throughput are per line-image recognition cost on the RTX A5000 and are independent of the evaluation corpus.
Table 13. Benchmark comparison on the real-scan evaluation set (19 pages). CER and WER are corpus-level (micro-averaged over characters and words). Latency and throughput are per line-image recognition cost on the RTX A5000 and are independent of the evaluation corpus.
ModelModel SizeCERWERLatencyThroughput
(ms/Image)(Images/s)
small7-refined-250061.6 M0.03050.17701644.60.61
small7-1580k61.6 M0.06180.33551782.30.56
trocr-base-ckb241.1 M0.42520.85351415.60.71
tesseract-ara1.4 MB tessdata0.29620.871941.024.42
tesseract-ckbLayer5.5 MB tessdata0.07390.342351.019.60
tesseract-ckbLayer_fast3.6 MB tessdata0.07380.341145.322.07
Table 14. Per-page mean CER and WER with bootstrap 95% confidence intervals ( B = 10,000 , n = 19  pages).
Table 14. Per-page mean CER and WER with bootstrap 95% confidence intervals ( B = 10,000 , n = 19  pages).
SystemCER [95% CI]WER [95% CI]
small7-refined-25000.0293 [0.0248, 0.0343]0.1699 [0.1479, 0.1911]
small7-1580k0.0581 [0.0445, 0.0722]0.3209 [0.2474, 0.3943]
trocr-base-ckb0.3946 [0.3440, 0.4459]0.8293 [0.7877, 0.8685]
tesseract-ara0.2959 [0.2792, 0.3134]0.8752 [0.8506, 0.9007]
tesseract-ckbLayer0.0743 [0.0633, 0.0853]0.3491 [0.3053, 0.3915]
tesseract-ckbLayer_fast0.0741 [0.0634, 0.0848]0.3486 [0.3059, 0.3910]
Table 15. Paired comparison of the proposed model against each baseline on the same 19 pages. Δ is the mean error reduction (baseline—ours); 95% CI from paired bootstrap ( B = 10,000 ); p from the two-sided Wilcoxon signed-rank test ( n = 19 ; its floor at this sample size is 3.8 × 10 6 ).
Table 15. Paired comparison of the proposed model against each baseline on the same 19 pages. Δ is the mean error reduction (baseline—ours); 95% CI from paired bootstrap ( B = 10,000 ); p from the two-sided Wilcoxon signed-rank test ( n = 19 ; its floor at this sample size is 3.8 × 10 6 ).
MetricBaselineΔ (Base − Ours) [95% CI]Wilcoxon p
CERsmall7-1580k+0.0288 [+0.0163, +0.0415] 9.7 × 10 4
trocr-base-ckb+0.3653 [+0.3172, +0.4157] 3.8 × 10 6
tesseract-ara+0.2666 [+0.2487, +0.2854] 3.8 × 10 6
tesseract-ckbLayer+0.0450 [+0.0353, +0.0544] 3.8 × 10 6
tesseract-ckbLayer_fast+0.0448 [+0.0354, +0.0542] 3.8 × 10 6
WERsmall7-1580k+0.1510 [+0.0847, +0.2158] 7.9 × 10 4
trocr-base-ckb+0.6594 [+0.6123, +0.6989] 3.8 × 10 6
tesseract-ara+0.7053 [+0.6695, +0.7402] 3.8 × 10 6
tesseract-ckbLayer+0.1792 [+0.1396, +0.2206] 3.8 × 10 6
tesseract-ckbLayer_fast+0.1787 [+0.1401, +0.2188] 3.8 × 10 6
Table 16. Per-page CER distribution across the 19 evaluation pages.
Table 16. Per-page CER distribution across the 19 evaluation pages.
SystemMedianIQR (Q1–Q3)MinMaxStd
small7-refined-25000.02570.0218–0.03710.01470.05100.0108
small7-1580k0.05630.0380–0.07950.00980.11870.0317
trocr-base-ckb0.39770.3127–0.44850.22790.64220.1155
tesseract-ara0.28690.2634–0.32690.24880.37140.0389
tesseract-ckbLayer0.07290.0545–0.09690.02980.11210.0248
tesseract-ckbLayer_fast0.06990.0544–0.09730.03370.11210.0246
Table 17. Cumulative accuracy: percentage of the 19 evaluation pages whose CER is at or below each threshold.
Table 17. Cumulative accuracy: percentage of the 19 evaluation pages whose CER is at or below each threshold.
System≤0.05≤0.1≤0.15≤0.2≤0.3≤0.5
small7-refined-250089.5100.0100.0100.0100.0100.0
small7-1580k31.689.5100.0100.0100.0100.0
trocr-base-ckb0.00.00.00.026.384.2
tesseract-ara0.00.00.00.057.9100.0
tesseract-ckbLayer15.873.7100.0100.0100.0100.0
tesseract-ckbLayer_fast21.178.9100.0100.0100.0100.0
Table 18. Edit-operation decomposition of the proposed model’s errors on the real-scan benchmark.
Table 18. Edit-operation decomposition of the proposed model’s errors on the real-scan benchmark.
LevelSubstitutionsDeletionsInsertionsTotal
Char357 (41.1%)234 (26.9%)278 (32.0%)869
Word574 (78.5%)66 (9.0%)91 (12.4%)731
Table 19. Most frequent character substitutions by the proposed model on the real-scan benchmark (reference → hypothesis), under script-aware normalization (kaf, yeh and digit forms unified). Dagger (†) marks dot/diacritic-differentiated Sorani minimal pairs.
Table 19. Most frequent character substitutions by the proposed model on the real-scan benchmark (reference → hypothesis), under script-aware normalization (kaf, yeh and digit forms unified). Dagger (†) marks dot/diacritic-differentiated Sorani minimal pairs.
#Ref → HypCount
1ه heh (U + 0647) → ە ae (U + 06D5)103
2ڵ lam-with-v (U + 06B5) → ل lam (U + 0644) †57
3ڕ reh-with-v (U + 0695) → ر reh (U + 0631) †16
4ە ae (U + 06D5) → ␣9
5و waw (U + 0648) → ر reh (U + 0631)8
6. → ، comma (U + 060C)4
7ر reh (U + 0631) → ڕ reh-with-v (U + 0695) †4
8ن noon (U + 0646) → ت teh (U + 062A) †4
9ل lam (U + 0644) → ڵ lam-with-v (U + 06B5) †4
10ک keheh (U + 06A9) → گ gaf (U + 06AF) †4
11ی farsi-yeh (U + 06CC) → پ peh (U + 067E)4
12ن noon (U + 0646) → ئ yeh-hamza (U + 0626) †3
Table 20. Inference latency per image (ms) and throughput.
Table 20. Inference latency per image (ms) and throughput.
SystemMeanp50p95p99StdThroughput
small7-refined-25001644.61636.62171.32415.6338.60.61
small7-1580k1782.31760.82420.92775.1379.80.56
trocr-base-ckb1415.61255.22296.14956.8703.00.71
tesseract-ara41.041.174.693.919.524.42
tesseract-ckbLayer51.050.282.3104.719.519.60
tesseract-ckbLayer_fast45.344.483.991.518.822.07
Table 21. Speed and accuracy of the proposed recognizer under deployment settings, measured on the same 200 line images from the frozen evaluation set on one NVIDIA RTX A5000. Each row adds a single change to the row above, and speed-up is relative to the first row, which uses the decoding configuration from Section 5.4 (four beams, one image at a time, full precision). Absolute latencies are lower than those in Table 20 because that table times the full-page pipeline on real scans, whereas this one isolates recognition on pre-cropped lines; the comparison across rows is what matters here.
Table 21. Speed and accuracy of the proposed recognizer under deployment settings, measured on the same 200 line images from the frozen evaluation set on one NVIDIA RTX A5000. Each row adds a single change to the row above, and speed-up is relative to the first row, which uses the decoding configuration from Section 5.4 (four beams, one image at a time, full precision). Absolute latencies are lower than those in Table 20 because that table times the full-page pipeline on real scans, whereas this one isolates recognition on pre-cropped lines; the comparison across rows is what matters here.
ConfigurationBeamsBatchLatencyp95ThroughputSpeed-UpCER
(ms/img)(ms)(img/s)
reported setting41350.8604.62.851.0×0.0651
+ SDPA encoder41343.7592.42.911.0×0.0651
+ fp1641187.5299.05.331.9×0.0648
+ greedy decoding11151.0246.76.622.3×0.0644
+ batch 41458.184.717.226.0×0.0644
+ batch 81844.862.422.327.8×0.0644
+ batch 1611670.1105.014.275.0×0.0644
+ batch 3213281.795.812.244.3×0.0644
beam 4, batch 16416204.4279.04.891.7×0.0651
Table 22. End-to-end character error rate on the 19 real pages under controlled degradation of the page image, applied before detection. Severity 1 is the strongest setting of each operator; the undegraded benchmark scores 0.0257. Ground truth is unchanged throughout, so the rows isolate image quality.
Table 22. End-to-end character error rate on the 19 real pages under controlled degradation of the page image, applied before detection. Severity 1 is the strongest setting of each operator; the undegraded benchmark scores 0.0257. Ground truth is unchanged throughout, so the rows isolate image quality.
DegradationRange at Severity 10.30.61
Gaussian blurradius 0.5 3.0 px0.03510.05160.1289
Downscalingscale 1.0 0.25 0.02560.03080.0716
Contrast reduction × 1.0 × 0.25 0.02640.03090.0332
JPEG compressionquality 90 5 0.02570.02660.0316
Additive noise σ 0 40 levels0.02790.02940.0305
Skew (rotation) 0 5 ° 0.02530.02380.0264
Table 23. Cross-domain probe. The proposed recognizer is applied to Kurdish handwriting with no adaptation of any kind, on 2000 line images drawn from 1000 sentence sets of KHLD [24]. The last two rows are figures reported by their own authors on their own handwriting corpora and are given only to indicate the scale a model trained for the task reaches; they are not measured here and are not directly comparable, since no shared Kurdish handwriting benchmark exists.
Table 23. Cross-domain probe. The proposed recognizer is applied to Kurdish handwriting with no adaptation of any kind, on 2000 line images drawn from 1000 sentence sets of KHLD [24]. The last two rows are figures reported by their own authors on their own handwriting corpora and are given only to indicate the scale a model trained for the task reaches; they are not measured here and are not directly comparable, since no shared Kurdish handwriting benchmark exists.
SystemTrained onEvaluated onCERWER
Proposedprinted (synthetic)printed real scans, 19 pages0.02570.1513
Proposedprinted (synthetic)KHLD handwriting, zero-shot0.3117 0.8844
In-domain handwriting systems, as reported by their authors
ResNet–ViT [26]Kurdish handwritingDASNUS0.03470.1737
DenseNet121–Transf. [27]Kurdish handwritingown corpus0.0593n/a
Table 24. Detection error separated from recognition error on the 19-page real-scan benchmark. Detected lines are aligned to the ground-truth lines and only matched pairs are scored for the recognition-only row, so the difference between the rows is what the line-detection and cropping stage costs. Values are page means.
Table 24. Detection error separated from recognition error on the 19-page real-scan benchmark. Detected lines are aligned to the ground-truth lines and only matched pairs are scored for the recognition-only row, so the difference between the rows is what the line-detection and cropping stage costs. Values are page means.
MeasurementCERWER
End-to-end (detection + recognition)0.02570.1513
Recognition only (matched lines)0.02550.1474
Detection share of the character error: 0.7%
Ground-truth lines 467; matched 467; missed 0; spurious 13
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Ahmad, H.A. Synthetic Data-Driven Transformer OCR for Kurdish Sorani via Dynamic Line Generation and Script-Aware Normalization. Algorithms 2026, 19, 795. https://doi.org/10.3390/a19090795

AMA Style

Ahmad HA. Synthetic Data-Driven Transformer OCR for Kurdish Sorani via Dynamic Line Generation and Script-Aware Normalization. Algorithms. 2026; 19(9):795. https://doi.org/10.3390/a19090795

Chicago/Turabian Style

Ahmad, Hawraz A. 2026. "Synthetic Data-Driven Transformer OCR for Kurdish Sorani via Dynamic Line Generation and Script-Aware Normalization" Algorithms 19, no. 9: 795. https://doi.org/10.3390/a19090795

APA Style

Ahmad, H. A. (2026). Synthetic Data-Driven Transformer OCR for Kurdish Sorani via Dynamic Line Generation and Script-Aware Normalization. Algorithms, 19(9), 795. https://doi.org/10.3390/a19090795

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop