PP-OCRv6-Vietnamese-Rec
Vietnamese text-line recognition fine-tuned by ANZ Innovation from tieubaoca/pp-ocrv6-medium-rec-vietnamese, using the PaddleOCR PP-OCRv6 medium recognition architecture.
The default model is epoch 30. On our internal held-out test of 1,900 text crops, it achieves 2.22% CER, 3.50% WER, and 90.11% exact-line accuracy. CER is 82.47% lower relative to the tieubaoca starting checkpoint on this test. These are recognition results on our corpus, not a public benchmark or a measurement of full-page OCR quality.
Comparison on the same held-out test
All values below are percentages. Lower CER/WER is better; higher exact-line and diacritic accuracy is better.
| Model | CER ↓ | WER ↓ | Exact-line accuracy ↑ | Diacritic accuracy ↑ |
|---|---|---|---|---|
| Official PP-OCRv6 medium recognition | 14.85 | 52.30 | 13.00 | 36.59 |
| tieubaoca/pp-ocrv6-medium-rec-vietnamese | 12.65 | 26.24 | 45.58 | 88.97 |
| ANZ Innovation — epoch 12 | 2.46 | 3.93 | 88.68 | 98.62 |
| ANZ Innovation — epoch 30 (default) | 2.22 | 3.50 | 90.11 | 98.76 |
The official baseline uses its original weights and dictionary; the Vietnamese baseline and our checkpoints use the Vietnamese dictionary. The official vocabulary cannot represent at least one reference character in 1,423/1,900 test crops. Consequently, its gap includes vocabulary coverage as well as adaptation. It should not be interpreted as an architecture-only comparison.
Epoch 30 improves CER over epoch 12 by 0.238 percentage points. A paired bootstrap over 136 document/source groups (2,000 resamples) gives a 95% interval of −0.529 to −0.094 percentage points. This interval describes this corpus only.
Validation results
| Model | CER ↓ | WER ↓ | Exact-line accuracy ↑ | Diacritic accuracy ↑ |
|---|---|---|---|---|
| Official PP-OCRv6 medium recognition | 20.01 | 60.95 | 14.95 | 30.08 |
| tieubaoca/pp-ocrv6-medium-rec-vietnamese | 16.38 | 29.54 | 53.92 | 84.27 |
| ANZ Innovation — epoch 12 | 3.84 | 5.61 | 88.69 | 97.27 |
| ANZ Innovation — epoch 30 | 3.88 | 5.76 | 88.29 | 97.12 |
Validation contains 3,023 crops. Epoch 12 is the checkpoint selected by validation exact-line accuracy; epoch 30 is the final training checkpoint and has better results on the reported test. Both are provided. Test results were measured after training; no further tuning on this test is reported.
Evaluation protocol and limitations
- Identical fixed ground-truth text crops and NFC-normalized reference strings for all four models; BGR inputs resized with preserved aspect ratio to height 48 and padded to width 1280. No accent stripping or case folding.
- The existing test/validation sets contained 1,909/3,034 crops. Nine test and eleven validation examples with characters outside the Vietnamese dictionary were excluded before the comparison. The official baseline receives the same remaining examples, with no additional filtering.
- CER is total character edit distance divided by total reference characters. WER uses whitespace-separated words. Exact-line accuracy requires the entire prediction to match. Diacritic accuracy is the fraction of Vietnamese diacritic-bearing reference characters recovered correctly under edit alignment.
- Test references contain 59,550 characters, 13,146 words, and 10,269 diacritic-bearing characters. Full aggregate counts and source-level results are in
metrics/. - Test sources include internal documents, invoices, financial documents, tables, existing OCR datasets, and a small replay subset. Difficult invoices still have 5.02% CER; the 93-crop replay subset has 13.62% CER. Broad multilingual/general-domain robustness has not been established.
- These measurements exclude detection, reading order, page rendering, and PDF processing. This model recognizes cropped text; use a detector separately for full images/pages.
- The benchmark data are private and are not distributed. These results cannot be independently reproduced from this repository alone. Evaluate on your own representative data before deployment.
The tables use FP32 dynamic-checkpoint inference. Exported inference artifacts were separately checked on all 1,900 test crops: epoch 30 has 2.2200% CER, 3.5068% WER, 90.1053% exact accuracy (one prediction differs from dynamic inference); epoch 12 has 2.4635% CER, 3.9404% WER, 88.6316% exact accuracy (four predictions differ). See export_verification.json. Dynamic-width graph inputs at widths 320 and 1280 were also verified.
Usage
Install PaddlePaddle for your CPU/CUDA environment following the official installation instructions, then install paddleocr and huggingface_hub. Artifacts were exported and tested with PaddlePaddle 3.3.1.
from huggingface_hub import snapshot_download
from paddleocr import TextRecognition
model_dir = snapshot_download(
repo_id="ANZ-Innovation/PP-OCRv6-Vietnamese-Rec",
allow_patterns=["inference.*", "ppocr_keys.txt"],
)
model = TextRecognition(
model_name="PP-OCRv6_medium_rec",
model_dir=model_dir,
device="gpu:0", # Use "cpu" for CPU inference.
input_shape=(3, 48, 1280),
)
for result in model.predict(input="cropped_line.png", batch_size=1):
result.print()
Input should be a cropped text-line image. To use epoch 12, also download epoch12/* and use that subdirectory as model_dir. For full images/pages, use a detector separately. See the PaddleOCR text recognition documentation.
Repository contents
The default inference model is epoch 30; epoch 12 is provided as an alternative. Training code, training configurations, and optimization scripts are not distributed in this repository.
| Path | Contents |
|---|---|
inference.json, inference.pdiparams, inference.yml, ppocr_keys.txt | Epoch 30 inference graph, parameters, configuration, dictionary |
epoch12/ | Epoch 12 inference artifacts |
training_checkpoint/epoch30.pdparams, epoch12.pdparams | Full model weights, including both heads; optimizer state is not included |
metrics/ | Aggregate evaluation results, bootstrap, vocabulary coverage |
release_manifest.json | Artifact SHA-256 hashes |
Attribution and licensing
This release derives from PaddleOCR and the tieubaoca Vietnamese checkpoint. PaddleOCR source code is distributed under Apache-2.0. The upstream tieubaoca model card did not declare a model-weight license at release time; this card does not assign a new license to inherited weights. Consult upstream terms for your intended use.