Method and device for determining sample of character recognition model

By selecting high-confidence samples from the labeled sample set for multiple rounds of training and closed-loop iteration of unlabeled data, the problem of variable annotation quality and high cleaning costs in text recognition technology is solved, and efficient training sample quality improvement and Model confidence is enhanced.

CN118629054APending Publication Date: 2024-09-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410749748.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

In existing text recognition technology, the annotation quality of historical data is uneven, the cleaning cost is high, and the quality of manual cleaning is difficult to guarantee. How to utilize unlabeled new data efficiently and cost-effectively has become a problem.

Method used

By filtering out samples with confidence greater than the threshold from the labeled sample set, multiple rounds of training and iteration are performed to achieve automatic cleaning of labeled data and closed-loop iteration of unlabeled data to ensure the quality of training samples.

Benefits of technology

It reduces labor costs, improves the quality of training samples, enhances the confidence of model output, avoids text misrecognition problems caused by the quality of training samples, and improves data utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118629054A
    Figure CN118629054A
Patent Text Reader

Abstract

The invention provides a sample determination method and device for a character recognition model. The invention relates to the technical field of artificial intelligence, in particular to the technical fields of computer vision, deep learning, image processing, character recognition and the like, and can be applied to scenes of smart cities, smart finance and the like. Obtaining an updated first training set based on the initial first character recognition model; retraining the initial first character recognition model by using the updated first training set to obtain an updated first character recognition model; obtaining a first training set updated again based on the updated first character recognition model; based on the first training set which is updated again, retraining the updated first character recognition model until a first preset condition is met; and determining a first class sample set according to a first training set adopted by the target first character recognition model obtained by training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically to technical fields such as computer vision, deep learning, image processing, and text recognition, and can be applied to scenarios such as smart cities and smart finance. Background Art

[0002] With the development of technology, the data accumulated by major text recognition service providers is becoming more and more abundant, and the scenarios covered are becoming more and more extensive. However, the richer the accumulated historical data sources, the more uneven the annotation quality is. The cost of cleaning these annotations is high, and the quality of manual cleaning is still difficult to guarantee. Summary of the invention

[0003] The present disclosure provides a sample determination method for a text recognition model, a training method for a text recognition model, and a text recognition method and device.

[0004] According to a first aspect of the present disclosure, a sample determination method for a text recognition model is provided, comprising:

[0005] The training model is trained based on the initial first training set to obtain an initial first text recognition model; wherein the samples in the initial first training set are labeled samples with confidence greater than a first threshold selected from the labeled sample set;

[0006] Based on the initial first character recognition model, an updated first training set is obtained; and the initial first character recognition model is retrained using the updated first training set to obtain an updated first character recognition model;

[0007] Based on the updated first text recognition model, obtaining a first training set that is updated again; based on the first training set that is updated again, retraining the updated first text recognition model until a first preset condition is met;

[0008] A first type of sample set is determined based on a first training set used by a target first text recognition model obtained through training.

[0009] According to a second aspect of the present disclosure, a method for training a text recognition model is provided, comprising:

[0010] Get a sample set;

[0011] The pre-trained model is trained based on the sample set to obtain a text recognition model;

[0012] The sample set is obtained based on the sample determination method of the text recognition model of the first aspect.

[0013] According to a third aspect of the present disclosure, there is provided a text recognition method, comprising:

[0014] Obtain an image to be recognized;

[0015] Inputting the image to be recognized into the text recognition model, and obtaining the text recognition result of the image to be recognized output by the text recognition model;

[0016] The text recognition model is obtained based on training of a sample set, and the sample set is obtained based on the sample determination method of the text recognition model of the first aspect.

[0017] According to a fourth aspect of the present disclosure, a sample determination device for a text recognition model is provided, comprising:

[0018] A first training module is used to train the training model based on an initial first training set to obtain an initial first text recognition model; wherein the samples in the first training set are labeled samples with a confidence level greater than a first threshold selected from the labeled sample set;

[0019] A second training module is used to select, based on the initial first character recognition model, labeled samples with a confidence greater than a first threshold from the remaining labeled samples in the labeled sample set to obtain an updated first training set; retrain the initial first character recognition model using the updated first training set to obtain an updated first character recognition model; obtain a re-updated first training set based on the updated first character recognition model; and retrain the updated first character recognition model based on the re-updated first training set until a first preset condition is met;

[0020] The first determination module is used to determine a first type of sample set according to a first training set used by a target first text recognition model obtained through training.

[0021] According to a fifth aspect of the present disclosure, a training device for a text recognition model is provided, comprising:

[0022] A first acquisition module, used to acquire a sample set;

[0023] The third training module is used to train the pre-trained model based on the sample set to obtain a text recognition model;

[0024] The sample set is obtained based on the sample determination method of the text recognition model of the first aspect.

[0025] According to a sixth aspect of the present disclosure, there is provided a text recognition device, comprising:

[0026] A second acquisition module is used to acquire an image to be identified;

[0027] The second recognition module is used to input the image to be recognized into the text recognition model to obtain the text recognition result of the image to be recognized output by the text recognition model;

[0028] The text recognition model is obtained based on training of a sample set, and the sample set is obtained based on the sample determination method of the text recognition model of the first aspect.

[0029] According to the seventh aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; a memory communicatively connected to the at least one processor; the memory storing instructions that can be executed by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor can execute the sample determination method of the text recognition model provided in the first aspect and / or the training method of the text recognition model provided in the second aspect and / or the text recognition method provided in the third aspect.

[0030] According to the eighth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the sample determination method of the text recognition model provided by the first aspect and / or the training method of the text recognition model provided by the second aspect and / or the text recognition method provided by the third aspect.

[0031] According to the ninth aspect of the present disclosure, a computer program product is provided, comprising a computer program stored on a storage medium, which, when executed by a processor, implements the sample determination method of the text recognition model provided in the first aspect and / or the training method of the text recognition model provided in the second aspect and / or the text recognition method provided in the third aspect.

[0032] According to the technical solution disclosed in the present invention, correct labeled samples can be screened out from a set of labeled samples, thereby achieving automatic cleaning of labeled data and improving the quality of training samples obtained after cleaning.

[0033] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.

[0035] Figure 1 The following is a flow chart of a sample determination method of a text recognition model according to an embodiment of the present disclosure. Figure 1 ;

[0036] Figure 2 is a schematic diagram of a process for cleaning labeled data according to an embodiment of the present disclosure;

[0037] Figure 3 The following is a flow chart of a sample determination method of a text recognition model according to an embodiment of the present disclosure. Figure 2 ;

[0038] Figure 4 is a schematic diagram of a process of determining a second type of sample set based on a second training set according to an embodiment of the present disclosure;

[0039] Figure 5 is a schematic diagram of a process of cleaning unlabeled data according to an embodiment of the present disclosure;

[0040] Figure 6 is a flowchart of a method for training a text recognition model according to an embodiment of the present disclosure;

[0041] Figure 7 is a flowchart of a text recognition method according to an embodiment of the present disclosure;

[0042] Figure 8 is a structural schematic diagram of a sample determination device of a text recognition model according to an embodiment of the present disclosure;

[0043] Fig. 9 is a structural schematic diagram of a training device for a text recognition model according to an embodiment of the present disclosure;

[0044] Fig.10 is a structural schematic diagram of a text recognition device according to an embodiment of the present disclosure;

[0045] Fig.11 is a schematic diagram of a scenario of a sample determination method of a text recognition model according to an embodiment of the present disclosure;

[0046] Fig.12 is a schematic diagram of a scenario of a method for training a text recognition model according to an embodiment of the present disclosure;

[0047] Fig.13 is a schematic diagram of a scene of a text recognition method according to an embodiment of the present disclosure;

[0048] Fig.14 It is a structural schematic diagram of an electronic device used to implement the sample determination method of the text recognition model and / or the training method of the text recognition model and / or the text recognition method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0049] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0050] The terms "first", "second", and "third", etc. in the specification embodiments and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, including a series of steps or units. The method, system, product, or device is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0051] Optical Character Recognition (OCR) refers to the process of translating text on an image into computer text through electronic devices. The mainstream industrial text recognition training process often includes: text detection (Text Detection) → text recognition (Text Recognition) based on text lines / text blocks → post-processing based on semantics / prior knowledge. The accuracy of the text recognition model depends largely on the quality of the training samples.

[0052] The text recognition technology based on deep learning has been developed for decades. The data accumulation of major text recognition service providers is becoming more and more abundant, and the coverage of scenarios is becoming more and more extensive. The huge stock data is the basis of excellent text recognition models, but maintaining the stock data is sometimes a burden. The accumulated historical data often comes from rich sources, and the quality of annotations varies. It is costly to clean these annotations, and the quality of manual cleaning is still difficult to guarantee. At the same time, as the business expands, suppliers often obtain new unlabeled data continuously. How to make good use of the new unlabeled data efficiently and at low cost is also a difficult problem.

[0053] In related technologies, faced with massive amounts of text recognition data, some suppliers will perform data cleaning by screening based on confidence and then manually annotating, thereby reducing the cost of manual annotation to a certain extent. However, there are many problems with the method of screening samples based on confidence for labeling. First, the confidence of the model may not be reliable. Since there are problems with the quality of the training samples of the model itself, the model's judgment of high confidence does not mean that there are no errors in the annotation. Secondly, the quality of manual cleaning is questionable. When the effect of the model has developed to a higher level, the samples that the model is prone to make mistakes on are also difficult for the human eye to recognize, especially some uncommon characters and similar characters.

[0054] In the related art, in order to ensure the quality of samples and reduce the cost of annotation, suppliers sometimes also adopt the method of artificial samples. The first method of artificial samples is to use generative adversarial networks (GAN) and other methods to generate rich text data based on models. However, using models to produce artificial samples cannot solve the quality problem. Whether the fonts of the text produced by the model are accurate remains to be discussed, especially when it is expected to use this font to guide the training of the text recognition model, it may also cause confusion in rare characters and similar characters. The second method of artificial samples is to use open source libraries such as open source computer vision library (openCV) and Python imaging library (PIL) to add words to pictures of specific scenes, and add disturbances such as Gaussian noise to simulate real scenes. However, although using scripts to generate samples in a targeted manner can generate data for specific scenes in large quantities at low cost, it is relatively expensive to customize strategies for each scene when there are many scenes, and artificial samples cannot fully simulate the complex and subtle disturbances of real scenes.

[0055] In order to at least partially solve one or more of the above problems and other potential problems, the present disclosure proposes a sample determination solution for a text recognition model, which can greatly reduce labor costs and ensure the quality of training samples through the cleaning of labeled data and closed-loop iteration of unlabeled data, thereby making the confidence of the model output more meaningful. At the same time, the problem of text misrecognition caused by the quality of training samples can be largely avoided.

[0056] The present disclosure provides a method for determining a sample of a text recognition model. Figure 1It is a flow chart of a sample determination method for a text recognition model according to an embodiment of the present disclosure. The sample determination method for a text recognition model can be applied to a sample determination device for a text recognition model. The sample determination device for a text recognition model is located in an electronic device. The electronic device includes but is not limited to fixed devices and / or mobile devices. For example, fixed devices include but are not limited to servers, and the server can be a cloud server or an ordinary server. For example, mobile devices include but are not limited to mobile phones, tablet computers, vehicle-mounted terminals, personal computers, etc. In some possible implementations, the sample determination method for a text recognition model can also be implemented by a processor calling computer-readable instructions stored in a memory. For example Figure 1 As shown, the sample determination method of the text recognition model includes:

[0057] S101: training a model to be trained based on an initial first training set to obtain an initial first text recognition model; wherein the samples in the first training set are labeled samples selected from a set of labeled samples and having a confidence level greater than a first threshold;

[0058] S102: obtaining an updated first training set based on the initial first character recognition model; retraining the initial first character recognition model using the updated first training set to obtain an updated first character recognition model;

[0059] S103: obtaining a first training set after being updated again based on the updated first character recognition model; and retraining the updated first character recognition model based on the first training set after being updated again until a first preset condition is met;

[0060] S104: Determine a first type of sample set according to a first training set used by a target first text recognition model obtained through training.

[0061] In the disclosed embodiment, the “model to be trained” may be an initial model that has not yet been trained with data.

[0062] In the disclosed embodiment, the first training set in S101 is an initial data set for training the first text recognition model. In some embodiments, labeled data is obtained from multiple suppliers providing text recognition services, and the first training set is obtained based on the multiple labeled data. In some embodiments, the first training set can be obtained by screening from an open source image library. In some embodiments, the first training set can be obtained by screening from a public data set. The above is only an exemplary description and is not intended to limit all possible sources of the first training set, but it is not exhaustive here.

[0063] In the disclosed embodiment, the initial first text recognition model is a first text recognition model obtained by training the to-be-trained model based on the initial first training set. The accuracy of the initial first text recognition model is lower than that of the updated first text recognition model. As the version of the first text recognition model is upgraded, the accuracy of the first text recognition model also increases.

[0064] In the disclosed embodiment, the annotated sample set refers to a set of data samples that have been annotated manually or automatically. Optionally, the annotated samples in the annotated sample set may be images with text, and the annotated samples have been annotated manually or by machine. For example, an image of "a sign containing Swan Lake Park" contains the text "Swan Lake Park". The text in the image is annotated manually or by machine, and the annotated result is "Swan Lake Park".

[0065] In the embodiment of the present disclosure, the first threshold may be a numerical value, such as 0.6, 0.8, 0.9, etc.; the first threshold may also be a specific range, such as 0.7-0.8, 0.8-0.9, etc. Here, the first threshold is not specifically limited and can be flexibly configured according to actual needs.

[0066] In some implementations, selecting labeled samples with a confidence level greater than a first threshold from the labeled sample set includes:

[0067] Using multiple models to identify target samples in the labeled sample set, respectively, to obtain recognition results and confidence levels for the target samples corresponding to the multiple models;

[0068] If the recognition results of each model are consistent with the labeling results and the confidence levels are greater than the first threshold, the target sample is added to the first training set.

[0069] Here, the target sample is any sample in the labeled sample set. The confidence thresholds corresponding to different models can be the same or different. In practical applications, multiple models can use a unified first threshold or their respective first thresholds.

[0070] Here, the first threshold of the confidence level corresponding to the labeled sample can be set or adjusted according to the accuracy of the model. The higher the accuracy, the larger the first threshold. For example, the first threshold of a model accuracy of 90% is greater than the first threshold of a model accuracy of 80%.

[0071] In the disclosed embodiment, the updated first training set is used to train the initial first text recognition model to obtain the updated first text recognition model. The updated first training set may include: annotated samples with a confidence greater than a first threshold selected from the annotated sample set and annotated samples with a confidence greater than the first threshold selected from the remaining annotated samples in the annotated sample set based on the initial first text recognition model.

[0072] In an embodiment of the present disclosure, based on the initial first text recognition model, an updated first training set is obtained, including: based on the initial first text recognition model, labeled samples with confidence greater than a first threshold are screened out from the remaining labeled samples in the labeled sample set to obtain an updated first training set.

[0073] In the disclosed embodiment, the updated first text recognition model is a first text recognition model obtained by training the initial first text recognition model based on the updated first training set. The accuracy of the updated first text recognition model is higher than that of the initial first text recognition model. The accuracy of the updated first text recognition model is at least lower than that of the first text recognition model after being updated again. In the disclosed embodiment, the first preset condition may include at least one of the following: the evaluation index of the model reaches the first evaluation value; the number of screened labeled samples is lower than the first quantity threshold. The above is only an exemplary description and is not intended to limit all possible contents of the first preset condition, but it is not exhaustive here.

[0074] In the embodiment of the present disclosure, the first type of sample set is a sample set selected from the labeled sample set. The samples in the first type of sample set are at least samples with accurate labels. The first type of sample set can be used for closed-loop iteration of combining unlabeled samples.

[0075] In the disclosed embodiment, the target first character recognition model may be the first character recognition model when the first preset condition is satisfied, or may be any first character recognition model between the initial first character recognition model and the first character recognition model when the first preset condition is satisfied.

[0076] To facilitate the understanding of “initial”, “updated” and “updated again”, “initial” is recorded as “first edition”, “updated” is recorded as “second edition”, and “updated again” is recorded as “3rd to Yth edition”, Y≥3, and Y is an integer.

[0077] Figure 2 The schematic diagram of the process of labelled data cleaning is shown in Figure 2 As shown, the process may include:

[0078] S201: training a model to be trained based on a first training set of a first version to obtain a first text recognition model of a first version. Specifically, S201 includes S201a and S201b.

[0079] S201 a: Screening the labeled samples in the labeled sample set according to the K models and the labeling results to obtain the first training set of the first version; here, K is a positive integer, and the K models can be recorded as model-1, model-2, ..., model-K.

[0080] S201b: training the to-be-trained model based on the first training set of the first version to obtain a first text recognition model of the first version;

[0081] like Figure 2 As shown in the figure, in the first round of cleaning of "labeled samples in the labeled sample set", multiple models can be voted. Suppliers of text recognition services have accumulated a large amount of historical data, which often include multiple models with different scenarios and characteristics. Suppliers can select multiple appropriate models based on the characteristics of the data and comprehensively judge whether each labeled sample needs to be retained together with the labeling results.

[0082] For example, whether the recognition results and labeling results of the K models are completely identical can be used as a basis for judgment. If the recognition results of the K models for a labeled sample are all the same, then the labeled sample is added to the first training set.

[0083] For another example, whether the recognition results and labeling results of the K models are exactly the same, and whether the confidence of the recognition results of the K models is greater than the first threshold, can be used as a basis for judgment. If the recognition results of the K models for a labeled sample are the same, and the confidence of the recognition results of each model is greater than the first threshold, then the labeled sample is added to the first training set.

[0084] For another example, the screening strategy can be supplemented according to the characteristics of the K models themselves. For example, the recognition accuracy of model-1 is lower than that of other models. The first threshold corresponding to the confidence level of the recognition result output by model-1 can be slightly lower than the first threshold corresponding to other models.

[0085] Through step S201, samples with correct annotations can be screened out, and then these samples with correct annotations constitute the first training set for training the model to be trained.

[0086] S202: retraining the updated first character recognition model using the updated first training set to obtain the latest version of the first character recognition model. Specifically, S202 includes S202a and S202b.

[0087] S202a: Screen the remaining labeled samples of the labeled sample set according to the first text recognition model of version N-1, and combine them with the first training set of version N-1 to obtain the first training set of version N;

[0088] Here, the remaining labeled samples in the labeled sample set are identified by the N-1th version model, and the labeled samples whose recognition results and annotation results are the same as those of the N-1th version model are screened out. The labeled samples whose recognition results and annotation results are the same as those of the N-1th version model are added to the first training set of the N-1th version to obtain the first training set of the Nth version. The first training set of the Nth version is used for the first text recognition model of the N-1th version to obtain the first text recognition model of the N-1th version.

[0089] S202b: Train the first text recognition model of version N-1 based on the first training set of version N to obtain the first text recognition model of version N.

[0090] It should be noted that if Figure 2 As shown, after the first round of data cleaning is completed, it can be considered that the annotations of all samples in the first training set are reliable, and the confidence reliability of the model output is also greatly improved. In the second round of data cleaning, the confidence of the first version of the first text recognition model and whether the output of the first version of the first text recognition model is consistent with the annotation can be comprehensively considered to recover some of the labeled samples that were eliminated in the first round. Referring to the second round of iteration, the third round, fourth round, ..., Nth round are carried out until there are very few labeled samples that can be recovered (the number of samples recovered in this round is lower than the first quantity threshold), or the model effect is no longer improved after the recovered data participates in the iteration (such as the evaluation index of the model reaches the first evaluation value, or the growth of the evaluation index of the model is lower than the preset growth amount).

[0091] The technical solution of the disclosed embodiment is to train the training model based on the initial first training set to obtain the initial first text recognition model; to obtain the updated first training set based on the initial first text recognition model; to retrain the initial first text recognition model using the updated first training set to obtain the updated first text recognition model; and so on, repeat the steps of updating the first training set and retraining until the first preset condition is met; when the target first text recognition model meets the first preset condition, the first class of sample sets is determined according to the first training set adopted by the target first text recognition model obtained through training. Based on the above technical solution, by cleaning the labeled data, the correct labeled samples can be screened out from the labeled sample set, the automatic cleaning of the labeled data is realized, and the quality of the training samples obtained after cleaning is improved, so that the confidence of the model output is more meaningful. In addition, the problem of text misrecognition caused by the quality of the training samples, such as the wrong association caused by some dirty samples, can be greatly avoided, reducing the difficulty of problem analysis. Furthermore, by the above-mentioned cleaning method of the labeled data, as many correct labeled samples as possible can be screened out from the labeled sample set, improving the data utilization rate of the labeled sample set.

[0092] In the disclosed embodiment, the method for determining the text recognition model may also include: determining K models that match the scene characteristics from multiple models, where K is a positive integer; using the K models to respectively identify the labeled samples in the labeled sample set to obtain recognition results corresponding to each labeled sample; based on the recognition results and the labeling results, screening out labeled samples with a confidence level greater than a first threshold from the labeled sample set to obtain an initial first training set.

[0093] In the disclosed embodiment, the scenes of the text recognition model may include: handwritten text recognition scene, special font recognition scene, low-quality image recognition scene, multi-language mixed recognition scene, and natural scene image recognition scene. Specifically, the characteristics of the handwritten text recognition scene are: handwriting is diverse, and different people have different writing styles and fonts, which makes recognition complicated; the difficulty of recognition is: the text recognition model needs to be able to handle various writing styles, font sizes, stroke thicknesses and other factors, and at the same time be able to deal with possible blurring, broken strokes and other problems. The characteristics of the special font recognition scene are: special fonts such as artistic fonts and ancient characters have a large difference in structure from regular fonts, and are difficult to recognize; the difficulty of recognition is: the model needs to have the ability to extract and recognize special font features, as well as an understanding of the cultural connotations behind these fonts. The characteristics of the low-quality image recognition scene are: the image may have low quality due to factors such as shooting angle, light, resolution, etc., and the text may be blurred and incomplete; the difficulty of recognition is: the model needs to be able to accurately recognize the text in the image under these conditions, which requires the model to have strong image processing and feature extraction capabilities. The characteristics of this multi-language mixed recognition scenario are: the image may contain text in multiple languages, such as a mixture of Chinese and English, or a mixture of multiple languages; the difficulty in recognition is: the model needs to have cross-language recognition capabilities and be able to accurately recognize and distinguish text in different languages. The characteristics of this natural scene image recognition scenario are: the text in natural scenes is often accompanied by complex backgrounds, light changes, and occlusions, which makes recognition more difficult; the difficulty in recognition is: the model needs to be able to handle noise and interference in the image, as well as possible deformation and distortion of the text, and at the same time be able to accurately recognize the location and content of the text.

[0094] In the disclosed embodiment, the confidences of the K models for the same labeled sample may be different. Only when the recognition results of the K models for the labeled sample are the same and the confidences are all greater than the first threshold, the labeled sample can be added to the first training set.

[0095] The technical solution of the disclosed embodiment determines K models that match the scene characteristics from multiple models; uses K models to recognize the labeled samples in the labeled sample set respectively, and obtains the recognition results corresponding to each labeled sample; based on the recognition results and the labeling results, the labeled samples with confidence greater than the first threshold are screened from the labeled sample set to obtain the initial first training set. In this way, since the screened samples have a higher confidence, they can better represent the data distribution in the real scene. Using samples with high confidence for training can enable the model to better learn the characteristics of the real scene, thereby improving the generalization ability of the model in the real scene.

[0096] In the embodiment of the present disclosure, the first preset condition includes at least one of the following: the evaluation index of the model reaches a first evaluation value; the number of screened labeled samples is lower than a first quantity threshold.

[0097] In the disclosed embodiment, the evaluation index of the model reaching the first evaluation value can be understood as the model effect no longer improving after the latest version of the first text recognition model participates in the iteration. The evaluation index of the model is a quantitative standard for measuring the performance of the machine learning model. For text recognition models, common evaluation indicators include precision (Precision), recall (Recall), F1 measure (F1 Measure, F1), area under the curve (Area Under the Curve, AUC) value, character error rate (Character Error Rate, CER), word error rate (Word Error Rate, WER), etc. The above indicators are helpful to evaluate the predictive ability, accuracy and stability of the model. It should be noted that different evaluation indicators are suitable for different task types and scenarios.

[0098] Here, the first evaluation value is not specifically limited and can be flexibly configured according to actual needs. Different task types and scenarios can use different evaluation indicators.

[0099] In the embodiment of the present disclosure, the number of the screened labeled samples is lower than the first quantity threshold, which can be understood as the number of labeled samples recovered from the labeled sample set is extremely small, that is, lower than the first quantity threshold.

[0100] Here, the first quantity threshold is not specifically limited and can be flexibly configured according to actual needs. Different task types and scenarios can use different first quantity thresholds.

[0101] The technical solution of the embodiment of the present disclosure can ensure the accuracy of the annotation of the labeled samples in the first category sample set and the number of the first category sample set by setting the first preset condition, so as to obtain a representative and diverse first category sample set. By setting the first preset condition, it can also ensure that the model can learn key features or patterns and improve its recognition performance in various scenarios. By setting the first preset condition, the diversity of the first category sample set can be ensured, while enhancing the generalization ability of the model, reducing the time and resources required for training.

[0102] In the disclosed embodiment, determining a first type of sample set according to a first training set used by a target first text recognition model obtained through training includes: extracting some samples from the first training set used by the target first text recognition model obtained through training to form the first type of sample set.

[0103] In some embodiments, extracting some samples from the first training set used by the target first text recognition model to form a first category sample set includes: randomly extracting some samples from the first training set used by the target first text recognition model to form the first category sample set.

[0104] In some embodiments, some samples in the first training set used to obtain the target first text recognition model for training are extracted to form a first category of sample set, including: samples in the first training set used to train the first version of the first text recognition model, and samples extracted from labeled samples screened from different versions of the first text recognition model in a certain proportion to form the first category of sample set.

[0105] For example, if the target first character recognition model is recorded as the Nth version of the first character recognition model, and the first training set (recorded as the Nth version of the first training set) used when training the Nth version of the first character recognition model is used, then some samples in the Nth version of the first training set can be extracted to form a first type of sample set. Specifically, some samples in the Nth version of the first training set can be extracted randomly, or some samples in the Nth version of the first training set can be extracted according to a certain ratio, or samples of corresponding ratios can be extracted from samples collected from different versions of the first character recognition models according to a preset distribution ratio.

[0106] In the disclosed embodiment, some samples may be extracted from the first training set as needed. For example, some samples may be extracted from the first training set according to the application scenario of the text recognition model; some samples may be extracted from the first training set according to a preset ratio; some samples may be extracted from the first training set according to the characteristics of the text recognition model. The above is only an exemplary description and is not intended to limit all possible conditions for extracting some samples from the first training set, but it is not exhaustive here.

[0107] The technical solution of the embodiment of the present disclosure extracts some samples from the first training set used by the first text recognition model obtained by training to form a first-category sample set. In this way, compared with using the entire training set, using a smaller first-category sample set for model training or tuning can significantly reduce computing resources and time costs. By screening and extracting the first training set, the first-category sample set obtained will contain the most representative samples that can reflect the main features and patterns in the training data. Using such a first-category sample set for further training or tuning of the model can ensure that the model can learn these key features more accurately, thereby improving the recognition accuracy and performance of the model.

[0108] In the disclosed embodiment, determining a first type of sample set based on a first training set used by a target first character recognition model obtained through training includes: using the entire training set used by the target first character recognition model obtained through training as the first type of sample set.

[0109] Here, when training some large-scale text recognition models, the entire training set used when training the target first text recognition model can be used as the first type of sample set. Large-scale data sets usually bring better generalization ability and higher recognition accuracy.

[0110] The technical solution of the embodiment of the present disclosure uses the entire training set used by the first text recognition model obtained by training as the first type of sample set. In this way, using the entire training set as the first type of sample set can ensure that all samples used in the model training process are taken into consideration, which helps to maintain the integrity and consistency of the model training and ensure that the model can learn all possible features and patterns. Using the entire training set for model training can usually maximize the performance of the model. More data means more information and features, which helps the model learn more complex patterns and more subtle differences, thereby improving recognition accuracy and generalization ability. By directly using the entire training set as the first type of sample set, the data selection and bias risks that may be introduced when selecting some samples can be avoided, which helps to ensure that the training and evaluation of the model are performed on the same data set, thereby more accurately evaluating the performance of the model. Using the entire training set as the first type of sample set can simplify the process of model development and deployment, help speed up the iteration and optimization of the model, and improve development efficiency.

[0111] In some embodiments, a flow chart of a sample determination method of a text recognition model is as follows: Figure 3 As shown, the process may include:

[0112] S301: pseudo-labeling the unlabeled samples in the unlabeled sample set using the target first character recognition model;

[0113] S302: adding pseudo-annotated samples whose confidence level is greater than a second threshold to the first type of sample set to obtain an initial second training set;

[0114] S303: Determine a second type of sample set based on the initial second training set.

[0115] In the disclosed embodiments, the unlabeled sample set refers to a set of samples that have not been labeled manually or by machine. The unlabeled samples in the unlabeled sample set are images with text, and the samples are not labeled by human / machine labeling or the like. For example, a photo frame image of "Study Habits of a Top Student", to which no annotations are attached. For example, an image of "Road Sign", to which no annotations are attached. The above is only an exemplary description and is not intended to be a limitation on all possible types of unlabeled samples, except that they are not exhaustive.

[0116] In the disclosed embodiments, unlabeled samples can be obtained by online service reflux; unlabeled samples can also be obtained by crawling from the Internet; unlabeled samples can also be extracted from public data sets; and unlabeled samples in specific fields or scenarios can also be obtained by cooperating with partners or third-party data providers. The above is only an exemplary description and is not intended to limit all possible ways of obtaining unlabeled samples, but it is not exhaustive here.

[0117] In the disclosed embodiment, pseudo labeling is a semi-supervised learning technique commonly used in machine learning and deep learning. Through the prediction of the model on the unlabeled data, a credible pseudo label is selected according to a predefined confidence threshold. These pseudo-labeled data are used together with the existing labeled data for further training of the model. The pseudo-labeling process generally includes the following steps:

[0118] 1. Determine the pre-trained model: Use the latest version of the first text recognition model as the basic model for generating pseudo labels.

[0119] 2. Generate pseudo labels: Apply the latest version of the first text recognition model to the unlabeled sample set to generate prediction results for the unlabeled samples, and use the prediction results of the unlabeled samples as pseudo labels for these unlabeled samples.

[0120] 3. Filter pseudo labels: In order to improve the quality of pseudo labels, the generated pseudo labels are filtered. This can be achieved by setting a confidence threshold (i.e., the second threshold), that is, only samples with higher confidence in the model prediction results are retained as pseudo-labeled samples.

[0121] In some implementations, pseudo-annotated samples with a confidence level greater than a second threshold are added to the first category of sample sets to obtain a second training set.

[0122] Here, the second threshold of the confidence level corresponding to the pseudo-annotated sample can be set or adjusted according to the sample quality requirement, and the higher the quality, the larger the second threshold. For example, the second threshold of 90% accuracy is greater than the second threshold of 80% accuracy.

[0123] Since the samples participating in the training are accurate in each round during the cleaning process of the labeled data, the confidence of the model based on the cleaned labeled data can be considered relatively reliable. When selecting unlabeled data for training, it is also necessary to ensure that the newly added pseudo-labeled samples are accurate. Using this model to pseudo-label the unlabeled data and selecting high-confidence samples to add to the first sample set for training can improve the accuracy of the samples in the second training set.

[0124] In some embodiments, the second sample set is used for training and improving the text recognition model. The second sample set includes labeled samples and verified pseudo-labeled samples. The number of samples in the second sample set is greater than the number of samples in the first sample set.

[0125] In some implementations, the second type of sample set is determined based on the second training set, and the second type of sample set can be determined based on the first version of the second training set.

[0126] In some implementations, the first version of the second training set may be continuously updated to obtain a final version of the second training set. The higher the version of the second training set, the greater the number of samples. The second type of sample set is determined based on the second training set, and the second type of sample set may be determined based on any one or more second training sets from the second version to the final version.

[0127] In the disclosed embodiment, the second type of sample set includes labeled samples and accurate pseudo-labeled samples.

[0128] The technical solution of the embodiment of the present disclosure adopts the target first text recognition model to pseudo-annotate the unlabeled samples in the unlabeled sample set; adds the pseudo-annotated samples with a confidence level greater than the second threshold to the first category of sample sets to obtain an initial second training set; and determines the second category of sample sets based on the initial second training set. In this way, by pseudo-annotating the unlabeled samples and screening the pseudo-annotated samples with high confidence levels, the unlabeled samples are effectively utilized and the training data set of the model is expanded. The generation of the second training set improves the generalization ability and robustness of the model, enabling it to better cope with various practical scenarios. The determination of the second category of sample sets provides more extensive and accurate data support for subsequent model training and testing.

[0129] In some embodiments, the process of determining the second type of sample set based on the initial second training set is as follows: Figure 4 As shown, the process may include:

[0130] S401: training a target first character recognition model based on an initial second training set to obtain an initial second character recognition model;

[0131] S402: based on the initial second text recognition model, re-pseudo-label the remaining unlabeled samples in the unlabeled sample set; add the pseudo-labeled samples with a confidence level greater than a second threshold to the initial second training set to obtain an updated second training set; retrain the first version of the second text recognition model using the updated second training set to obtain an updated second text recognition model;

[0132] S403: obtaining a second training set after being updated again based on the updated second character recognition model; and retraining the updated second character recognition model based on the second training set after being updated again until a second preset condition is met;

[0133] S404: Determine a second type of sample set according to a second training set used by the target second text recognition model obtained through training.

[0134] In the disclosed embodiment, the target second character recognition model can be the second character recognition model when the second preset condition is met, or it can be any second character recognition model between the initial second character recognition model and the second character recognition model when the second preset condition is met. In the disclosed embodiment, the second threshold can be a numerical value, such as 0.7, 0.8, 0.9, etc.; the second threshold can also be a specific range, such as 0.8-0.9, 0.9-1.0, etc. Here, the second threshold is not specifically limited, and can be flexibly configured according to actual needs. It should be noted that when selecting unlabeled samples for training, it is also necessary to ensure that the newly added pseudo-labeled samples are accurate. The second threshold is usually greater than the first threshold.

[0135] In the disclosed embodiment, the second training set obtained for the first time is recorded as the second training set of the first version, and the second training set of the first version is used to train and generate the second text recognition model of the first version. The second training set obtained for the second time is recorded as the second training set of the second version, and the second training set of the second version is used to train and generate the second text recognition model of the second version. By analogy, the second training set obtained for the Mth time is recorded as the second training set of the Mth version, and the second training set of the Mth version is used to train and generate the second text recognition model of the Mth version.

[0136] In the embodiment of the present disclosure, the second training set of the first version includes the first category sample set + pseudo-annotated samples with a confidence level greater than a second threshold screened from the unannotated sample set using the second text recognition model of the first version.

[0137] In the disclosed embodiment, the second training set of the second version includes the first category sample set + pseudo-annotated samples with a confidence level greater than a second threshold selected from the unlabeled sample set using the second text recognition model of the first version + pseudo-annotated samples with a confidence level greater than the second threshold selected from the remaining unlabeled samples in the unlabeled sample set using the second text recognition model of the second version.

[0138] In the disclosed embodiment, the second training set of the Mth version includes the first category sample set + pseudo-annotated samples with a confidence level greater than a second threshold selected from the unlabeled sample set using the second text recognition model of the first version + pseudo-annotated samples with a confidence level greater than the second threshold selected from the remaining unlabeled samples in the unlabeled sample set using the second text recognition model of the second version +… + pseudo-annotated samples with a confidence level greater than the second threshold selected from the remaining unlabeled samples in the unlabeled sample set using the second text recognition model of the Mth version.

[0139] In the disclosed embodiment, the second text recognition model of the second version is obtained by training the second text recognition model of the first version based on the updated second training set. The accuracy of the second text recognition model of the second version is higher than that of the second text recognition model of the first version. The accuracy of the second text recognition model of the second version is at least lower than that of the second text recognition model of the third version.

[0140] Figure 5 The schematic diagram of the process of unlabeled data cleaning is shown in Figure 5 As shown, the process may include:

[0141] S501: Based on the second training set of the first version, obtain a second text recognition model of the first version. Specifically, S501 includes S501a and S501b.

[0142] S501a: Input the unlabeled samples in the unlabeled sample set into the Nth version of the first text recognition model to obtain the pseudo-labeling results output by the Nth version of the first text recognition model, add the pseudo-labeling samples with confidence greater than the second threshold to the first category sample set, and obtain the second training set of the first version.

[0143] S501b: training the first text recognition model of the Nth version based on the second training set of the first version to obtain the second text recognition model of the first version;

[0144] Through step S501, samples with correct pseudo-annotations can be screened out, and then the correct pseudo-annotated samples and the first category sample set are used to generate a second training set for the first version.

[0145] S502: retraining the updated second text recognition model using the updated second training set to obtain the latest version of the second text recognition model. Specifically, S502 includes S502a and S502b.

[0146] S502a: input the remaining unlabeled samples in the unlabeled sample set into the second text recognition model of the M-1th version to obtain the pseudo-labeling results of the second text recognition model of the M-1th version, and add the pseudo-labeling samples with a confidence level greater than the second threshold to the second training set to obtain the second training set of the Mth version;

[0147] S502b: Train the second character recognition model of the M-1th version based on the second training set of the Mth version to obtain the second character recognition model of the Mth version.

[0148] It should be noted that multiple rounds of closed-loop iteration of unlabeled data can also be performed. The high-confidence pseudo-annotated data output by the previous round of model is used to participate in training to produce the current round of model. The current round of model re-pseudo-annotates the remaining unlabeled samples, and continues to screen high-confidence pseudo-annotated data. New high-confidence pseudo-annotated data is added to participate in training until the model effect is no longer improved after iteration or very few high-confidence pseudo-annotated data are added.

[0149] The technical solution of the embodiment of the present disclosure is to train the target first text recognition model based on the initial second training set to obtain the initial second text recognition model; based on the initial second text recognition model, re-pseudo-annotate the remaining unlabeled samples of the unlabeled sample set; add the pseudo-annotated samples with a confidence greater than the second threshold to the second training set to obtain an updated second training set; retrain the initial second text recognition model using the updated second training set to obtain an updated second text recognition model; repeat the above updating and retraining steps until the second preset condition is met, and determine the second type of sample set according to the second training set used by the target second text recognition model obtained by training. In this way, through the closed-loop iteration of unlabeled data, the correct pseudo-annotated samples can be determined from the unlabeled sample set, the automatic cleaning of unlabeled data is realized, and the quality of the training samples obtained after cleaning is improved, so that the confidence of the model output is more meaningful. In addition, the problem of text misrecognition caused by the quality of training samples can also be greatly avoided. Furthermore, through the above-mentioned cleaning method of unlabeled data, as many pseudo-annotated samples as possible can be determined based on the unlabeled sample set, which improves the data utilization rate of the unlabeled sample set.

[0150] In the embodiment of the present disclosure, the second preset condition includes at least one of the following: the evaluation index of the model reaches a second evaluation value; the number of pseudo-annotated samples screened out is lower than a second quantity threshold.

[0151] In the disclosed embodiment, the evaluation index of the model reaches the second evaluation value, which means that the model effect no longer improves after the latest version of the second text recognition model participates in the iteration. The evaluation index of the model is a quantitative standard for measuring the performance of the machine learning model. For text recognition models, common evaluation indicators include Precision, Recall, F1 value, AUC value, CER value, WER value, etc. It should be noted that different evaluation indicators are suitable for different task types and scenarios.

[0152] Here, the second evaluation value is not specifically limited and can be flexibly configured according to actual needs.

[0153] In the disclosed embodiment, the number of unlabeled samples screened out being lower than the second quantity threshold means that there are very few unlabeled data recovered from the unlabeled sample set (the number of samples screened out in this round is lower than the second quantity threshold).

[0154] Here, the second quantity threshold is not specifically limited and can be flexibly configured according to actual needs.

[0155] The technical solution of the embodiment of the present disclosure can ensure the accuracy of the pseudo-annotated samples in the second category sample set and the quantity of the second category sample set by setting the second preset condition, thereby obtaining a representative and diverse second category sample set. By setting the second preset condition, the diversity of the second category sample set can be ensured, while enhancing the generalization ability of the model and reducing the time and resources required for training. By setting the second preset condition, it can also ensure that the model can learn key features or patterns, improving its recognition performance in various scenarios.

[0156] In the disclosed embodiment, determining the second type of sample set according to the second training set used by the target second text recognition model obtained through training includes: extracting some samples from the second training set used by the target second text recognition model obtained through training to form the second type of sample set.

[0157] In some embodiments, some samples in the second training set used to train the target second text recognition model are extracted to form a second type of sample set, including: samples in the second training set used to train the first version of the second text recognition model, and samples extracted from labeled samples screened from different versions of the second text recognition models in a certain proportion to form the second type of sample set.

[0158] For example, if the target second character recognition model is recorded as the second character recognition model of the Mth version, and the first training set used when the second character recognition model of the Mth version is obtained through training is the second training set of the Mth version, then some samples in the second training set of the Mth version can be extracted to form the second type of sample set. Specifically, some samples in the second training set of the Mth version can be extracted randomly, or some samples in the second training set of the Mth version can be extracted according to a certain proportion, or samples of corresponding proportions can be extracted from samples determined by different versions of the second character recognition models according to a preset distribution ratio.

[0159] In the disclosed embodiment, some samples may be extracted from the second training set as needed. For example, some samples may be extracted from the second training set according to the application scenario of the text recognition model; some samples may be extracted from the second training set according to a preset ratio; some samples may be extracted from the second training set according to the characteristics of the text recognition model. The above is only an exemplary description and is not intended to limit all possible conditions for extracting some samples from the second training set, but it is not exhaustive here.

[0160] The technical solution of the embodiment of the present disclosure extracts some samples from the second training set used when training the target second text recognition model to form a second category sample set. In this way, compared with using the entire training set, using a smaller second category sample set for model training or tuning can significantly reduce computing resources and time costs. By screening and extracting the second training set, the obtained second category sample set will contain the most representative samples, which can reflect the main features and patterns in the training data. Using such a second category sample set for further training or tuning of the model can ensure that the model can learn these key features more accurately, thereby improving the recognition accuracy and performance of the model.

[0161] In the disclosed embodiment, determining the second type of sample set according to the second training set used by the target second character recognition model obtained through training includes: using the entire training set used by the target second character recognition model obtained through training as the second type of sample set.

[0162] Here, when training some large-scale text recognition models, the entire training set used by the second target text recognition model can be used as the second type of sample set. Large-scale data sets usually bring better generalization ability and higher recognition accuracy.

[0163] The technical solution of the disclosed embodiment uses the entire training set used by the target second text recognition model as the second type of sample set, which helps the model learn a broader and more comprehensive feature representation. The rich data can cover more scenarios and situations, and improve the generalization ability of the model. By directly using the entire training set as the second type of sample set, the risks of data selection and bias that may be introduced when selecting some samples can be avoided, which helps to ensure that the training and evaluation of the model are performed on the same data set, thereby more accurately evaluating the performance of the model. Using the entire training set as the second type of sample set can simplify the process of model development and deployment, help speed up the iteration and optimization of the model, and improve development efficiency.

[0164] The present disclosure provides a method for training a text recognition model. Figure 6 It is a flowchart of a method for training a text recognition model according to an embodiment of the present disclosure. The method for training a text recognition model can be applied to a training device for a text recognition model. The method for training a text recognition model can be applied to electronic devices. The electronic devices include but are not limited to fixed devices and / or mobile devices. For example, fixed devices include but are not limited to servers, and the servers can be cloud servers or ordinary servers. For example, mobile devices include but are not limited to mobile phones, tablet computers, personal computers, etc. In some possible implementations, the method for training a text recognition model can also be implemented by a processor calling computer-readable instructions stored in a memory. For example Figure 6 As shown, the training method of the text recognition model includes:

[0165] S601: Obtain a sample set;

[0166] S602: Train the pre-trained model based on the sample set to obtain a text recognition model.

[0167] The sample set is obtained based on the sample determination method of the aforementioned text recognition model.

[0168] In some implementations, the sample set is obtained based on a sample determination method of the aforementioned text recognition model and is a part of a first-category sample set or a second-category sample set.

[0169] In some implementations, the sample set is obtained by obtaining the entirety of the first category sample set or the second category sample set obtained based on the sample determination method of the aforementioned text recognition model.

[0170] The technical solution of the embodiment of the present disclosure obtains a sample set; trains a pre-trained model based on the sample set to obtain a text recognition model. In this way, the text recognition model can better adapt to the needs of specific tasks or scenarios, improve the recognition accuracy and performance of the model, and enhance the interpretability and scalability of the model.

[0171] The present disclosure provides a method for character recognition. Figure 7 : is a flowchart of a text recognition method according to an embodiment of the present disclosure, and the text recognition method can be applied to a text recognition device. The text recognition method can be applied to electronic devices. The electronic devices include but are not limited to fixed devices and / or mobile devices. For example, fixed devices include but are not limited to servers, and the servers can be cloud servers or ordinary servers. For example, mobile devices include but are not limited to mobile phones, tablet computers, personal computers, etc. In some possible implementations, the text recognition method can also be implemented by a processor calling computer-readable instructions stored in a memory. Figure 7 As shown, the text recognition method may include:

[0172] S701: Acquire an image to be recognized;

[0173] S702: Input the image to be recognized into a text recognition model, and obtain a text recognition result of the image to be recognized output by the text recognition model.

[0174] The text recognition model is obtained by training based on the aforementioned sample set, and the sample set is obtained based on the sample determination method of the aforementioned text recognition model.

[0175] For example, an image of a bamboo slip from the Han Dynasty with the Han Dynasty characters "The Art of War" is input into the text recognition model, and the text recognition result "The Art of War" is output by the text recognition model.

[0176] The technical solution of the disclosed embodiment can improve the recognition accuracy of the text recognition model because the sample set used in training the text recognition model is rich and accurate. The image to be recognized is input into the text recognition model to obtain the text recognition result of the image to be recognized output by the text recognition model, which can improve the accuracy of text recognition in multiple scenarios.

[0177] It should be understood that Figure 2 and Figure 5 The schematic diagram shown is only exemplary and not restrictive, and it is scalable, and those skilled in the art can Figure 2 and Figure 5 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0178] The present disclosure provides a sample determination device for a text recognition model, such as Figure 8As shown, the sample determination device of the text recognition model includes: a first training module 801, which is used to train the model to be trained based on the initial first training set to obtain the initial first text recognition model; wherein the samples in the first training set are labeled samples with confidence greater than a first threshold selected from the labeled sample set; a second training module 802, which is used to obtain an updated first training set based on the initial first text recognition model; retrain the initial first text recognition model using the updated first training set to obtain an updated first text recognition model; obtain a first-updated first training set based on the updated first text recognition model; retrain the updated first text recognition model based on the first-updated training set until the first preset condition is met; a first determination module 803, which is used to determine the first category of sample sets based on the first training set adopted by the target first text recognition model obtained through training when the target first text recognition model meets the first preset condition.

[0179] In some embodiments, the first preset condition includes at least one of the following:

[0180] The evaluation index of the model reaches the first evaluation value;

[0181] The number of the screened labeled samples is lower than the first quantity threshold.

[0182] In some embodiments, the first determining module 803 is further configured to:

[0183] Some samples are extracted from the first training set used by the first target text recognition model obtained through training to form a first type of sample set.

[0184] In some embodiments, the first determining module 803 is further configured to:

[0185] The entire training set used by the first target text recognition model obtained by training is used as the first type of sample set.

[0186] In some embodiments, the sample determination device of the text recognition model further includes:

[0187] Generate Module( Figure 8 (not shown), for pseudo-annotating the unlabeled samples in the unlabeled sample set using the target first text recognition model; adding the pseudo-annotated samples whose confidence is greater than the second threshold to the first class sample set to obtain an initial second training set;

[0188] The second determination module ( Figure 8 ), which is not shown in the figure, and is used to determine a second type of sample set based on an initial second training set.

[0189] In some embodiments, the second determining module includes:

[0190] A first training submodule, used to train the target first character recognition model based on the second training set to obtain an initial second character recognition model;

[0191] A second training submodule is used to re-pseudo-annotate the remaining unlabeled samples in the unlabeled sample set based on the initial second text recognition model; a generation submodule is used to add the pseudo-annotated samples with a confidence level greater than a second threshold to the second training set to obtain an updated second training set; the initial second text recognition model is retrained using the updated second training set to obtain an updated second text recognition model; based on the updated second text recognition model, a second updated training set is obtained; based on the second updated second training set, the updated second text recognition model is retrained until the second preset condition is met;

[0192] The determination submodule is used to determine the second type of sample set based on the second training set used by the target second character recognition model obtained through training when the target second character recognition model meets the second preset condition.

[0193] In some embodiments, the second preset condition includes at least one of the following:

[0194] The evaluation index of the model reaches the second evaluation value;

[0195] The number of the filtered pseudo-annotated samples is lower than the second number threshold.

[0196] In some embodiments, the determining submodule is further used to:

[0197] Some samples are extracted from the second training set used by the second character recognition model obtained by training to form a second type of sample set.

[0198] In some embodiments, the determining submodule is further used to:

[0199] The entire training set used by the target second text recognition model is used as the second type of sample set.

[0200] In some embodiments, the sample determination device of the text recognition model further includes:

[0201] The third determination module ( Figure 8 (not shown), used to determine K models matching the scene characteristics from multiple models, where K is a positive integer;

[0202] The first identification module ( Figure 8 (not shown in the figure), for using K models to respectively identify the labeled samples in the labeled sample set, and obtain the recognition results corresponding to each labeled sample;

[0203] Filter Module( Figure 8 ), which is used to filter out labeled samples with a confidence level greater than a first threshold from the labeled sample set based on the recognition result and the labeling result, to obtain an initial first training set.

[0204] Those skilled in the art should understand that the functions of each processing module in the sample determination device of the text recognition model of the embodiment of the present disclosure can be understood with reference to the relevant description of the sample determination method of the text recognition model mentioned above, and each processing module in the sample determination device of the text recognition model of the embodiment of the present disclosure can be realized by an analog circuit that realizes the functions described in the embodiment of the present disclosure, and can also be realized by running software that executes the functions described in the embodiment of the present disclosure on an electronic device.

[0205] The sample determination device of the text recognition model of the embodiment of the present disclosure can not only realize the automatic determination of training samples through the cleaning of labeled data and the closed-loop iteration of unlabeled data, but also ensure the quality of training samples, thereby making the confidence of the model output more meaningful; it can also largely avoid the problem of misrecognition caused by the quality of training samples.

[0206] The present disclosure provides a training device for a text recognition model. Fig. 9 As shown, the training device for the text recognition model includes: a first acquisition module 901, used to obtain a sample set; a third training module 902, used to train a pre-trained model based on the sample set to obtain a text recognition model; wherein the sample set is obtained by the sample determination method of the text recognition model described above.

[0207] Those skilled in the art should understand that the functions of each processing module in the training device of the text recognition model of the embodiment of the present disclosure can be understood with reference to the relevant description of the training method of the text recognition model mentioned above, and each processing module in the training device of the text recognition model of the embodiment of the present disclosure can be realized by an analog circuit that realizes the functions described in the embodiment of the present disclosure, and can also be realized by running software that executes the functions described in the embodiment of the present disclosure on an electronic device.

[0208] The training device for the text recognition model of the embodiment of the present disclosure can enable the text recognition model to better adapt to the needs of specific tasks or scenarios, improve the recognition accuracy and performance of the model, and enhance the interpretability and scalability of the model.

[0209] The present disclosure provides a text recognition device, such as Fig.10 As shown, the text recognition device includes: a second acquisition module 1001, used to acquire an image to be recognized; a second recognition module 1002, used to input the image to be recognized into a text recognition model, and obtain a text recognition result of the image to be recognized output by the text recognition model;

[0210] The text recognition model is obtained based on sample set training, and the sample set is obtained through the sample determination method of the text recognition model described above.

[0211] Those skilled in the art should understand that the functions of each processing module in the text recognition device of the embodiment of the present disclosure can be understood with reference to the relevant description of the aforementioned text recognition method. Each processing module in the text recognition device of the embodiment of the present disclosure can be realized by an analog circuit that realizes the functions described in the embodiment of the present disclosure, or can be realized by running software that executes the functions described in the embodiment of the present disclosure on an electronic device.

[0212] The text recognition device of the embodiment of the present disclosure can improve the accuracy of text recognition in multiple scenarios.

[0213] The present disclosure provides a scenario diagram of a sample determination method for a text recognition model, such as Fig.11 As mentioned above, the sample determination method of the text recognition model provided by the embodiment of the present disclosure is applied to electronic devices. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.

[0214] Specifically, the electronic device can perform the following operations:

[0215] The training model is trained based on the initial first training set to obtain an initial first text recognition model; wherein the samples in the initial first training set are labeled samples with confidence greater than a first threshold selected from the labeled sample set;

[0216] Based on the initial first character recognition model, an updated first training set is obtained; and the initial first character recognition model is retrained using the updated first training set to obtain an updated first character recognition model;

[0217] Based on the updated first text recognition model, a first training set that is updated again is obtained; and the updated first text recognition model is retrained using the first training set that is updated again until a first preset condition is met;

[0218] A first type of sample set is determined based on a first training set used by a target first text recognition model obtained through training.

[0219] The first training set may be obtained from a data source, which may be a data storage device in various forms.

[0220] It should be understood that Fig.11 The scene diagram shown is only illustrative and not restrictive. Those skilled in the art can Fig.11 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0221] The present disclosure also provides a scenario diagram of a method for training a text recognition model. Fig.12 As mentioned above, the training method of the text recognition model provided by the embodiment of the present disclosure is applied to electronic devices. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.

[0222] Specifically, the electronic device can perform the following operations:

[0223] Get a sample set;

[0224] The pre-trained model is trained based on the sample set to obtain a text recognition model;

[0225] The sample set is obtained through the sample determination method of the text recognition model described above.

[0226] The sample set may be obtained from a data source, which may be a data storage device in various forms.

[0227] It should be understood that Fig.12 The scene diagram shown is only illustrative and not restrictive. Those skilled in the art can Fig.12 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0228] The present disclosure also provides a scene diagram of a text recognition method, such as Fig.13 As mentioned above, the text recognition method provided by the embodiment of the present disclosure is applied to electronic devices. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.

[0229] Specifically, the electronic device can perform the following operations:

[0230] Obtain an image to be recognized;

[0231] Inputting the image to be recognized into the text recognition model, and obtaining the text recognition result of the image to be recognized output by the text recognition model;

[0232] The text recognition model is obtained based on sample set training, and the sample set is obtained through the sample determination method of the text recognition model described above.

[0233] It should be understood that Fig.13 The scene diagram shown is only illustrative and not restrictive. Those skilled in the art can Fig.13 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0234] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0235] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0236] Fig.14 A schematic block diagram of an example electronic device 1400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0237] like Fig.14 As shown, the device 1400 includes a computing unit 1401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1402 or a computer program loaded from a storage unit 1408 to a random access memory (RAM) 1403. In RAM 1403, various programs and data required for the operation of the device 1400 can also be stored. The computing unit 1401, ROM 1402, and RAM 1403 are connected to each other via a bus 1404. An input / output (I / O) interface 1405 is also connected to the bus 1404.

[0238] A number of components in the device 1400 are connected to the I / O interface 1405, including: an input unit 1406, such as a keyboard, a mouse, etc.; an output unit 1407, such as various types of displays, speakers, etc.; a storage unit 1408, such as a disk, an optical disk, etc.; and a communication unit 1409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1409 allows the device 1400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0239] The computing unit 1401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1401 include, but are not limited to, a central processing unit CPU, a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1401 performs the various methods and processes described above, such as the sample determination method of the text recognition model / the training method of the text recognition model / the text recognition method. For example, in some embodiments, the sample determination method of the text recognition model / the training method of the text recognition model / the text recognition method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1400 via the ROM 1402 and / or the communication unit 1409. When the computer program is loaded into RAM 1403 and executed by computing unit 1401, one or more steps of the sample determination method of the text recognition model / the training method of the text recognition model / the text recognition method described above may be executed. Alternatively, in other embodiments, computing unit 1401 may be configured to execute the sample determination method of the text recognition model / the training method of the text recognition model / the text recognition method by any other appropriate means (e.g., by means of firmware).

[0240] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0241] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0242] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories (EPROM), flash memories, optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0243] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0244] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.

[0245] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on the respective computers and having a client and server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0246] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0247] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A sample determination method for a text recognition model, comprising: The training model is trained based on the initial first training set to obtain an initial first text recognition model; wherein the samples in the initial first training set are labeled samples with a confidence greater than a first threshold selected from the labeled sample set; Based on the initial first character recognition model, an updated first training set is obtained; and the initial first character recognition model is retrained using the updated first training set to obtain an updated first character recognition model; Based on the updated first text recognition model, a first training set that is updated again is obtained; based on the first training set that is updated again, the updated first text recognition model is retrained until a first preset condition is met, and a first category of sample sets is determined based on the first training set adopted by the target first text recognition model obtained through training.

2. The method according to claim 1, wherein: The step of obtaining a first training set adopted by a target first character recognition model through training and determining a first type of sample set comprises: Some samples are extracted from a first training set used by the target first text recognition model to form the first type of sample set.

3. The method according to claim 1, wherein: The step of obtaining a first training set adopted by a target first character recognition model through training and determining a first type of sample set comprises: The entire training set used by the target first character recognition model obtained by training is used as the first category sample set.

4. The method according to claim 1, wherein: The preset condition includes at least one of the following: The evaluation index of the model reaches the first evaluation value; The number of the screened labeled samples is lower than the first quantity threshold.

5. The method according to any one of claims 1 to 4, further comprising: The target first character recognition model is used to pseudo-label the unlabeled samples in the unlabeled sample set; Adding pseudo-annotated samples whose confidence level is greater than a second threshold to the first type of sample set to obtain an initial second training set; A second type of sample set is determined based on the initial second training set.

6. The method according to claim 5, wherein: The determining of the second type of sample set based on the initial second training set includes: Training the target first character recognition model based on the initial second training set to obtain an initial second character recognition model; Based on the initial second character recognition model, pseudo-annotate the remaining unlabeled samples of the unlabeled sample set again; add the pseudo-annotated samples with a confidence level greater than a second threshold to the initial second training set to obtain an updated second training set; and retrain the initial second character recognition model using the updated second training set to obtain an updated second character recognition model; Based on the updated second text recognition model, a second training set that is updated again is obtained; based on the second training set that is updated again, the updated second text recognition model is retrained until a second preset condition is met, and the second training set adopted by the target second text recognition model is obtained according to the training, and the second category sample set is determined.

7. The method according to claim 6, wherein: The step of obtaining a second training set adopted by the target second character recognition model through training and determining a second type of sample set comprises: Some samples are extracted from the second training set used when training the target second text recognition model to form the second type of sample set.

8. The method according to claim 6, wherein: Determining the second type of sample set according to the second training set used when training to obtain the target second text recognition model includes: The entire training set used when training the target second text recognition model is used as the second type of sample set.

9. The method according to claim 6, wherein: The second preset condition includes at least one of the following: The evaluation index of the model reaches the second evaluation value; The number of the filtered pseudo-annotated samples is lower than the second number threshold.

10. The method according to claim 1, further comprising: Determine K models matching the scene characteristics from multiple models, where K is a positive integer; Using the K models to respectively identify the labeled samples in the labeled sample set, and obtain a recognition result corresponding to each labeled sample; Based on the recognition result and the labeling result, labeled samples with a confidence level greater than a first threshold are screened out from the labeled sample set to obtain the initial first training set.

11. A method for training a text recognition model, comprising: Get a sample set; Training the pre-trained model based on the sample set to obtain the text recognition model; Wherein, the sample set is obtained based on the sample determination method of the text recognition model described in any one of claims 1 to 10.

12. A method for character recognition, comprising: Obtain an image to be recognized; Inputting the image to be recognized into a text recognition model, and obtaining a text recognition result of the image to be recognized output by the text recognition model; The text recognition model is obtained based on training of a sample set, and the sample set is obtained based on the sample determination method of the text recognition model according to any one of claims 1 to 10.

13. A sample determination device for a text recognition model, comprising: A first training module is used to train a to-be-trained model based on an initial first training set to obtain an initial first text recognition model; wherein the samples in the initial first training set are labeled samples with a confidence level greater than a first threshold selected from a set of labeled samples; A second training module is used to obtain an updated first training set based on the initial first character recognition model; retrain the initial first character recognition model using the updated first training set to obtain an updated first character recognition model; obtain a re-updated first training set based on the updated first character recognition model; and retrain the updated first character recognition model based on the re-updated first training set until a first preset condition is met; The first determination module is used to determine a first type of sample set according to a first training set used by a target first text recognition model obtained through training.

14. The device according to claim 13, wherein: The first determining module is further used for: Some samples are extracted from a first training set used by the target first text recognition model to form the first type of sample set.

15. The device according to claim 13, wherein: The first determining module is further used for: The entire training set used by the target first character recognition model obtained by training is used as the first category sample set.

16. The device according to claim 13, wherein: The first preset condition includes at least one of the following: The evaluation index of the model reaches the first evaluation value; The number of the screened labeled samples is lower than the first quantity threshold.

17. The device according to any one of claims 13 to 16, further comprising: A generation module, used for pseudo-annotating the unlabeled samples in the unlabeled sample set by using the target first character recognition model; Adding pseudo-annotated samples whose confidence level is greater than a second threshold to the first type of sample set to obtain an initial second training set; The second determination module is used to determine a second type of sample set based on the initial second training set.

18. The device according to claim 17, wherein: The second determining module includes: A first training submodule, configured to train the target first character recognition model based on the second training set to obtain an initial second character recognition model; A second training submodule is used to re-pseudo-annotate the remaining unlabeled samples of the unlabeled sample set based on the initial second text recognition model: a generation submodule is used to add the pseudo-annotated samples with a confidence level greater than a second threshold to the second training set to obtain an updated second training set; retrain the initial second text recognition model using the updated second training set to obtain an updated second text recognition model; obtain a second-updated training set based on the updated second text recognition model; retrain the updated second text recognition model based on the second-updated second training set until a second preset condition is met; The determination submodule is used to determine the second type of sample set according to the second training set used by the target second text recognition model obtained through training.

19. The device according to claim 18, wherein The determining submodule is further used for: Some samples are extracted from the second training set used to train the target second text recognition model to form the second type of sample set.

20. The device according to claim 18, wherein The determining submodule is further used for: The entire training set used by the target second character recognition model obtained by training is used as the second type of sample set.

21. The device according to claim 18, wherein The second preset condition includes at least one of the following: The evaluation index of the model reaches the second evaluation value; The number of the filtered pseudo-annotated samples is lower than the second number threshold.

22. The apparatus of claim 13, further comprising: A third determination module is used to determine K models matching the scene characteristics from multiple models, where K is a positive integer; A first recognition module is used to use the K models to respectively recognize the labeled samples in the labeled sample set to obtain a recognition result corresponding to each labeled sample; A screening module is used to screen out the labeled samples with a confidence level greater than a first threshold from the labeled sample set based on the recognition result and the labeling result, so as to obtain the initial first training set.

23. A training device for a text recognition model, comprising: A first acquisition module, used to acquire a sample set; A third training module, used for training the pre-training model based on the sample set to obtain the text recognition model; Wherein, the sample set is obtained based on the sample determination method of the text recognition model described in any one of claims 1 to 10.

24. A text recognition device, comprising: A second acquisition module is used to acquire an image to be identified; A second recognition module, used for inputting the image to be recognized into a text recognition model to obtain a text recognition result of the image to be recognized output by the text recognition model; The text recognition model is obtained based on training of a sample set, and the sample set is obtained based on the sample determination method of the text recognition model according to any one of claims 1 to 10.

25. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.

26. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.

27. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Sample labeling method and device based on multiple models

    CN109784391A

  • OCR data misannotation cleaning method

    CN110610175A

  • OCR-based data processing method, system, platform and equipment, and medium

    CN111539309A

  • Character recognition model training method, character recognition method, related equipment and storage medium

    CN113239967A

  • Identification model training method and device

    CN114332873A