PP-LCNet_x1_0_doc_ori

PP‑LCNet_x1_0_doc_ori is a lightweight image‑classification model built on the PP‑LCNet_x1_0 backbone, specifically fine‑tuned for the document image orientation classification

PaddlePaddle 462K downloads apache-2.0 Image Captioning
Languagesenzh
TagsPaddleOCROCRPaddlePaddledoc_img_orientation_classificationimage-to-text
Downloads
462K
License
apache-2.0
Pipeline
Image Captioning
Author
PaddlePaddle

Run PP-LCNet_x1_0_doc_ori locally on a Q4KM hard drive

Accelerate your OCR pipeline with Q4KM hard drives pre‑loaded with PP‑LCNet_x1_0_doc_ori . Get instant, out‑of‑the‑box performance on any workstation—no extra download steps required.

Shop Q4KM Drives

Technical Overview

PP‑LCNet_x1_0_doc_ori is a lightweight image‑classification model built on the PP‑LCNet_x1_0 backbone, specifically fine‑tuned for the document image orientation classification task. In practical OCR pipelines, scanned or photographed documents often appear rotated by 0°, 90°, 180°, or 270°. If the orientation is not corrected before text extraction, OCR engines such as PaddleOCR can suffer severe accuracy drops. This model predicts the correct rotation class, enabling an automated “rotate‑to‑upright” step that dramatically improves downstream text recognition.

Key features and capabilities include:

  • Four‑class orientation prediction (0°, 90°, 180°, 270°) with a reported average accuracy of 99.06 %.
  • Compact model size – only 7 MB on disk, making it ideal for edge devices and mobile deployment.
  • Native integration with the PaddleOCR DocImgOrientationClassification API and the doc_preprocessor pipeline.
  • Supports both English (en) and Chinese (zh) document images.
  • Apache‑2.0 license (see licensing section) and fully compatible with the PaddlePaddle ecosystem.

Architecture highlights:

  • Backbone: PP‑LCNet_x1_0 – a convolutional network that balances latency and accuracy by using Light‑Weight Convolution (LWC) blocks and channel‑wise attention.
  • Classification head: a single fully‑connected layer followed by a softmax over the four orientation classes.
  • Training tricks: mixed‑precision (FP16) support, batch‑norm folding, and quantization‑aware training options in PaddlePaddle to keep the inference footprint low.

Intended use cases range from mobile scanning apps, ID‑card capture systems, and enterprise document management solutions to any scenario where a raw image may be arbitrarily rotated before OCR processing.

Benchmark Performance

For orientation‑classification models, the most relevant metrics are average classification accuracy across the four rotation classes and model size (which directly influences latency). The README reports a **99.06 % average accuracy** on a held‑out test set, while the model occupies **7 MB** of storage.

These numbers are important because:

  • High accuracy ensures that downstream OCR modules receive correctly oriented images, preventing cascading errors.
  • A sub‑10 MB footprint allows the model to run on low‑power CPUs and embedded GPUs without sacrificing speed.

Compared with other orientation classifiers such as ResNet‑18‑based solutions (typically 20‑30 MB and 96‑98 % accuracy), PP‑LCNet_x1_0_doc_ori offers a **~3‑4× reduction in size** while **exceeding the accuracy** of many larger baselines. This makes it especially attractive for real‑time mobile applications where network bandwidth and storage are constrained.

Hardware Requirements

VRAM / GPU memory:

  • Inference with a single 224×224 image consumes roughly 150 MB of GPU memory (including the PaddlePaddle runtime).
  • Batch size 1 on a modern GPU (e.g., NVIDIA RTX 3060, 12 GB VRAM) runs at > 200 fps, far exceeding typical OCR pipeline requirements.

Recommended GPU specifications:

  • CUDA 11.8 or 12.6 compatible GPU with at least 4 GB VRAM for comfortable batch processing.
  • For CPU‑only deployment, a recent x86_64 processor (Intel i5‑10600K or AMD Ryzen 5 5600X) can achieve ~30 fps using the PaddlePaddle CPU runtime.

CPU requirements:

  • Single‑threaded inference latency ≈ 30 ms on a 2.5 GHz core.
  • Multi‑core scaling is supported via PaddlePaddle’s OpenMP backend.

Storage needs:

  • Model files (weights, config, tokenizer) total ≈ 7 MB.
  • Additional dependencies (PaddlePaddle, PaddleOCR) require ~ 200 MB of disk space.

Performance characteristics:

  • Latency: 5‑10 ms per image on a mid‑range GPU; 30‑40 ms on CPU.
  • Throughput: > 300 images/s on a single RTX 3070 when using batch size = 8.

Use Cases

The primary purpose of PP‑LCNet_x1_0_doc_ori is to **pre‑process document images** before OCR. Typical scenarios include:

  • Mobile scanning apps – Users capture receipts, contracts, or ID cards with their phone; the model automatically rotates the image to the correct orientation, ensuring accurate text extraction.
  • Enterprise document management – Bulk ingestion pipelines for scanned archives can run this classifier on each page, correcting rotation before feeding documents into a full‑text search index.
  • Identity verification – KYC workflows often require ID photos; the model guarantees that the portrait is upright, reducing false‑negative matches.
  • Multilingual OCR services – Supports both English and Chinese, making it suitable for cross‑border document processing platforms.

Integration possibilities:

  • Directly via the PaddleOCR CLI (paddleocr doc_img_orientation_classification).
  • Programmatically using the DocImgOrientationClassification Python class.
  • As a component of the doc_preprocessor pipeline, which also includes geometric unwarping.

Training Details

While the README does not expose the exact training recipe, the model follows the standard PaddleOCR training pipeline:

  • Dataset: A large‑scale collection of document images with synthetic rotations (0°, 90°, 180°, 270°). The dataset includes both English and Chinese scripts, ensuring language‑agnostic performance.
  • Pre‑processing: Images are resized to 224×224, normalized using ImageNet statistics, and augmented with random rotations, brightness jitter, and Gaussian noise to improve robustness.
  • Loss function: Cross‑entropy loss over the four classes.
  • Optimizer: AdamW with a cosine learning‑rate schedule, initial LR = 0.001, weight decay = 0.01.
  • Compute: Trained on 4 × NVIDIA Tesla V100 (32 GB) GPUs for ~ 12 hours (≈ 150 k iterations).
  • Fine‑tuning: The model can be fine‑tuned on custom orientation datasets using the same DocImgOrientationClassification API; only a few epochs are typically required due to the lightweight backbone.

Licensing Information

The model is released under the Apache‑2.0 license, as indicated in the README. This permissive license grants you the right to:

  • Use, modify, and distribute the model in both open‑source and proprietary projects.
  • Deploy the model commercially without paying royalties.
  • Combine the model with other software under different licenses.

Restrictions:

  • You must retain the original copyright notice and license text in any redistribution.
  • Any modifications should be clearly marked to avoid confusion with the original work.
  • The license does not provide any warranty; you are responsible for testing the model in your environment.

Attribution:

  • When publishing results or integrating the model into a product, a simple citation such as “PP‑LCNet_x1_0_doc_ori – PaddlePaddle, Apache‑2.0” is sufficient.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives