Truncated PaddleOCR-VL vision encoder — 1152D intermediate features for document image quality assessment.
Layer 12 of the PaddleOCR-VL vision encoder captures mid-level visual patterns (texture, edge structure, compression artifacts, noise patterns) that are highly predictive of OCR readability. This ONNX model extracts those features with zero PyTorch dependency — just onnxruntime + numpy + Pillow.
Why Layer 12?
From a sensitivity analysis across all 27 encoder layers:
Degradation
Best Layer
Spearman ρ
Notes
Gaussian Noise
layer_00
0.96
Shallow layers detect fine noise
JPEG Compression
layer_08
0.86
Mid layers sense blocking artifacts
Gaussian Blur
layer_08
0.66
Moderate response
Downscale
pooled
0.65
Resolution loss detectable
Layer 12 was chosen because:
Highest intra/inter-class distance ratio (0.29) — features cluster by quality level, not degradation type
Cross-resolution consistency >0.99 — same image at 224² vs 728² produces nearly identical features
Good balance: deeper than noise-sensitive layers, shallower than semantic layers
Correlation between feature distance and degradation severity across 12 degradation types × 7 levels × 5 image types:
Degradation
Spearman ρ
Monotonicity
Sensitivity
Gaussian Noise
0.96
0.98
Excellent
JPEG Compression
0.86
0.97
Excellent
Gaussian Blur
0.72
0.95
Good
Motion Blur
0.68
0.93
Good
Median Blur
0.65
0.92
Good
Downscale
0.65
0.90
Good
ISO Noise
0.60
0.88
Fair
Salt & Pepper
0.55
0.85
Fair
Rotation
0.30
0.60
Weak
Brightness
0.05
0.52
Blind spot
Contrast
0.05
0.50
Blind spot
Mean |ρ| = 0.55 across all degradations.
2. Paired Ranking Accuracy
Given a pristine reference and two degraded copies at different severity levels, can the model correctly rank which is worse?
Overall: 89% across 200 random pairs.
3. Cross-Resolution Consistency
Same content at different resolutions → same features? Cosine similarity between features extracted at 224² vs 728²:
Mean: 0.997 — near-perfect consistency thanks to PaddleOCR-VL's smart_resize.
Use Cases
Document upload quality gate — reject blurry/noisy scans before OCR
Image preprocessing quality monitor — detect when enhancement pipeline degrades
Reference-based quality scoring — compare against a known-good template
Feature backbone for quality regression — use 1152D features as input to a lightweight quality regressor (e.g., Two-Tower MLP, XGBoost)
Limitations
Blind to brightness/contrast issues — these don't affect the feature space. Complement with traditional CV metrics (Laplacian variance, histogram stats).
Geometric degradations (rotation) have weak signal — the model uses position encoding, but rotated text still looks like text to mid-layer features.
Not a standalone quality scorer — this is a feature extractor. You need a downstream head (trained regressor, reference comparison, or CV complement) for final quality scores.
Original PaddleOCR-VL base model — the vision encoder is from PaddleOCR-VL, which is optimized for Chinese + English document OCR.
Recommended Quality Pipeline
For a robust document quality system, use a Two-Tower fusion:
Recommended starting point: OCR-Quality — it's the only dataset that directly measures OCR quality assessment, with human annotations and per-page MOS scores. Our benchmark script includes a loader for it.
1@software{paddleocr-quality-onnx,
2 title = {PaddleOCR-VL Layer-12 Feature Extractor (ONNX)},
3 year = {2025},
4 note = {Truncated PaddleOCR-VL vision encoder for document image quality assessment},
5 url = {https://huggingface.co/[your-username]/paddleocr-quality-onnx},
6}
The original PaddleOCR-VL model is from PaddlePaddle. This is a derived work using only the vision encoder (layers 0-12), exported to ONNX for lightweight deployment.
License
This model is derived from PaddleOCR-VL, which is released under Apache 2.0. This ONNX export and accompanying code are also Apache 2.0.