A text recognition method, device, electronic device and storage medium
By using multiple text recognition models and the accurate number of error samples in image text recognition to determine the blur type and build a comprehensive recognition model, the problem of low accuracy in blurred image recognition in the existing technology is solved and higher recognition accuracy is achieved. and robustness.
Patent Information
- Application Number
- CN202011628551.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-12-31
AI Technical Summary
Existing image text recognition methods have low accuracy when processing blurred images, mainly because the training model cannot effectively handle the complexity of real blurring methods, resulting in poor classification results.
By inputting the blurred images to be recognized into a variety of trained text recognition models, and determining the blur type based on the text recognition accuracy of each model and the accurate number of error samples, a comprehensive recognition model is constructed to improve the recognition accuracy.
It significantly improves the accuracy of text recognition in blurred images, enhances the robustness of the recognition process, and can handle multiple blur types of images more effectively.
Smart Images

Figure CN112699875B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a text recognition method, device, electronic device and storage medium. Background Art
[0002] In the financial and insurance business, OCR (Optical Character Recognition) technology is widely used to identify text information on various documents, bills and other images uploaded by users, which is used in scenarios such as automatic information entry or review, effectively simplifying the workflow and improving work efficiency. For clear images, OCR has a high accuracy rate in text recognition, but for fuzzy images, the recognition effect is poor.
[0003] At present, there are two main types of image text recognition methods identified in the industry: one is to directly train real images. In this process, the real images need to be labeled. Since the real blurring method of the image is unknown, the labeled image labels are often different from the blurring method of the real image. Therefore, the trained model often has poor classification effect. The other type is to train synthetic blurred images. This type of blurred image is artificially blurred on the basis of a clear image. However, since the blurring effect of real images is often more complicated, the accuracy of text recognition on blurred images using this method is not high. Summary of the invention
[0004] In view of this, the embodiments of the present application at least provide a text recognition method, device, electronic device and storage medium, which inputs the blurred image to be recognized into various types of trained text recognition models, and determines the blur type in the real image based on two recognition conditions: the text recognition accuracy rate corresponding to each type of text recognition model, and the accurate number of text recognition in the text recognition error samples. Then, the text recognition is performed on the blurred image to be recognized through the comprehensive recognition model corresponding to these blur types, which can improve the accuracy of text recognition on the blurred image.
[0005] This application mainly includes the following aspects:
[0006] In a first aspect, an embodiment of the present application provides a text recognition method, the text recognition method comprising:
[0007] Input the fuzzy image to be recognized into each type of trained text recognition model respectively, and obtain the text recognition accuracy rate corresponding to each type of text recognition model;
[0008] From the multiple text recognition models, select the text recognition model with the highest text recognition accuracy as the first model, and obtain the first text that is incorrectly recognized by the first model in the fuzzy image to be recognized;
[0009] Based on the accurate number of characters recognized on the first text, determining a second model from other text recognition models among the plurality of text recognition models except the first model;
[0010] Based on the first model and the second model, a comprehensive recognition model is determined, and the fuzzy image to be recognized is input into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
[0011] In a possible implementation, trained text recognition models of various types are obtained according to the following steps:
[0012] Perform different types of blur processing on the multiple sample clear images respectively to obtain multiple types of sample second blurred images;
[0013] An initial recognition model of each type is trained using a plurality of sample second fuzzy images corresponding to the type to obtain a text recognition model corresponding to the type.
[0014] In a possible implementation, before performing different types of blur processing on the multiple sample clear images to obtain multiple types of sample second blurred images, the text recognition method further includes:
[0015] Acquire a plurality of sample first blurred images;
[0016] For each of the sample first blurred images, the sample first blurred image is sharpened to obtain a sample sharp image corresponding to the sample first blurred image.
[0017] In a possible implementation, the determining of the second model from other text recognition models in the plurality of text recognition models except the first model based on the accurate number of characters recognized for the first text includes:
[0018] From the multiple text recognition models other than the first model, select a text recognition model that has the highest number of accurate character recognitions for the first text and determine it as a first candidate model, and obtain a second text that is incorrectly recognized by the first candidate model in the first text;
[0019] From the multiple text recognition models other than the first model and the first candidate model, select a text recognition model with the highest number of accurate character recognitions for the second text and determine it as the second candidate model, until the accurate number is less than a preset threshold;
[0020] The first candidate model and the second candidate model are determined as the second model.
[0021] In a possible implementation, determining a comprehensive recognition model based on the first model and the second model according to the following steps includes:
[0022] Determining a first weight corresponding to the first model and a second weight corresponding to the second model;
[0023] A comprehensive fuzzy recognition model is determined according to the first model, the first weight, the second model, and the second weight.
[0024] In a second aspect, the embodiment of the present application further provides a text recognition device, the recognition device comprising:
[0025] The first input module is used to input the fuzzy image to be recognized into each type of trained text recognition model to obtain the text recognition accuracy rate corresponding to each type of text recognition model;
[0026] A selection module, configured to select the text recognition model with the highest text recognition accuracy from the multiple text recognition models as a first model, and obtain a first text that is incorrectly recognized by the first model in the fuzzy image to be recognized;
[0027] A determination module, configured to perform accurate character recognition on the first text, and determine a second model from other text recognition models among the plurality of text recognition models except the first model;
[0028] The second input module is used to determine a comprehensive recognition model based on the first model and the second model, and input the fuzzy image to be recognized into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
[0029] In a possible implementation, the input module obtains trained text recognition models of various types according to the following steps:
[0030] Perform different types of blur processing on the multiple sample clear images respectively to obtain multiple types of sample second blurred images;
[0031] An initial recognition model of each type is trained using a plurality of sample second fuzzy images corresponding to the type to obtain a text recognition model corresponding to the type.
[0032] In a possible implementation, before the input module performs different types of blur processing on the multiple sample clear images to obtain multiple types of sample second blurred images, the input module further includes:
[0033] Acquire a plurality of sample first blurred images;
[0034] For each of the sample first blurred images, the sample first blurred image is sharpened to obtain a sample sharp image corresponding to the sample first blurred image.
[0035] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the text recognition method described in the first aspect or any possible implementation manner of the first aspect.
[0036] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the text recognition method described in the first aspect or any possible implementation manner of the first aspect are executed.
[0037] In an embodiment of the present application, the blurry image to be identified is input into various types of trained text recognition models, and the blur type in the real image is determined based on two recognition conditions: the text recognition accuracy rate corresponding to each type of text recognition model and the accurate number of text recognition in text recognition error samples. Then, the text recognition is performed on the blurry image to be identified through the comprehensive recognition models corresponding to these blurry types, which can improve the accuracy of text recognition on the blurry image.
[0038] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A flowchart of a text recognition method provided by an embodiment of the present application is shown;
[0041] Figure 2 A flowchart of another text recognition method provided by an embodiment of the present application is shown;
[0042] Figure 3 A structural schematic diagram of a text recognition device provided in an embodiment of the present application is shown;
[0043] Figure 4 A schematic diagram showing the structure of another text recognition device provided in an embodiment of the present application is shown;
[0044] Figure 5 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.
[0045] Description of main component symbols:
[0046] In the figure: 300-text recognition device; 310-first input module; 320-selection module; 330-determination module; 331-first acquisition unit; 332-second acquisition unit; 333-determination unit; 340-second input module; 500-electronic device; 510-processor; 520-memory; 530-bus. DETAILED DESCRIPTION
[0047] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.
[0048] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0049] In order to enable those skilled in the art to use the contents of this application, the following implementation is given in combination with the specific application scenario of "text recognition". For those skilled in the art, the general principles defined here can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.
[0050] The text recognition method, device, electronic device and storage medium described in the embodiments of the present application can be applied to any text recognition scenario. The embodiments of the present application are not limited to specific application scenarios. Any scheme using the wireless communication method and device provided in the embodiments of the present application is within the protection scope of the present application.
[0051] It is worth noting that, through research, it was found that before the present application was submitted, there were two main types of image text recognition methods currently determined in the industry: one is to directly train with real images, during which the real images need to be labeled. Since the actual blurring method of the images is unknown, the labeled image labels are often different from the blurring method of the real images. Therefore, the trained models often have poor classification effects. The other type is to train with synthetic blurred images. This type of blurred image is a method of artificially adding blur to clear images. However, since the blurring effect of real images is often more complicated, the accuracy of text recognition on blurred images using this method is not high.
[0052] In response to the above problems, the embodiments of the present application provide a text recognition method, device, electronic device and storage medium. The blurred image to be recognized is input into various types of trained text recognition models, and the blur type in the real image is determined based on two recognition conditions: the text recognition accuracy rate corresponding to each type of text recognition model and the accurate number of text recognition in text recognition error samples. The text recognition result of the blurred image to be recognized is obtained, which greatly enhances the robustness of the text recognition process while enhancing the accuracy rate of the text recognition result.
[0053] To facilitate the understanding of the present application, the technical solution provided by the present application is described in detail below in conjunction with specific embodiments.
[0054] See also Figure 1 , Figure 1 This is a flowchart of a text recognition method provided by an embodiment of the present application. Figure 1 As shown in the text recognition method provided in the embodiment of the present application, the text recognition method includes:
[0055] S101, inputting the fuzzy image to be recognized into each type of trained text recognition model respectively, and obtaining the text recognition accuracy corresponding to each type of text recognition model.
[0056] In this step, the trained text recognition models of various types are text recognition models that have been trained with different blur types added. The optimal number of nodes of each text recognition model based on different blur types is obtained by inputting the blurry images to be recognized into the text recognition models of various types with different blur types added respectively. The optimal node accuracy of the text recognition model of this type is calculated based on the optimal number of nodes of the text recognition model of this type.
[0057] Here, taking the fuzzy image of "real birth certificate" to be recognized as an example, the following Table 1 is the data of inputting the fuzzy image of "real birth certificate" to be recognized into the text recognition model of different fuzzy types, as shown below:
[0058] Experiment Name Fuzzy Type Optimal node accuracy Experiment Zero none 0.793 Experiment 1 gaussian 0.817 Experiment 2 blur 0.901 Experiment 3 resize 0.873 Experiment 4 jpeg 0.894 Experiment 5 erode 0.857 Experiment 6 dilate 0.776 Experiment 7 median 0.900 Experiment 8 bilateralfilter 0.784 Experiment 9 motion 0.889
[0059] Table 1
[0060] Among them, the first column in Table 1 represents the experiment name, the second column represents the fuzzy type used in the experiment, and the third column represents the accuracy of the optimal node of the present recognition model when the text recognition model selects the optimal node.
[0061] According to the above experimental results, it can be seen that different types of text recognition models correspond to different text recognition accuracy rates, and no type of text recognition model corresponds to a text recognition accuracy rate of 100%, indicating that there are one or more different blur types on the blurred image to be identified, and it is difficult to represent the blur type of the current blurred image to be identified using only one blur type.
[0062] Further, the trained text recognition models of various types are obtained according to the following steps:
[0063] Get a plurality of sample first blurred images.
[0064] Here, the first blurred image is real blurred image data.
[0065] For each of the sample first blurred images, the sample first blurred image is sharpened to obtain a sample sharp image corresponding to the sample first blurred image.
[0066] In this step, the sample first blurred image is subjected to a clearing process, specifically by using a Synthtext algorithm to extract image features in the first blurred image, so as to obtain a sample clear image corresponding to the sample first blurred image.
[0067] Here, the sample clear image is a synthesized image, and the extracted image features may specifically include but are not limited to: the background of the image text, the font of the text, the font size of the text, and text quotations related to the text.
[0068] Different types of blur processing are performed on the multiple sample clear images to obtain multiple types of sample second blurred images.
[0069] In this step, a plurality of sample clear images are introduced into different types of single blur types respectively to perform blur processing on the plurality of sample clear images, so as to obtain a plurality of types of sample second blurred images.
[0070] Here, the blur types specifically include nine blur types: Gaussian blur type (gaussian), mean blur type (blur), downsampling type (resize), JPEG type (jpeg), erosion type (erode), dilation type (dilate), median filter type (median), bilateral filter type (bilateralfilter) and motion blur (motion).
[0071] The initial recognition model of each type is trained by using a plurality of sample second blurred images corresponding to the type to obtain a text recognition model corresponding to the type.
[0072] In this step, the constructed neural network model of each type is trained using the plurality of sample second fuzzy images corresponding to the type, so as to obtain a text recognition model of the trained neural network corresponding to the type.
[0073] Here, the initial recognition model is a constructed neural network model, specifically, a neural network constructed by using a CRNN algorithm to train a plurality of the sample second blurred images.
[0074] Among them, the specific process of the CRNN algorithm is as follows: the second blurred image is passed through a convolutional neural network structure (such as VGG16, Res50, etc.) to extract the high-dimensional features of the second blurred image, and then the sequence features of the text in the second blurred image and the context information of the text are extracted through a deep bidirectional recurrent neural network. Finally, the CTC loss function is used to train and recognize the neural network model.
[0075] S102: Select the text recognition model with the highest text recognition accuracy from the multiple text recognition models as the first model, and obtain the first text that is incorrectly recognized by the first model in the fuzzy image to be recognized.
[0076] In this step, the text recognition model with the highest text recognition accuracy is selected from the multiple text recognition models as the first model, and the first model is a benchmark experimental model among the text recognition models. The image that is incorrectly recognized by the benchmark experimental model represented by the first model in the fuzzy image to be recognized is taken as the first text.
[0077] Here, according to the embodiment shown in Table 1 above, it can be known that the accuracy of the optimal node of the text recognition model of the type shown in Experiment 2 in the blurred image to be recognized is higher than the accuracy of the optimal node in other text recognition models. Therefore, the text recognition model of the type shown in the experiment is selected as the first model, and the first text that is incorrectly recognized by the text recognition model of the type shown in Experiment 2 in the blurred image to be recognized is obtained.
[0078] S103: Based on the accurate number of characters recognized on the first text, determine a second model from other text recognition models in the multiple text recognition models except the first model.
[0079] In this step, a second model is selected from other text recognition models except the first model according to the accurate number of characters recognized by the first text.
[0080] Here, the second model is at least one other text recognition model except the first model, and the first model and the second model are the main blur types existing in the blurry image to be recognized.
[0081] S104, determining a comprehensive recognition model based on the first model and the second model, and inputting the fuzzy image to be recognized into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
[0082] In this step, the main blur type in the blurred image to be identified is determined based on the first model and the second model, and the main blur type is used as a comprehensive recognition model. As long as any blurred image to be identified that the user needs to identify is input into the comprehensive recognition model, the text recognition result of the blurred image to be identified can be obtained.
[0083] Further, determining a comprehensive recognition model based on the first model and the second model according to the following steps includes:
[0084] A first weight corresponding to the first model and a second weight corresponding to the second model are determined.
[0085] In this step, the first weight is set according to the text recognition accuracy of the first model in the image to be recognized, and the second weight is set according to the text recognition accuracy of the second model in the image to be recognized. The specific first weight and the second weight can be customized and adaptively adjusted according to specific experimental data and the text recognition accuracy of the fuzzy image.
[0086] A comprehensive fuzzy recognition model is determined according to the first model, the first weight, the second model, and the second weight.
[0087] In this step, the weight ratio of the first model and the second model is adjusted according to the setting of the first weight and the second weight, and the fuzzy ratio of the first model and the second model is determined by adjusting the weight ratio, so as to improve the recognition result of the text recognition model on the fuzzy image to be recognized.
[0088] Compared with the text recognition method in the prior art, the text recognition method provided in the embodiment of the present application inputs the blurred image to be recognized into various types of trained text recognition models, and determines the blur type in the real image based on two recognition conditions: the text recognition accuracy rate corresponding to each type of text recognition model and the accurate number of text recognition in the text recognition error samples. Then, the text recognition is performed on the blurred image to be recognized through the comprehensive recognition model corresponding to these blur types, which can improve the accuracy of text recognition on the blurred image.
[0089] See also Figure 2 , Figure 2 Flow chart of another text recognition method provided by the embodiment of the present application. Figure 2 As shown in the text recognition method provided in the embodiment of the present application, the text recognition method includes:
[0090] S201, inputting the fuzzy image to be recognized into each type of trained text recognition model respectively, and obtaining the text recognition accuracy corresponding to each type of text recognition model.
[0091] S202: Select the text recognition model with the highest text recognition accuracy from the multiple text recognition models as the first model, and obtain the first text that is incorrectly recognized by the first model in the blurred image to be recognized.
[0092] Among them, the description of steps S201 to S202 and S206 can refer to the description of steps S101 to S103, and can achieve the same technical effects, which will not be repeated here.
[0093] S203. From the multiple text recognition models other than the first model, select a text recognition model that has the highest number of accurate character recognition results for the first text and determine it as a first candidate model, and obtain a second text that is incorrectly recognized by the first candidate model in the first text.
[0094] In this step, based on the accurate number of text recognition performed on the first text, a text recognition model with the highest accurate number of text recognition in the first text is selected from other text recognition models except the first model as the first candidate model, and a sample image in which the blurred image to be recognized is incorrectly recognized in the first candidate model is used as the second text.
[0095] S204. From the multiple text recognition models except the first model and the first candidate model, select a text recognition model with the highest number of accurate character recognitions for the second text and determine it as the second candidate model, until the accurate number is less than a preset threshold.
[0096] In this step, according to the accurate number of characters recognized in the second text, a text recognition model with the highest accurate number of characters recognized in the second text is selected from other text recognition models except the first model and the first candidate model as the second candidate model, and a sample image with incorrect recognition of the fuzzy image to be recognized in the first candidate model is used as the third text, and the above process is repeated until the accurate number in the other text recognition models is less than a preset threshold.
[0097] Here, we take the blurred image of "real birth certificate" to be identified as an example, as shown in Table 2:
[0098]
[0099] Table 2
[0100] Among them, the first row of Table 2 represents different experiment names, the second row records the fuzzy types used in different experiments, the third row represents the optimal node values of different experiments on the real fuzzy test set of birth certificates, the fourth, fifth, sixth and seventh rows on the far left represent the selected benchmark experiment names, and the other numerical values represent the accurate number of text recognition statistics performed by other experiments in the text.
[0101] For example, the number "41" in the third column of the fourth row means that when Experiment 2 is used as the benchmark experiment for the first model, when Experiment 1 performs text recognition on samples with incorrect recognition of blurred images in Experiment 2, the accurate number in Experiment 1 is 41. The other data in the table have the same meaning as above.
[0102] Here, when Experiment 2 is used as the first model, Experiment 4 which has the highest number of accurate character recognition for the first text is selected as the first candidate model from other text recognition models except Experiment 2, and the second text which is incorrectly recognized by Experiment 4 in the first text is obtained.
[0103] Continue to select Experiment 7, which has the highest number of accurate character recognition for the second text, as the second candidate model from other text recognition models except Experiment 2 and Experiment 4, and obtain the third text that Experiment 7 recognizes incorrectly in the second text.
[0104] Continue to select Experiment 9 with the highest accurate number of text recognition for the third text from other text recognition models except Experiment 2, Experiment 4 and Experiment 7 as the third candidate model, until the accurate number in the other text recognition models is less than a preset threshold, ending with Experiment 9 in this embodiment.
[0105] In this way, the preset threshold can be customized according to the accurate number in the text recognition model in the experiment. In this embodiment, the preset threshold is preset to 10.
[0106] S205: Determine the first candidate model and the second candidate model as the second model.
[0107] In this step, the text recognition model whose accurate number among the first candidate model, the second candidate model and other unknown text recognition models is greater than a preset threshold is determined as the second model.
[0108] Here, in combination with this embodiment, experiment 4 of the first candidate model, experiment 7 of the second candidate model, and experiment 9 of the third candidate model are determined as the second model.
[0109] S206. Determine a comprehensive recognition model based on the first model and the second model, and input the fuzzy image to be recognized into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
[0110] In this step, combined with the above Table 2, it can be seen that the comprehensive model is a text recognition model determined based on the experiment two, the experiment four, the experiment seven and the experiment nine.
[0111] The weight ratio of the experiment 2, the experiment 4, the experiment 7 and the experiment 9 is set to 1:1:1:1, and the weights are adaptively adjusted, as shown in Table 3:
[0112] Experiment Name Fuzzy Type Optimal node accuracy Experiment Zero none 0.793 Experiment 2 blur 0.901 Experiment 4 jpeg 0.894 Experiment 7 median 0.900 Experiment 9 motion 0.889 Experimental blur∶jpeg∶median; motion=1∶1∶1∶1 0.956
[0113] Table 3
[0114] In the above Table 3, the first column indicates the experiment name, the second column corresponds to the fuzzy type used in the experiment, the third column records the optimal node saved during the model training process, and the fourth column corresponds to the accuracy of the model on the fuzzy test set when taking the optimal node.
[0115] It can be seen from the weight adjustment in the above Table 3 that when the weight ratio of Experiment 2, Experiment 4, Experiment 7 and Experiment 9 is 1:1:1:1 (that is, Experiment 10), and the blurred image to be identified is input into the comprehensive recognition model, the text recognition result of the blurred image to be identified is more accurate.
[0116] Compared with the text recognition method in the prior art, the text recognition method provided in the embodiment of the present application inputs the blurred image to be recognized into various types of trained text recognition models, and determines the blur type in the real image based on two recognition conditions: the text recognition accuracy rate corresponding to each type of text recognition model and the accurate number of text recognition in the text recognition error samples. Then, the text recognition is performed on the blurred image to be recognized through the comprehensive recognition model corresponding to these blur types, which can improve the accuracy of text recognition on the blurred image.
[0117] Based on the same inventive concept, a text recognition device 300 corresponding to the text recognition method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned detection method in the embodiment of the present application, the implementation of the text recognition device 300 can refer to the implementation of the method, and the repeated parts will not be repeated.
[0118] See also Figure 3 , Figure 3 Schematic diagram of the structure of a text recognition device 300 provided in an embodiment of the present application. Figure 3 As shown in the text recognition device 300 provided in the embodiment of the present application, the text recognition device 300 includes:
[0119] The first input module 310 is used to input the fuzzy image to be recognized into each type of trained text recognition model to obtain the text recognition accuracy corresponding to each type of text recognition model.
[0120] Furthermore, the input module obtains the trained text recognition models of various types according to the following steps:
[0121] Get a plurality of sample first blurred images.
[0122] For each of the sample first blurred images, the sample first blurred image is sharpened to obtain a sample sharp image corresponding to the sample first blurred image.
[0123] Different types of blur processing are performed on the multiple sample clear images to obtain multiple types of sample second blurred images.
[0124] An initial recognition model of each type is trained using a plurality of sample second fuzzy images corresponding to the type to obtain a text recognition model corresponding to the type.
[0125] The selection module 320 is used to select the text recognition model with the highest text recognition accuracy from the multiple text recognition models as the first model, and obtain the first text that is incorrectly recognized by the first model in the fuzzy image to be recognized.
[0126] The determination module 330 is used to determine the exact number of characters recognized on the first text, and to determine a second model from other text recognition models in the multiple text recognition models except the first model.
[0127] The second input module 340 is used to determine a comprehensive recognition model based on the first model and the second model, and input the fuzzy image to be recognized into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
[0128] Furthermore, the second input module 340 determines a comprehensive recognition model based on the first model and the second model according to the following steps, including:
[0129] A first weight corresponding to the first model and a second weight corresponding to the second model are determined.
[0130] A comprehensive fuzzy recognition model is determined according to the first model, the first weight, the second model, and the second weight.
[0131] Compared with the text recognition method in the prior art, the text recognition method provided in the embodiment of the present application inputs the blurred image to be recognized into various types of trained text recognition models, and determines the blur type in the real image based on two recognition conditions: the text recognition accuracy rate corresponding to each type of text recognition model and the accurate number of text recognition in the text recognition error samples. Then, the text recognition is performed on the blurred image to be recognized through the comprehensive recognition model corresponding to these blur types, which can improve the accuracy of text recognition on the blurred image.
[0132] See also Figure 4 , Figure 4 FIG. 3 is a schematic diagram of another text recognition device 300 provided in an embodiment of the present application. Figure 4 As shown in the text recognition device 300 provided in the embodiment of the present application, the text recognition device 300 includes:
[0133] The first input module 310 is used to input the fuzzy image to be recognized into each type of trained text recognition model to obtain the text recognition accuracy corresponding to each type of text recognition model.
[0134] The selection module 320 is used to select the text recognition model with the highest text recognition accuracy from the multiple text recognition models as the first model, and obtain the first text that is incorrectly recognized by the first model in the fuzzy image to be recognized.
[0135] The determination module 330 is used to determine the exact number of characters recognized on the first text, and to determine a second model from other text recognition models in the multiple text recognition models except the first model.
[0136] Furthermore, the determination module 330 includes:
[0137] The first acquisition unit 331 is used to select a text recognition model with the highest number of accurate character recognition for the first text from other text recognition models except the first model among the multiple text recognition models, determine it as the first candidate model, and obtain the second text that is incorrectly recognized by the first candidate model in the first text.
[0138] The second acquisition unit 332 is used to select a text recognition model with the highest number of accurate character recognitions for the second text from the multiple text recognition models except the first model and the first candidate model, and determine it as the second candidate model until the accurate number is less than a preset threshold.
[0139] The determination unit 333 is used to determine the first candidate model and the second candidate model as the second model.
[0140] The second input module 340 is used to determine a comprehensive recognition model based on the first model and the second model, and input the fuzzy image to be recognized into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
[0141] Compared with the text recognition method in the prior art, the text recognition method provided in the embodiment of the present application inputs the blurred image to be recognized into various types of trained text recognition models, and determines the blur type in the real image based on two recognition conditions: the text recognition accuracy rate corresponding to each type of text recognition model and the accurate number of text recognition in the text recognition error samples. Then, the text recognition is performed on the blurred image to be recognized through the comprehensive recognition model corresponding to these blur types, which can improve the accuracy of text recognition on the blurred image.
[0142] Based on the same application idea, please refer to Figure 5 , Figure 5A structural diagram of an electronic device 500 provided for an embodiment of the present application includes: a processor 510, a memory 520 and a bus 530, wherein the memory 520 stores machine-readable instructions executable by the processor 510, and when the electronic device 500 is running, the processor 510 communicates with the memory 520 through the bus 530, and the machine-readable instructions are executed by the processor 510 when running to perform the steps of the text recognition method described in any of the above embodiments.
[0143] Specifically, when the machine-readable instruction is executed by the processor 510, the following processing may be performed:
[0144] The fuzzy images to be recognized are input into the trained text recognition models of various types respectively to obtain the text recognition accuracy corresponding to each type of text recognition model.
[0145] From the multiple text recognition models, the text recognition model with the highest text recognition accuracy is selected as the first model, and the first text that is incorrectly recognized by the first model in the fuzzy image to be recognized is obtained.
[0146] Based on the accurate number of characters recognized on the first text, a second model is determined from other text recognition models among the multiple text recognition models except the first model.
[0147] Based on the first model and the second model, a comprehensive recognition model is determined, and the fuzzy image to be recognized is input into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
[0148] Compared with the text recognition method in the prior art, the text recognition method provided in the embodiment of the present application inputs the blurred image to be recognized into various types of trained text recognition models, and determines the blur type in the real image based on two recognition conditions: the text recognition accuracy rate corresponding to each type of text recognition model and the accurate number of text recognition in the text recognition error samples. Then, the text recognition is performed on the blurred image to be recognized through the comprehensive recognition model corresponding to these blur types, which can improve the accuracy of text recognition on the blurred image.
[0149] Based on the same application concept, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the text recognition method provided in the above embodiment are executed. The specific implementation method can be found in the method embodiment, which will not be repeated here.
[0150] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, the above-mentioned detection method can be executed. The blurred image to be identified can be input into various types of trained text recognition models, and the blur type in the real image can be determined based on the text recognition accuracy rate corresponding to each type of text recognition model and the accurate number of text recognition in the text recognition error samples. Then, the text recognition can be performed on the blurred image to be identified through the comprehensive recognition models corresponding to these blur types, which can improve the accuracy of text recognition on the blurred image.
[0151] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, 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 through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0153] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0154] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0155] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for character recognition, characterized in that: The text recognition method comprises: Input the fuzzy image to be recognized into the trained text recognition models of various types respectively, and obtain the text recognition accuracy corresponding to each type of text recognition model; wherein the trained text recognition models of various types are text recognition models that have been trained and added with different fuzzy types; From the multiple text recognition models, the text recognition model with the highest text recognition accuracy is selected as the first model, and the first text that is incorrectly recognized by the first model in the fuzzy image to be recognized is obtained; based on the accurate number of texts recognized for the first text, a second model is determined from other text recognition models in the multiple text recognition models except the first model; Based on the first model and the second model, a comprehensive recognition model is determined, and the fuzzy image to be recognized is input into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
2. The text recognition method according to claim 1, characterized in that: According to the following steps, we can get the trained text recognition models of various types: Perform different types of blur processing on the multiple sample clear images respectively to obtain multiple types of sample second blurred images; An initial recognition model of each type is trained using a plurality of sample second fuzzy images corresponding to the type to obtain a text recognition model corresponding to the type.
3. The text recognition method according to claim 2, characterized in that: Before performing different types of blur processing on the multiple sample clear images to obtain multiple types of sample second blurred images, the text recognition method further includes: Acquire a plurality of sample first blurred images; For each of the sample first blurred images, the sample first blurred image is sharpened to obtain a sample sharp image corresponding to the sample first blurred image.
4. The text recognition method according to claim 1, characterized in that: The determining of a second model from other text recognition models in the plurality of text recognition models except the first model based on the accurate number of characters recognized for the first text comprises: From the multiple text recognition models other than the first model, select a text recognition model that has the highest number of accurate character recognitions for the first text and determine it as a first candidate model, and obtain a second text that is incorrectly recognized by the first candidate model in the first text; From the multiple text recognition models other than the first model and the first candidate model, select a text recognition model with the highest number of accurate character recognitions for the second text and determine it as the second candidate model, until the accurate number is less than a preset threshold; The first candidate model and the second candidate model are determined as the second model.
5. The text recognition method according to claim 1, characterized in that: Determining a comprehensive recognition model based on the first model and the second model according to the following steps includes: Determining a first weight corresponding to the first model and a second weight corresponding to the second model; A comprehensive fuzzy recognition model is determined according to the first model, the first weight, the second model, and the second weight.
6. A text recognition device, characterized in that: The identification device comprises: The first input module is used to input the fuzzy image to be recognized into the trained text recognition models of various types, and obtain the text recognition accuracy corresponding to each type of text recognition model; wherein the trained text recognition models of various types are text recognition models that have been trained and added with different fuzzy types; A selection module is used to select the text recognition model with the highest text recognition accuracy from the multiple text recognition models as a first model, and obtain a first text that is incorrectly recognized by the first model in the fuzzy image to be recognized; A determination module, configured to perform accurate character recognition on the first text, and determine a second model from other text recognition models among the plurality of text recognition models except the first model; The second input module is used to determine a comprehensive recognition model based on the first model and the second model, and input the fuzzy image to be recognized into the comprehensive recognition model to obtain a text recognition result of the fuzzy image to be recognized.
7. The character recognition device according to claim 6, characterized in that: The input module obtains the trained text recognition models of various types according to the following steps: Perform different types of blur processing on the multiple sample clear images respectively to obtain multiple types of sample second blurred images; An initial recognition model of each type is trained using a plurality of sample second fuzzy images corresponding to the type to obtain a text recognition model corresponding to the type.
8. The character recognition device according to claim 7, characterized in that: Before the input module performs different types of blur processing on the multiple sample clear images to obtain multiple types of sample second blurred images, the input module further includes: Acquire a plurality of sample first blurred images; For each of the sample first blurred images, the sample first blurred image is sharpened to obtain a sample sharp image corresponding to the sample first blurred image.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the text recognition method as described in any one of claims 1 to 5 are performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the text recognition method as described in any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
License plate recognition method and cloud system
CN108701234A
Fuzzy character detection and recognition method based on deep learning
CN110276253A
