Post-OCR Correction of Mixed-Script Uzbek Text: Byte-Level ByT5 with an Empirical Homoglyph Noise Matrix
Organizations: Department of Robotics and Intelligent Systems Tashkent University of Information Technologies named after Muhammad al-Khwarizmi Tashkent, Uzbekistan · Department of Artificial Intelligence Tashkent State University of Economics Tashkent, Uzbekistan
Abstract
In Uzbek official and technical documents, a large share of OCR errors is caused not by poor image quality but by characters that are visually identical across the two alphabets in use. Because the script transition is still under way, Cyrillic and Latin appear on the same page and often within a single sentence, and in our measurements the density of homoglyph errors on such pages is close to five times higher than in single-script text. We study this problem in a setting where the corpus of engineering-geological and ICT infrastructure reports may not leave the organisation, so every stage was executed on local hardware. The proposed system combines a byte-level ByT5 model with a noise generator whose sampling weights are estimated from 359 manually classified error events, together with a Levenshtein-bounded conservative decoding rule. On a Gold set of 5,204 line pairs it lowers the character error rate from 0.0578 to 0.0369, restores 91.3% of the homoglyphs and introduces only 84 new errors.
Figures & tables
| Type of homoglyph event | Count | Share |
|---|---|---|
| Single substitution | 184 | 51.3% |
| Cluster substitution | 66 | 18.4% |
| Whole-word polarisation | 32 | 8.9% |
| Multi-position substitution | 77 | 21.4% |
| Total | 359 | 100% |
| System | CER | ERP | Homogl. | New err. |
|---|---|---|---|---|
| Raw OCR | 0.0578 | – | 0 | 0 |
| Rule-based baseline | 0.0575 | +0.5% | 7.2% | 38 |
| LLM (Qwen2.5-7B) | 0.0534 | +7.6% | 52.4% | 1,132 |
| ByT5, no domain adapt. | 0.0491 | +15.1% | 69.8% | 286 |
| ByT5, proposed | 0.0369 | +36.2% | 91.3% | 84 |
| Raw OCR | Model output | Reference | Code points (raw model) | Model behaviour |
|---|---|---|---|---|
| ep (Lat.) | ер (Cyr.) | ер (Cyr.) | U+0065 U+0070 U+0435 U+0440 | Homoglyph restored |
| BA (Lat.) | ВА (Cyr.) | ВА (Cyr.) | U+0042 U+0041 U+0412 U+0410 | Polarised word restored |
| РоЕ (Cyr.) | PoE (Lat.) | PoE (Lat.) | U+0420 U+043E U+0415 U+0050 U+006F U+0045 | Mixed token normalised |
| КМК 2.01.03-19 | unchanged | КМК 2.01.03-19 | – | Domain code preserved |
| LMS.TUIT.UZ | unchanged | LMS.TUIT.UZ | – | Abbreviation preserved |
| Condition | Raw CER | Model CER | ERP | |
|---|---|---|---|---|
| Cyrillic, clean | 1,008 | 0.0608 | 0.0403 | +33.7% |
| Cyrillic, noisy | 1,000 | 0.0569 | 0.0365 | +35.9% |
| Latin, clean | 1,216 | 0.0610 | 0.0438 | +28.2% |
| Latin, noisy | 1,199 | 0.0550 | 0.0374 | +32.0% |
| Mixed, clean | 394 | 0.0572 | 0.0311 | +45.6% |
| Mixed, noisy | 387 | 0.0348 | 0.0206 | +40.8% |
| Training noise | Synthetic test | Gold set | ||
|---|---|---|---|---|
| CER | ERP | CER | ERP | |
| Random visual noise | 0.1667 | 0.0619 | ||
| Homoglyph-oriented | 0.0724 | +24.0% | 0.0491 | +15.1% |
| Emp. matrix + domain | n/a | n/a | 0.0369 | +36.2% |
| Metric | Estimate | 95% CI |
|---|---|---|
| Raw OCR CER | 0.0578 | 0.0565 – 0.0592 |
| Model CER | 0.0369 | 0.0358 – 0.0381 |
| CER difference (paired) | 0.0209 | 0.0190 – 0.0218 |
| ERP | +36.2% | 34.8% – 37.6% |
| Parameter | Value | Parameter | Value |
|---|---|---|---|
| Accelerator | NVIDIA RTX 5090, 32 GB GDDR7 (Blackwell) | Learning rate | , linear, 5% warm-up |
| Deployment | Single workstation inside the perimeter | Batch / sequence length | bytes |
| Precision | BF16 mixed precision | Epochs | 16, early stop after 3 |
| Peak memory | 26.4 GB / 32 GB | Decoding | Beam search, width 4 |
| Gradient accumulation | Not required | Conservatism threshold | characters |
| Training time | 12 hours (wall-clock) | Training pairs | 2,283,198 |
Optical Character Recognition
Optical character recognition converts text in images into machine-readable text, from printed pages and handwriting to signs and symbols.
See all 222 papers