# US 2021/0343030 A1 · Scalable, flexible and robust template-based data extraction pipeline

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0343030 A1
- Document ID: US20210343030A1
- Status: Published application
- Kind: A1
- Application number: 17/243,467
- Filed: 2021-04-28
- Published: 2021-11-04
- Earliest claimed: 2020-04-29
- Assignees: Onfido Ltd
- Applicants: Onfido Ltd
- Inventors: Christos Sagonas; Karolina Dabkowska; Zhiyuan Shi; Edward Fleri Soler; Mohan Mahadevan; Iona Grace Vincent; Luca Peric; Alessandro Lenzi; Alvaro Fernando Lara; James Stonehill
- Web page: https://patentgrep.com/patent/US20210343030A1

## CPC

- G06V 30/40: Document-oriented image-based pattern recognition
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/24: Classification techniques
- G06T 3/40: Scaling of whole images or parts thereof, e.g. expanding or contracting
- G06T 7/11: Region-based segmentation
- G06T 7/136: involving thresholding
- G06T 7/30: Determination of transform parameters for the alignment of images, i.e. image registration
- G06T 7/70: Determining position or orientation of objects or cameras (camera calibration G06T7/80)
- G06V 10/22: by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
- G06V 10/7515: {Shifting the patterns to accommodate for positional errors}
- G06V 30/414: Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
- G06T 2207/20132: Image cropping
- G06T 2207/30176: Document
- G06V 30/10: Character recognition
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

A computer-implemented method for extracting information from a document, for example an official document, is disclosed. The method comprises acquiring an input image comprising a document portion; performing image segmentation on the input image to form a binary input image that distinguishes the document portion from the remaining portion of the input image; estimating a first image transform to align the binary input image to a binary template image, using the first image transform on the input image to form an intermediate image; estimating a second image transform to align the intermediate image to a template image; using the second image transform on the intermediate image to form an output image; and extracting a field from the output image using a predetermined field of the template image.

## Claims

### Claim 1

A computer-implemented method for extracting data from a document comprising:
acquiring an input image comprising a document portion, the document portion being of a document of a first document type;
performing image segmentation on the input image to form a binary input image that distinguishes the document portion from the remaining portion of the input image;
estimating a first image transform to align the binary input image to a binary template image;
using the first image transform on the input image to form an intermediate image;
estimating a second image transform to align the intermediate image to a template image, the template image comprising a template document portion, the template document portion being of a different document of the first document type;
using the second image transform on the intermediate image to form an output image; and
extracting a field from the output image using a predetermined field of the template image.

### Claim 2 (depends on 1)

The method of claim 1, wherein estimating the first image transform, using the first image transform, estimating the second image transform, and using the second image transform do not use a deep learning-based model.

### Claim 3 (depends on 1)

The method of claim 1, wherein the template document portion has predetermined coordinates in the template image, the method further comprising:
after using the first image transform and prior to estimating the second image transform, cropping the intermediate image using the predetermined coordinates; and
cropping the template image using the predetermined coordinates.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
after using the first image transform and prior to estimating the second image transform, reducing the size of the intermediate image and the template image using a resize operator; and
after estimating the second image transform and prior to using the second image transform, applying a transverse of the resize operator to the second image transform.

### Claim 5 (depends on 1)

The method of claim 1, wherein the binary input image is a binary segmentation mask of the same size as the input image that represents the document portion with a pixel value of 255 and the remaining portion with a pixel value of 0, and the binary template image is a binary segmentation mask of the same size as the template image that represents the template document portion with a pixel value of 255 and the remaining portion with a pixel value of 0.

### Claim 6 (depends on 1)

The method of claim 1, wherein the predetermined field has predetermined coordinates within the template image, and extracting the field comprises using the predetermined coordinates.

### Claim 7 (depends on 1)

The method of claim 1, wherein the field is a text field, the method further comprising cropping the text field so that the text field fits the text contained therein and performing optical character recognition on the text field to extract text from the document.

### Claim 8 (depends on 7)

The method of claim 7, wherein the optical character recognition (OCR) is performed using a deep learning-based OCR model, the method further comprising generating training images to train the deep learning-based OCR model.

### Claim 9 (depends on 1)

The method of claim 1, wherein the first image transform comprises a plurality of first image transforms, each of the plurality of first image transforms configured to align a different sub-frame of the binary input image to the binary template image.

### Claim 10 (depends on 1)

The method of claim 1, wherein the second image transform comprises a plurality of second image transforms, each of the plurality of second image transforms configured to align a different sub-frame of the intermediate input image to the template image.

### Claim 11 (depends on 1)

The method of claim 1, further comprising, prior to performing image segmentation, pre-processing the input image by determining document location within the input image and estimating the pose of the document within the input image.

### Claim 12 (depends on 1)

The method of claim 1, further comprising, prior to performing image segmentation, classifying the document of the input image as the first document type, and retrieving the template image and the binary template image of the first document type from a database.

### Claim 13 (depends on 1)

The method of claim 1, further comprising:
acquiring a second input image comprising a document portion, the document portion being of a document of a second document type;
performing image segmentation on the second input image to form a second binary input image that distinguishes the document portion from the remaining portion of the second input image;
estimating a third image transform to align the second binary input image to a second binary template image,
using the third image transform on the second input image to form a second intermediate image;
estimating a fourth image transform to align the second intermediate image to a second template image, the second template image comprising a template document portion, the template document portion being of a different document of the second document type;
using the second image transform on the second intermediate image to form a second output image; and
extracting a field from the second output image using a predetermined field of the second template image.

### Claim 14

A non-transitory computer-readable medium comprising a plurality of instructions that, when executed by a processor, cause the processor to:
acquire an input image comprising a document portion, the document portion being of a document of a first document type;
perform image segmentation on the input image to form a binary input image that distinguishes the document portion from the remaining portion of the input image;
estimate a first image transform to align the binary input image to a binary template image;
use the first image transform on the input image to form an intermediate image;
estimate a second image transform to align the intermediate image to a template image, the template image comprising a template document portion, the template document portion being of a different document of the first document type;
use the second image transform on the intermediate image to form an output image; and
extract a field from the output image using a predetermined field of the template image.

### Claim 15

A server comprising a processor configured to execute executable code stored in a computer-readable memory, wherein the executable code comprises instructions that cause the processor to:
acquire an input image comprising a document portion, the document portion being of a document of a first document type;
perform image segmentation on the input image to form a binary input image that distinguishes the document portion from the remaining portion of the input image;
estimate a first image transform to align the binary input image to a binary template image;
use the first image transform on the input image to form an intermediate image;
estimate a second image transform to align the intermediate image to a template image, the template image comprising a template document portion, the template document portion being of a different document of the first document type;
use the second image transform on the intermediate image to form an output image; and
extract a field from the output image using a predetermined field of the template image.
