# US 2023/0245483 A1 · Handwriting recognition method and apparatus, and electronic 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 2023/0245483 A1
- Document ID: US20230245483A1
- Status: Published application
- Kind: A1
- Application number: 17/921,241
- Filed: 2020-05-27
- Published: 2023-08-03
- Earliest claimed: 2020-05-27
- Assignees: Boe Technology Group Co., Ltd.
- Applicants: BOE Technology Group Co., Ltd.
- Inventors: Huanhuan Zhang
- Web page: https://patentgrep.com/patent/US20230245483A1

## CPC

- G06V 30/194: References adjustable by an adaptive method, e.g. learning
- G06V 10/82: using neural networks
- G06V 30/10: Character recognition
- G06V 30/18057: {Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]}
- G06V 30/1831: {using gradient analysis}
- G06V 30/1916: {Validation; Performance evaluation}
- G06V 30/19173: {Classification techniques}
- G06V 30/274: {Syntactic or semantic context, e.g. balancing}
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

A handwriting recognition method and apparatus, and an electronic device and a storage medium are provided. The method includes: acquiring a text image containing handwritten text; inputting the text image into a convolutional neural network, and extracting a CNN feature and a HOG feature of the text image; and extracting the handwritten text in text image according to the CNN feature and the HOG feature.

## Claims

### Claim 1

A handwriting recognition method, comprising:
acquiring a text image containing handwritten text;
inputting the text image to a convolutional neural network and extracting a CNN feature of the text image;
dividing the text image into a plurality of text subimages according to a preset size, and extracting directional gradient features of the plurality of text subimages;
acquiring a HOG feature of the text image according to the directional gradient features; and
extracting the handwritten text from the text image according to the CNN feature and the HOG feature.

### Claim 2 (depends on 1)

The method according to claim 1, wherein acquiring the HOG feature of the text image according to the directional gradient feature comprises:
generating a plurality of subimage blocks according to the plurality of text subimages, wherein each of the plurality of subimage blocks contains a preset quantity of text subimages;
connecting the directional gradient features of all of the text subimages in each of the subimage blocks in series to obtain a HOG subfeature corresponding to each of the subimage blocks; and
acquiring the HOG feature according to HOG subfeatures corresponding to the plurality of subimage blocks.

### Claim 3 (depends on 1)

The method according to claim 1, wherein after acquiring the text images containing handwritten text, the method further comprises:
acquiring a preset image size and adjusting a size of the text image to the preset image size.

### Claim 4 (depends on 1)

The method according to claim 1, wherein extracting the handwritten text from the text image according to the CNN feature and the HOG feature comprises:
generating a target image feature according to the CNN feature and the HOG feature and dividing the target image feature into a plurality of time steps;
encoding the target image feature by an encoding layer in a recognition model, so as to obtain an image encoding feature corresponding to each of the time steps in the target image feature;
sequentially inputting the image encoding feature corresponding to each of the time steps to a decoding layer in the recognition model for decoding, so as to obtain an image decoding feature corresponding to each of the time steps;
inputting the image decoding feature corresponding to each of the time steps to a classification layer in the recognition model, so as to obtain a handwritten text recognition result corresponding to each of the time steps; and
recognizing the handwritten text according to the handwritten text recognition result.

### Claim 5 (depends on 4)

The method according to claim 4, wherein sequentially inputting the image encoding feature corresponding to each of the time steps to the decoding layer in the recognition model for decoding, so as to obtain an image decoding feature corresponding to each of the time steps comprises:
determining whether a currently input image encoding feature is a first image encoding feature;
on the condition that the currently input image encoding feature is not the first image encoding feature, acquiring an image decoding feature corresponding to a previously input image encoding feature;
generating an image decoding feature corresponding to the currently input image encoding feature according to the currently input image encoding feature and the image decoding feature corresponding to the previously input image encoding feature; and
on the condition that the currently input image encoding feature is the first image encoding feature, acquiring a corresponding image decoding feature according to the currently input image encoding feature.

### Claim 6 (depends on 1)

The method according to claim 1, wherein extracting the handwritten text from the text image according to the CNN feature and the HOG feature comprises:
determining a candidate handwritten text of the text image according to the CNN feature and the HOG feature;
identifying a semantic fluency of the candidate handwritten text;
on the condition that the semantic fluency is less than or equal to a preset threshold, correcting the candidate handwritten text according to a pre-trained error correction model so as to generate the handwritten text; and
on the condition that the semantic fluency is greater than the preset threshold, taking the candidate handwritten text as the handwritten text.

### Claim 7

(canceled)

### Claim 8

(canceled)

### Claim 9

(canceled)

### Claim 10

(canceled)

### Claim 11

(canceled)

### Claim 12

(canceled)

### Claim 13

An electronic device, comprising:
at least one processor; and
a memory in communication connection with the at least one processor; wherein
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the operations comprise:
acquiring a text image containing handwritten text;
inputting the text image to a convolutional neural network and extracting a CNN feature of the text image;
dividing the text image into a plurality of text subimages according to a preset size, and extracting directional gradient features of the plurality of text subimages;
acquiring a HOG feature of the text image according to the directional gradient features; and
extracting the handwritten text from the text image according to the CNN feature and the HOG feature.

### Claim 14 (depends on 1)

A non-transitory computer readable storage medium, with computer instructions stored thereon, wherein the computer instructions are configured to cause a computer to execute the handwriting recognition method according to claim 1.

### Claim 15 (depends on 1)

A computer program product, when instructions in the computer program product are executed by a processor, the handwriting recognition method according to claim 1 is implemented.

### Claim 16 (depends on 13)

The electronic device according to claim 13, wherein the operation of acquiring the HOG feature of the text image according to the directional gradient feature comprises:
generating a plurality of subimage blocks according to the plurality of text subimages, wherein each of the plurality of subimage blocks contains a preset quantity of text subimages;
connecting the directional gradient features of all of the text subimages in each of the subimage blocks in series to obtain a HOG subfeature corresponding to each of the subimage blocks; and
acquiring the HOG feature according to HOG subfeatures corresponding to the plurality of subimage blocks.

### Claim 17 (depends on 13)

The electronic device according to claim 13, wherein after the operation of acquiring the text images containing handwritten text, the operation further comprises:
acquiring a preset image size and adjusting a size of the text image to the preset image size.

### Claim 18 (depends on 13)

The electronic device according to claim 13, wherein the operation of extracting the handwritten text from the text image according to the CNN feature and the HOG feature comprises:
generating a target image feature according to the CNN feature and the HOG feature and dividing the target image feature into a plurality of time steps;
encoding the target image feature by an encoding layer in a recognition model, so as to obtain an image encoding feature corresponding to each of the time steps in the target image feature;
sequentially inputting the image encoding feature corresponding to each of the time steps to a decoding layer in the recognition model for decoding, so as to obtain an image decoding feature corresponding to each of the time steps;
inputting the image decoding feature corresponding to each of the time steps to a classification layer in the recognition model, so as to obtain a handwritten text recognition result corresponding to each of the time steps; and
recognizing the handwritten text according to the handwritten text recognition result.

### Claim 19 (depends on 18)

The electronic device according to claim 18, wherein the operation of sequentially inputting the image encoding feature corresponding to each of the time steps to the decoding layer in the recognition model for decoding, so as to obtain an image decoding feature corresponding to each of the time steps comprises:
determining whether a currently input image encoding feature is a first image encoding feature;
on the condition that the currently input image encoding feature is not the first image encoding feature, acquiring an image decoding feature corresponding to a previously input image encoding feature;
generating an image decoding feature corresponding to the currently input image encoding feature according to the currently input image encoding feature and the image decoding feature corresponding to the previously input image encoding feature; and
on the condition that the currently input image encoding feature is the first image encoding feature, acquiring a corresponding image decoding feature according to the currently input image encoding feature.

### Claim 20 (depends on 13)

The electronic device according to claim 13, wherein the operation of extracting the handwritten text from the text image according to the CNN feature and the HOG feature comprises:
determining a candidate handwritten text of the text image according to the CNN feature and the HOG feature;
identifying a semantic fluency of the candidate handwritten text;
on the condition that the semantic fluency is less than or equal to a preset threshold, correcting the candidate handwritten text according to a pre-trained error correction model so as to generate the handwritten text; and
on the condition that the semantic fluency is greater than the preset threshold, taking the candidate handwritten text as the handwritten text.
