Guide for OCR Modes Available with Private AI DEID Container

info

This guide is relevant for container users only

This guide outlines the different Optical Character Recognition (OCR) modes available for processing documents and images. Each mode has its unique application, depending on the document's nature and the specific requirements for text extraction.

Table of contents:

Standard OCR

Attribute Rating
Accuracy Medium
Speed High
Cost Low

Standard OCR is built into the container and is the default OCR engine. It's designed for high-performance text recognition in images and digital documents, focusing on efficiency and accuracy for standard printed text.

The control flow for Standard OCR mode is depicted in the following flow chart:

OCR
No
Yes
Standard OCR
Process File
Is Image?
Extract Image
Text Deid
Create Redacted Image
Create Redacted File

When to choose Standard OCR?

  • Most cost efficient OCR solution is needed.

Azure OCR

Attribute Rating
Accuracy High
Speed High
Cost Medium

Azure OCR uses Microsoft's Computer Vision API to analyze and extract text from a wide range of document types. It's particularly effective for complex documents, including those with handwriting, images, and various fonts, layouts and rotations.

Set PAI_OCR_SYSTEM=azure environment variable at container startup to use this OCR mode. Check out our Guide for Integrating Private AI DEID container with Azure OCR for setup information.

The control flow for Azure OCR mode is depicted in the following flow chart:

OCR
No
Yes
Azure OCR
Process File
Is Image?
Extract Image
Text Deid
Create Redacted Image
Create Redacted File

When to choose Azure OCR?

  • Handwriting support is needed.
  • Rotated document support is needed.
  • Enhanced language support is needed.

Hybrid OCR

Attribute Rating
Accuracy Medium
Speed High
Cost Medium

The Hybrid OCR mode combines Azure OCR and Standard OCR to optimize text extraction and the cost for PDF documents. This mode uses Azure OCR for pages containing graphics and switches to Standard OCR for other pages. The choice between OCR modes is made on a page by page basis.

The setup of OCR in hybrid mode is the same as Azure mode, just follow our Guide for Integrating Private AI DEID container with Azure OCR & use PAI_OCR_SYSTEM=hybrid environment variable instead of PAI_OCR_SYSTEM=azure.

The control flow for Hybrid OCR mode is depicted in the following flow chart:

OCR
Yes
No
Yes
No
Standard OCR
Azure OCR
Process File
File is a PDF
Render Pages
Image present in the page
Text Deid
Create Redacted Image

When to choose Hybrid OCR?

  • Need a mix of performance and cost effectiveness.
  • Need to process mainly PDFs. For other document types the Hybrid OCR will work just like the Standard OCR.
© Copyright 2024 Private AI.