Khmer is a low-resource language characterized by a complex script, presenting significant challenges for optical character recognition (OCR). While document printed text recognition has advanced because of available datasets, performance on other modalities, such as handwritten and scene text, remains limited by data scarcity. Training modality-specific models for each modality does not allow cross-modality transfer learning, from which modalities with limited data could otherwise benefit. Moreover, deploying many modality-specific models results in significant memory overhead and requires error-prone routing each input image to the appropriate model. On the other hand, simply training on a combined dataset with a non-uniform data distribution across different modalities often leads to degraded performance on underrepresented modalities. To address these, we propose a universal Khmer text recognition (UKTR) framework capable of handling diverse text modalities. Central to our method is a novel modality-aware adaptive feature selection (MAFS) technique designed to adapt visual features according to a particular input image modality and enhance recognition robustness across modalities. Extensive experiments demonstrate that our model achieves state-of-the-art (SoTA) performance. Furthermore, we introduce the first comprehensive benchmark for universal Khmer text recognition, which we release to the community to facilitate future research. Our datasets and models can be accessible via this gated repository\footnote{in review}.
Figures & tables
Figure 1: Sample images from our new datasets.
Figure 2: Sample Khmer text layout (with permission [ 8 ] .) Blue: consonant subscript. Green: base consonant. Orange: dependent vowel. Purple: diacritic. Best viewed in color.
Figure 3: The proposed UKTR framework.
Name
Params.
Flops
ResNet backbone (visual features)
13.0M
3.2G
Transformers encoder (sequential features)
9.5M
2.2G
Total
22.5M
5.4G
Table 1: The visual encoder’s complexity and model size. Params: model parameters. Flops: floating operations on an input of 32×116 pixels.
Figure 4: The designs of the ROUTER and ADAPTER networks.
Name
Params.
Flops
Transformers decoder (AR decoding)
24.08M
0.82G
Table 2: The Transformers decoder’s complexity and model size. Flops: floating operations on an input of 32×116 pixels.
Figure 5: Sample cropped images from the existing datasets. (a) Buoy et al. [ 1 ] . (b) KHOB. (c) HierText. (d) KhmerST.
Figure 6: Sample images from the WildKhmerST dataset and our GKST dataset.
Figure 7: Sample images from our KHT dataset.
Figure 8: Sample cropped images from our new datasets.
Dataset
Train
Eval
Training (D)
Adapting (S&H)
Eval
Doc
Scene
Handwritten
Buoy et al. [ 1 ]
2.8M
–
✓
–
–
✓
✓
–
KHOB [ 23 ]
–
1,318
–
✓
✓
✓
–
–
SynthText [ 22 ]
70k
–
✓
–
–
✓
–
–
HierText [ 20 ]
518,726
–
✓
–
–
–
✓
✓
KhmerST [ 3 ]
–
3,022
–
✓
✓
–
✓
–
WildKhmerST [ 5 ]
29,601
–
–
✓
–
–
✓
–
Table 3: Summary of datasets, sizes, usage, and modalities.
Dec.
Tok.
KHOB(D)
KhmerST(S)
KH(D,H)
GKST(S)
KHT(H)
Tesseract-OCR [ 11 ]
CTC
Char.
9.19
40.96
–
–
–
Surya-OCR [ 10 ]
Tr.
17.69
43.21
–
–
–
Buoy et al. [ 1 ]
Tr.
Char.
3.03
–
–
–
–
Buoy et al. [ 9 ]
CTC
KCC
2.33
–
–
–
–
Nom et al. [ 3 ]
Tr.
–
17.00
–
–
–
Soy et al. [ 21 ]
Tr.
–
–
17.00
–
–
Table 4: Character error rates (CER) on the evaluation datasets of different modalities (D,S,&H). * : model-specific tokenizer. Char.: character. KCC: Khmer character cluster. Bold : best. Italic : second best.
Decoder
Tokenizer
KHOB
KhmerST
KH
GKST
KHT
UKTR w/o MAFS (D + S&H)
CTC
KCC
3.85
4.30
8.17
6.15
11.89
UKTR w/o MAFS (D + S&H)
Tr.
KCC
3.93
5.48
5.84
5.39
7.66
UKTR w/ MAFS (D + S&H)
CTC
KCC
2.46
3.02
5.89
4.41
9.52
UKTR w/ MAFS (D + S&H)
Tr.
KCC
2.37
2.19
4.11
3.34
6.10
Table 5: Character error rates (CER) w/ and w/o the MAFS module. * : model-specific tokenizer. Char.: character. KCC: Khmer character cluster. Bold : best. Italic : second best.
Decoder
Tokenizer
KHOB
KhmerST
KH
GKST
KHT
UKTR ( n=3 , D + S&H)
CTC
KCC
2.43
3.03
7.12
4.57
9.87
UKTR ( n=3 , D + S&H)
Tr.
KCC
2.29
2.12
5.17
2.99
5.82
UKTR ( n=5 , D + S&H)
CTC
KCC
2.46
3.02
5.89
4.41
9.52
UKTR ( n=5 , D + S&H)
Tr.
KCC
2.37
2.19
4.11
3.34
6.10
UKTR ( n=8 , D + S&H)
CTC
KCC
2.45
3.09
6.50
4.79
9.71
UKTR ( n=8 , D + S&H)
Tr.
KCC
2.07
2.31
4.67
3.78
6.44
Table 6: Character error rates (CER) for n=3 , n=5 , and n=8 . * : model-specific tokenizer. Char.: character. KCC: Khmer character cluster. Bold : best. Italic : second best.
Figure 9: Sample images, ground-truth texts, and model predictions (CTC vs. Transformers).