Close Menu
    Trending
    • The cozy management sim Discounty arrives on August 21
    • This free to-do list app keeps me organized and sane
    • Call me old-fashioned, but I’ll never ditch my wired headphones
    • Hitman Co-Op Proves World Of Assassination Isn’t Slowing Down Soon
    • A courtroom drama deckbuilder about avenging a murdered river? Why not
    • The 46 Best Movies on Netflix Right Now (June 2025)
    • Ben Stiller May Bring ‘The Twilight Zone’ Back to Movies
    • Make it Home takes interior design on the road
    Tech Trends Today
    • Home
    • Technology
    • Tech News
    • Gadgets & Tech
    • Gaming
    • Curated Tech Deals
    • More
      • Tech Updates
      • 5G Technology
      • Accessories
      • AI Technology
      • eSports
      • Mobile Devices
      • PC Gaming
      • Tech Analysis
      • Wearable Devices
    Tech Trends Today
    Home»AI Technology»Benchmarking OCR APIs on Real-World Documents
    AI Technology

    Benchmarking OCR APIs on Real-World Documents

    GizmoHome CollectiveBy GizmoHome CollectiveMay 25, 2025015 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    With the fast developments in Giant Language Fashions (LLMs) and Imaginative and prescient-Language Fashions (VLMs), many imagine OCR has grow to be out of date. If LLMs can “see” and “learn” paperwork, why not use them straight for textual content extraction?

    The reply lies in reliability. Are you able to all the time be a 100% certain of the veracity of textual content output that LLMs interpret from a doc/picture? We put this to check with a easy experiment. We requested colleagues to make use of any LLM of their option to extract an inventory of passenger names (10) from a pattern PDF flight ticket.

    đź’ˇ

    The outcomes have been fairly fascinating – Claude 3 Opus could not learn the PDF in any respect, Claude 3.5 Sonnet missed one passenger’s identify, the output from ChatGPT o3-mini was utterly made up (100% hallucination), ChatPDF missed half of the passengers on the listing.

    Solely NotebookLM and Deepseek acquired the listing of names utterly proper!

    Whereas LLMs can interpret and summarize paperwork, they lack the precision and structured output required for vital enterprise purposes the place 100% information accuracy is essential. Moreover, LLMs require important computational assets, making them expensive and impractical for large-scale doc processing, particularly in enterprise and edge deployments.

    OCR, alternatively, is optimized for effectivity, working on low-power gadgets whereas delivering constant outcomes. When accuracy is non-negotiable whether or not in monetary data, authorized contracts, or regulatory compliance, OCR stays probably the most reliable resolution.

    In contrast to LLMs, OCR APIs present confidence scores and bounding containers, permitting builders to detect uncertainties in extracted textual content. This stage of management is essential for companies that can’t afford incorrect or hallucinated information. That’s why OCR APIs proceed to be broadly utilized in doc automation workflows, AI-driven information extraction, and enterprise purposes.

    To evaluate the state of OCR in 2025, we benchmarked 9 of the most well-liked OCR APIs, protecting industrial options, open-source OCR engines, and doc processing frameworks. Our purpose is to offer an goal, data-driven comparability that helps builders and enterprises select the very best software for his or her wants.


    Methodology

    Dataset Choice:

    To make sure a complete analysis of OCR APIs or OCR fashions in real-world situations, we chosen datasets that embody a various vary of doc varieties and challenges generally encountered in sensible purposes. Our dataset selections embody:

    • Frequent Enterprise Paperwork: Varieties, invoices, and monetary statements containing structured textual content.
    • Receipts: Printed transaction slips with various fonts, noise, and light textual content.
    • Low-Decision Photos: Paperwork captured below suboptimal situations, mimicking real-world scanning and images limitations.
    • Handwritten Textual content: Samples with totally different handwriting types to check handwriting recognition capabilities.
    • Blurred or Distorted Textual content: Photos with movement blur or compression artifacts to evaluate OCR robustness.
    • Rotated or Skewed Textual content: Paperwork scanned or photographed at an angle, requiring superior textual content alignment dealing with.
    • Tabular Information: Paperwork containing structured tabular info, difficult for OCR fashions to protect format integrity.
    • Dense Textual content: Textual content-heavy paperwork, resembling account opening kinds, to guage efficiency in high-content areas.

    To make sure our benchmark covers all these real-world challenges, we choose the next datasets:

    1. STROIE (link to dataset)
    1. FUNSD (link to dataset)

    These datasets present a complete testbed for evaluating OCR efficiency throughout sensible and actual life situations.

    Fashions Choice

    To guage OCR efficiency throughout totally different situations, we embody a mixture of industrial APIs, open-source OCR fashions, and doc processing frameworks. This ensures a balanced comparability between proprietary options and freely obtainable alternate options. The fashions utilized in our benchmark are:

    • In style Business OCR APIs:
      • Google Cloud Imaginative and prescient AI
      • Azure AI Doc Intelligence
      • Amazon Textract
    • In style Open-Supply OCR APIs:
      • Surya
      • PaddleOCR
      • RapidOCR
      • Extractous
    • In style Open-Supply Doc Processing Frameworks:

    To display how every OCR API processes a picture, we offer code snippets for working OCR utilizing each industrial APIs and open-source frameworks. These examples present easy methods to load a picture, apply OCR, and extract the textual content, providing a sensible information for implementation and comparability. Under are the code snippets for every mannequin:

    1. Google Cloud Imaginative and prescient AI: First step is to arrange a brand new Google Cloud Mission. Within the Google Cloud Console, navigate to APIs & Companies → Library, seek for Imaginative and prescient API, and click on Allow. Go to APIs & Companies → Credentials, click on Create Credentials → Service Account, identify it (e.g., vision-ocr-service), and click on Create & Proceed. Assign the Proprietor (or Editor) function and click on Executed. Now, in Service Accounts, choose the account, go to Keys → Add Key → Create New Key, select JSON, and obtain the .json file.

    Required Packages:

    pip set up google-cloud-vision
    
    from google.cloud import imaginative and prescient
    from google.oauth2 import service_account
    
    credentials = service_account.Credentials.from_service_account_file("/content material/ocr-nanonets-cea4ddeb1dd2.json") #path to the json file downloaded
    
    shopper = imaginative and prescient.ImageAnnotatorClient(credentials=credentials)
    
    def detect_text(image_path):
       """Detects textual content in a picture utilizing Google Cloud Imaginative and prescient AI."""
       with open(image_path, 'rb') as image_file:
           content material = image_file.learn()
    
       picture = imaginative and prescient.Picture(content material=content material)
       response = shopper.text_detection(picture=picture)
      
       texts = response.text_annotations
    
       if texts:
           return texts[0].description
       else:
           return "No textual content detected."
    
       if response.error.message:
           elevate Exception(f"Error: {response.error.message}")
    
    # Substitute along with your picture path
    image_path = "/content material/drive/MyDrive/OCR_datasets/STROIE/test_data/img/X00016469670.jpg"
    print(detect_text(image_path))
    
    1. Azure AI Doc Intelligence: Create an Azure Account (Azure Portal) to get $200 free credit for 30 days. Within the Azure Portal, go to Create a Useful resource, seek for Azure AI Doc Intelligence (Kind Recognizer), and click on Create. Select a Subscription, Useful resource Group, Area (nearest to you), set Pricing Tier to Free (if obtainable) or Commonplace, then click on Evaluate + Create → Create. As soon as created, go to the Azure AI Doc Intelligence useful resource, navigate to Keys and Endpoint, and replica the API Key and Endpoint.

    Required Packages:

    pip set up azure-ai-documentintelligence
    
    from azure.ai.documentintelligence import DocumentIntelligenceClient
    from azure.core.credentials import AzureKeyCredential
    import io
    # Substitute along with your Azure endpoint and API key
    AZURE_ENDPOINT = "https://your-region.api.cognitive.microsoft.com/"
    AZURE_KEY = "your-api-key"
    
    shopper = DocumentIntelligenceClient(AZURE_ENDPOINT, AzureKeyCredential(AZURE_KEY))
    def extract_text(image_path):
       """Extracts textual content from a picture utilizing Azure AI Doc Intelligence."""
       with open(image_path, "rb") as image_file:
           image_data = image_file.learn()
           
       poller = shopper.begin_analyze_document("prebuilt-read", doc=image_data)
       
       outcome = poller.outcome()
       extracted_text = []
       for web page in outcome.pages:
           for line in web page.strains:
               extracted_text.append(line.content material)
    
       print("Detected textual content:")
       print("n".be a part of(extracted_text))
       
    image_path = image_path
    extract_text(image_path)
    
    
    1. Amazon Textract: Create an AWS Account (AWS Sign-Up) to entry Amazon Textract’s free-tier (1,000 pages/month for 3 months). Within the AWS Administration Console, go to IAM (Id & Entry Administration) → Customers → Create Person, identify it (e.g., textract-user), and choose Programmatic Entry. Beneath Permissions, connect AmazonTextractFullAccess and AmazonS3ReadOnlyAccess (if utilizing S3). Click on Create Person and replica the Entry Key ID and Secret Entry Key.

    Required Packages:

    pip set up boto3
    

    Set Surroundings Variables:

    export AWS_ACCESS_KEY_ID="your-access-key"
    export AWS_SECRET_ACCESS_KEY="your-secret-key"
    export AWS_REGION="your-region"
    
    import boto3
    textract = boto3.shopper("textract", region_name="us-east-1")
    
    def extract_text(image_path):
       """Extracts textual content from a picture utilizing Amazon Textract."""
       with open(image_path, "rb") as image_file:
           image_bytes = image_file.learn()
    
       response = textract.detect_document_text(Doc={"Bytes": image_bytes})
       extracted_text = []
       for merchandise in response["Blocks"]:
           if merchandise["BlockType"] == "LINE":
               extracted_text.append(merchandise["Text"])
       print("Detected textual content:")
       print("n".be a part of(extracted_text))
       
    image_path = image_path
    extract_text(image_path)
    
    
    1. Surya :  Use pip set up surya-ocr to obtain the required packages. Then create a python file with the next code and run it in terminal.
    from PIL import Picture
    from surya.recognition import RecognitionPredictor
    from surya.detection import DetectionPredictor
    
    picture = Picture.open(image_path)
    langs = ["en"]
    
    recognition_predictor = RecognitionPredictor()
    detection_predictor = DetectionPredictor()
    
    predictions = recognition_predictor([image], [langs], detection_predictor)
    
    
    1. PaddleOCR : Use “pip set up paddleocr paddlepaddle” to put in the required packages. Then create a python file with the next code and run it in terminal.
    from paddleocr import PaddleOCR
    
    ocr = PaddleOCR(use_angle_cls=True, lang="en")
    
    outcome = ocr.ocr(image_path, cls=True)
    
    1. RapidOCR : Use “pip set up rapidocr_onnxruntime” to put in the required packages. Then create a python file with the next code and run it in terminal.
    from rapidocr_onnxruntime import RapidOCR
    
    engine = RapidOCR()
    
    img_path = image_path
    outcome, elapse = engine(img_path)
    
    
    1. Extractous: Use “sudo apt set up tesseract-ocr tesseract-ocr-deu” to put in the required packages. Then create a python file with the next code and run it in terminal.
    from extractous import Extractor, TesseractOcrConfig
    extractor = Extractor().set_ocr_config(TesseractOcrConfig().set_language("en"))
    
    outcome, metadata = extractor.extract_file_to_string(image_path)
    
    print(outcome)
    
    1. Marker: Use “pip set up marker-pdf” to put in the required packages. Then in terminal use the next code.
    !marker_single image_path --output_dir saving_directory --output_format json
    
    
    1. Unstructured-IO: Use “pip set up “unstructured[image]”” to put in the required packages. Then create a python file with the next code and run it in terminal.
    from unstructured.partition.auto import partition
    
    parts = partition(filename=image_path)
    
    print("nn".be a part of([str(el) for el in elements]))
    

    Analysis Metrics

    To evaluate the effectiveness of every OCR mannequin, we consider each accuracy and efficiency utilizing the next metrics:

    • Character Error Fee (CER): Measures the ratio of incorrect characters (insertions, deletions, and substitutions) to the entire characters within the floor fact textual content. Decrease CER signifies higher accuracy.
    • Phrase Error Fee (WER): Much like CER however operates on the phrase stage, calculating errors relative to the entire variety of phrases. It helps assess how effectively fashions acknowledge full phrases.
    • ROUGE Rating: A textual content similarity metric that compares OCR output with the bottom fact primarily based on overlapping n-grams, capturing each precision and recall.

    For efficiency analysis, we measure:

    • Inference Time (Latency per Picture): The time taken by every mannequin to course of a single picture, indicating velocity and effectivity in real-world purposes.

    Value Analysis:

    • For industrial OCR APIs, value is decided by their pricing fashions, usually primarily based on the variety of processed pages or pictures. 
    • For open-source OCR APIs, whereas there aren’t any direct utilization prices, we assess computational overhead by measuring reminiscence utilization throughout inference.

    Benchmarking Outcomes

    For the reason that datasets used—STROIE (totally different receipt pictures) and FUNSD (enterprise paperwork with tabular layouts)—comprise various format types, the extracted textual content varies throughout fashions primarily based on their capability to protect construction. This variation impacts the Phrase Error Fee (WER) and Character Error Fee (CER), as these metrics rely on the place of phrases and characters within the output.

    A excessive error price signifies {that a} mannequin struggles to keep up the chronological order of textual content, particularly in advanced layouts and tabular codecs.

    1. Phrase Error Fee

    WER of every mannequin on the FUNSD and STROIE datasets is offered under. These outcomes spotlight how effectively every mannequin preserves phrase order throughout totally different doc layouts.

    Phrase Error Fee on the FUNSD dataset
    Phrase Error Fee on the STROIE dataset

    2. Character Error Fee

    CER of every mannequin on the FUNSD and STROIE datasets is offered under. These outcomes point out how precisely every mannequin captures character-level textual content whereas dealing with totally different doc layouts.

    Character Error Fee on the FUNSD dataset
    Character Error Fee on the STROIE dataset

    Why are the WER and CER metrics for Surya and Marker so excessive on the STROIE dataset?

    STROIE’s intricate layouts make OCR tough. Surya tries to fill gaps by inserting additional phrases, resulting in excessive WER and CER, even after post-processing. Marker, which makes use of Surya for OCR and outputs markdown textual content, inherits these points. The markdown formatting additional misaligns textual content, worsening the error charges.

    Variation in Mannequin Efficiency Throughout Datasets

    OCR fashions carry out in a different way primarily based on dataset construction. Google Cloud Imaginative and prescient AI and Azure AI Doc Intelligence deal with various layouts higher, whereas open-source fashions like RapidOCR and Surya wrestle with structured codecs, resulting in extra errors.

    For the reason that fashions wrestle to protect layouts, resulting in excessive WER and CER, we use one other metric—ROUGE Rating—to evaluate textual content similarity between the mannequin’s output and the bottom fact. In contrast to WER and CER, ROUGE focuses on content material similarity moderately than phrase place. Because of this no matter format preservation, a excessive ROUGE rating signifies that the extracted textual content intently matches the reference, whereas a low rating suggests important content material discrepancies.

    3. ROUGE Rating

    ROUGE Rating of every mannequin on the FUNSD and STROIE datasets is offered under. These outcomes mirror the content material similarity between the extracted textual content and the bottom fact, no matter format preservation.

    ROUGE Rating on the FUNSD dataset
    ROUGE Rating on the STROIE dataset

    The ROUGE scores reveal that Google Cloud Imaginative and prescient AI persistently outperforms different fashions throughout each FUNSD (75.0%) and STROIE (87.8%), indicating superior textual content extraction. Surya and Marker, which depend on the identical backend, present comparable efficiency, although Marker barely lags on STROIE (70.3%). Extractous and Unstructured-IO rating the bottom in each datasets, suggesting weaker textual content coherence. PaddleOCR and Azure AI Doc Intelligence obtain balanced outcomes, making them aggressive alternate options. The general pattern highlights the power of economic APIs, whereas open-source fashions exhibit blended efficiency.

    đź’ˇ

    For those who’d wish to run the fashions your self and compute the analysis scores, you should use this GitHub repository. The repository contains scripts for working OCR APIs on the datasets, calculating WER, CER, and ROUGE scores.

    4. Latency per picture

    Latency per picture for every mannequin is offered under. This measures the time taken by every mannequin to carry out OCR on one picture, offering insights into their effectivity and processing velocity.

    Latency per picture or Inference time per picture

    The latency evaluation exhibits that Google Cloud Imaginative and prescient AI, Amazon Textract, and Extractous preserve a great steadiness between velocity and accuracy. Surya and Paddle OCR exhibit notably increased inference occasions, suggesting potential inefficiencies. Open-source fashions like Speedy OCR and Marker differ in efficiency, with some providing aggressive speeds whereas others lag behind. Azure AI Doc Intelligence additionally exhibits reasonable latency, making it a viable alternative relying on the use case.

    5. Value or reminiscence utilization per picture

    For industrial APIs, we current the utilization value (value per 1000 pictures processed). For open-source fashions, the metric signifies reminiscence consumption as a proxy for value, offering insights into their useful resource effectivity.

    OCR API Value per 1,000 Pages
    Google Cloud Imaginative and prescient AI $1.50
    Amazon Textract $1.50
    Azure AI Doc Intelligence $0.50

    Reminiscence utilization per picture

    Amongst open-source fashions, Marker and Unstructured-IO have considerably increased reminiscence consumption, which can impression deployment in resource-constrained environments. Surya and Extractous strike a steadiness between efficiency and reminiscence effectivity. PaddleOCR and RapidOCR are probably the most light-weight choices, making them supreme for low-memory situations.

    Conclusion

    Based mostly on the analysis throughout latency, inference time, and ROUGE rating, no single mannequin dominates in all points. Nevertheless, some fashions stand out in particular areas:

    • Finest Latency & Inference Time: Extractous and Amazon Textract display the quickest response occasions, making them supreme for real-time purposes.
    • Finest ROUGE Rating (Accuracy): Google Cloud Imaginative and prescient AI and Azure AI Doc Intelligence obtain the best accuracy in textual content recognition, making them sturdy candidates for purposes requiring exact OCR.
    • Finest Reminiscence Effectivity: RapidOCR and PaddleOCR devour the least reminiscence, making them extremely appropriate for low-resource environments.

    Finest Mannequin General

    Contemplating a steadiness between accuracy, velocity, and effectivity, Google Cloud Imaginative and prescient AI emerges as the very best total performer. It supplies sturdy accuracy with aggressive inference time. Nevertheless, for open sourced fashions, PaddleOCR and RapidOCR provide the very best trade-off between accuracy, velocity and reminiscence effectivity.

    Leaderboard of Finest OCR APIs primarily based on totally different efficiency metrics:

    Metric Finest Mannequin Rating / Worth
    Highest Accuracy (ROUGE Rating) Google Cloud Imaginative and prescient AI Finest ROUGE Rating
    Finest Format Dealing with (Least WER & CER) Google Cloud Imaginative and prescient AI Lowest WER & CER
    Quickest OCR (Lowest Latency) Extractous Lowest Processing Time
    Reminiscence Environment friendly RapidOCR Least Reminiscence Utilization
    Most Value-Efficient amongst Business APIs Azure AI Doc Intelligence Lowest Value Per Web page

    LLM vs. Devoted OCR: A Case Research

    To know how OCR fashions evaluate to Giant Language Fashions (LLMs) in textual content extraction, we examined a difficult picture utilizing each LLaMa 3.2 11B Vision  and RapidOCR, a small however devoted OCR mannequin.

    Outcomes:

    1. LLaMa 3.2 11B Imaginative and prescient
      • Struggled with faint textual content, failing to reconstruct sure phrases.
      • Misinterpreted some characters and added hallucinated phrases.
      • Took considerably longer to course of the picture.
      • Used a whole lot of compute assets.
    2. RapidOCR
      • Precisely extracted a lot of the textual content regardless of the tough situations.
      • Ran effectively on very low compute assets.

    Is OCR Nonetheless Related At present?

    With the rise of multimodal LLMs able to deciphering pictures and textual content, some imagine OCR could grow to be out of date. Nevertheless, the fact is extra nuanced.

    For those who or your finish prospects have to be 100% certain of information you are extracting from paperwork or pictures, OCR nonetheless is your finest wager for now! Confidence scores and bounding containers from OCR APIs can be utilized to deduce when the output will not be dependable.

    With LLMs you’ll be able to by no means be 100% certain of the veracity of the textual content output due to hallucinations and the insecurity scores.

    Who Nonetheless Wants OCR?

    • Enterprises Dealing with Excessive-Quantity Paperwork: Banks, authorized companies, and insurance coverage corporations depend on OCR for automated doc processing at scale.
    • Governments and Compliance: Passport scanning, tax data, and regulatory filings nonetheless require OCR for structured extraction.
    • AI-Powered Information Pipelines: Many companies combine OCR with NLP pipelines to transform paperwork into structured information earlier than making use of AI fashions.
    • Multilingual and Low-Useful resource Language Purposes: OCR stays important for digitizing uncommon scripts the place LLMs lack coaching information.

    Why Ought to Enterprises Nonetheless Care About OCR When Everybody Needs LLMs?

    1. Accuracy and Reliability: LLMs generate hallucinations, whereas OCR ensures exact textual content extraction, making it vital for authorized, monetary, and authorities purposes.
    2. Velocity and Value Effectivity: OCR is light-weight and works on edge gadgets, whereas LLMs require excessive compute assets and cloud inference prices.
    3. The longer term will not be OCR vs. LLMs—it’s OCR and LLMs: OCR can extract clear textual content, and LLMs can then course of and interpret it for insights. AI-powered OCR fashions will proceed to enhance, integrating LLM reasoning for higher post-processing.

    Remaining Ideas

    Whereas LLMs have expanded the probabilities of textual content extraction from pictures, OCR stays indispensable for structured, high-accuracy textual content retrieval and can all the time be essential for dependable doc processing. Reasonably than changing OCR, LLMs will complement it, bringing higher understanding, context, and automation to extracted information.



    Source link

    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    GizmoHome Collective

    Related Posts

    Manus has kick-started an AI agent boom in China

    June 5, 2025

    What’s next for AI and math

    June 4, 2025

    Inside the tedious effort to tally AI’s energy appetite

    June 3, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    Best Buy Offers HP 14-Inch Chromebook for Almost Free for Memorial Day, Nowhere to be Found on Amazon

    May 22, 2025

    The Best Sleeping Pads For Campgrounds—Our Comfiest Picks (2025)

    May 22, 2025

    Time has a new look: HUAWEI WATCH 5 debuts with exclusive watch face campaign

    May 22, 2025
    Latest Posts
    Categories
    • 5G Technology
    • Accessories
    • AI Technology
    • eSports
    • Gadgets & Tech
    • Gaming
    • Mobile Devices
    • PC Gaming
    • Tech Analysis
    • Tech News
    • Tech Updates
    • Technology
    • Wearable Devices
    Most Popular

    Best Buy Offers HP 14-Inch Chromebook for Almost Free for Memorial Day, Nowhere to be Found on Amazon

    May 22, 2025

    The Best Sleeping Pads For Campgrounds—Our Comfiest Picks (2025)

    May 22, 2025

    Time has a new look: HUAWEI WATCH 5 debuts with exclusive watch face campaign

    May 22, 2025
    Our Picks

    How to trace a picture’s origin with reverse image search

    June 6, 2025

    EA, fresh from killing a big Marvel game, reassures fans it still has three other Marvel projects it could kill in the future

    May 30, 2025

    Entering a New Era of Modeling and Simulation

    May 28, 2025
    Categories
    • 5G Technology
    • Accessories
    • AI Technology
    • eSports
    • Gadgets & Tech
    • Gaming
    • Mobile Devices
    • PC Gaming
    • Tech Analysis
    • Tech News
    • Tech Updates
    • Technology
    • Wearable Devices
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us
    • Curated Tech Deals
    Copyright © 2025 Gizmohome.co All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.