A character recognition method, device, equipment and storage medium

By combining CTC decoding and sequence-to-sequence recognition methods, using character constituting elements and positional relationship characteristics, the problem of poor recognition effect of existing optical character recognition methods when training is insufficient, and more accurate and comprehensive character recognition is achieved.

CN114332871BActive Publication Date: 2024-12-31IFLYTEK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111671276.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-12-31
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

The existing optical character recognition methods cannot accurately recognize optical characters when training is insufficient or incomplete, resulting in unsatisfactory character recognition effect.

Method used

By combining CTC decoding and sequence-to-sequence recognition methods, optical characters are recognized from the whole to the local, and character constituent elements and positional relationship characteristics are compared to determine the character recognition results.

Benefits of technology

It improves the accuracy and effect of optical character recognition, and can achieve better recognition results when feature learning is insufficient, reducing the requirements for character feature learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114332871B_ABST
    Figure CN114332871B_ABST
Patent Text Reader

Abstract

The present application proposes a character recognition method, device, equipment and storage medium, the method comprising: obtaining a decoding feature of a text image, and decoding to obtain a first character recognition result corresponding to the text image according to the decoding feature; determining a second character recognition result corresponding to the text image by comparing the decoding feature of the text image with the character element sequence feature of each character in a preset dictionary; wherein the character element sequence is composed of each constituent element of the character and the positional relationship information between each constituent element; determining the character recognition result of the text image based on the first character recognition result and the second character recognition result. The above scheme can achieve better character recognition effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a character recognition method, device, equipment and storage medium. Background Art

[0002] Optical character recognition refers to the technology of recognizing text in images. There are two main conventional optical character recognition schemes: the first is a recognition scheme based on CTC decoding. This scheme first extracts image features through convolutional neural networks and recurrent neural networks, and then automatically aligns characters through the CTC decoding method to achieve end-to-end text recognition. The second is a recognition scheme based on sequence to sequence (seq2seq). This scheme consists of two parts: an encoder and a decoder. An encoder extracts the features of the text line image, and then a decoder decodes the image features into a character sequence, where the context feature vector used at each decoding moment is calculated by an attention module.

[0003] The above optical character recognition schemes are general optical character recognition methods, in which neural networks are applied. Neural networks are data-driven models, and when training is insufficient or incomplete, they are usually unable to accurately recognize optical characters, resulting in the above optical character recognition schemes failing to achieve ideal character recognition results, specifically, failing to accurately recognize all characters. Summary of the invention

[0004] Based on the above technical status, the present application proposes a character recognition method, device, equipment and storage medium to solve the above technical problems and improve the character recognition effect.

[0005] In order to solve the above problems, this application proposes the following technical solutions:

[0006] A character recognition method, comprising:

[0007] Acquire a decoding feature of the text image, and decode to obtain a first character recognition result corresponding to the text image according to the decoding feature;

[0008] Determine a second character recognition result corresponding to the text image by comparing the decoded features of the text image with the character element sequence features of each character in a preset dictionary; wherein the character element sequence is composed of each constituent element of the character and positional relationship information between each constituent element;

[0009] A character recognition result for the text image is determined based on the first character recognition result and the second character recognition result.

[0010] Optionally, determining a second character recognition result corresponding to the text image by comparing the decoding feature of the text image with the character element sequence features of each character in a preset dictionary includes:

[0011] The decoding features are input into a pre-trained structural decoding model, so that the structural decoding model determines the character recognition result corresponding to the text image by comparing the decoding features of the text image with the character element sequence features of each character in a preset dictionary, and uses the character recognition result determined by the structural decoding model as the second character recognition result corresponding to the text image.

[0012] Optionally, obtaining a decoding feature of the text image, and decoding to obtain a first character recognition result corresponding to the text image according to the decoding feature, includes:

[0013] A text image is input into a pre-trained character recognition model, and the character recognition model is made to perform feature extraction and character recognition processing on the text image to obtain decoding features and character recognition results output by the character recognition model, and the character recognition results output by the character recognition model are used as the first character recognition result corresponding to the text image.

[0014] Optionally, the first character recognition result and the second character recognition result respectively record the probability that the character to be recognized in the text image is recognized as each character in a preset dictionary;

[0015] Determining a character recognition result for the text image based on the first character recognition result and the second character recognition result includes:

[0016] The first recognition result and the second recognition result are fused to determine a character recognition result for the text image.

[0017] Optionally, fusing the first recognition result with the second recognition result to determine a character recognition result for the text image includes:

[0018] Taking the weight of the first character recognition result as a first weight and the weight of the second character recognition result as a second weight, weighted summing the first character recognition result and the second character recognition result is performed to determine the probability that the character to be recognized in the text image is recognized as the weighted sum of each character in a preset dictionary;

[0019] The character recognition result of the text image is determined according to the weighted sum of the probabilities that the character to be recognized in the text image is recognized as each character in the preset dictionary.

[0020] Optionally, the first weight and the second weight are determined as follows:

[0021] If the character with the highest recognition probability recorded in the first character recognition result is a character in a preset similar character list, the second weight is set to be greater than the first weight; wherein the similar character list stores character pairs with similar shapes; the character with the highest recognition probability is the character corresponding to the highest probability among the probabilities of the character to be recognized being recognized as various characters in the preset dictionary;

[0022] If the character with the highest recognition probability recorded in the first character recognition result is not a character in the preset similar character list, the second weight is set not to be greater than the first weight.

[0023] Optionally, the first character recognition result and the second character recognition result are characters obtained by recognizing the characters to be recognized in the text image;

[0024] Determining a character recognition result for the text image based on the first character recognition result and the second character recognition result includes:

[0025] A character recognition result for the text image is selected from the first character recognition result and the second character recognition result.

[0026] Optionally, selecting a character recognition result for the text image from the first character recognition result and the second character recognition result includes:

[0027] Determining whether the first character recognition result is a character in a preset similar character list; wherein the similar character list stores character pairs with similar shapes;

[0028] If the first character recognition result is not a character in the preset similar character list, determining the first character recognition result as a character recognition result for the text image;

[0029] If the first character recognition result is a character in a preset list of similar characters, determining whether a character pair formed by the first character recognition result and the second character recognition result is a character pair in the preset list of similar characters;

[0030] If the character pair formed by the first character recognition result and the second character recognition result is a character pair in a preset similar character list, determining the second character recognition result as a character recognition result for the text image;

[0031] If the character pair formed by the first character recognition result and the second character recognition result is not a character pair in a preset similar character list, the first character recognition result is determined as a character recognition result for the text image.

[0032] Optionally, the structure decoding model is trained in the following manner:

[0033] Obtaining decoding features of the character sample image, as well as character element sequence features of the positive sample label and character element sequence features of the negative sample label corresponding to the character sample image;

[0034] Inputting the decoding features of the character sample image into a structural decoding model, so that the structural decoding model determines a character recognition result corresponding to the character sample image by comparing the decoding features of the character sample image with the character element sequence features of each character in the character sample set;

[0035] The parameters of the structural decoding model are optimized with the goal of maximizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the positive sample label corresponding to the character sample image, and minimizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the negative sample label corresponding to the character sample image.

[0036] Optionally, the character samples used to train the structural decoding model include characters obtained by replacing constituent elements of the characters.

[0037] Optionally, the character element sequence features of each character in the preset dictionary are obtained by the following processing:

[0038] According to the spatial structure of the character, the character is split into elements to determine the various constituent elements contained in the character, and the spatial position relationship between the various constituent elements contained in the character is determined;

[0039] Generate a character element sequence corresponding to the character by using a position relationship descriptor corresponding to the spatial position relationship between each component element included in the character and each component element included in the character;

[0040] Feature extraction is performed on the character element sequence to obtain character element sequence features of the character.

[0041] A character recognition device, comprising:

[0042] A first recognition unit, used to obtain a decoding feature of the text image, and decode to obtain a first character recognition result corresponding to the text image according to the decoding feature;

[0043] A second recognition unit is used to determine a second character recognition result corresponding to the text image by comparing the decoded features of the text image with the character element sequence features of each character in a preset dictionary; wherein the character element sequence is composed of each constituent element of the character and positional relationship information between each constituent element;

[0044] A recognition result determination unit is used to determine a character recognition result for the text image based on the first character recognition result and the second character recognition result.

[0045] A character recognition device, comprising:

[0046] Memory and processor;

[0047] Wherein, the memory is connected to the processor and is used to store programs;

[0048] The processor is used to implement the above-mentioned character recognition method by running the program in the memory.

[0049] A storage medium stores a computer program, and when the computer program is executed by a processor, the character recognition method is implemented.

[0050] The character recognition method proposed in the present application can not only perform character recognition on the text image to obtain the first character recognition result, but also determine the second character recognition result of the text image from the perspective of the character constituent elements by comparing the decoding features of the text image with the character element sequence features of each character in the dictionary. Finally, based on the first character recognition result and the second character recognition result, the final character recognition result of the text image is determined. The above-mentioned character recognition scheme combines optical character recognition schemes based on different dimensions to recognize characters in the text image through character features of different granularities. Since the character features considered in this character recognition process are more comprehensive and diverse, better character recognition effects can be achieved compared to conventional character recognition schemes.

[0051] In particular, the technical solution of the embodiment of the present application uses character constituent elements to perform character recognition, so that even if the feature learning of the character to be recognized is insufficient, the purpose of character recognition can be achieved based on the feature learning of the basic character constituent elements and the positional relationship of the character constituent elements. That is, the technical solution of the embodiment of the present application can reduce the requirements for character feature learning, and even if the character feature learning is insufficient, a more ideal character recognition effect can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0053] Figure 1 It is a flowchart of a character recognition method provided by an embodiment of the present application;

[0054] Figure 2 is a schematic diagram of a character recognition process provided by an embodiment of the present application;

[0055] Figure 3 is a schematic diagram of the spatial position relationship and position relationship descriptor of the character constituent elements provided in an embodiment of the present application;

[0056] Figure 4 This is a schematic diagram of a binary tree for character splitting provided in an embodiment of the present application;

[0057] Figure 5 is a schematic diagram of a processing process for determining a character element sequence of a character provided in an embodiment of the present application;

[0058] Figure 6 is a schematic diagram of the structure of a character recognition device provided in an embodiment of the present application;

[0059] Figure 7 It is a structural diagram of a character recognition device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solution of the embodiment of the present application is applicable to the application scenario of optical character recognition. By adopting the technical solution of the embodiment of the present application, various optical characters can be recognized more accurately, thereby improving the optical character recognition effect.

[0061] There are two main types of conventional optical character recognition schemes: The first is a recognition scheme based on CTC decoding. This scheme first extracts image features through convolutional neural networks and recurrent neural networks, and then automatically aligns characters through the CTC decoding method to achieve end-to-end text recognition. The second is a recognition scheme based on sequence to sequence (seq2seq). This scheme consists of two parts: an encoder and a decoder. An encoder extracts the features of the text line image, and then a decoder decodes the image features into a character sequence, where the context feature vector used at each decoding moment is calculated through an attention module.

[0062] The above optical character recognition schemes are general optical character recognition methods, in which neural networks are applied. Neural networks are data-driven models, and when training is insufficient or incomplete, they are usually unable to accurately recognize optical characters, resulting in the above optical character recognition schemes failing to achieve ideal character recognition results, specifically, failing to accurately recognize all characters.

[0063] Based on the above problems, an embodiment of the present application proposes an optical character recognition solution, which combines two different character recognition methods to recognize optical characters from the whole to the part, thereby improving the character recognition effect.

[0064] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0065] The present application embodiment proposes a character recognition method, see Figure 1 As shown, the method includes:

[0066] S101. Obtain decoding features of a text image, and decode to obtain a first character recognition result corresponding to the text image according to the decoding features.

[0067] Specifically, the above-mentioned text image refers to an image containing text, which can be a natural scene image or an image obtained by scanning text, and the characters in the image can be characters of any language, any font, and any size. The character recognition method proposed in the embodiment of the present application is intended to recognize characters in a text image.

[0068] The embodiment of the present application first performs image encoding on the text image, and decodes the image encoding features, and finally obtains features that can be used to identify the characters contained in the image, namely, decoding features. Then, based on the decoding features, character decoding under a preset dictionary dimension is performed to obtain a character recognition result corresponding to the text image. The character recognition result can be the probability that the characters to be recognized in the text image are recognized as the various characters in the dictionary, or one or more characters that are most likely to be the characters to be recognized in the text image are selected from the dictionary as the character recognition result.

[0069] For ease of distinction, the embodiment of the present application names the character recognition result as the first character recognition result.

[0070] As an exemplary embodiment, the embodiment of the present application pre-trains a character recognition model for feature extraction and character recognition processing of text images. The character recognition model can be a character recognition model of any network structure, for example, it can be a character recognition model of an encoder-decoder structure. As a preferred embodiment, the embodiment of the present application uses ResNet-34 as an encoder network and a GRU network with an attention module as a decoder network to form a character recognition model. The specific structure and function of the character recognition model, as well as the processing process of the character recognition model when performing character recognition on text images, the calculation process of decoding features, etc., can all be referred to the conventional scheme of optical character recognition using an optical character recognition model, and the embodiment of the present application will not be described in detail.

[0071] In the above-mentioned character recognition model, the height of the text image is adjusted to 32, and the width of the text image is scaled according to the aspect ratio. The processed text image is input into the character recognition model, and the character recognition model performs feature extraction and character recognition processing on the text image to obtain the text image decoding features output by the character recognition model and the character recognition result corresponding to the text image. For example, the feature vector output of the last hidden layer of the character recognition model is output as the decoding feature of the text image input into the character recognition model. By using the decoding feature to perform character classification, character recognition of the text image can be realized.

[0072] Finally, the character recognition result output by the character recognition model is used as the first character recognition result corresponding to the text image.

[0073] The above processing process realizes the feature extraction and recognition of characters in the text image, which is a recognition scheme at the character granularity. That is, the entire recognition process is based on the features of the characters.

[0074] S102: Determine a second character recognition result corresponding to the text image by comparing the decoding features of the text image with the character element sequence features of each character in a preset dictionary.

[0075] Specifically, the above-mentioned preset dictionary refers to a dictionary of the same language as the characters to be recognized in the text image, and the dictionary is used to recognize the characters of the language. For example, a Chinese dictionary contains all Chinese characters, and a Korean dictionary contains all Korean characters.

[0076] Theoretically, any character to be recognized in a text image is one of the characters in the dictionary of the corresponding language. As long as it is clear which character in the dictionary the character to be recognized is, the purpose of character recognition can be achieved.

[0077] The embodiment of the present application separates each character in the dictionary, analyzes the constituent elements of the character from the perspective of spatial structure, and determines the spatial position relationship of each constituent element contained in the character. Then, the constituent elements of the character and the position relationship information between the constituent elements are used to form a character element sequence corresponding to the character.

[0078] Specifically, characters in a certain language are usually composed of some basic character elements. For example, Chinese characters, Korean characters, Japanese characters, etc. are all composed of some basic elements, such as strokes, radicals, single word structures, etc., which are combined according to the prescribed spatial structures such as left-right structure, top-bottom structure, semi-enclosed structure, and fully enclosed structure. Based on the reuse of character elements, a large number of characters with different meanings can be combined with a small number of character elements.

[0079] Therefore, if character recognition is converted into the recognition of the spatial position relationship between character constituent elements, on the one hand, the diversity of recognition targets can be reduced, that is, the purpose of recognizing a large number of characters can be achieved by only recognizing the position relationship between character constituent elements and character constituent elements (the number of spatial position relationships between character constituent elements and character constituent elements is much less than the number of dictionary characters), which is especially beneficial for the recognition of rare characters and complex characters. On the other hand, the learning precision of character features can be enhanced, that is, from the dimension of the constituent elements of the characters, the characters can be split and features learned in a more fine-grained manner, which is conducive to grasping the subtle differences between similar characters, thereby helping to improve the accuracy of character recognition.

[0080] Based on the above ideas, the embodiment of the present application determines the character element sequence corresponding to each character in the dictionary corresponding to the text image, extracts the characteristics of the character element sequence, obtains the character element sequence characteristics of the character, and applies it to text image character recognition. The specific implementation scheme of obtaining the character element sequence of the character and extracting the character element sequence characteristics will be introduced in the subsequent embodiments.

[0081] It should be noted that the character element sequence features of each character in the above-mentioned preset dictionary can be acquired and stored in advance, and read directly from the storage address when needed, or, when executing the character recognition method proposed in the embodiment of the present application, character element sequence generation and character element sequence feature extraction can be performed for each character in the dictionary.

[0082] After obtaining the decoding features of the text image and the character element sequence features of each character in the preset dictionary, the embodiment of the present application compares the decoding features of the text image with the character element sequence features of each character in the preset dictionary, determines the similarity between the character element sequence features of each character in the dictionary and the decoding features of the text image, and finally, determines the character recognition result according to the similarity between the character element sequence features of each character in the dictionary and the decoding features of the text image. For example, one or more characters in the dictionary whose character element sequence features have the highest similarity with the decoding features of the text image can be determined as the character recognition result corresponding to the text image; or, the similarity between the character element sequence features of each character in the dictionary and the decoding features of the text image can be used as the probability that the character to be recognized in the text image is recognized as each character in the dictionary, and the character recognition result is composed of these probabilities. For the sake of distinction, the embodiment of the present application names the character recognition result as the second character recognition result.

[0083] In addition, in order to ensure the comparability between the decoded features of the text image and the character element sequence features of each character in the preset dictionary, before comparing the decoded features of the text image with the character element sequence features of each character in the preset dictionary, the embodiment of the present application first processes the decoded features of the text image so that its feature dimensions, feature forms, etc. are the same as the character element sequence features of each character in the dictionary. For example, the decoded features of the text image are input into a fully connected network, so that the fully connected network processes the decoded features into features with the same dimensions and feature forms as the character element sequence features of the dictionary characters, so as to facilitate the subsequent similarity comparison of the two features.

[0084] As an exemplary implementation, the embodiment of the present application pre-trains a structural decoding model, which is used to determine the character recognition result corresponding to the text image by comparing the decoding features of the text image with the character element sequence features of each character in a preset dictionary.

[0085] The training process of the structural decoding model will be introduced in subsequent embodiments.

[0086] As an optional implementation, see Figure 2As shown, the embodiment of the present application combines the above-mentioned character recognition model and structural decoding model for application. Specifically, in the process of the character recognition model performing character recognition on the text image to obtain the first character recognition result, the feature output of the last hidden layer of the character recognition model, that is, the decoding feature of the text image is output, and then the structural decoding model compares the decoding feature of the text image with the character element sequence features of each character in the preset dictionary for similarity, determines the similarity between the decoding feature of the text image and the character element sequence features of each character in the preset dictionary, and then obtains the second character recognition result. Among them, Figure 2 The solid line in the figure represents the maximum similarity between the two items involved in the comparison, and the dotted line represents the minimum similarity between the two items involved in the comparison.

[0087] S103: Determine a character recognition result for the text image based on the first character recognition result and the second character recognition result.

[0088] Based on the above introduction, it can be known that the first character recognition result is the recognition result obtained by directly performing character recognition on the text image, while the second character recognition result is the character recognition result obtained by using the character element sequence feature of the character. In other words, the first character recognition result and the second character recognition result are recognition results obtained by using different feature granularities.

[0089] Finally, the embodiment of the present application determines the final character recognition result based on the first character recognition result and the second character recognition result obtained by different granularities, that is, obtains the character recognition result for the text image. Exemplarily, the first character recognition result and the second character recognition result can be fused to obtain the character recognition result for the text image, or the first character recognition result and the second character recognition result can be compared to select the correct character recognition result.

[0090] In summary, the character recognition method proposed in the embodiment of the present application can not only perform character recognition on the text image to obtain a first character recognition result, but also determine the second character recognition result of the text image from the perspective of the character constituent elements by comparing the decoding features of the text image with the character element sequence features of each character in the dictionary. Finally, based on the first character recognition result and the second character recognition result, the final character recognition result of the text image is determined. The above-mentioned character recognition scheme combines optical character recognition schemes based on different dimensions to recognize characters in text images through character features of different granularities. Since the character features considered in the character recognition process are more comprehensive and diverse, better character recognition effects can be achieved compared to conventional character recognition schemes.

[0091] In particular, the technical solution of the embodiment of the present application uses character constituent elements to perform character recognition, so that even if the feature learning of the character to be recognized is insufficient, the purpose of character recognition can be achieved based on the feature learning of the basic character constituent elements and the positional relationship of the character constituent elements. That is, the technical solution of the embodiment of the present application can reduce the requirements for character feature learning, and even if the character feature learning is insufficient, a more ideal character recognition effect can be achieved.

[0092] As an optional implementation, when the embodiment of the present application determines the character recognition result for the text image based on the above-mentioned first character recognition result and second character recognition result, specifically, the first character recognition result is integrated with the second character recognition result to determine the character recognition result for the text image, or the most accurate result is selected from the first character recognition result and the second character recognition result as the character recognition result for the text image.

[0093] Specifically, (1) when the first character recognition result and the second character recognition result respectively record the probability that the character to be recognized in the text image is recognized as each character in the preset dictionary, the character recognition result of the text image is determined by fusing the first character recognition result and the second character recognition result, that is, performing a weighted summation on the first character recognition result and the second character recognition result.

[0094] Specifically, weights are set for the first character recognition result and the second character recognition result, with the weight of the first character recognition result being the first weight and the weight of the second character recognition result being the second weight, and weighted summation of the first character recognition result and the second character recognition result is performed to determine the probability that the character to be recognized in the text image is recognized as the weighted summation of each character in the preset dictionary. The sum of the first weight and the second weight is 1.

[0095] Then, the character recognition result of the text image is determined according to the weighted sum of the probabilities that the character to be recognized in the text image is recognized as each character in the preset dictionary.

[0096] For example, one or more characters in a preset dictionary with the highest recognition probability after weighted summation are used as the character recognition result for the text image.

[0097] Optionally, the first weight and the second weight may be determined as follows:

[0098] First, it is determined whether the character with the highest recognition probability recorded in the first character recognition result is a character in a preset similar character list.

[0099] The similar characters list is a list of character pairs with similar shapes. The embodiment of the present application pre-performs a conventional character recognition test on the characters in the dictionary, and stores the characters with similar shapes that are easily confused and cause recognition errors into character pairs, as a similar character list.

[0100] After obtaining the first character recognition result, according to the probability of the character to be recognized in the text image recorded in the character recognition result being recognized as each character in the preset dictionary, the dictionary character with the highest recognition probability is selected as the character recognition result for the character to be recognized in the text image. Then, it is determined whether the character is a character in the preset similar character list.

[0101] If yes, it means that the character is easily confused with other character recognitions in conventional character recognition, resulting in recognition errors, that is, the first character recognition result is likely to be inaccurate. At this time, the second weight is set to be greater than the first weight, that is, the weight of the first character recognition result is lowered.

[0102] If not, it means that the recognition accuracy of the character in conventional character recognition is relatively high. In this case, the second weight is set not to be greater than the first weight, that is, the weight of the first character recognition result can be appropriately increased.

[0103] Based on the above-mentioned weight setting concept, the first weight and the second weight can be flexibly set in combination with actual conditions to improve the character recognition effect of the fused text image.

[0104] (2) When the first character recognition result and the second character recognition result are characters obtained by recognizing a character to be recognized in a text image, the character recognition result for the text image is selected from the first character recognition result and the second character recognition result.

[0105] Specifically, it is first determined whether the character in the first character recognition result is a character in the above-mentioned similar character list.

[0106] If the character in the first character recognition result is not a character in the above-mentioned list of similar characters, it means that the character to be recognized in the text image is not an easily confused character, that is, the character can be recognized more accurately through conventional character recognition methods. Therefore, the first character recognition result can be directly determined as the character recognition result for the text image.

[0107] If the character in the first character recognition result is a character in the above list of similar-looking characters, it indicates that the character to be recognized in the text image is a character that is likely to be confused and cause recognition errors in the conventional character recognition method. Therefore, the first character recognition result cannot be directly used as the character recognition result of the text image. At this time, the embodiment of the present application further determines whether the character pair formed by the second character recognition result and the first character recognition result is a character pair in the above list of similar-looking characters, that is, it determines whether the character in the second character recognition result is a character in the above list of similar-looking characters that pairs with the character in the first character recognition result. If so, it indicates that the characters in the first character recognition result and the second character recognition result are characters that are likely to be confused in recognition. And the second character recognition result is a character recognition result obtained based on the features of more fine-grained character constituent elements. Therefore, compared with the first character recognition result, it can more accurately distinguish easily confused characters. It can be considered that in the recognition of easily confused characters, the second character recognition result has higher accuracy. Therefore, at this time, the second character recognition result is determined as the character recognition result of the text image.

[0108] If not, it indicates that the first character recognition result and the second character recognition result are not easily confused characters. At this time, it cannot be considered that the second character recognition result must be a more accurate character recognition result relative to the first character recognition result. Therefore, the first character recognition result is determined as the character recognition result of the text image.

[0109] For example: Assume that the first character recognition result at time t is the Chinese character "今" (today), and the second character recognition result is the Chinese character "令" (order). If the predicted Chinese character pair ("今", "令") is in the list of similar-looking characters, the final result at the current moment is "令", otherwise the final result at the current moment is "今".

[0110] As an optional implementation manner, the embodiment of the present application trains the above-mentioned structure decoding model according to the training process shown in the following steps A1 - A3:

[0111] A1. Obtain the decoding features of the character sample image, as well as the character element sequence features of the positive sample label and the character element sequence features of the negative sample label corresponding to the character sample image.

[0112] Specifically, the above-mentioned character sample image refers to an image containing character samples for training the structure decoding model. For example, it can be an image containing characters in a dictionary.

[0113] Since in actual working conditions, most characters are relatively easy to recognize. To enhance the feature learning intensity of the model and enable the model to have stronger feature discrimination ability, the embodiment of the present application constructs negative samples similar to each character in the dictionary and adds them to the character sample set as character samples for training the model.

[0114] Specifically, in the embodiments of the present application, new characters are obtained by replacing the constituent elements of the characters, and the obtained new characters are used as model training character samples.

[0115] The specific process is as follows: for each character in the dictionary, the embodiments of the present application split its constituent elements to determine each constituent element that makes up the character. Then, one or more constituent elements in the character are replaced with similar constituent elements to obtain new characters. For example, for the character "冷" which is composed of the constituent elements "冫" and "令", the embodiments of the present application replace the constituent element "冫" with the similar character constituent element "氵" to form the character "泠"; or, replace the constituent element "令" with the similar character constituent element "今" to form the character "汵".

[0116] It should be noted that in the above process of replacing character constituent elements, only one constituent element is replaced each time, each constituent element is replaced with at most three of its most similar constituent elements, and the operation of replacing constituent elements does not change the spatial position relationship between the constituent elements of the character.

[0117] All the characters obtained by the above replacement are used as negative samples corresponding to the original characters. Since the characters obtained by the replacement are relatively similar to the original characters, these negative samples belong to difficult negative samples. In the actual training process, the embodiments of the present application also control the proportion of the negative samples of each sample character, so that the ratio of the true negative samples of the character to the constructed difficult negative samples is 10:1, so that the model can focus more on the learning of difficult samples, thereby improving the model performance.

[0118] For each character sample, the embodiments of the present application respectively obtain its character sample image, and obtain the character element sequence features of the positive sample label and the character element sequence features of the negative sample label corresponding to the character sample image. Among them, the character element sequence features of the positive sample label refer to the features of the character element sequence of the positive sample label corresponding to the character sample image. Similarly, the character element sequence features of the negative sample label refer to the features of the character element sequences of the respective negative sample labels corresponding to the character sample image. The above-mentioned character element sequence features of the positive sample label and the character element sequence features of the negative sample label can be obtained by extracting the features of the character element sequence of the character respectively. The specific feature extraction process can refer to the character element sequence feature extraction process described in the subsequent embodiments.

[0119] A2. Input the decoded features of the character sample image into a structure decoding model, so that the structure decoding model determines the character recognition result corresponding to the character sample image by comparing the decoded features of the character sample image with the character element sequence features of each character in the character sample set.

[0120] Specifically, after encoding and decoding the character sample image, the last layer of decoding features, that is, the decoding features of the character sample image, is input into the structural decoding model. The decoding features of the character sample image can be obtained by Figure 2 The character recognition model shown in is obtained. That is, the character sample image is input into the pre-trained character recognition model, and the features of the last hidden layer output of the character recognition model are obtained, which are the decoding features of the character sample image.

[0121] The structural decoding model compares the decoding features of the character sample image with the character element sequence features of each character in the character sample set, and selects the character whose character element sequence features have the highest similarity with the decoding features of the character sample image as the character recognition result corresponding to the character sample image by calculating the similarity between the decoding features and the character element sequence features of each character in the character sample set.

[0122] Among them, in order to ensure the comparability of the decoding features of the character sample image and the character element sequence features of each character in the character sample set, the structural decoding model first processes the decoding features of the character sample image before comparison, for example, through a fully connected network, so that the dimensions, feature content types, etc. of the decoding features of the character sample image are the same as the character element sequence features of each character in the character sample set.

[0123] A3. Optimize the parameters of the structural decoding model with the goal of maximizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the positive sample label corresponding to the character sample image, and minimizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the negative sample label corresponding to the character sample image.

[0124] Specifically, the structural decoding model realizes character recognition of the character sample image by measuring the similarity between the decoding features of the character sample image and the character element sequence features of each character in the character sample set. If the structural decoding model can determine that the similarity between the decoding features of the character sample image and the character element sequence features of the positive sample label corresponding to the character sample image is the largest, and the similarity between the decoding features of the character sample image and the character element sequence features of the negative sample label corresponding to the character sample image is the smallest, then it means that the structural decoding model can accurately distinguish the positive sample label and the negative sample label of the character sample image, that is, it can accurately recognize the characters in the character sample image.

[0125] Therefore, when the structural decoding features are cyclically trained and the parameters are corrected, the embodiment of the present application optimizes the parameters of the structural decoding model with the goal of maximizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the positive sample label corresponding to the character sample image, and minimizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the negative sample label corresponding to the character sample image, so that the structural decoding model can accurately identify the similarity between the character sample and the positive sample label and the negative sample label of the character sample, thereby accurately identifying the character sample.

[0126] Exemplarily, the present application embodiment involves the following formula as a loss function for model training, which is used to correct the model parameters:

[0127]

[0128] Among them, q represents the decoding feature of the character sample image, k0 represents the character element sequence feature of the positive sample label corresponding to the character sample image, and k i (1≤i≤N) represents the character element sequence features of each negative sample label corresponding to the character sample image, which is a hyperparameter (generally set to 0.1).

[0129] As an exemplary implementation, the embodiment of the present application obtains the character element sequence features of the character by processing the following steps B1-B3. This processing method can be used to obtain the character element sequence features of the characters in the dictionary, or to obtain the character element sequence features of the characters in the character sample set.

[0130] B1. According to the spatial structure of the character, the character is split into elements to determine the various constituent elements contained in the character, and the spatial position relationship between the various constituent elements contained in the character is determined.

[0131] Specifically, the embodiment of the present application pre-parses the dictionary characters to determine the various constituent elements that constitute the dictionary characters. The granularity of the constituent elements can be set according to actual needs. For example, the characters can be divided into stroke elements with the smallest granularity, or into radical elements, or into any set character structure.

[0132] At the same time, by parsing the dictionary characters, the relative position relationship of each character constituent element when constituting the character is determined. After analyzing the position of constituent elements of all the characters in the dictionary, the embodiment of the present application determines the following: Figure 3 The 10 positional relationships are shown, and the positional relationship descriptors corresponding to the various positional relationships are determined.

[0133] Based on the above settings of character composition elements and the spatial position relationship of character composition elements, when generating the character element sequence feature of a certain character, first perform element splitting processing on the character to determine each composition element included in the character and the spatial position relationship between each composition element included in the character.

[0134] See Figure 4 As shown, when parsing the character "殿", it is split layer by layer from the whole to the local. At each split, the object to be split (the whole character or a certain composition element of the character) is split into two composition elements with a smaller granularity, and at the same time, the spatial position relationship between the two split composition elements with a smaller granularity is determined, and the entire parsing process is represented in the form of a binary tree until the split composition elements cannot be split any further. In this binary tree structure, it includes each composition element of the character "殿" and includes the spatial position relationship information of each composition element. Among them, the spatial position relationship of each composition element is represented in the form of a position relationship descriptor.

[0135] B2. Use the position relationship descriptors corresponding to the spatial position relationships between each composition element included in the character, and each composition element included in the character, to generate a character element sequence corresponding to the character.

[0136] Specifically, after splitting the character into elements in the above manner and obtaining the split result in the form of a binary tree, take the pre-order traversal sequence of the binary tree as the character element sequence corresponding to the character. As Figure 5 shown, perform a pre-order traversal on the binary tree split result of the character "殿", and the obtained sequence is the character element sequence of the character "殿".

[0137] It can be seen that in the character element sequence of the character, it not only includes the composition elements that make up the character, but also includes the spatial position relationship between each composition element. According to this character element sequence, a corresponding character can be uniquely combined. That is to say, the character element sequences of the characters determined in the above manner are all unique.

[0138] B3. Extract features from the character element sequence to obtain the character element sequence feature of the character.

[0139] Exemplarily, input the character element sequence of the character into a BiLSTM network, so that the network extracts features from the input character element sequence, and the features output by the network are the character element sequence features. In the embodiments of the present application, the mean value of the features output by the BiLSTM network at all times is used as the character element sequence feature corresponding to the character element sequence input to the network.

[0140] Corresponding to the above character recognition method, the embodiments of the present application also propose a character recognition device. See Figure 6 As shown, the device comprises:

[0141] The first recognition unit 100 is used to obtain a decoding feature of the text image, and decode the text image to obtain a first character recognition result corresponding to the text image according to the decoding feature;

[0142] The second recognition unit 110 is used to determine a second character recognition result corresponding to the text image by comparing the decoded features of the text image with the character element sequence features of each character in a preset dictionary; wherein the character element sequence is composed of each constituent element of the character and positional relationship information between each constituent element;

[0143] The recognition result determining unit 120 is configured to determine a character recognition result for the text image based on the first character recognition result and the second character recognition result.

[0144] As an optional implementation, determining a second character recognition result corresponding to the text image by comparing the decoding feature of the text image with the character element sequence features of each character in a preset dictionary includes:

[0145] The decoding features are input into a pre-trained structural decoding model, so that the structural decoding model determines the character recognition result corresponding to the text image by comparing the decoding features of the text image with the character element sequence features of each character in a preset dictionary, and uses the character recognition result determined by the structural decoding model as the second character recognition result corresponding to the text image.

[0146] As an optional implementation, obtaining a decoding feature of a text image, and decoding to obtain a first character recognition result corresponding to the text image according to the decoding feature, includes:

[0147] A text image is input into a pre-trained character recognition model, and the character recognition model is made to perform feature extraction and character recognition processing on the text image to obtain decoding features and character recognition results output by the character recognition model, and the character recognition results output by the character recognition model are used as the first character recognition result corresponding to the text image.

[0148] As an optional implementation manner, the first character recognition result and the second character recognition result respectively record the probability that the character to be recognized in the text image is recognized as each character in the preset dictionary;

[0149] Determining a character recognition result for the text image based on the first character recognition result and the second character recognition result includes:

[0150] The first recognition result and the second recognition result are fused to determine a character recognition result for the text image.

[0151] As an optional implementation, fusing the first recognition result with the second recognition result to determine a character recognition result for the text image includes:

[0152] The weight of the first character recognition result is taken as a first weight, and the weight of the second character recognition result is taken as a second weight, and the first character recognition result and the second character recognition result are weighted and summed to determine the probability that the character to be recognized in the text image is recognized as the weighted sum of each character in the preset dictionary; wherein the sum of the first weight and the second weight is 1;

[0153] The character recognition result of the text image is determined according to the probability of the weighted sum of the characters to be recognized in the text image being recognized as the characters in the preset dictionary.

[0154] As an optional implementation manner, the first weight and the second weight are determined as follows:

[0155] If the character with the highest recognition probability recorded in the first character recognition result is a character in a preset similar character list, the second weight is set to be greater than the first weight; wherein the similar character list stores character pairs with similar shapes; the character with the highest recognition probability is the character corresponding to the highest probability among the probabilities of the character to be recognized being recognized as various characters in the preset dictionary;

[0156] If the character with the highest recognition probability recorded in the first character recognition result is not a character in the preset similar character list, the second weight is set not to be greater than the first weight.

[0157] As an optional implementation manner, the first character recognition result and the second character recognition result are characters obtained by recognizing the characters to be recognized in the text image;

[0158] Determining a character recognition result for the text image based on the first character recognition result and the second character recognition result includes:

[0159] A character recognition result for the text image is selected from the first character recognition result and the second character recognition result.

[0160] As an optional implementation manner, selecting a character recognition result for the text image from the first character recognition result and the second character recognition result includes:

[0161] Determining whether the first character recognition result is a character in a preset similar character list; wherein the similar character list stores character pairs with similar shapes;

[0162] If the first character recognition result is not a character in the preset similar character list, determining the first character recognition result as a character recognition result for the text image;

[0163] If the first character recognition result is a character in a preset list of similar characters, determining whether a character pair formed by the first character recognition result and the second character recognition result is a character pair in the preset list of similar characters;

[0164] If the character pair formed by the first character recognition result and the second character recognition result is a character pair in a preset similar character list, determining the second character recognition result as a character recognition result for the text image;

[0165] If the character pair formed by the first character recognition result and the second character recognition result is not a character pair in a preset similar character list, the first character recognition result is determined as a character recognition result for the text image.

[0166] As an optional implementation, the structure decoding model is trained in the following manner:

[0167] Obtaining decoding features of the character sample image, as well as character element sequence features of the positive sample label and character element sequence features of the negative sample label corresponding to the character sample image;

[0168] Inputting the decoding features of the character sample image into a structural decoding model, so that the structural decoding model determines a character recognition result corresponding to the character sample image by comparing the decoding features of the character sample image with the character element sequence features of each character in the character sample set;

[0169] The parameters of the structural decoding model are optimized with the goal of maximizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the positive sample label corresponding to the character sample image, and minimizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the negative sample label corresponding to the character sample image.

[0170] As an optional implementation, the character samples used to train the structural decoding model include characters obtained by replacing constituent elements of the characters.

[0171] As an optional implementation, the character element sequence features of each character in the preset dictionary are obtained by the following processing:

[0172] According to the spatial structure of the character, the character is split into elements to determine the various constituent elements contained in the character, and the spatial position relationship between the various constituent elements contained in the character is determined;

[0173] Generate a character element sequence corresponding to the character by using a position relationship descriptor corresponding to the spatial position relationship between each component element included in the character and each component element included in the character;

[0174] Feature extraction is performed on the character element sequence to obtain character element sequence features of the character.

[0175] Specifically, for the specific working contents of each unit of the above-mentioned character recognition device, please refer to the specific processing contents of each processing step in each embodiment of the above-mentioned character recognition method, which will not be repeated here.

[0176] Another embodiment of the present application also provides a character recognition device, see Figure 7 As shown, the device includes:

[0177] Memory 200 and processor 210;

[0178] The memory 200 is connected to the processor 210 and is used to store programs;

[0179] The processor 210 is used to implement the character recognition method disclosed in any of the above embodiments by running the program stored in the memory 200.

[0180] Specifically, the above-mentioned character recognition device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .

[0181] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.

[0182] A bus may include a pathway that transfers information between components of a computer system.

[0183] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0184] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.

[0185] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.

[0186] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.

[0187] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.

[0188] The communication interface 220 may include any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.

[0189] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any character recognition method provided in the above embodiments of the present application.

[0190] Another embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, each step of any character recognition method provided in the above embodiments of the present application is implemented.

[0191] Specifically, the specific working contents of each part of the above-mentioned character recognition device, as well as the specific processing contents of the computer program on the above-mentioned storage medium when being executed by the processor, can all be found in the contents of each embodiment of the above-mentioned character recognition method, and will not be repeated here.

[0192] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0193] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0194] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.

[0195] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.

[0196] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0197] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0198] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.

[0199] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0200] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0201] Finally, it should be noted that, in this article, relational terms such as second and first are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0202] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A character recognition method, characterized in that: include: Acquire a decoding feature of the text image, and decode to obtain a first character recognition result corresponding to the text image according to the decoding feature; Determining a second character recognition result corresponding to the text image by comparing the decoded features of the text image with the character element sequence features of each character in a preset dictionary; wherein the character element sequence is composed of each constituent element of the character and positional relationship information between each constituent element; Determining a character recognition result for the text image based on the first character recognition result and the second character recognition result; The character element sequence features of each character in the preset dictionary are obtained by the following processing: According to the spatial structure of the character, the character is split into elements to determine the various constituent elements contained in the character, and the spatial position relationship between the various constituent elements contained in the character is determined; Generate a character element sequence corresponding to the character by using a position relationship descriptor corresponding to the spatial position relationship between each component element included in the character and each component element included in the character; Feature extraction is performed on the character element sequence to obtain character element sequence features of the character.

2. The method according to claim 1, characterized in that Determining a second character recognition result corresponding to the text image by comparing the decoding feature of the text image with the character element sequence features of each character in a preset dictionary includes: The decoding features are input into a pre-trained structural decoding model, so that the structural decoding model determines the character recognition result corresponding to the text image by comparing the decoding features of the text image with the character element sequence features of each character in a preset dictionary, and uses the character recognition result determined by the structural decoding model as the second character recognition result corresponding to the text image.

3. The method according to claim 1, characterized in that Acquiring a decoding feature of a text image, and decoding to obtain a first character recognition result corresponding to the text image according to the decoding feature, including: A text image is input into a pre-trained character recognition model, and the character recognition model is made to perform feature extraction and character recognition processing on the text image to obtain decoding features and character recognition results output by the character recognition model, and the character recognition results output by the character recognition model are used as the first character recognition result corresponding to the text image.

4. The method according to claim 1, characterized in that The first character recognition result and the second character recognition result respectively record the probability that the character to be recognized in the text image is recognized as each character in the preset dictionary; Determining a character recognition result for the text image based on the first character recognition result and the second character recognition result includes: The first character recognition result and the second character recognition result are fused to determine a character recognition result for the text image.

5. The method according to claim 4, characterized in that The first character recognition result and the second character recognition result are fused to determine a character recognition result for the text image, including: Taking the weight of the first character recognition result as a first weight and the weight of the second character recognition result as a second weight, weighted summing the first character recognition result and the second character recognition result is performed to determine the probability that the character to be recognized in the text image is recognized as the weighted sum of each character in a preset dictionary; The character recognition result of the text image is determined according to the probability of the weighted sum of the characters to be recognized in the text image being recognized as the characters in the preset dictionary.

6. The method according to claim 5, characterized in that The magnitudes of the first weight and the second weight are determined as follows: If the character with the highest recognition probability recorded in the first character recognition result is a character in a preset similar character list, the second weight is set to be greater than the first weight; wherein the similar character list stores character pairs with similar shapes; the character with the highest recognition probability is the character corresponding to the highest probability among the probabilities of the character to be recognized being recognized as various characters in the preset dictionary; If the character with the highest recognition probability recorded in the first character recognition result is not a character in the preset similar character list, the second weight is set not to be greater than the first weight.

7. The method according to claim 1, characterized in that The first character recognition result and the second character recognition result are characters obtained by recognizing the characters to be recognized in the text image; Determining a character recognition result for the text image based on the first character recognition result and the second character recognition result includes: A character recognition result for the text image is selected from the first character recognition result and the second character recognition result.

8. The method according to claim 7, characterized in that Selecting a character recognition result for the text image from the first character recognition result and the second character recognition result includes: Determining whether the first character recognition result is a character in a preset similar character list; wherein the similar character list stores character pairs with similar shapes; If the first character recognition result is not a character in the preset similar character list, determining the first character recognition result as a character recognition result for the text image; If the first character recognition result is a character in a preset list of similar characters, determining whether a character pair formed by the first character recognition result and the second character recognition result is a character pair in the preset list of similar characters; If the character pair formed by the first character recognition result and the second character recognition result is a character pair in a preset similar character list, determining the second character recognition result as a character recognition result for the text image; If the character pair formed by the first character recognition result and the second character recognition result is not a character pair in a preset similar character list, the first character recognition result is determined as a character recognition result for the text image.

9. The method according to claim 2, characterized in that: The structural decoding model is trained in the following way: Obtaining decoding features of the character sample image, as well as character element sequence features of the positive sample label and character element sequence features of the negative sample label corresponding to the character sample image; Inputting the decoding features of the character sample image into a structural decoding model, so that the structural decoding model determines a character recognition result corresponding to the character sample image by comparing the decoding features of the character sample image with the character element sequence features of each character in the character sample set; The parameters of the structural decoding model are optimized with the goal of maximizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the positive sample label corresponding to the character sample image, and minimizing the similarity between the decoding features of the character sample image determined by the structural decoding model and the character element sequence features of the negative sample label corresponding to the character sample image.

10. The method according to claim 9, characterized in that The character samples used to train the structural decoding model include characters obtained by replacing constituent elements of the characters.

11. A character recognition device, characterized in that: include: A first recognition unit, used to obtain a decoding feature of the text image, and decode to obtain a first character recognition result corresponding to the text image according to the decoding feature; A second recognition unit is used to determine a second character recognition result corresponding to the text image by comparing the decoded features of the text image with the character element sequence features of each character in a preset dictionary; wherein the character element sequence is composed of each constituent element of the character and positional relationship information between each constituent element; a recognition result determining unit, configured to determine a character recognition result for the text image based on the first character recognition result and the second character recognition result; The character element sequence features of each character in the preset dictionary are obtained by the following processing: According to the spatial structure of the character, the character is split into elements to determine the various constituent elements contained in the character, and the spatial position relationship between the various constituent elements contained in the character is determined; Generate a character element sequence corresponding to the character by using a position relationship descriptor corresponding to the spatial position relationship between each component element included in the character and each component element included in the character; Feature extraction is performed on the character element sequence to obtain character element sequence features of the character.

12. A character recognition device, characterized in that: include: Memory and processor; Wherein, the memory is connected to the processor and is used to store programs; The processor is used to implement the character recognition method as described in any one of claims 1 to 10 by running the program in the memory.

13. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the character recognition method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Character identification device and character identification method

    CN102096828A

  • Character recognition method, device and equipment and readable storage medium

    CN111126410A

  • Character image recognition method and device, electronic equipment and storage medium

    CN111275046A

  • Character-recognizing method, computer-readable recording medium for recording the character- recognizing program and character-recognizing device

    JP2002183662A

  • Method, apparatus and storage medium for recognizing character

    US20200143191A1