Automate your workflow with Nanonets
schedule a demo Get Started

Optical Character Recognition (OCR) is a technology that can interpret and recognize text from images and scanned documents. It is often used in conjunction with scanning and digitizing documents.

OCR converts any kind of text or information stored in digital documents into machine-readable data. Hard copies and paper documents can thus be converted into computer-readable file formats, suitable for further editing or data processing.

OCR coupled with AI can even be used to implement advanced methods of intelligent character recognition (ICR), like identifying languages or styles of handwriting.

OCR in all its forms can help save time, reduce errors, and lower costs by eliminating manual data entry.

This article will take a brief look at the history of optical character recognition (OCR), explain how it works, explore some use cases and examine benefits.


Have an OCR problem in mind? Want to extract text or data from documents? Head over to Nanonets and build free online OCR models!


A brief history of OCR

In the early 1970s, Ray Kurzweil founded Kurzweil Computer Products, Inc., whose OCR product could recognize text printed in any font.

He quickly realized that the best application for this technology would be a  text-to-speech reading machine for the visually challenged. In 1980, Xerox snapped up Kurzweil’s company; a clear sign of the commercial viability of OCR.

Later, in the 1990s, OCR was extensively used to digitize historical newspapers and legal documents. Today OCR products are available online and as APIs that can integrate seamlessly with other applications - e.g. Tesseract OCR and Google Vision.

Over the years, OCR has been increasingly adopted in many document-processing workflows that previously depended on manual data entry. OCR is used to extract data from all types of business documents and send it to other business applications for further processing.

How does OCR work?

The first step with OCR involves converting the physical document into a digital image using a scanner or similar hardware.

The OCR process then involves the following stages:

Image Pre-Processing

The purpose of this stage is to create a precise representation of the document while also removing any unwanted constraints. Pre-processing techniques include:

  • Fixing alignment issues during the scanning process by deskewing or tilting the scanned document.
  • Despeckling – a process to remove spots or smooth the edges of images. This would improve the overall quality of digital images.
  • Removing noise from the image and cleaning up boxes and lines in the image.


After the images are converted into a digital format, they are transformed to a black-and-white rendition, evaluated for bright vs. dark regions (characters). This will let OCR analyze the scanned image and classify the light areas as background and the dark areas as text.

Text recognition

In the second step, the pre-processed image uses different text recognition algorithms like pattern recognition or feature recognition.

​​

  • Pattern recognition algorithms are based on the assumption that each character has a unique shape and can be identified by its distinctive features. These algorithms find the best match for each character in a database of character shapes. However, this method may fail if there are variations in font size or spacing between characters.
  • Feature recognition algorithms look for specific features in an image to determine what is being scanned. This method works well with non-standard fonts and handwritten characters.

Post-Processing

The post-processing step involves techniques & algorithms to improve the accuracy of the extracted data by first detecting and then fixing errors. This requires comparing the extracted text/data against a standard lexicon or vocabulary and taking into account logical, grammatical, and contextual considerations.

In the final step, OCR converts scanned text into a digitized file.


Have an OCR problem in mind? Want to extract text or data from documents? Head over to Nanonets and build free online OCR models!


Different types of OCR

There are several types of OCR:

  1. Intelligent word recognition software converts scanned images into text that can be edited on a computer. When you scan a piece of paper, the software will read the words and translate them into editable digital text.
  2. Intelligent character recognition software uses machine learning algorithms to interpret characters within an image. This type of OCR doesn't rely on human-readable text but instead identifies individual characters within an image and translates them into text that can be edited on a computer.
  3. Optical Word Recognition targets typewritten text wordwise and is sometimes referred to as OCR
  4. Optical mark recognition (OMR) is a technology that can be used to read marks on paper, such as barcodes and OCR characters.

Optical character recognition use-cases

OCR has been mostly used for converting physical documents into machine-readable or searchable formats that can then be edited on word processors.

But apart from this, OCR is also widely used for the following use cases:

Accounting & Finance

Invoices and other financial documents are integral to any business transaction and must be processed quickly and accurately. OCR helps automate this process by converting images of financial documents into text that can be easily verified. The extracted text can then be used to perform tasks like book-keeping, AP automation, invoice auditing or further processing.

Banking

Banks need to verify multiple types of documents before approving loans. OCR can be used to scan these documents quickly and efficiently. Banks also use OCR to convert loan documents into digital formats to be stored electronically and shared among departments.

This helps streamline the loan application process by allowing employees from different departments to work on the same document simultaneously instead of waiting for paper copies to be delivered back and forth between departments.

OCR also helps banks comply with KYC regulations by making it possible for employees to quickly identify people based on their photos or other identifying information

Healthcare

The healthcare industry has a lot of paperwork that must be processed quickly and accurately. The same goes for insurance companies that need to process health insurance claims, clinical laboratories that need to report results, and pharmacies that need to track prescriptions.

OCR can help these organizations reduce their costs by automating manual workflows. As more patients are treated in an outpatient setting rather than an inpatient one, it’s essential that their records are easily accessible at all times — whether they are at home or in the office.

OCR allows you to scan patient files into your EHR system anytime without manually keying in each field.

Big Data Modelling

One of the most important aspects of big-data modeling is the ability to handle data that's not in a traditional, structured format. In many cases, this will mean unstructured or semi-structured data that's in a variety of different formats and languages.

And this is where optical character recognition (OCR) comes in. By using OCR, you can take documents that have been scanned into your database and turn them into a form that can be accessed by your model. This can be done either automatically or manually, depending on the type of document you're trying to convert.

Once you've done this conversion, it's easier for your model to understand what it's looking at because it has been converted into something more easily parseable by computers.

Logistics

Logistics companies deal with large amounts of data every day. OCR allows logistics workflows to automatically recognize and store information from millions of documents per day.

Examples include,

  • Managing inventory by scanning barcodes on items and automatically recording the information in your system
  • Automatically read shipping labels and send the data to your system, so you don't have to enter it manually.
  • Using machine learning after OCR to predict what types of products a customer might want the next time they place an order.

Benefits of OCR

With the help of deep learning, optical character recognition (OCR) has seen a huge leap in benefits over the last few years. Here are some of the key benefits that businesses can obtain by automating internal workflows with OCR:

Improved Accuracy

With deep learning, OCR programs can now read 97% of text correctly regardless of font type or size. This advancement is thanks to deep learning's ability to identify patterns in data, which has allowed OCR software to recognize common patterns like lowercase letters and even numbers.

In addition to understanding more complex shapes than previous systems could, deep learning also allows OCR programs to recognize images from different angles and lighting conditions.

Extracts from Complex Documents

One more complex problem that OCR has solved with Deep learning is the ability to extract data from unstructured documents. This type of data has been challenging to process and analyze, as they are usually not in a tabular format. There were limited ways of extracting information from these unstructured documents.

However, by using deep learning models that can be trained on large datasets containing thousands of images containing text and their corresponding labels, it is possible to train a model that can recognize patterns within the image and extract the relevant information from it.

Information Extraction with OCR and CNN's Models on Nanonets

Using Natural Language

One of the biggest challenges in OCR is the ability to recognize and understand the text. Named entity recognition (NER), a machine learning technique, is a powerful tool that can help improve accuracy by recognizing specific types of information, such as names, locations, dates, and monetary values.

These entities are then used to help the OCR software make more accurate contextual guesses about what words might be in the text.

NER recognition entities for accurate OCR extraction

Prevention of Fraud

With deep learning, you can detect text patterns that are difficult for humans to see. This means that if there is a pattern in a document that suggests fraud—like if someone has been altering the date on their driver's license—the neural network will pick up on it and flag it.

How can Nanonets help with OCR?

Nanonets is an AI-based OCR software that automates cognitive capture for intelligent document processing of invoices, receipts, ID cards, and other documents.

Nanonets uses advanced OCR, machine learning, and deep learning techniques to extract relevant information from unstructured data.

It is fast, accurate, and easy to use, allows users to build custom OCR models from scratch, and has some neat Zapier integrations. Digitize documents, extract data fields, and integrate with your everyday apps via APIs in a simple, intuitive interface.


Here’s why you should use Nanonets as a data parser:

  • Pre-processing: If your documents are poorly scanned or in various formats, you need not worry about preprocessing them. Nanonets automatically process documents based on alignments, fonts, and image quality.
  • Post Processing: You can always post-process on outputs and export the data into desired formats such as CSV, Excel Sheets, and Google Sheets.
  • Automation: If you are working with loads of data, Nanonets has pre-installed installations using Zapier, UiPath, etc.



Update Nov 2022: this post was originally published in April 2021 and has since been updated.

Here's a slide summarizing the findings in this article. Here's an alternate version of this post.