Elamur Research

EfficientOCR: An Extensible, Open-Source Package for Efficiently Digitizing World Knowledge

Paper · 2023 · Tom Bryan, Jacob Carlson, Abhishek Arora et al.

Summary

A scanned document can be read by someone looking at the image, but its contents still cannot be searched or analyzed as text. Optical character recognition, or OCR, converts the marks in that image into a transcription. For a large archive, the conversion needs to be affordable across the entire collection and accurate enough for the work people want to do with it. The difficulty grows when the typefaces, writing systems, or scan conditions differ from those served by existing software. EfficientOCR, which the authors call EffOCR, is an open-source package designed to make both processing and adaptation affordable.

EffOCR turns recognition into a visual matching problem. It finds lines on a page and locates characters or words within them. An image encoder then converts each crop into a numerical representation. The recognizer searches a prepared index of examples rendered from a digital font and returns the text associated with the closest match. During training, the encoder learns to bring different-looking instances of the same character or word close together. Much of this training can use rendered images, supplemented with a smaller set of labeled crops from real documents. Inference can process multiple crops in parallel because recognizing one crop does not require the transcription of the preceding crop.

The paper puts this design to work on historical newspapers, archival records, and a vertically written Japanese publication. For the American Stories dataset, the authors combined EffOCR with page layout analysis to process 20 million newspaper scans for $60K USD in cloud compute, with pipeline development costing extra. An English recognizer trained on newspapers reached 11.2% character error rate on sampled lines from the U.S. National Archives, ahead of the open-source alternatives reported for that test. Google Cloud Vision reached 1.2% on the same lines. For the Japanese collection, where the strongest existing engine in the comparison got more than half of the characters wrong, a version trained with 898 labeled table cells reached 0.7% character error rate.

The package offers ready-to-use components, tools for training on a new collection, and ways to inspect and export both the transcription and the locations associated with it. Its strongest case is a collection for which either the scale makes existing OCR expensive or the documents require adaptation with little labeled data. The results distinguish those situations. The newspaper project demonstrates a working pipeline and a compute budget at collection scale, the archive test measures transfer to unfamiliar document images, and the Japanese experiment shows what collection-specific training can accomplish. The authors identify substantial illegibility and handwriting as limits of the system they describe.

Deep dive: EfficientOCR: An Extensible, Open-Source Package for Efficiently Digitizing World Knowledge

EfficientOCR recognizes text in scans by matching images of words or characters, reducing the cost of adapting OCR and running it at scale. · about 32 minutes to read

The problem and its context

A scan and a transcription support different kinds of work

An image preserves the appearance of the original document. A transcription gives researchers and software access to the text itself. A page image lets a person read an individual record. Machine-readable text makes it possible to search for related records, compare wording across documents, or collect values from a series of reports. The authors place OCR before these tasks because the reliability of the transcription affects what can be learned from it. A reading error can be visible to someone checking the scan and still pass unnoticed when the same value is processed automatically as part of a larger dataset. This matters especially when a small transcription mistake generates a large outlier in a quantitative analysis.

The U.S. National Archives gives the paper a sense of the scale involved. The authors cite approximately 13.28 billion pages of textual records, most in the public domain. They also point to large national collections elsewhere and to the holdings of state and local institutions. Many records have research or public value, but their physical preservation and the ability to work with their contents are different accomplishments. Even when a scan exists, effective information retrieval requires text that can support indexing and search. A dependable transcription also makes information extraction possible when the goal is to turn information dispersed across documents into data that can be examined together.

The cost of obtaining that transcription takes a different form at archive scale. A recognition service may be practical for a small set of files while becoming too expensive for an entire collection. The same consideration applies to open-source OCR if each image requires substantial computation. A project also needs to account for the shape of the document. A service that handles a line cleanly may make mistakes when it receives a full page with several columns and different kinds of content. Preparing the input at a finer level can help with layout, but it also changes the number of images to process. When the service bills per image, that decision affects the budget directly.

Accuracy and cost also vary independently. Some archives can use an existing engine and spend their effort on processing a large volume of images. Others have a more basic problem. The available engines misread the writing so often that greater throughput just produces more unusable output. The paper highlights low-resource languages in this connection, while treating scarcity of usable OCR as a broader issue. Historical printing, unusual fonts, a different text direction, and degradation from scanning or aging can make a collection hard to recognize even when OCR is readily available for the language in other settings. A user may need to adapt the software specifically to the documents at hand.

What earlier engines learn

The authors describe sequence-to-sequence recognition as a common design in earlier OCR. The input in this setting is an image of text, often a line, and the output is a sequence of written symbols. A visual encoder extracts information from the image. A decoder uses those visual features and the output produced so far to generate the transcription. The process is called autoregressive because later predictions depend on earlier ones. It gives the system a means to learn regularities in how text is written, but that sequential dependency also limits which parts of decoding can run at the same time.

TrOCR is the paper’s main example of the training requirements of this approach. The authors report that its training used 684 million text lines and 32 32GB V100 GPU cards. They use that example to explain why a system that can be downloaded and applied immediately may still be difficult for a small research group to reproduce or extend. The distinction is particularly important for scripts or languages for which a suitable starting checkpoint may be unavailable. The paper relates this difficulty to the concentration of progress in language modeling described by The State and Fate of Linguistic Diversity and Inclusion in the NLP World.

The paper also describes differences among widely used OCR alternatives. EasyOCR uses a convolutional recurrent approach to sequence recognition. TrOCR uses an encoder and decoder built with the Transformer. PaddleOCR’s SVTR takes a visual approach that divides the input into small patches. Those patches do not have to coincide with character boundaries. Its components mix information within and across character regions before prediction. This matters for placing EffOCR in context. The paper compares it with both sequential and vision-based approaches. Its distinctive choice is to detect units corresponding to characters or words and recognize them by retrieving labeled images with similar representations.

The authors also point to prior work on correcting OCR output. That literature addresses errors after a first transcription has been produced. Its relevance here is that reliable text often requires work beyond running an existing engine on an image. EffOCR intervenes earlier by changing how recognition is learned and carried out. The paper’s design question is whether a recognizer can concentrate its training on the appearance of written units, leaving it easier to adapt when the available examples of real documents are scarce.

Adaptation as part of the package

The intended users include researchers, libraries, and archives with different budgets and levels of experience in machine learning. The authors therefore treat the interface as part of the contribution. A collection may resemble material already supported by a ready-to-use checkpoint. Another collection may need a different detector, a recognizer trained with local examples, or both. Making those components independently accessible allows a user to begin with a working system and directs attention to the part that needs changing when the output is poor.

A collection can also impose different demands at each stage of a project. Quality checks may require looking at individual crops and seeing where a detected line begins and ends. Later, bulk processing may require only assembled text or may need coordinates for every unit. The package addresses those uses alongside recognition and training. In the authors’ account, computational efficiency makes processing feasible, sample efficiency makes adaptation feasible, and the interface determines how readily users can take advantage of either.

The method, step by step

Find the text before identifying it

To read a scan, EffOCR first needs to determine where the writing is. Its line detector marks regions occupied by lines. A localizer then finds characters and, in configurations that use word recognition, words within those lines. Both steps use object detection. An object detector predicts bounding boxes marking the location and extent of objects in an image. For OCR, those boxes define crops that can be passed to recognition. The exercise is spatial at this stage. A character box can be correctly placed even if the subsequent recognizer assigns it the wrong letter.

The separation is visible in the package’s outputs. When a transcription is wrong, the line, word, and character boxes show whether the relevant portion of the image reached recognition as intended. A box can omit part of a symbol, include material from a neighboring symbol, or miss a region entirely. Those errors have different consequences from a well-framed crop that is matched to the wrong entry in the recognition index. Exposing the intermediate boxes lets a reader examine the distinction in the original image.

The package supports localization inference through YOLO and MMDetection. The authors describe YOLO v8 as the choice geared towards efficiency, YOLO v5 as an option with fewer dependencies, and Cascade R-CNN as a choice aimed at accuracy. Ready-to-use detectors address different geometries, including alphabetic English or Latin text, Polytonic Greek, and CJK characters. The training interface also exposes whether the characters in a line are arranged horizontally or vertically. This setting matters when moving between the printed English documents and the vertically written Japanese documents used in the paper.

Line localization has a narrower job than page layout analysis. On a newspaper page, a box around a line identifies a region of text, while a layout analysis system distinguishes a headline, article, caption, or advertisement. A page with columns and several kinds of content may need both analyses. The newspaper project combined EffOCR with Layout Parser so that the workflow addressed page structure as well as the transcription of the text within it. The paper also describes a planned interface through which Layout Parser users could invoke EffOCR directly.

How EffOCR reads a document image

The steps in order.

How EffOCR reads a document imageStep 1: Detect lines in the image1. Detect lines in the imageStep 2: Locate characters and any word regions2. Locate characters and any word regionsStep 3: Crop the detected text regions3. Crop the detected text regionsStep 4: Encode each crop as a vector4. Encode each crop as a vectorStep 5: Retrieve the closest labeled exemplar5. Retrieve the closest labeled exemplarStep 6: Use character recognition for weak word matches6. Use character recognition for weak word matchesStep 7: Assemble the transcription in reading order7. Assemble the transcription in reading order

Represent a crop by what it looks like

The input to the recognizer is a crop. An image encoder converts the crop into a vector, an ordered set of numerical features. The paper calls that representation an embedding. An embedding is useful for this task when examples of the same written unit occupy nearby positions even if the original images look different in superficial ways. Changes in typeface or scan appearance should therefore interfere as little as possible with identifying the underlying character or word.

EffOCR trains the encoder contrastively. For the recognition task, that means teaching it which crops should have similar representations and which should be distinguishable. Crops labeled with the same character or word provide examples that should be close. Crops labeled differently provide distinctions the encoder needs to preserve. The desired result is a space in which comparing vectors helps answer the transcription question. The system can then match an image from a scan to a clean rendered example even though the pixel values are different.

The paper leaves the detailed training specification for the distributed recognizers to the companion architecture study. It describes the role of contrastive training and the nearest-neighbor decision in words. The important distinction is between learning the comparison and performing it. Training changes how the encoder represents images. At inference time, the trained encoder supplies a representation for the crop and the search returns an entry from a previously built index.

Retrieve a labeled exemplar

EffOCR prepares that index from exemplars made with a digital font. An exemplar is an image with a known identity. When the encoder processes that image, its vector can be stored alongside its label. The same encoder processes crops from a document at inference time. Each new vector is compared with the stored ones, and the label associated with the closest exemplar supplies the recognition result. Preparing the reference side in advance means it can be reused across the document images processed with that recognizer.

The English word recognizer uses cosine similarity as a measure of how well a crop matches an exemplar. Cosine similarity compares the direction of the vectors. Vectors pointing in more similar directions have a higher similarity. EffOCR has a default cutoff that users can adjust. When the proposed word match falls below the cutoff, the package switches to character recognition for that crop. The cutoff controls whether the evidence is strong enough to accept a match to an entire word. Character recognition gives the system another route to a reading when the word search supplies a weak match.

The English offerings include a character-only recognizer as well. The Japanese offerings described in the paper use character recognition without a word stage. The localizer can accordingly be set to detect just characters, a choice the authors recommend for writing systems where words are not grouped visually. These choices affect what the detector marks, what crops are passed to the encoder, and what labels the retrieval index must contain.

This design creates a different dependency structure from autoregressive OCR. After a crop has been located, its representation and match can be computed without waiting for the label of the preceding crop. The package can process crops in parallel and put their transcriptions in reading order afterwards. Reading order matters for the final text, but the recognition decision uses the visual evidence for the unit being matched. Where a crop is clear, this lets the encoder focus on recognizing the shape present in the image. Where the crop is substantially obscured, the same design limits the evidence available to it.

Train on rendered examples and real document crops

EffOCR relies heavily on text rendered in digital fonts. These images come with known labels because the text used to generate each crop is already available. Rendering supplies visual variations without requiring someone to transcribe every training example. Real crops then expose the recognizer to the appearance of the material it will encounter in use. The authors describe mixing rendered data with a modest amount of labeled material taken from actual documents. Their sample-efficiency argument concerns how much of that real material needs annotation.

Localization and recognition need different information from the annotations. A detector needs coordinates showing where units occur. The recognizer needs the identity of the character or word in a crop. A useful collection-specific training set can therefore provide examples of both the geometry of the text and its appearance. The package accepts COCO JSON, a format that can carry annotations such as bounding boxes and their labels. It can also export predictions in the same format. A user can review predicted regions and correct them, giving the next training pass a starting set of annotations to work from.

For custom localization training, the paper describes initialization with a YOLO detector. MMDetection is available for inference in the package described, and training support was planned. For recognition, the package accepts image encoders supported by timm. The recognizer settings include the source of fonts, where renders and labeled crops are kept, and which encoder to start from. The settings also cover routine training choices such as learning rate, optimizer, and batch size. According to the authors, system training used a single Nvidia card, either an RTX 3090 or an A6000, and the convolutional options can be trained on Google Colab.

The package provides for a further training pass using hard negatives. For an image recognizer, a hard negative is an example from a different class that is difficult to distinguish from the target. After an initial run, EffOCR can generate a file used to draw these examples. The authors say that most recognizer training in the package uses an initial pass followed by a pass with hard negative sampling. The distinction matters because teaching the encoder to separate easy examples leaves open whether it can resolve the confusions that occur among closer matches.

The localizer exposes settings for text direction, whether to detect words, and thresholds that affect how detections are judged. The overlap setting uses intersection over union, a measure of how much of the area covered by either box is shared by both. It gives the detector a criterion for how closely a proposed box corresponds to a reference box. The confidence setting concerns the detector’s score for a proposed region. The authors also point out that the input image shape can be adjusted for unusually long or short lines. These settings address the quality of the crop before the recognizer attempts a match.

Turn character readings into word training examples

The historical newspaper project gives a concrete example of how the components can be trained in succession. The authors began with character recognition, using rendered data and a labeled set of 291 newspaper lines. They say that creating the labeled set took a couple of hours. Once the character recognizer was available, they used it to produce annotations for word training. In this workflow, earlier predictions supplied labels for examples that would otherwise have needed more manual transcription.

The authors filtered out lines with a high rate of outputs judged to be non-words before relying on them for word annotations. The filter is part of what makes bootstrapping plausible. A recognizer trained on labels from its predecessor can inherit systematic mistakes, so the workflow screened some of the noisier predicted material before using it. The paper gives the principle behind that screen. It does not report a controlled comparison that isolates its contribution.

The choice to build the character recognizer first also illustrates the roles of the two levels. Character recognition can turn a word image into a reading even when a whole-word reference match is weak. Word recognition can learn directly from crops for which a reliable word label is available. In the newspaper pipeline, character recognition supplied both a way to generate training material and a route to recognition when a whole-word match lacked sufficient similarity.

Run the system and inspect its output

EffOCR’s catalog is organized around ready-to-use components with descriptions of the data used to train them. At the time of the paper, it contained 30 pretrained entries covering English, Polytonic Greek, and Japanese in horizontal and vertical orientations. Its English offerings included newspaper and mixed archival settings. The available recognizers range from lightweight convolutional backbones to larger image encoders, including the Swin Transformer. A backbone is the part of the recognizer that extracts the image representation on which retrieval depends. Providing several lets users choose among different computational requirements while keeping the same retrieval workflow.

Deployment can use ONNX, which gives the package a standard format and runtime for executing trained components. All stages can optionally use ONNX, and the package can convert components to that format. Both localization and recognition inference can run across multiple threads. Parallel processing across crops, multithreading, and the choice of runtime contribute at different levels. The first comes from the recognition design, the second distributes work available within the implementation, and the third affects how the operations are executed on the hardware. The paper measures the combined performance separately from the method description.

After recognition, EffOCR assembles the text in reading order. It can return the assembled transcription and text associated with line, word, or character coordinates. The visualization also shows the original image beside the OCR and can display detections at those levels. This gives quality checks a common reference. A reader can find a questionable part of the output, inspect the corresponding region of the original, and trace the error to the part of the pipeline that produced it.

The authors released EffOCR under the GNU General Public License. They describe a workflow for uploading trained components to the project’s Hugging Face hub. Saving a trained component generates a card with information about its architecture, training, and use in the package. That record matters for reuse because a checkpoint’s suitability depends partly on the writing, layout, and image conditions to which it was exposed. Several components can perform the same role in the pipeline while being appropriate for different collections.

Experiments and results

Read the evaluations at the level they measure

The paper draws on several kinds of evidence. It reports an actual digitization run, compares systems on held-out archival lines, and evaluates adaptation to a historical Japanese collection. Its supplementary experiments also vary the amount of labeled data and measure CPU throughput. These experiments have different units. A page processed in the production pipeline, a line selected for transcription, and a character crop classified from an image tell the reader about different portions of the work.

The main accuracy measure is character error rate, abbreviated CER. It measures how many character edits are needed to turn the OCR output into the reference transcription, relative to the reference text’s length. A wrong character, an omitted one, or an extra one can all count against the result. Lower CER means closer correspondence with the reference. The paper also reports character classification error for the Japanese experiment with very few labeled examples. That measure asks whether a character image receives the right identity. It gives evidence about the recognizer under sparse supervision and should be read separately from an error rate over whole transcriptions.

Historical newspapers at collection scale

Using scans from Chronicling America, a Library of Congress collection, the authors built the American Stories dataset and later published it on Hugging Face. The production run covered 20 million historical newspaper pages. The paper uses examples with varying typography and image quality to explain the recognition challenge. A newspaper also combines several kinds of content on the same page. An accurate line recognizer can still produce a difficult-to-use transcription if the pipeline groups or orders page regions incorrectly.

The pipeline combined layout analysis with EffOCR. The character recognition training drew on synthetic data and the 291 labeled newspaper lines. The authors then generated word annotations with the character recognizer and filtered the resulting material to remove lines with a high non-word rate. The labels at the character stage were small in scope relative to the production collection. The actual deployment depended on additional work to process the layout and organize the resulting text.

The authors report a $60K USD cloud compute budget for the run, with pipeline development costs additional. This is a compute figure for the digitization workflow described in the paper. It demonstrates that the software was used at the stated scale under a concrete budget. The paper refers to the American Stories study for a fuller assessment of the resulting dataset’s quality. The evidence reported here emphasizes production scale, compute cost, and the setup needed to process the pages.

The authors compare this run with their estimates for alternative approaches. Google Cloud Vision made substantial layout mistakes when given complete newspaper pages and did best when fed individual lines, according to their account. Since the service charges per image, treating each line as an image changes the number of billed requests. Using that input arrangement and the prices cited by the authors, they estimate a cost of over $23 million USD for the full collection. They also estimate that TrOCR Base would have exceeded their budget by a factor of nearly 50. Those figures describe counterfactual workflows. The $60K USD figure describes the workflow the authors ran.

The commercial comparison illustrates how a recognition decision can turn into a layout and billing decision. A system may offer strong text recognition when the crop is already well specified. Its costs and accuracy on a full newspaper archive then depend on how the pages are divided and submitted. The newspaper application shows EffOCR working in a pipeline that made those decisions explicitly, with a cost reported for the run as a whole.

Transfer from newspapers to archival lines

The U.S. National Archives experiment measures what the lightweight English word recognizer could do on unfamiliar records. The authors describe the recognizer used for this test as having seen only newspapers in training. They sampled 300 documents at random from distinct record groups and took a single line per document. Zero-shot performance here means performance without adapting the recognizer to examples from the target collection. This design gives a view of how a newspaper-trained system handles a variety of other document images.

Character error rate on sampled U.S. National Archives lines

EffOCR had the lowest character error rate among the reported open-source systems, while Google Cloud Vision had the lowest rate overall.

Character error rate on sampled U.S. National Archives linesGoogle Cloud Vision: 1.2Google Cloud Vision1.2EffOCR lightweight word recognizer (this paper): 11.2EffOCR lightweight word recognizer (thispaper)11.2Tesseract (Best): 11.8Tesseract (Best)11.8EasyOCR: 12.1EasyOCR12.1TrOCR (Small): 51TrOCR (Small)51
The numbers
System or settingCER %
Google Cloud Vision1.2
EffOCR lightweight word recognizer (this paper)11.2
Tesseract (Best)11.8
EasyOCR12.1
TrOCR (Small)51

EffOCR reached 11.2% CER on the selected lines. Tesseract, in its Best configuration, reached 11.8%, and EasyOCR reached 12.1%. TrOCR Small recorded 51%. The authors say that it appeared to have trouble with blurry and partly obscured text. Google Cloud Vision reached 1.2%. EffOCR led the reported open-source systems on this sample, and the commercial system achieved markedly lower error than any of them.

The sample’s breadth comes from taking lines from separate documents and record groups. Its unit remains the selected line. The figures evaluate how well systems transcribed that material. They provide no measurement of how often a pipeline would find all the lines on full pages or organize their output correctly. The authors propose that exposure to a random sample of archival material during training might improve recognition. The reported result is for the newspaper-trained recognizer, so the proposed improvement has no measured size in this experiment.

The availability of a mixed archival option in the package’s catalog is separate from the definition of this comparison. The intended test was whether the newspaper-trained recognizer could transfer without target-collection training. Keeping that detail in view helps interpret the commercial result as well. The observations show what the tested systems did on these lines, with EffOCR’s training background deliberately chosen to test transfer. They also show why a practical engine choice can depend on the value of extra accuracy and the budget for applying the software across a collection.

Adaptation to vertically written Japanese records

The low-resource application concerns historical firm records in a vertically written Japanese publication. The authors use an evaluation set of randomly selected segments that were independently labeled twice. The collection’s contents were of interest for research on Japanese economic growth. In practical terms, the OCR needed to read the records well enough to turn those printed entries into material that could be studied. Available systems were inadequate for that task. The strongest existing engine in the comparison, Baidu OCR, misread more than half the characters.

The adapted EffOCR system used 898 labeled table cells for training and reached 0.7% CER on the evaluation material. The authors describe the improvement in error over the strongest existing alternative as 80 times. The counts refer to labeled table cells, while the outcome refers to characters in the evaluation transcriptions. A cell can contain several written units, and it is the transcription of that material that the CER evaluates.

The result is a comparison between a collection-specific EffOCR system and available OCR alternatives as applied to the same recognition problem. The labels gave EffOCR examples of the particular typography and document conditions it needed to handle. The paper shows that access to that amount of labeled material was sufficient for an accurate reading on the evaluation set. It also narrows the claim about availability. The obstacle for the researchers was recognition of these vertical historical records, not a lack of OCR software bearing a Japanese language setting.

The authors separately restrict the number of labeled crops per character to see what happens under much scarcer supervision. That experiment reports character classification error. Its role is to test how quickly the recognizer learns from a few real examples per character. The main 0.7% figure belongs to the adapted transcription system trained with the labeled table cells.

Recognition throughput on a CPU

The speed benchmark uses four 2200 MHz CPU cores. The paper evaluates Python implementations on single lines and on articles containing 5-40 lines. Throughput is the amount of text processed per unit of time, so higher values indicate faster processing. The EffOCR entries use pretrained English newspaper components in ONNX format with default settings. The baseline configurations also matter. Tesseract uses pytesseract with defaults, EasyOCR uses its standard English setup, and PaddleOCR uses its English defaults with the angle classification option enabled. The TrOCR implementations use their printed-text Base and Small variants.

CPU text-line throughput for the tested English OCR configurations

EffOCR Small processed the most text lines per second in this setup, with EasyOCR close behind.

CPU text-line throughput for the tested English OCR configurationsEffOCR Small (this paper): 21.07EffOCR Small (this paper)21.07EasyOCR: 19.80EasyOCR19.80PaddleOCR: 13.56PaddleOCR13.56Tesseract: 4.47Tesseract4.47TrOCR (Small): 0.97TrOCR (Small)0.97EffOCR Base: 0.46EffOCR Base0.46TrOCR (Base): 0.43TrOCR (Base)0.43
The numbers
System or settingtext lines/s
EffOCR Small (this paper)21.07
EasyOCR19.80
PaddleOCR13.56
Tesseract4.47
TrOCR (Small)0.97
EffOCR Base0.46
TrOCR (Base)0.43

EffOCR Small processed 21.07 text lines per second in the benchmark. EasyOCR processed 19.80, and PaddleOCR processed 13.56. The larger EffOCR Base entry processed 0.46 text lines per second, close to the 0.43 recorded for TrOCR Base. The difference between the EffOCR entries is important for interpreting the package’s speed claims. The retrieval design allows parallel recognition, but the encoder and the rest of the selected configuration still determine how much work has to be done for each input.

On the article inputs, EffOCR Small processed 1.08 articles per second. EasyOCR processed 1.03 articles per second and PaddleOCR 0.61. EffOCR Base and TrOCR Base each recorded 0.02 articles per second. The result places the lightweight configuration ahead in both benchmark formats on the chosen CPU setup. It also shows that the larger configurations are much slower on that setup. The article benchmark counts text inputs containing several lines. The newspaper deployment adds the work required to handle actual scanned pages and their layouts.

The authors attribute the lightweight version’s deployment speed to parallel decoding and ONNX integration, and describe multithreading across localization and recognition. They report that ONNX Runtime can raise CPU throughput by up to four times for YOLO configurations in EffOCR. The supplement separately reports up to a 3x CPU speedup compared with native PyTorch. These are conditional speedup claims with different descriptions of scope. The throughput benchmark reports the performance of complete tested configurations and does not assign a separate share of their performance to each implementation choice.

The comparison also illustrates why parameter count alone is an incomplete guide to throughput. The authors say that lightweight EffOCR has around 8x as many parameters as Tesseract and around 4x as many as EasyOCR, while PaddleOCR has a similar parameter count to lightweight EffOCR. Which operations run, what can execute together, and how the runtime executes them all matter. The authors emphasize that the ranking can depend on deployment hardware, especially in comparing EffOCR with EasyOCR.

What the ablations show

Varying the amount of annotated material

The supplementary sample-efficiency experiment compares how recognition approaches respond to different amounts of labeled benchmark data. The EffOCR entry is EffOCR-C Base in the written account. The alternatives are CRNN through EasyOCR, SVTR through PaddleOCR, and TrOCR. The paper describes pretraining on 8,000 synthetic text lines. The architectures start from pretrained checkpoints without OCR customization where their frameworks support such initialization. After the synthetic stage, they are adapted to the real benchmark data at different training fractions.

The train, test, and validation splits are 70%-15%-15%, 50%-25%-25%, 20%-40%-40%, 5%-47.5%-47.5%, and 0%-50%-50%. At the last split the real benchmark contributes no training examples, which is why the authors describe it as zero-shot. This use of zero-shot concerns the real benchmark annotations after synthetic training. In the National Archives test, the term concerns transfer from newspaper training to a new document collection. Both tests withhold examples from the target setting, but they arrive there by different training routes.

The learning curves use an English newspaper benchmark at character level and a horizontal Japanese benchmark. The comparison architectures did not support vertical Japanese in this exercise. At the 5% training split, EffOCR used 99 labeled table cells for Japanese and recorded 5% CER. On the English LoCCA data, it used 21 labeled rows and recorded 7% CER. The authors describe the other architectures’ results at that amount of training data as unusable. They also report that EffOCR performs nearly as well using 20% of the training data as using 70%, and is ahead of the compared alternatives at the larger split.

The experiment supports the view that EffOCR can adapt with fewer real labels in the tested settings. The common synthetic training budget and the changes in benchmark training fractions make the comparison more informative than comparing ready-made systems that have unknown exposure to the target documents. The architectures still differ as complete approaches. The curves therefore measure the practical behavior of those approaches under the described setup. They do not attribute the observed advantage separately to contrastive training, the use of character-sized crops, or the choice of encoder.

The changes in split also change the amounts of data reserved for validation and testing. The paper describes a series of configurations, each with its own allocation of benchmark examples. The reported curves are evidence about performance under those allocations. The small-split results show that the approach can work with a limited annotation budget. They do not imply that a similar budget would work regardless of which documents, character types, and scan conditions are present in the labeled portion.

Restricting examples per character

The vertical Japanese application asks a related question from the perspective of a character class. The authors restrict supervision to one labeled crop, or up to 5 labeled crops, for each character that appears in the training set. According to the paper, those characters account for 77% of all test-set characters. The measurement is character classification error. It probes how well a recognizer distinguishes individual crops when real examples of each trained character are severely limited.

With one labeled crop per character, classification error was 13.4%. With up to 5 labeled crops per character, it was 2.0%. The improvement indicates that multiple labeled appearances of a character are useful even with synthetic training. A single real crop shows the form under one set of local image conditions. Additional examples can expose variations that the encoder needs to treat as instances of the same character. The authors particularly point to the benefit of seeing several real crops of often occurring characters.

The two figures give a more specific account of few-shot learning than the table-cell count alone. The cell-level experiment asks whether a small collection of transcribed regions supports an accurate reading of the documents. The crop-level experiment asks how performance changes when real examples per character are capped. Its coverage statement also matters. Restricting the number of examples for characters seen during training is a different question from testing recognition of every character absent from that set.

The 13.4% and 2.0% results can be compared directly to each other because they measure the same outcome under different limits on labeled crops. The 0.7% CER from the adapted system measures a different outcome under a different training arrangement. Reading the tests together shows both the value of scarce labeled examples and the gains available from supplying more than one real instance of a written unit.

What speed and application comparisons can isolate

The Base and Small throughput entries show how much practical performance can differ within EffOCR. Both use the same general recognition principle. The benchmark measures the selected implementations and configurations together, including their encoders and runtime. It supplies a reason to evaluate the actual configuration intended for a project because the architectural name alone cannot predict its speed. The paper does not give a matched breakdown of how much throughput comes from the encoder, parallel crop recognition, or other implementation choices.

The newspaper and Japanese projects also offer analyses of complete workflows. The newspaper application shows how layout analysis, character training, and bootstrapped word annotations fit into production. The Japanese comparison shows that customization can succeed on material where the tested existing systems perform poorly. Each supports the use of EffOCR in the corresponding setting. The results do not quantify what would have happened if the newspaper pipeline had omitted its word annotation filter or if the same Japanese labels had been used to adapt every engine in the practical comparison.

Several proposed design choices would require different experiments to isolate. The word similarity threshold sets the point where the recognizer falls back to characters. The paper explains its role and tunability, but reports no threshold sweep showing how errors change as it is moved. Likewise, the description of hard negative sampling explains the training workflow without giving a paired result with that stage removed. The controlled evidence in the paper is strongest for annotation quantity and per-character supervision. The remaining comparisons show what complete systems and workflows achieved under stated conditions.

Limitations

Limits identified by the authors

The authors identify substantial illegibility as a limit of visual recognition. When a large part of the document cannot be read from the image, matching crops to visual exemplars gives the recognizer little evidence. A system with linguistic context might be able to infer some of the missing material. The independent recognition of crops reduces sequential computation and training requirements, while leaving the recognizer without that source of evidence. The limiting case is especially relevant for aged or damaged records, where finding the location of a line can be easier than identifying its obscured contents.

Handwriting was outside the package’s support at the time of the paper. The released recognizers covered typewritten English, Japanese, and Polytonic Greek. The authors explain that they began with printed or typewritten material because large public domain collections of that kind were available and of interest to researchers. They describe plans to collect handwriting annotations and to use synthetic handwriting as an analogue to rendering digital fonts, where generators support the relevant scripts. These are proposed extensions. The experiments in the paper establish results for the documents actually evaluated.

The authors also identify a circumstance in which users may prefer a commercial engine. For a well-served language such as English and a project that can afford the charges, Google Cloud Vision may provide better accuracy. The archival line comparison illustrates the point. EffOCR’s advantage in that comparison concerns competitive open-source recognition and deployment considerations, while Google Cloud Vision recorded the lowest CER. The package is designed around the constraints faced by large or difficult collections, and those constraints need not dominate every project.

The ready-to-use catalog likewise has a defined coverage. The option to initialize a recognizer from an image encoder or share a trained component makes it easier to extend the package. It still takes suitable examples and annotations to handle a new collection when its appearance differs enough. The authors present community contributions as a way to widen coverage. That mechanism gives users a route to add support, with the results for such additions depending on the training data and evaluation in each new setting.

Limits visible in the evaluation

The recognition experiments provide limited evidence about document layout in their own right. The archival evaluation starts with selected lines, and the Japanese case evaluates labeled segments from a particular publication. Those tests give a reference transcription for the material being measured. A user working from complete scans also needs to know whether the pipeline finds every region, assigns it the correct place in the reading order, and preserves relationships that matter to the task. The production newspaper run shows how layout can be supplied by a separate component. Its success leaves room for layout to be evaluated separately from OCR accuracy.

The archived line sample gives evidence about transfer across a variety of documents. It does not establish the same error rate for every record group, for full pages, or for material with different writing and scan conditions. A single sampled line from each document gives breadth across documents but little information about variation within them. The paper does not report a breakdown that would show whether errors concentrate in unusually blurry images, particular typefaces, or some other subset. Its observation about TrOCR Small’s difficulty with obscured and blurry text describes what the authors saw, without a separate error estimate for those conditions.

The Japanese result is strong evidence for a custom solution on the evaluated publication. It offers less direct evidence about transferring that solution to a different publisher, time period, or document type. The controlled sample-efficiency comparison uses horizontal Japanese because the alternative architectures could not be included for vertical Japanese. The comparisons thus support two distinguishable findings. The horizontal test measures how approaches learn from reduced annotation in a common setup. The vertical application shows what EffOCR achieved after tailoring it to a collection where existing options were inadequate.

CER summarizes transcription errors across the material used for measurement. It does not identify which errors matter most to a downstream study. A mistake in a firm’s name or a number in a table can have disproportionate consequences even when the surrounding text is correct. The paper motivates OCR in part through this concern about quantitative work, but its headline recognition metrics do not measure the error in any subsequent statistical result. The ability to inspect crops, positions, and transcriptions is useful for checking those details. The resulting accuracy for a particular research task depends on which parts of the transcription that task uses.

The publicized costs likewise answer a defined question. The newspaper figure covers cloud compute and has development costs alongside it. The Google Cloud Vision estimate assumes line inputs and the pricing the authors cite. The comparison is informative for a project in which full-page layout mistakes make line submission the preferred input. It cannot provide a general price comparison independent of service rates, document layout, and preprocessing choices. The CPU benchmark holds a particular hardware setup fixed and shows the behavior of configurations tested there. Other resource allocations can change their relative performance.

Finally, the visual matching design makes the reference index and the crop quality consequential. A weak word match can trigger the character route, but both routes depend on regions the detector supplied and the visual evidence within them. The examples in the paper show that this arrangement can work across different typefaces and can adapt to challenging historical printing. They give no independent measurement of how often detection, retrieval, or final ordering accounts for errors on each collection. The package makes those stages inspectable, while the published aggregate results measure their performance only at the levels described for each experiment.

What came after

The paper documents a direct use of EffOCR in American Stories. The accompanying dataset study examines the quality of the newspaper text, while the EffOCR paper explains how the scans were processed within the project’s compute budget. American Stories used recognition as part of a structured digitization pipeline. Layout analysis supplied page regions, and EffOCR provided the text used to build the dataset. This is an application documented alongside the package, with the evidence for the resulting dataset discussed in its own study.

The paper also records plans to connect EffOCR more directly with Layout Parser and to expand the available recognizers through contributed annotations, including handwriting. The proposed integration would let a common layout workflow invoke EffOCR alongside existing alternatives. The annotation effort was meant to extend the same training procedure to scripts and document conditions beyond the initial catalog. These plans describe the direction the authors set for the package. Subsequent research results from those extensions are undocumented here.

Cite

Cite as Tom Bryan, Jacob Carlson, Abhishek Arora and Melissa Dell. 2023. EfficientOCR: An Extensible, Open-Source Package for Efficiently Digitizing World Knowledge. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: System Demonstrations.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2023.emnlp-demo.52

@inproceedings{bryan2023efficientocr,
  title = {{EfficientOCR: An Extensible, Open-Source Package for Efficiently Digitizing World Knowledge}},
  author = {Tom Bryan, Jacob Carlson, Abhishek Arora and Melissa Dell},
  booktitle = {Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: System Demonstrations},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-demo.52},
  url = {https://doi.org/10.18653/v1/2023.emnlp-demo.52}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bryan-2023-efficientocr-extensible-open-source-package/