Source-linked AI summary
PP-OCR: A Practical Ultra Lightweight OCR System
Yuning Du, Chenxia Li, Ruoyu Guo, Xiaoting Yin, Weiwei Liu, Jun Zhou, Yifan Bai, Zilin Yu, Yehua Yang, Qingqing Dang, Haoshuang Wang
TL;DR
OCR must handle varied text appearances while maintaining computational efficiency for massive workloads and embedded devices. PP-OCR addresses this with a three-part ultra lightweight system and model-size reduction strategies, achieving compact recognition models and verification across multiple languages.
Problem
OCR remains challenging because text appearances vary widely, while practical deployments require high computational efficiency, CPU operation, and small models for embedded devices.
Method
PP-OCR combines text detection, detected-box rectification with direction classification, and text recognition, using strategies such as lightweight backbones, augmentation, resolution choices, and PACT quantization.
Results
PP-OCR reaches an overall model size of 3.5M for 6622 Chinese characters and 2.8M for 63 alphanumeric symbols, with released models verified for several other languages.
Takeaways & Limitations
The paper provides practical ultra lightweight OCR models and large-scale datasets for Chinese and English recognition, alongside verification on French, Korean, Japanese, and German.
Abstract
from arXiv · showhide
The Optical Character Recognition (OCR) systems have been widely used in various of application scenarios, such as office automation (OA) systems, factory automations, online educations, map productions etc. However, OCR is still a challenging task due to the various of text appearances and the demand of computational efficiency. In this paper, we propose a practical ultra lightweight OCR system, i.e., PP-OCR. The overall model size of the PP-OCR is only 3.5M for recognizing 6622 Chinese characters and 2.8M for recognizing 63 alphanumeric symbols, respectively. We introduce a bag of strategies to either enhance the model ability or reduce the model size. The corresponding ablation experiments with the real data are also provided. Meanwhile, several pre-trained models for the Chinese and English recognition are released, including a text detector (97K images are used), a direction classifier (600K images are used) as well as a text recognizer (17.9M images are used). Besides, the proposed PP-OCR are also verified in several other language recognition tasks, including French, Korean, Japanese and German. All of the above mentioned models are open-sourced and the codes are available in the GitHub repository, i.e., https://github.com/PaddlePaddle/PaddleOCR.
1 Introduction
OCR serves many applications but must handle varied text appearances and stringent computational constraints. PP-OCR addresses this challenge with a three-part ultra-lightweight pipeline supported by large datasets and model-efficiency strategies.
- OCR supports applications including document electronization, identity authentication, digital finance, vehicle license plates, factory management, and education.
- Various of Text Appearances: Scene text varies with perspective, scaling, bending, clutter, fonts, multilingual content, blur, and illumination, while document text presents high-density, long-text, and structuring challenges.
- Computational Efficiency: Massive image volumes and CPU- or embedded-device deployment make computational efficiency, model size, and performance difficult but valuable trade-offs.
- PP-OCR combines text detection, detected-box rectification, and text recognition in a practical ultra-lightweight OCR system.
- Text Detection: The detector uses DB with six slimming or enhancement strategies and reaches a 1.4M model size.
- Detection Boxes Rectify: The direction classifier uses four strategies and reaches 500KB, while the CRNN recognizer applies nine strategies to improve capability and reduce size.
- Text Recognition: The text recognizer reaches 1.6M for Chinese and English recognition and 900KB for alphanumeric symbols recognition.
- The study uses 97K detection images, 600K direction-classification images, and 17.9M recognition images, and verifies PP-OCR on French, Korean, Japanese, and German.
2 Enhancement or Slimming Strategies
PP-OCR combines lightweight architectures, training strategies, pruning, and quantization to improve OCR efficiency while preserving model ability. The section applies these strategies across text detection, direction classification, and recognition.
- Light Backbone: MobileNetV3 and ShuffleNetV2 provide lightweight backbone options whose accuracy and inference time guide architecture selection.MobileNetV3 is selected empirically for balancing accuracy and efficiency in the detector and direction classifier.
- Light Head: Reducing detector inner channels from 256 to 96 cuts model size from 7M to 4.1M, with a slight accuracy decline.
- Remove SE: Removing SE blocks reduces detector model size from 4.1M to 2.5M without affecting accuracy.SE blocks add substantial time cost at large input resolution, while their accuracy improvement is limited.
- Learning Rate Decay: Cosine learning-rate decay keeps the learning rate relatively large during training and yields slower convergence but better final convergence accuracy.The strategy is compared with other decay methods in Figure 8.
- FPGM Pruner: FPGM pruning uses geometric median to identify similar filters and remove unimportant sub-networks for improved inference efficiency.Each convolutional filter is treated as a point in Euclidean space when computing the geometric median.
- Direction Classification: The direction classifier uses MobileNetV3 small x0.35, data augmentation, increased input resolution, and PACT quantization to balance accuracy and model size.PP-OCR increases normalized input resolution from 32 × 100 to 48 × 192 for the direction classifier.
3 Experiments
Experiments evaluate PP-OCR on large Chinese-English and multilingual datasets, then measure how design strategies affect component and system efficiency. The ablations show substantial model-size and inference-time reductions, while system-level accuracy remains competitive with a large-scale alternative.
- Datasets: 17.9M images train text recognition, alongside 97K text-detection and 600K direction-classification images.The datasets combine real-scene and synthetic images, and smaller real-scene subsets support rapid ablation experiments.
- Datasets: PP-OCR is also evaluated for alphanumeric, French, Korean, Japanese, and German recognition.The Chinese-English text detector can support multilingual text detection because its source detection data include multilingual images.
- Text Detection: 46.2% smaller and 18.9% faster on an SD 855 device, FPGM pruning reduces the text-detection model with only a slight HMean drop.The reported result supports FPGM as an effective text-detection compression strategy.
- Direction Classification: 45.9% smaller and 25.86% faster, PACT quantization improves direction-classifier efficiency while accuracy is slightly promoted.Increasing input resolution improves classification accuracy while prediction speed remains basically unchanged.
- Text Recognition: 5.27% accuracy improvement follows increased feature-map resolution and reduced second-downsampling stride in text recognition.Other reported gains include 3.12% from BDA, 1.47% from cosine decay, 3.4% from L2 decay, 0.62% from warm-up, and 0.91% from TIA.
- System Performance: 55.7% smaller and 12.42% faster, the slimmed OCR system shows no F-score impact, while large-scale OCR achieves higher F-score but worse size and inference time.For the recognizer alone, PACT quantization reduces model size by 67.39% and accelerates inference by 8.3%.
4 Conclusions
PP-OCR is presented as a practical ultra lightweight OCR system, using strategies to enhance ability or reduce model size while releasing models trained with large-scale data.
- 3.5M recognizes 6622 Chinese characters, while 2.8M recognizes 63 alphanumeric symbols.These are the reported overall model sizes for the two recognition settings.
- PP-OCR combines strategies intended to enhance model ability or reduce model size.
- The paper provides corresponding ablation experiments and releases practical ultra lightweight OCR models with a large-scale dataset.