This article was automatically translated from the original Turkish version.

In the first article, Matbudan Dijitale I: Osmanlıca OCR Çalışmaları, Deneyler ve Bulgular, research in Ottoman Turkish OCR and the initial performance of pre-trained OCR models were examined. This article moves from that initial point to training experiments. First, the data used in model training is addressed: how the existing real data was expanded through data augmentation and synthetic page generation, which methods proved effective and which were excluded because they degraded training. Subsequently, the model families adapted using this data and their benchmark results are presented.
In this study, line-level OCR and page-level HTML OCR experiments are treated separately. Since the two tasks use different inputs and evaluation criteria, combining their results into a single ranking would be incorrect.
Just as much as the models themselves, the data provided to them determines the outcome. The available real Ottoman Turkish and Arabic script images were both limited in quantity and insufficient in variety with respect to font type, paper condition, and ink quality. To close this gap, new variants were generated from existing images through data augmentation, and page types not present in the original corpus were synthetically generated. First, the augmentation work on line images is described, followed by synthetic page generation at the page level.
For line-level augmentation, the augmentation set used by Meoded in their work on historical manuscripts with TrOCR served as the foundation.【1】 Nine methods were applied: random rotation, Gaussian blur, dilation, erosion, underlining, elastic distortion, random affine transformation, random perspective, and re-resizing. These transformations were applied directly via torchvision classes.
Two deliberate deviations from the methodology in the original paper were made:
Augmentation was applied only to training images. The original image and all its augmented copies were always kept in the same split (training or validation), with splits performed at the group level (document, dataset, image) rather than at the individual row level. Otherwise, a slightly distorted copy of the same row could leak into the validation set and produce artificially high scores.
It was not assumed that all nine methods were beneficial; each was tested individually. Training was conducted on the same TrOCR + mT5 pipeline,【2】 using the same hyperparameters and evaluated on the same benchmark (Arabic, Ottoman Turkish, Persian, and Urdu lines). In these experiments, methods were compared without relying on a single metric: in addition to character and word errors, the average performance across examples and structural differences in the HTML output were also assessed. Before presenting the result tables, a brief explanation of what these metrics signify is provided.
Benchmark Metrics: The metrics reported in this paper are calculated as follows; S, D, and I denote substitutions, deletions, and insertions respectively; N denotes the number of characters or words in the reference.
CER and WER values can exceed 1 due to insertion errors; these values should not be interpreted as percentages.
Tur 1: Augmented Data Only. For each method, a training set was prepared consisting solely of images augmented using that method. The control group (base) was a model trained on unmodified raw data.
Table 1: Test Set Results of Models Trained Using Augmented Data Only
The results were as expected: models trained solely on augmented data failed to surpass the performance of raw data. It was concluded that augmentation should be added alongside, not in place of, raw data. The perspective transformation model did not converge (training loss remained high until the end). Therefore, it is clear that the perspective transformation itself is not inherently flawed, but rather its associated training was unsuccessful.
Round 2: raw data + augmented data. Due to the above reason, in the second round, the augmented images for each method were added alongside the raw data, and retraining was performed for each method.
Table 2: Test Set Results for Training Using Raw Data and Augmented Data Together
In four of the six selected methods, the general CER fell below the baseline control value of 0.1371. Although Underline slightly lagged behind the control in general CER, it achieved better scores than the control in WER, chrF++, and Ottoman CER; Dilation, however, did not surpass the control in any of these four metrics. When evaluated collectively, Rotation, Perspective, Re-resize, Erosion, and Underline emerged as the top performers. Perspective, which had previously failed during training in Tur 1, now ranked among the top two; it was hypothesized that the earlier failure was due more to training conditions than to the method itself.
In three methods, however, the table was completely disrupted: Affine, Elastic, and Gaussian blur. During training, validation CER for Affine and Elastic initially decreased to a certain point (with best values of approximately 0.14 and 0.17 respectively), then diverged, causing CER to rise above 1. In the case of Gaussian blur, validation CER never dropped below 0.8. No convergence issues were observed in the other six methods trained under identical conditions. Since the scores in the comparison table correspond to the final checkpoint, this divergence directly impacted the final results. The exact reason for the instability of these three methods has not been definitively determined; it may stem from either training configuration issues or the nature of the transformations themselves.
As a result, blur, affine, and elastic were removed from the final augmentation set, and training continued with six methods: rotation, dilation, erosion, underline, perspective, and re-resize. The impact of this elimination in TrOCR training with full data is not clear: training with the raw + Ottoman augmented dataset including all nine methods yielded a general CER of 0.1200, while two trainings using the six-method datasets produced values of 0.1532 and 0.1596. Since the six-method datasets contained fewer images, this difference cannot be attributed solely to the choice of methods. It should be noted that the elimination increased stability—three methods exhibited divergence—but no clear accuracy gain can be claimed.
Line-level augmented data was used for Ottoman; the raw data originated from all languages. At the page level, real pages for all languages were augmented using the nine methods; for hybrid pages, the above six methods were applied. Since geometric transformations at the page level invalidated box coordinates, the XML of augmented pages was not copied; the HTML target was left unchanged. The underline method could be applied within this framework because it used the original row positions from the page’s XML.
The number of real pages available for page-level OCR was limited. Therefore, two distinct synthetic generation pipelines were established.
1. Synthetic pages from scratch: In the first pipeline, Ottoman pages were entirely drawn from scratch. For each page, three outputs were generated together: the page image, the HTML target, and block/line-level box labels. The following considerations were observed:
After generating a large synthetic dataset, a consistency check confirmed that visual, HTML, and JSON matches were complete and that font and background usage was evenly distributed. A minor issue was also identified in the same check: approximately 2 percent of pages had box coordinates extending beyond the page boundaries. This finding was reported, and affected records were excluded from training based on box information.

Generated Example Ottoman Turkish Synthetic Data (Created with Artificial Intelligence).
2. Hybrid Transplantation: A limitation of fully synthetic pages is the absence of real paper structure, stain patterns, and layout. Therefore, in the second pipeline, the approach was reversed. A real page is taken and some of its lines are replaced with new text.
Only raw training pages were used in this pipeline: augmented copies, validation, and benchmark sources were not included in the transplantation. For Arabic pages, text was drawn exclusively from a corpus generated from Arabic training labels, preventing contamination of the benchmark text with synthetic data. Hybrid pages were then augmented once more using the six selected methods above. The final training set was composed of these hybrid pages, raw pages, and augmented pages; the validation set remained unchanged.
The table below presents the Surya OCR 2【6】 training results at the page level, grouped by data composition. The CER columns are presented in "mean / micro" format, while HTML-CER is calculated over normalized HTML.
Table 3: Page-Level Surya OCR 2 Training Results by Data Composition
This table can be interpreted from two perspectives:
This comparison is not controlled: training duration, data volume, and certain hyperparameters vary across rows. When a second batch of hybrid data was added (via continued training), scores did not improve (text CER 0.3233; Ottoman CER 0.4181). Therefore, the impact of synthetic data is presented not as a definitive gain but as a consistent directional observation with non-identical conditions.
In this section, models trained with the data prepared above are compared. The term “Ottoman Turkish augmented data” in the tables refers to the augmentation outputs applied to line-level Ottoman Turkish images; the terms “all languages augmentation” and “synthetic” at the page level refer to the page-level augmentation and synthetic generation pipelines described above.
In the line-level experiments, the TrOCR, OvisOCR2,【7】 CHURRO【8】 and Surya OCR 2 models were compared. In the TrOCR pipeline, the microsoft/trocr-base-handwritten【9】 visual encoder was combined with the google/mt5-base【10】 text decoder. In the tokenizer experiments evaluated in the first section, the mT5 choice was found to be more suitable due to its lossless handling of Ottoman Turkish characters and the generation of shorter sequences.

Sample Input and Output of the Model at the Line Level (Generated by Artificial Intelligence.)
For OvisOCR2, CHURRO, and Surya OCR 2, full fine-tuning was applied via MS-Swift; the language model, visual encoder, and alignment layers were not frozen; checkpoints were evaluated based on validation CER.
First, the pre-training benchmark results of the models are presented, followed by the results after fine-tuning. Below are the values recorded for the initial models.
Table 4: Benchmark Results of Pre-trained Line Models
Different training data compositions were used across models and experimental variants. The table below presents the line-level benchmark scores.
Table 5: Benchmark Results of Line-Level Training Conditions
The lowest overall CER and WER were achieved by TrOCR, while the highest chrF++ score was obtained by Surya OCR 2. Among the two conditions for OvisOCR 2, the experiment using augmented data yielded better scores across all four metrics. These values reflect a benchmark comparison of the respective conditions; the difference cannot be attributed entirely to the augmentation method without strictly matching data volume and training conditions.
In full-page experiments, Surya OCR 2 was required to generate the visible text on each page in HTML format. Training and benchmark requirements were designed based solely on returning the HTML transcription of the text visible in the image. The benchmark evaluated 500 pages, with 125 pages each from Arabic, Ottoman Turkish, Persian, and Urdu.
The binary CER values on the page benchmark are presented according to the definitions mentioned earlier as average CER / micro CER. Text metrics were calculated based on the visible text after removing HTML tags, while HTML-CER was computed over the normalized HTML sequence. Therefore, the page-level results cannot be directly compared with the single CER value from the line-level benchmark.
Table 6: Page-Level HTML OCR Benchmark Results for the Surya OCR 2 Model

Sample Input and Output of the Page-Level Model (Generated by Artificial Intelligence.)
When examining the training curves, signs of overfitting to the training data were observed in later stages. Nevertheless, longer training yielded improved results for text CER, WER, and HTML-CER, while chrF++ decreased slightly. In this experiment, signs of overfitting were not considered alone as indicators of failure; improvement in benchmark results served as the primary criterion. This observation should not be generalized to suggest that overfitting is beneficial in all tasks.
On the data side, it was found valuable to test augmentation methods individually: three of the nine methods were excluded from the final set due to observed divergence during training, while the remaining six were used alongside the raw data. At the page level, the best Ottoman Turkish scores were achieved using hybrid synthetic data generated by writing text on real paper; however, this comparison is not controlled. On the model side, different model families were observed to exhibit distinct metric profiles on similar training data. TrOCR achieved the lowest overall CER and WER, while Surya OCR 2 achieved the highest chrF++ score. Page-level experiments revealed that checkpoint selection and the separate evaluation of HTML output demonstrate that OCR performance cannot be assessed using a single metric.
Datalab. "Announcing Surya OCR 2: Small, Accurate, Multilingual." Datalab. Accessed October 20, 2026.https://www.datalab.to/blog/surya-2
Google. "mt5-base." Hugging Face. Accessed October 20, 2026.https://huggingface.co/google/mt5-base
Levenshtein, V. I. “Binary Codes Capable of Correcting Deletions, Insertions, and Reversals.” *Soviet Physics Doklady* 10, no. 8 (1966): 707–710. Accessed October 22, 2026.https://nymity.ch/sybilhunting/pdf/Levenshtein1966a.pdf
Li, M., T. Lv, J. Chen, et al. “TrOCR: Transformer-Based Optical Character Recognition with Pre-trained Models.” *Proceedings of the AAAI Conference on Artificial Intelligence* 37, no. 11 (2023): 13094–13102. Accessed October 24, 2026.https://ojs.aaai.org/index.php/AAAI/article/view/26538
Lu, S., Y. Li, Y. Xia, et al. “OvisOCR2 Technical Report.” *arXiv* 2026. Accessed October 23, 2026.https://arxiv.org/abs/2607.13639
Meoded, E. “Handwritten Text Recognition of Historical Manuscripts Using Transformer-Based Models.” *arXiv* 2025. Accessed October 21, 2026.https://arxiv.org/abs/2508.11499
Microsoft. “TrOCR (base-sized model, fine-tuned on IAM).” Hugging Face. Accessed October 25, 2026.https://huggingface.co/microsoft/trocr-base-handwritten
Popović, M. “chrF++: Words Helping Character n-grams.” *Proceedings of the Conference on Machine Translation (WMT)* 2. (2017): 612–618. Accessed October 25, 2026.https://aclanthology.org/W17-4770/
Semnani, S., H. Zhang, X. He et al. “CHURRO: Making History Readable with an Open-Weight Large Vision-Language Model for High-Accuracy, Low-Cost Historical Text Recognition.” *Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing*. (2025): 34777–34824. Accessed October 21, 2026.https://aclanthology.org/2025.emnlp-main.1763/
Xue, L., N. Constant, A. Roberts, et al. “mT5: A Massively Multilingual Pre-trained Text-to-Text Transformer.” *Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies*. (2021): 483–498. Accessed October 19, 2026.https://aclanthology.org/2021.naacl-main.41/
[1]
E. Meoded, “Handwritten Text Recognition of Historical Manuscripts Using Transformer-Based Models,” *arXiv* 2025, 5. Accessed October 21, 2026.
[2]
L. Xue, N. Constant, A. Roberts et al., “mT5: A Massively Multilingual Pre-trained Text-to-Text Transformer,” *Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies*, (2021), 483. Accessed October 19, 2026.
[3]
V. I. Levenshtein, “Binary Codes Capable of Correcting Deletions, Insertions, and Reversals,” *Soviet Physics Doklady* 10, no. 8 (1966): 707. Accessed October 22, 2026.
[4]
V. I. Levenshtein, 707.
[5]
M. Popović, “chrF++: Words Helping Character n-grams,” *Proceedings of the Conference on Machine Translation (WMT)* 2, (2017), 612–613. Accessed October 25, 2026.
[6]
Datalab, “Announcing Surya OCR 2: Small, Accurate, Multilingual,” Datalab, Accessed October 20, 2026.
[7]
S. Lu, Y. Li, Y. Xia, et al., “OvisOCR2 Technical Report,” *arXiv* 2026, 1, Accessed October 23, 2026.
[8]
S. Semnani, H. Zhang, X. He, et al. “CHURRO: Making History Readable with an Open-Weight Large Vision-Language Model for High-Accuracy, Low-Cost Historical Text Recognition,” *Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing*, (2025), 34777. Accessed October 21, 2026.
[9]
Microsoft, “TrOCR (base-sized model, fine-tuned on IAM),” Hugging Face, Accessed October 25, 2026.
[10]
Google. “mt5-base,” Hugging Face, Accessed October 20, 2026.
Data Preparation: Augmentation and Synthetic Examples
Data Augmentation on Line Images
Methods
Preventing Leakage
Which Methods Were Effective?
Synthetic Page Generation Containing Ottoman Text
Impact of Synthetic Data on Page-Level Results
Training Experiments
Text Generation from Line Images
Page-Level HTML OCR
Conclusion