# US 2021/0081729 A1 · Method for image text recognition, apparatus, device and storage medium

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

- Number: US 2021/0081729 A1
- Document ID: US20210081729A1
- Status: Published application
- Kind: A1
- Application number: 16/984,231
- Filed: 2020-08-04
- Published: 2021-03-18
- Earliest claimed: 2019-09-16
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science Technology Co., Ltd.
- Inventors: Xiangkai HUANG; Leyi WANG; Lei NIE; Siyu AN; Minghao LIU; Jiangliang GUO
- Web page: https://patentgrep.com/patent/US20210081729A1

## CPC

- G06F 40/30: Semantic analysis
- G06V 10/82: using neural networks
- G06V 30/19173: {Classification techniques}
- G06V 30/274: {Syntactic or semantic context, e.g. balancing}
- G06V 30/412: Layout analysis of documents structured with printed lines or input boxes, e.g. business forms or tables
- G06V 30/413: Classification of content, e.g. text, photographs or tables
- G06V 30/293: {of characters other than Kanji, Hiragana or Katakana}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

The present application discloses a method for image text recognition, an apparatus, a device, and a storage medium, and relates to image processing technologies in the field of cloud computing. A specific implementation is: acquiring an image to be processed, where at least one text line exists in the image to be processed; processing each text line in the image to be processed to obtain a composite encoded vector corresponding to each word in each text line, where the composite encoded vector carries semantic information and position information; and determining a text recognition result of the image to be processed according to the semantic information and the position information carried in the composite encoded vector corresponding to each word in each text line. This technical solution can accurately distinguish adjacent fields with small pixel spacing in the image and improve the accuracy of text recognition in the image.

## Claims

### Claim 1

A method for image text recognition, comprising:
acquiring an image to be processed, wherein at least one text line exists in the image to be processed;
processing each text line in the image to be processed to obtain a composite encoded vector corresponding to each word in each text line, wherein the composite encoded vector carries semantic information and position information; and
determining a text recognition result of the image to be processed according to the semantic information and the position information carried in the composite encoded vector corresponding to each word in each text line.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the processing each text line in the image to be processed to obtain a composite encoded vector corresponding to each word in each text line, comprises:
analyzing semantics of each word in each text line in the image to be processed to obtain a semantic encoded vector corresponding to each word in each text line;
determining coordinate information of each word in each text line in the image to be processed;
performing encoding and dimensional transformation on the coordinate information of each word to obtain a position encoded vector of each word, where a dimension of the position encoded vector is the same as a dimension of the semantic encoded vector; and
fusing the semantic encoded vector and the position encoded vector of each word to obtain the composite encoded vector of each word.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the analyzing semantics of each word in each text line in the image to be processed to obtain a semantic encoded vector corresponding to each word in each text line, comprises:
for each word in the image to be processed, weighting and fusing semantic information of all words in the text line to which the each word belongs to obtain the semantic encoded vector of the each word.

### Claim 4 (depends on 2)

The method according to claim 2, wherein the performing encoding and dimensional transformation on the coordinate information of each word to obtain a position encoded vector of each word, comprises:
determining multiple pixel points representing each word in the image to be processed;
determining a position vector of each word according to coordinate information of the multiple pixel points corresponding to each word; and
performing dimensional transformation on the position vector of each word according to the dimension of the semantic encoded vector corresponding to each word to obtain the position encoded vector having the same dimension as the semantic encoded vector.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the determining a text recognition result of the image to be processed according to the semantic information and the position information carried in the composite encoded vector corresponding to each word in each text line, comprises:
inputting the composite encoded vector corresponding to each word in each text line into a preset information analysis network to determine context information of each word, wherein the preset information analysis network is used to analyze the context information of each word;
determining a category label to which each word belongs according to the context information of each word; and
inputting the context information of each word in each text line and the category label to which each word belongs into a discriminant model to obtain the text recognition result of the image to be processed.

### Claim 6 (depends on 1)

The method according to claim 1, wherein before processing each text line in the image to be processed to obtain a composite encoded vector corresponding to each word in each text line, the method further comprises:
performing optical character recognition on the image to be processed, and determining text lines in the image to be processed and the position information of each word in each text line.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the method further comprises:
determining a range of each field in each text line according to the text recognition result of the image to be processed, wherein each field comprises multiple words of which context semantic information is related to each other; and
determining actual meaning of text in the image to be processed according to context semantic information of all words in a same field in each text line.

### Claim 8

An apparatus for image text recognition, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor, and when the at least one processor executes the instructions, the at least one processor is configured to:
acquire an image to be processed, wherein at least one text line exists in the image to be processed;
process each text line in the image to be processed to obtain a composite encoded vector corresponding to each word in each text line, wherein the composite encoded vector carries semantic information and position information; and
determine a text recognition result of the image to be processed according to the semantic information and the position information carried in the composite encoded vector corresponding to each word in each text line.

### Claim 9 (depends on 8)

The apparatus according to claim 8, wherein the at least one processor is specifically configured to: analyze semantics of each word in each text line in the image to be processed to obtain a semantic encoded vector corresponding to each word in each text line; determine coordinate information of each word in each text line in the image to be processed; perform encoding and dimensional transformation on the coordinate information of each word to obtain a position encoded vector of each word, wherein a dimension of the position encoded vector is the same as a dimension of the semantic encoded vector; and fuse the semantic encoded vector and the position encoded vector of each word to obtain the composite encoded vector of each word.

### Claim 10 (depends on 9)

The apparatus according to claim 9, wherein the at least one processor is specifically configured to: for each word in the image to be processed, weight and fuse semantic information of all words in the text line to which the each word belongs to obtain the semantic encoded vector of the each word.

### Claim 11 (depends on 9)

The apparatus according to claim 9, wherein the at least one processor is specifically configured to: determine multiple pixel points representing each word in the image to be processed; determine a position vector of each word according to coordinate information of the multiple pixel points corresponding to each word; and perform dimensional transformation on the position vector of each word according to the dimension of the semantic encoded vector corresponding to each word to obtain the position encoded vector having the same dimension as the semantic encoded vector.

### Claim 12 (depends on 8)

The apparatus according to claim 8, wherein the at least one processor is specifically configured to: input the composite encoded vector corresponding to each word in each text line into a preset information analysis network to determine context information of each word, wherein the preset information analysis network is used to analyze the context information of each word; determine a category label to which each word belongs according to the context information of each word; and input the context information of each word in each text line and the category label to which each word belongs into a discriminant model to obtain the text recognition result of the image to be processed.

### Claim 13 (depends on 8)

The apparatus according to claim 8, wherein the at least one processor is further configured to: before processing each text line in the image to be processed to obtain the composite encoded vector corresponding to each word in each text line, perform optical character recognition on the image to be processed, and determine text lines in the image to be processed and the position information of each word in each text line.

### Claim 14 (depends on 8)

The apparatus according to claim 8, wherein the at least one processor is further configured to: determine a range of each field in each text line according to the text recognition result of the image to be processed, wherein each field comprises multiple words of which context semantic information is related to each other; and determine actual meaning of text in the image to be processed according to the context semantic information of all words in a same field in each text line.

### Claim 15 (depends on 1)

A non-transitory computer-readable storage medium, having computer instructions stored thereon, wherein the computer instructions are used to enable a computer to execute the method according to claim 1.

### Claim 16

A method for image text recognition, comprising:
determining a composite encoded vector of each word in at least one text line of an image to be processed, wherein the composite encoded vector carries semantic information and position information; and
processing the composite encoded vector corresponding to each word in each text line to obtain a text recognition result of the image to be processed.
