PDF Page Classifier

Multi-label classifier for PDF page images. Determines whether a PDF page requires image embedding (vs. text-only) in RAG pipelines.

Backbone: EfficientNet-Lite0. Exported to ONNX and OpenVINO INT8 via Quantization-Aware Training (QAT). No PyTorch required at inference time.

Classes

  • Complex Table
  • Simple Table
  • Visual - Essential
  • Visual - Supportive

Pages matching any of the following classes should trigger image embedding:

  • Complex Table
  • Visual - Essential

Default threshold: 0.5

Usage

With chunknorris (recommended)

pip install "chunknorris[ml-onnx]"       # ONNX backend
pip install "chunknorris[ml-openvino]"   # OpenVINO INT8, fastest on CPU
from chunknorris.ml import load_classifier

clf = load_classifier("Wikit/pdf-pages-classifier")   # auto-selects best available backend
result = clf.predict("page.png")
# {"needs_image_embedding": True, "predicted_classes": [...], "probabilities": {...}}

Standalone (no chunknorris)

git clone https://huggingface.co/Wikit/pdf-pages-classifier
cd pdf-pages-classifier
pip install onnxruntime Pillow numpy   # or: openvino Pillow numpy
from classifiers import load_classifier

clf = load_classifier(".")            # auto-selects available backend
result = clf.predict("page.png")

Files

File Format Notes
model.onnx ONNX FP32 Cross-platform CPU/GPU inference
openvino_model.xml/.bin OpenVINO INT8 Fastest CPU inference (QAT)
pytorch_model.bin PyTorch Raw checkpoint; requires torch + timm
config.json JSON Preprocessing config and class names
classifiers/ Python Standalone inference scripts (no chunknorris needed)

Dataset

Trained on Wikit/PdfVisClassif.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support