The Character Error Rate (CER) is a key metric for evaluating the quality of Optical Character Recognition (OCR). However, this metric assumes that text has been perfectly parsed, which is often not the case. Under page-parsing errors, CER becomes undefined, limiting its use as a metric and making evaluating page-level OCR challenging, particularly when using data that do not share a labelling schema. We introduce the Character Error Vector (CEV), a bag-of-characters evaluator for OCR. The CEV can be decomposed into parsing and OCR, and interaction error components. This decomposability allows practitioners to focus on the part of the Document Understanding pipeline that will have the greatest impact on overall text extraction quality. The CEV can be implemented using a variety of methods, of which we demonstrate SpACER (Spatially Aware Character Error Rate) and a Character distribution method using the Jensen-Shannon Distance. We validate the CEV's performance against other metrics: first, the relationship with CER; then, parse quality; and finally, as a direct measure of page-level OCR quality. The validation process shows that the CEV is a valuable bridge between parsing metrics and local metrics like CER. We analyse a dataset of archival newspapers made of degraded images with complex layouts and find that state-of-the-art end-to-end models are outperformed by more traditional pipeline approaches. Whilst the CEV requires character-level positioning for optimal triage, thresholding on easily available values can predict the main error source with an F1 of 0.91. We provide the CEV as part of a Python library to support Document understanding research.
Figures & tables
Component
Difference
Comparison
Description
Parsing
dpars
d(R∥Q)
Errors caused by page regions being missed or captured more than once due to overlapping detections.
OCR
docr
d(S∗∥Q)
Transcription errors resulting in deviation from the true character distribution, isolated on GT regions.
Interaction
dint
d(S∥R)
OCR errors which are model dependent but on the parsing of the document image.
Total
dtotal
d(S∥Q)
Combined character error encompassing both parsing and OCR errors.
Table 1: CDD decomposition into parsing and OCR error components when character position information is available.
Symbol
Definition
Error captured
Q
GT character vector
No Error
R
Vector from the predicted parsing on GT characters
Parsing error only
S∗
Vector created by performing OCR on GT regions
OCR error only
S
Vector created by performing OCR on predicted regions
Combined OCR and Parsing
Table 2: Character vectors used in the CDD decomposition.
Figure 1: CDD decomposition when character position information is available. Solid arrows denote component differences; the dashed arrow denotes the total end-to-end divergence.
Property
Value
Images
49
Lines
19,691
Words
175,548
Granularity
Word level
Region Type
Polygon
Table 3: Details on The Spiritualist dataset used in this paper
Model
Type
Parameters
Framework
PaddleOCR
CNN
23.9M
PaddlePaddle
TrOCR
Transformer
334M
PyTorch
EasyOCR
CNN
13.4M
PyTorch
Tesseract
Traditional
—
C++
Table 4: Comparison of OCR Models
Model
Type
Parameters
Framework
DocLayout-YOLO
CNN
15.4M
PyTorch
Heron
Transformer
42.9M
PyTorch
PP-DocLayout-L
Transformer
30.94M
PaddlePaddle
PP-DocLayout-M
Transformer
5.65M
PaddlePaddle
PP-DocLayout-S
Transformer
1.21M
PaddlePaddle
Table 5: Comparison of Document Layout Analysis Models
Model
Type
Parameters
Framework
olmOCR
Transformer
7B
PyTorch
dots.MOCR
Transformer
7B
PyTorch
Granite-Docling
Transformer
258M
PyTorch
Table 6: Comparison of End-to-End OCR Models
Font
Layout
Columns
Ewert, Great Vibes, Kablammo, Roboto, UnifrakturMaguntia
Centered, Justified, Left aligned
1, 2, 3
Table 7: Parameters used in text generation process
Figure 2: Analysis of the impact of spatial uncertainty on the character position of the ground truth. We see that increasing the prediction width increases performance, but that paragraph-level inference is unusable at any scale.
SpACER ρ
CDD ρ
Easyocr
0.657
0.542
PaddleOCR
0.945
0.680
Tesseract
0.910
0.704
TrOCR
0.963
0.267
Table 8: Spearman correlation ( ρ ) between CER and docr for SpACER and CDD, computed over GT regions.
SpACER ρ
CDD ρ
Heron
-0.577
-0.742
PPDoc-L
-0.742
-0.809
PPDoc-M
-0.275
0.285
PPDoc-S
0.181
0.250
YOLO
-0.522
-0.649
Table 9: Spearman correlation ( ρ ) between per-page dpars and COTe score by parsing model. Negative ρ indicates that higher COTe (better parsing geometry) corresponds to lower parsing error, as expected.
Figure 3: We can see that SpACER has good correlation with CER at page level, indicating that they are both measuring the same thing. The CDD has low correlation, as it measures change in shape of the distribution not the error rate.
Easyocr
PaddleOCR
Tesseract
TrOCR
Heron
0.031
0.009
0.009
0.036
PPDoc-L
0.049
0.024
0.029
0.053
PPDoc-M
0.033
0.006 ∗
0.126
0.160
PPDoc-S
0.033
0.006
0.114
0.159
YOLO
0.028
0.015
0.016
0.037
Table 10: Page-level SpACER error ( dtotal ) by parsing model (rows) and OCR model (columns). Bold : column best; bold ∗ : overall best.
Figure 4: PPDoc-m and PPDoc-S, fail to correctly parse the images resulting in multiple columns in each crop, such as this example from image 1. All the OCR models fail to produce sensible text, but the failure mode depends on model architecture.
Table 11: Parsing error ( dpars ) by parsing model with COTe and [email protected]. SpACER macro is the primary metric; lower is better for SpACER/CDD, higher for COTe/mAP.
SpACER
CDD
CER
Easyocr
0.047
0.087
0.121
PaddleOCR
0.020
0.020
0.028
Tesseract
0.024
0.056
0.050
TrOCR
0.053
0.031
0.092
Table 12: OCR error ( docr ) by OCR model, averaged over pages using GT regions. SpACER macro is the primary metric; lower is better.
Easyocr
PaddleOCR
Tesseract
TrOCR
Heron
0.032
0.012
0.012
0.035
PPDoc-L
0.029
0.010
0.012
0.038
PPDoc-M
0.032
0.006
0.103
0.158
PPDoc-S
0.033
0.006 ∗
0.115
0.158
YOLO
0.027
0.014
0.013
0.028
Table 13: Interaction error ( dint , SpACER) by parsing model (rows) and OCR model (columns). Bold : column best; bold ∗ : overall best.
Model
SpACER
Output Text
EasyOCR
0.029
thc SPIRIT INFLUENCE. inches of Mr. Saul’$ and Mr. Hurt’s hands, and table, but in difierent parts of the room the table was ON one occasiol;
PaddleOCR
0.007
THE HANDLING OF inches of Mr. Saul’s and Mr. Hurt’s hands, and they SPIRIT INFLUENCE. table, but in different parts of the room; the table was
Tesseract
0.138
SPIRIT INFLUEN oe UNDER [bumed himself, Home then held it withi Month Sieone Tiiestiones. MeL
Table 14: Comparison of OCR model outputs from image 1 of the dataset when using PPDoc-S parsing regions.
Model
SpACER
CDD
Granite
0.864
0.207
M.OCR
0.097
0.057
OlmOCR
0.106
0.044
Table 15: Median SpACER and CDD by end-to-end model (d_total)
Figure 5: The figure shows that even conservative cutoffs for SpACER and COTe can identify if parsing or OCR quality is the main source of error in the pipeline