Training method, device, medium, and terminal for character-level text detection model

By combining iterative learning and character-level pseudo-labeling, target samples are automatically selected for manual labeling, which solves the problems of large amount of labeling data and long time consumption in visual text detection, improves the accuracy of the detection model and reduces the labeling cost.

CN115937870BActive Publication Date: 2025-09-09SHANGHAI FUDAN MICROELECTRONICS GROUP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111159043.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2025-09-09
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

In the field of visual text detection, existing technologies require large amounts of labeled data, are time-consuming, and costly, especially character-level labeling, which is more difficult and leads to low efficiency in training data labeling.

Method used

An iterative learning method is adopted to infer the enhanced sample set of the business candidate data set through the k-1th iteration of the text detection model, calculate the consistency index of the prediction results, select target samples for manual word-level annotation, and use character-level pseudo-labels for model training, gradually enriching the model features and reducing the difficulty and cost of annotation.

Benefits of technology

By combining active learning and character-level pseudo-labeling, target samples are automatically selected for manual labeling, which reduces the labeling workload, improves the accuracy of detection results, and reduces labeling time and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115937870B_ABST
    Figure CN115937870B_ABST
Patent Text Reader

Abstract

A training method, device, medium, and terminal for a character-level text detection model include: during the kth iteration, using the text detection model obtained in the k-1th iteration to infer an enhanced sample set of each sample in a business candidate dataset to obtain a set of prediction boxes; calculating the sample prediction result consistency index; selecting a target sample based on the prediction result consistency index of each sample; adding the target sample after manual word-level annotation to the selected sample set, inferring the target sample using the text detection model obtained in the k-1th iteration to obtain a character-level pseudo-label; training the text detection model obtained in the k-1th iteration based on the annotated target sample and its character-level pseudo-label to obtain a text detection model for the kth iteration; and evaluating the text detection model obtained in the kth iteration. If the evaluation passes, a character-level text detection model is obtained. The above scheme can reduce annotation time and cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of visual text detection, and in particular to a training method, device, medium, and terminal for a character-level text detection model. Background Art

[0002] With the rapid development of deep learning and the substantial increase in computing power, many tasks have achieved intelligent transformation with the help of deep learning models. However, deep learning requires massive amounts of labeled samples for model training to achieve the desired generalization capabilities.

[0003] In the field of visual text detection, real-world text is rich in information, and features such as font, size, curvature, and slope are all subject to uncertainty. To accurately predict text in real-world scenarios, massive amounts of training data must be manually annotated before model training to help the model learn rich textual knowledge. However, the amount of training data can often reach tens of thousands or even millions, resulting in large amounts of labeled data, lengthy labeling times, and high costs. Summary of the Invention

[0004] The technical problem solved by the embodiments of the present invention is that the amount of labeled data is large, the labeling is time-consuming and costly.

[0005] In order to solve the above technical problems, an embodiment of the present invention provides a training method for a character-level text detection model, comprising: in the kth iteration process, using the text detection model obtained in the k-1th iteration to infer the enhanced sample set of each sample in the business candidate data set, and obtaining a prediction box set corresponding to the enhanced sample set of each sample, the enhanced sample set including the original sample and the enhanced sample of the original sample, the prediction box set including the prediction boxes corresponding to the original sample and the enhanced sample of the original sample, respectively, wherein k is an integer greater than 1; for each sample, according to the prediction box set of the enhanced sample set of each sample, calculating the prediction result consistency index of each sample, the prediction result consistency index is used to characterize the consistency degree of the prediction result; according to each sample The prediction result consistency index is obtained, and a target sample is selected from the business candidate data set; the target sample is manually annotated at the word level, and the target sample after manual word-level annotating is added to the selected sample set, wherein the selected sample set includes multiple target samples annotated at the word level; the text detection model obtained by the k-1th iteration is used to infer each annotated target sample to obtain a character-level pseudo-label of each target sample, and the text detection model obtained by the k-1th iteration is trained based on the character-level pseudo-labels of each word-level annotated target sample and each target sample to obtain a text detection model of the kth iteration; the text detection model obtained by the kth iteration is evaluated using the test set, and if the evaluation passes, the character-level text detection model is obtained.

[0006] Optionally, the training method of the character-level text detection model further includes: if the evaluation fails, continuing iterative training based on the text detection model of the kth iteration until the evaluation passes, thereby obtaining the character-level text detection model.

[0007] Optionally, for each sample, the prediction result consistency index of each sample is calculated based on the prediction box set of the enhanced data set of each sample, including: for each sample, for the target object in each sample, calculating the ratio of the union of the prediction box of the target object to the intersection of the prediction box of the target object, and obtaining the prediction result consistency index of the target object according to the ratio; for each sample, obtaining the prediction result consistency index of each sample according to the prediction result consistency index of the target object in each sample.

[0008] Optionally, for each sample, the prediction result consistency index of each sample is obtained according to the prediction result consistency index of the target object in each sample, including: when the sample includes multiple target objects, determining the weight of each target object; weighting the prediction result consistency indices of multiple target objects according to the weight of each target object and the prediction result consistency index of each target object, and using the weighted result as the prediction result consistency index of the sample.

[0009] Optionally, determining the weight of each target object includes: determining the weight of each target object according to the size of the prediction box of the original sample, wherein the weight is positively correlated with the size of the prediction box of the target object in the original sample.

[0010] Optionally, the text detection model obtained by the k-1th iteration is used to infer target samples annotated at each word level to obtain character-level pseudo-labels of each target sample, and the text detection model obtained by the k-1th iteration is trained based on the character-level pseudo-labels of target samples annotated at each word level and each target sample to obtain a text detection model of the kth iteration, including: performing word-level slicing on each target sample in the selected sample set according to the word-level annotation to obtain one or more slices; using the text detection model obtained by the k-1th iteration to infer the slices of each target sample to obtain a character-level region probability heat map; according to the character-level region probability heat map of the slices of each target sample, using an image segmentation algorithm to cut each slice to predict the character prediction box of each character; mapping a two-dimensional Gaussian heat map onto the character prediction box of each character; for each target sample, obtaining the character-level pseudo-label of each target sample according to the two-dimensional Gaussian heat map and each target sample; training the text detection model obtained by the k-1th iteration according to the character-level pseudo-label of each target sample and each target sample to obtain a text detection model of the kth iteration.

[0011] Optionally, the text detection model obtained in the k-1th iteration is trained based on the pseudo-labels of each target sample and each target sample, including: for each slice, estimating the word prediction length of the words in each slice based on the character prediction box of each character in each slice; for each slice, calculating the authenticity index of the prediction result of each slice based on the word prediction length and the authenticity of the words; for each target sample, determining the learning weight of each target sample based on the authenticity index of the prediction results of all slices in each target sample; and training the text detection model obtained in the k-1th iteration in combination with the learning weight of each target sample, the character-level pseudo-label of each target sample, and the word-level annotation of each target sample.

[0012] Optionally, after selecting a target sample from the business candidate data set, the target sample is deleted from the business candidate data set to update the business candidate data set.

[0013] Optionally, the training method of the character-level text detection model further includes: when k is 1, during the first iteration, using the initial iterative text detection model to infer the enhanced sample set of each sample in the business candidate data set.

[0014] Optionally, the initial iterative text detection model is obtained in the following manner: performing word-level slicing on each image sample in an open source training sample set to obtain several slices, wherein the open source training sample set includes multiple word-level annotated image samples; using the original model to infer each slice obtained from the training sample set to obtain a character-level region probability heat map; for each slice, estimating the predicted length of the words in each slice based on the character-level region probability heat map of each slice; calculating the prediction result authenticity index of each slice based on the predicted length of the words in each slice and the actual length of the words; for each image sample, determining the learning weight of each image sample based on the prediction result authenticity index of all slices in each image sample, wherein the prediction result authenticity index is positively correlated with the learning weight; combining the learning weight of each image sample, each image sample and its character-level region probability heat map, the original model is trained to obtain the initial iterative text detection model.

[0015] Optionally, the original model is trained in the following manner: generating the word text information by randomly arranging and combining single characters; attaching the word text information to a background image without text information to generate a synthetic character-level annotated text image sample; and training the original model using the synthetic character-level annotated text image sample.

[0016] Optionally, the enhanced sample of the original sample is obtained in the following manner: performing at least one of the following data enhancement operations on the original sample to obtain the enhanced sample of the original sample: motion blur operation, scaling operation, rotation operation, noise addition operation, flipping operation, brightness adjustment, and color adjustment.

[0017] An embodiment of the present invention also provides a text detection method, comprising: obtaining a text image to be detected; using the character-level text detection model trained by any of the above-mentioned character-level text detection model training methods to detect the text image to be detected to obtain a character detection result, wherein the character detection result includes: a character probability heat map, and the character probability heat map is used to characterize the probability of the character area; according to the character detection result and the connected domain prediction result between characters, the character area is connected to obtain a word-level detection result.

[0018] The embodiment of the present invention also provides a training device for a character-level text detection model, comprising: an iteration unit, for inferring, during the kth iteration, an enhanced sample set of each sample in a business candidate data set using the text detection model obtained in the k-1th iteration, to obtain a prediction box set corresponding to the enhanced sample set of each sample, wherein the enhanced sample set includes the original sample and the enhanced sample of the original sample, and the prediction box set includes the prediction boxes corresponding to the original sample and the enhanced sample of the original sample, respectively, wherein k is an integer greater than 1; a calculation unit, for calculating, for each sample, a prediction result consistency index of each sample according to the prediction box set of the enhanced sample set of each sample; a selection unit, for selecting, from the prediction result consistency index of each sample according to the prediction result consistency index of each sample. A target sample is selected from a business candidate data set; a training unit is used to manually annotate the target sample at the word level, and add the manually annotated target sample to a selected sample set, wherein the selected sample set includes a plurality of target samples annotated at the word level; the text detection model obtained by the k-1th iteration is used to infer the target samples annotated at the word level to obtain the character-level pseudo-label of each target sample, and the text detection model obtained by the k-1th iteration is trained based on the character-level pseudo-label of each word-level annotated target sample and each target sample to obtain a text detection model of the kth iteration; an evaluation unit is used to evaluate the text detection model obtained by the kth iteration using a test set, and if the evaluation passes, the character-level text detection model is obtained.

[0019] An embodiment of the present invention also provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transient storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes any step of the above-mentioned character-level text detection model training method.

[0020] An embodiment of the present invention also provides a terminal, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor runs the computer program, it executes any step of the above-mentioned character-level text detection model training method.

[0021] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:

[0022] During the kth iteration, the text detection model obtained in the k-1th iteration is used to infer the enhanced sample set of each sample in the business candidate data set, and obtain the prediction box set corresponding to the enhanced sample set of each sample. The enhanced sample set of each sample includes the original sample and the enhanced sample of the original sample, and the prediction box set includes the prediction boxes corresponding to the original sample and the enhanced sample of the original sample. Based on the prediction box set of the enhanced sample set of each sample, the prediction result consistency index of the enhanced sample set of each sample is calculated; based on the prediction result consistency index of each sample, the target sample is selected from the business candidate data set; the selected target sample is manually annotated at the word level, and the manually annotated target sample is added to the selected sample set. The text detection model obtained in the k-1th iteration is used to infer the target sample with each word level annotation, and the character-level pseudo-label of each target sample is obtained. The text detection model obtained in the k-1th iteration is trained based on the character-level pseudo-label of each word-level annotated target sample and each target sample to obtain the text detection model of the kth iteration. The prediction box set is obtained by inferring the enhanced sample set of samples based on the text detection model obtained in the k-1th iteration, and the prediction result consistency index of each sample is calculated. Then, the target sample is selected for manual word-level labeling based on the prediction result consistency index of each sample. In this way, in each iteration, the text detection model obtained in the previous iteration selects the target sample that is more beneficial to itself, and performs manual word-level labeling on the selected target sample. The target sample after manual word-level labeling is then fed back to the text detection model obtained in the previous iteration for training in the current iteration, thereby realizing active learning. Through multiple iterations, not only the target samples are automatically selected for manual word-level labeling, but also the target samples with manual word-level labeling can be used for iterative training. In this way, the target samples that are more helpful to the model training can be selected, and the features learned by the text detection model can be continuously and efficiently enriched to further improve the accuracy of the detection results and complete the model training. Target samples are selected by combining iterative active learning with character-level pseudo-labeling. On the one hand, the target samples can be manually labeled at the word level without the need for character-level labeling, which can reduce the labeling workload by reducing the labeling difficulty. On the other hand, the total number of samples that need to be manually labeled is often much lower than the data volume of the entire set of candidate samples. Therefore, the number of sample labels in the training process of the character-level text detection model can be reduced, thereby reducing the labeling time and cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a flowchart of a method for training a character-level text detection model in an embodiment of the present invention;

[0024] Figure 2is a training flow chart of an initial iterative text detection model in an embodiment of the invention;

[0025] Figure 3 is a flowchart of a specific implementation of step S15;

[0026] Figure 4 is a flowchart of a specific implementation of step S156;

[0027] Figure 5 This is another training process of a character-level text detection model in an embodiment of the present invention;

[0028] Figure 6 is a flowchart of a text detection method in an embodiment of the present invention;

[0029] Figure 7 2 is a structural diagram of a training device for a character-level text detection model in an embodiment of the present invention. DETAILED DESCRIPTION

[0030] As mentioned above, existing models used for text detection tasks typically include those based on word-level regression boxes and those based on character-level probability heatmaps. Word-level regression box-based text detection models typically output word-level predictions, using rectangular boxes to locate the entire word. However, these models suffer from two issues. The first issue is that the inference output from these models uses rectangular boxes to identify the detected text. However, in real-world text, the slope and curvature of text vary, so directly using rectangular boxes to locate words results in low text detection accuracy. The second issue is that when learning and predicting long words, their receptive field struggles to cover the word size, resulting in low text detection accuracy. Character-level probability heatmap-based text detection models, on the other hand, predict areas in the image where characters are likely to exist and areas where there may be inter-character coordination, and output probability heatmaps for these areas. Post-processing is then used to connect the character regions, allowing the output word localization boxes to be non-rectangular. Furthermore, the detection targets are characters, thus addressing the limited receptive field of word-level regression box-based text detection models. However, when training a text detection model based on character-level probability heatmaps, the input labels must also be character-level annotation boxes. For text detection tasks involving English words, the cost of character-level annotation is often about 6 times that of word-level annotation. Manually annotating training data at the word level is already a very resource-intensive task. Character-level annotation will undoubtedly further increase the difficulty of annotation, resulting in a large amount of annotated data, a long annotation time, and a high cost.

[0031] To address the above-mentioned issues, in an embodiment of the present invention, during the kth iteration, the text detection model obtained during the k-1th iteration is used to infer the enhanced sample set of each sample in the business candidate dataset, obtaining a set of prediction boxes corresponding to the enhanced sample set of each sample. The enhanced sample set of each sample includes the original sample and the enhanced sample of the original sample, and the prediction box set includes the prediction boxes corresponding to the original sample and the enhanced sample of the original sample. Based on the prediction box set of the enhanced sample set of each sample, the prediction result consistency index of the enhanced sample set of each sample is calculated; based on the prediction result consistency index of each sample, target samples are selected from the business candidate dataset; the selected target samples are manually annotated at the word level, and the manually annotated target samples are added to the selected sample set. The text detection model obtained during the k-1th iteration is used to infer the target samples annotated at the word level, obtaining a character-level pseudo-label for each target sample. The text detection model obtained during the k-1th iteration is trained based on the character-level pseudo-labels of the target samples annotated at the word level and each target sample, obtaining a text detection model for the kth iteration. The prediction box set is obtained by inferring the enhanced sample set of samples based on the text detection model obtained in the k-1th iteration, and the prediction result consistency index of each sample is calculated. Then, the target sample is selected for manual word-level labeling based on the prediction result consistency index of each sample. In this way, in each iteration, the text detection model obtained in the previous iteration selects the target sample that is more beneficial to itself, and performs manual word-level labeling on the selected target sample. The target sample after manual word-level labeling is then fed back to the text detection model obtained in the previous iteration for training in the current iteration, thereby realizing active learning. Through multiple iterations, not only the target samples are automatically selected for manual word-level labeling, but also the target samples with manual word-level labeling can be used for iterative training. In this way, the target samples that are more helpful to the model training can be selected, and the features learned by the text detection model can be continuously and efficiently enriched to further improve the accuracy of the detection results and complete the model training. Target samples are selected by combining iterative active learning with character-level pseudo-labeling. On the one hand, the target samples can be manually labeled at the word level without the need for character-level labeling, which can reduce the labeling workload by reducing the labeling difficulty. On the other hand, the total number of selected samples that require manual labeling is often much lower than the data volume of the entire set of candidate samples. Therefore, the number of sample labels in the training process of the character-level text detection model can be reduced, thereby reducing labeling time and cost.

[0032] In order to make the above-mentioned objects, features and beneficial effects of the embodiments of the present invention more obvious and easy to understand, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0033] An embodiment of the present invention provides a method for training a character-level text detection model. The method for training a character-level text detection model provided by an embodiment of the present invention can be used in text detection scenarios in English, German, French, Spanish, or other languages ​​that require words to be composed by characters.

[0034] Reference Figure 1 , a flowchart of a method for training a character-level text detection model in an embodiment of the present invention is provided, which may specifically include the following steps:

[0035] Step S11, during the kth iteration, the text detection model obtained in the k-1th iteration is used to infer the enhanced sample set of each sample in the business candidate data set to obtain a prediction box set corresponding to the enhanced sample set of each sample.

[0036] In a specific implementation, the enhanced sample set of each sample (also referred to as the PATCH dataset of the sample) includes the original sample and the enhanced sample of the original sample. Thus, the prediction box set corresponding to the enhanced sample set of each sample includes the prediction box corresponding to the original sample and the prediction box of the enhanced sample of the original sample.

[0037] Among them, in computer vision detection tasks, word-level text detection is usually performed, and it is usually necessary to predict the words in the text. Therefore, the prediction box refers to the quadrilateral box that the text detection model infers and outputs for each word in the image. The prediction box is used to frame the word.

[0038] In some non-limiting embodiments, data augmentation operations may be performed on the original samples to obtain enhanced samples of the original samples. The number of enhanced samples may be one or more. During each iteration, each enhanced sample in the enhanced sample set of the sample used may be obtained using a different data augmentation operation. Specifically, during each iteration, the data augmentation operation performed on the original sample may be set based on text detection results, etc.

[0039] Data augmentation operations can include motion blur, scaling, rotation, noise addition, flipping, brightness adjustment, color adjustment, etc. By performing data augmentation on the original samples, on the one hand, the amount of sample data can be increased, and on the other hand, the enhanced samples can be used to train the character-level text detection model, which can improve the performance of the trained character-level text detection model, its generalization ability for business data, and its anti-interference ability.

[0040] In specific implementations, the data enhancement method for the original samples can be selected based on the expert's prior knowledge combined with the application scenario of the character-level text detection model, the characteristics of the text image to be detected in the application scenario, etc.

[0041] When k is an integer greater than 1, that is, starting from the second iteration, during the kth iteration, the text detection model obtained in the k-1th iteration is used to infer the enhanced sample set of each sample in the business candidate data set, and obtain the prediction box set corresponding to the enhanced sample set of each sample, that is, for the enhanced sample set of each sample, the prediction box set includes the prediction box of the original sample and the prediction box of the enhanced sample.

[0042] When k is 1, that is, in the first iteration process, the initial iterative text detection model can be used to infer the enhanced sample set of each sample in the business candidate set, and obtain the prediction box set corresponding to the enhanced sample set of each sample.

[0043] Reference Figure 2 , a training flow chart of an initial iterative text detection model in an embodiment of the present invention is given. In some non-limiting embodiments, the initial iterative text detection model can be trained in the following manner, which can specifically include the following steps.

[0044] Step S21 , performing word-level slicing on each image sample in the open-source training sample set to obtain a plurality of slices, wherein the training sample set includes a plurality of word-level annotated image samples.

[0045] Among them, an open source word-level annotated image text detection dataset collected in real scenarios can be used as an open source training sample. Since the open source word-level annotated image text detection dataset collected in real scenarios is an annotated sample, no manual annotation is required when training the initial iterative text detection model, so as to reduce the workload of manual annotation of the character-level text detection model during the training process, and can improve the adaptability of the trained initial iterative text detection model to noise, blur, and glyph changes, so that the initial iterative text detection model has a certain generalization prediction ability, further improve the accuracy of the trained character-level text detection model in predicting text information, and also lay a better foundation for the prediction box generation in step S11 (that is, the pseudo-label generation of samples in the business candidate data set), and can improve the accuracy of the prediction box in step S11.

[0046] Since the open-source training sample set consists of multiple word-level annotated image samples, each image sample can be sliced ​​according to the word-level ground truth box. Each word-level annotated image sample may contain one or more words, and each slice contains a single word. In supervised learning, the data is annotated and appears in the form of (x, t), where x is the input data and t is the annotation. The correct annotation t is ground true.

[0047] Step S22: Using the original model to infer each slice obtained from the open source training sample set to obtain a character-level region probability heat map.

[0048] In specific implementations, the original model is used to perform text detection on each slice, generating a character-level region probability heatmap, or character-level pseudo-label. The region probability heatmap represents the probability that each region represents a specific character. A pseudo-label is a non-human label derived through inference using a model. It may not be completely accurate and may contain a certain error rate. Character-level pseudo-labels refer to character-level pseudo-labels.

[0049] Step S23: For each slice, the predicted length of the words in each slice is estimated based on the character-level region probability heat map of each slice.

[0050] Specifically, an image segmentation algorithm is used to segment the image based on the character-level region probability heatmap for each slice (also referred to as the ground true slice region) to obtain character bounding boxes. Based on each character bounding box, the predicted length of the word in each slice is estimated. Image segmentation algorithms may include watershed segmentation algorithms, etc.

[0051] Step S24, calculating the authenticity index of the prediction result of each slice according to the predicted length of the word in each slice and the actual length of the word.

[0052] Because the open-source training sample set used multiple word-level annotated image samples, the word-level annotations of these image samples provide the actual lengths of the words, which are known. The prediction result authenticity index is calculated based on the predicted lengths and actual lengths of the words in each slice. The prediction result authenticity index is used to indicate the consistency between the predicted and actual lengths of the words. The higher the consistency between the predicted and actual lengths of the words, the larger the prediction result authenticity index, indicating a higher accuracy of the prediction result.

[0053] In some non-limiting embodiments, for each slice, the ratio of the word prediction length to the word actual length of each slice can be used as the authenticity index of the prediction result of each slice.

[0054] In other non-limiting embodiments, considering that the predicted length of a word may be greater than or less than the actual length of the word, in order to improve the rationality of the authenticity index of the prediction result, the following formula (1) can be used to determine the larger the authenticity index of the prediction result of each slice.

[0055]

[0056] Among them, W i is the authenticity index of the prediction result of the i-th slice; li is the actual length of the word in the i-th slice; Predict the length of the word in the i-th slice; is the absolute value of the difference between the actual length of the word in the i-th slice and the predicted length of the word; To obtain l i and The minimum value in .

[0057] Step S25 : for each image sample, determine the learning weight of each image sample according to the authenticity index of the prediction results of all slices in each image sample.

[0058] In a specific implementation, a variety of methods can be used to determine the learning weight of each image sample.

[0059] In some non-limiting embodiments, when an image sample includes a slice, the authenticity index of the prediction result of the slice is used as the learning weight of the image.

[0060] In other non-limiting embodiments, when an image sample includes multiple slices, a learning weight for each slice is obtained based on the authenticity index of the prediction result of each slice. That is, the learning weights for regions corresponding to different slices of the image sample may be different. In other words, when an image sample includes multiple slices, the image sample may include multiple learning weights.

[0061] In a specific implementation, the prediction result authenticity index is positively correlated with the learning weight. For each slice, the higher the consistency between the predicted word length and the actual word length, the greater the prediction result authenticity index, and accordingly, the greater the learning weight. Conversely, the lower the consistency between the predicted word length and the actual word length, the smaller the prediction result authenticity index, and accordingly, the smaller the learning weight.

[0062] Step S26 , combining the learning weights of each image sample, each image sample and its character-level region probability heat map, to train the original model and obtain the initial iterative text detection model.

[0063] By using manual word-level annotation as a constraint and generating character pseudo-labels for the model to learn, the learning weights are determined according to the actual word length and the predicted word length of each slice. This prevents model oscillation, difficulty in convergence, or other false or insufficient recalls caused by errors in pseudo-label generation, and prevents highly confident (but wrong) sample predictions of outliers from disrupting the training of the entire initial iterative text detection model.

[0064] In some non-limiting embodiments, the original model can be trained in the following manner: generating the word text information by randomly arranging and combining single characters; attaching the word text information to a background image without text information to generate a synthetic character-level annotated text image sample; and using the synthetic character-level annotated text image sample to train the original model.

[0065] The word text information can be generated by randomly permuting and combining individual characters. That is, the word text information is generated by randomly permuting and combining one or more characters using individual characters as units. In the process of generating the word text information, factors such as word font, word length, character combination, and frequency of character collocation can be considered to obtain word text information that meets the requirements.

[0066] For example, we can randomly arrange and combine individual characters to generate word text information and attach it to a text-free background image. Using methods such as synthetic scripts, we can automatically generate synthetic character-level annotated text image samples. Because synthetic scripts are used, the character positions are known, eliminating the need for manual annotation, significantly reducing the amount of annotation and the time required.

[0067] The original model trained with synthetic character-level annotated text image samples can give the original model the ability to predict character-level information. At the same time, through a large number of synthetic character-level annotated text image samples, the original model's generalized prediction ability for text information is guaranteed, laying the foundation for the subsequent generation of character-level pseudo-labels.

[0068] Step S12: For each sample, the prediction result consistency index of each sample is calculated based on the prediction box set of the enhanced sample set of each sample.

[0069] In a specific implementation, for each sample, for the target object in each sample, the ratio of the union of the target object's prediction box to the intersection of the target object's prediction box is calculated, and the prediction result consistency index of the target object is obtained based on the ratio. The ratio of the union of the target object's prediction box to the intersection of the target object's prediction box can also be called the intersection over union (IOU) of the target object's prediction box. The target object is in units of words, that is, the target object is a word.

[0070] Specifically, for each sample, for the target object in each sample, for the same target object, the ratio of the union of the target object's prediction boxes to the intersection of the target object's prediction boxes is calculated, and the prediction result consistency index of the target object is obtained based on the ratio. The prediction result consistency index of each sample is obtained based on the prediction result consistency index of the target object of each sample. In other words, each sample corresponds to an enhanced sample set, and each sample has a one-to-one corresponding prediction result consistency index.

[0071] For example, the enhanced sample set of each sample contains n pictures of original samples and enhanced samples, where n is a positive integer greater than 1. Taking the enhanced sample set as a unit, the following formula (2) can be used to calculate the consistency index of the prediction result of the target object.

[0072]

[0073] Among them, S j is the prediction result consistency index of target object j; box1 is the prediction box of target object j in the first picture; box2 is the prediction box of target object j in the second picture; box n is the predicted box of target object j in the nth picture; box1∩box2∩…∩box n To get the prediction box box1, box2 to box n The intersection of box1∪box2∪…∪box n To get the prediction box box1, box2 to box n The union of .

[0074] When the sample includes a target object, the prediction result consistency index of the target object is used as the prediction result consistency index of the sample.

[0075] When a sample includes multiple target objects, the prediction result consistency index of the sample can be obtained in the following manner. Specifically, when there are multiple target objects in the sample, the weight of each target object is determined. The prediction result consistency index of each target object is calculated, and the prediction result consistency index of each target object is weighted according to the weight of each target object and the prediction result consistency index. The weighted result is used as the prediction result consistency index of the sample.

[0076] For example, the sample includes m target objects, and the weights of the m target objects are w1, w2...w m , the following formula (3) can be used to calculate the consistency index of the sample prediction results.

[0077]

[0078] Among them, S is the prediction result consistency index of the sample; S1 to S m are the prediction result consistency indexes corresponding to m target objects respectively; m is the total number of target objects, and m is a positive integer greater than or equal to 1.

[0079] Research has found that the smaller the target object, the more susceptible it is to data enhancement such as noise and blurring. Therefore, in the enhanced sample set, the accuracy of the prediction result consistency index of the target object with a smaller size is lower. In order to improve the accuracy of the prediction result consistency index of the sample, in an embodiment of the present invention, a weight can be determined based on the size of the prediction box of each target object in the original sample, wherein the weight is positively correlated with the size of the prediction box of the target object in the original sample. That is, the larger the size of the prediction box of the target object in the original sample, the greater the weight; conversely, the smaller the size of the prediction box of the target object in the original object, the smaller the weight. The size of the weight is used to characterize the importance of the prediction result consistency index of the target object to the prediction result consistency index of the sample.

[0080] By determining the weight of the target object based on the size of its prediction box in the original sample, the impact of the smaller target object's prediction consistency index on the sample's prediction consistency index can be reduced, thereby improving the accuracy of the sample's prediction consistency index. Based on the size of the target object's prediction box in the original sample, since the original sample has not undergone data augmentation, the impact of data augmentation on the target object can be avoided, improving the accuracy of the target object's size prediction. This in turn improves the rationality of the weight set for each target object, avoids the unfairness caused by a large number of small target objects, and further improves the accuracy of the sample's prediction consistency index.

[0081] Step S13: selecting a target sample from the business candidate data set according to the consistency index of the prediction results of each sample.

[0082] In a specific implementation, target samples can be selected from the business candidate data set based on the consistency index of the prediction results of each sample.

[0083] In some non-limiting embodiments, samples whose prediction result consistency index is lower than a set threshold may be selected as target samples.

[0084] In other non-limiting embodiments, the prediction result consistency index of each sample can be sorted in reverse order, from low to high, and the samples with the top P prediction result consistency indexes are selected as target samples. It is understood that other methods can also be used to select target samples from the business candidate data set, where P is a positive integer.

[0085] Specifically, the smaller the value of the prediction result consistency index of a sample, the more inconsistent the inference result of the text detection model obtained in the k-1th iteration on the enhanced sample set of the sample. In other words, the fewer essential features of the sample learned by the text detection model obtained in the k-1th iteration, the worse the anti-interference ability. The target samples selected according to the prediction result consistency index of each sample are helpful in screening out samples with smaller prediction result consistency indexes from the business candidate data set, and these samples with smaller prediction result consistency indexes (target samples) are exactly the samples that the text detection model obtained in the k-1th iteration should learn more. The text detection model obtained in the k-1th iteration will also benefit more from learning samples with smaller prediction result consistency indexes.

[0086] Step S14: manually annotate the target sample at the word level, and add the manually annotated target sample to the selected sample set.

[0087] In a specific implementation, manual word-level annotation is performed on the target sample, and the manually word-level annotated target sample is added to a selected sample set, where the selected sample set includes a plurality of word-level annotated target samples.

[0088] In some non-limiting embodiments, professional annotators may annotate the target sample with manual word-level text boxes to obtain the manually annotated target sample.

[0089] Step S15: Use the text detection model obtained in the k-1th iteration to infer the target samples annotated at the word level to obtain the character-level pseudo-labels of each target sample; train the text detection model obtained in the k-1th iteration based on the character-level pseudo-labels of the target samples annotated at the word level and each target sample to obtain the text detection model of the kth iteration.

[0090] In the specific implementation, refer to Figure 3 , a flowchart of a specific implementation of step S15 is given. Step S15 may specifically include the following steps S151 to S156:

[0091] Step S151, performing word-level slicing on each target sample in the selected sample set according to word-level annotation to obtain one or more slices;

[0092] Step S152, using the text detection model obtained in the k-1th iteration to infer the slices of each target sample to obtain a character-level region probability heat map;

[0093] Step S153: Based on the character-level region probability heat map of each slice of the target sample, an image segmentation algorithm is used to cut each slice and predict the character prediction box of each character;

[0094] Step S154, generating a two-dimensional Gaussian heat map by mapping the character prediction boxes of each character;

[0095] Step S155: for each target sample, obtain a character-level pseudo label for each target sample based on the two-dimensional Gaussian heat map and each target sample;

[0096] Step S156 : training the text detection model obtained in the k-1th iteration according to the character-level pseudo labels of each target sample and each target sample to obtain a text detection model of the kth iteration.

[0097] Furthermore, in order to improve the performance of the text detection model obtained by training the kth iteration and prevent the outlier highly confident but wrong target samples from destroying the model, in the embodiment of the present invention, referring to Figure 4 , a flowchart of a specific implementation of step S156 is given. Step S156 may include the following steps S1561 to S1564.

[0098] Step S1561 , for each slice, based on the character prediction box of each character in each slice, estimate the word prediction length of each word in each slice.

[0099] Step S1562: For each slice, the authenticity index of the prediction result of each slice is calculated according to the word prediction length and word authenticity of each slice.

[0100] In a specific implementation, the calculation method of the prediction result authenticity index can refer to the above formula (1), which will not be repeated here.

[0101] Step S1563 , for each target sample, determining a learning weight for each target sample based on the authenticity index of the prediction results of all slices in each target sample;

[0102] In step S1564 , the text detection model obtained in the k-1th iteration is trained by combining the learning weights of each target sample, the character-level pseudo-labels of each target sample, and the word-level annotations of each target sample.

[0103] Therefore, by manually annotating the target samples at the word level and adding them to the selected sample set, the selected sample set is used to train the text detection model obtained in the k-1th iteration to obtain the text detection model of the kth iteration. This allows the text detection model of the kth iteration to learn the features of the target samples, which helps to enrich the features learned by the text detection model of the kth iteration, thereby improving the performance of the text detection model of the kth iteration.

[0104] Step S16: Use the test set to evaluate the text detection model obtained in the kth iteration. If the evaluation passes, the character-level text detection model is obtained.

[0105] In a specific implementation, after obtaining the text detection model of the kth iteration, the test set can be used to evaluate the text detection model obtained by the kth iteration. If the evaluation passes, the text detection model obtained by the kth iteration is used as the character-level text detection model.

[0106] In a specific implementation, if the evaluation fails, iterative training is continued based on the text detection model of the kth iteration until the evaluation passes, thereby obtaining the character-level text detection model. The specific process of subsequent iterative training can be found in the description of the kth iterative training in the above embodiment and will not be repeated here.

[0107] In a specific implementation, after selecting a target sample from the business candidate data set, the target sample is deleted from the business candidate data set to update the business candidate data set, and the updated business data set is used as the business data set for the k+1th iteration.

[0108] As can be seen from the above, during the kth iteration, the text detection model obtained in the k-1th iteration is used to infer the enhanced sample set of each sample in the business candidate data set, and obtain the prediction box set corresponding to the enhanced sample set of each sample. The enhanced sample set of each sample includes the original sample and the enhanced sample of the original sample, and the prediction box set includes the prediction boxes corresponding to the original sample and the enhanced sample of the original sample. Based on the prediction box set of the enhanced sample set of each sample, the prediction result consistency index of the enhanced sample set of each sample is calculated; based on the prediction result consistency index of each sample, the target sample is selected from the business candidate data set; the selected target sample is manually annotated at the word level, and the target sample after manual word level annotating is added to the selected sample set. The text detection model obtained in the k-1th iteration is used to infer the target samples annotated at the word level, and the character-level pseudo-label of each target sample is obtained. The text detection model obtained in the k-1th iteration is trained based on the character-level pseudo-label of each word-level annotated target sample and each target sample to obtain the text detection model of the kth iteration. The prediction box set is obtained by inferring the enhanced sample set of samples based on the text detection model obtained in the k-1th iteration, and the prediction result consistency index of each sample is calculated. Then, the target sample is selected for manual word-level labeling based on the prediction result consistency index of each sample. In this way, in each iteration, the text detection model obtained in the previous iteration selects the target sample that is more beneficial to itself, and performs manual word-level labeling on the selected target sample. The target sample after manual word-level labeling is then fed back to the text detection model obtained in the previous iteration for training in the current iteration, thereby realizing active learning. Through multiple iterations, not only the target samples are automatically selected for manual word-level labeling, but also the target samples with manual word-level labeling can be used for iterative training. In this way, the target samples that are more helpful to the model training can be selected, and the features learned by the text detection model can be continuously and efficiently enriched to further improve the accuracy of the detection results and complete the model training. Target samples are selected by combining iterative active learning with character-level pseudo-labeling. On the one hand, the target samples can be manually labeled at the word level without the need for character-level labeling, which can reduce the labeling workload by reducing the labeling difficulty. On the other hand, the total number of target samples that are finally selected and require manual labeling is often lower than the total number of candidate set samples. Therefore, the amount of sample labeling during the training process of the character-level text detection model can be reduced to reduce labeling time and cost.

[0109] In order to facilitate those skilled in the art to better understand and implement the embodiments of the present invention, the following describes the specific process of the training method of the character-level text detection model in conjunction with a specific embodiment. Figure 5, gives another training process of the character-level text detection model in an embodiment of the present invention, which is described in detail below.

[0110] The training of the character-level text detection model can be divided into the initialization phase and the iteration phase.

[0111] The initialization phase primarily involves obtaining the initial iterative text detection model M0, setting a good start for subsequent iterations. This prevents poor model performance from leading to poor pseudo-label generation on business data and inappropriate target samples. This phase can be divided into two steps.

[0112] Step 1: The training process of the original model.

[0113] Step 2: Based on the original model training, the initial model Q2 is obtained, that is, the initial iterative text detection model M0 is obtained.

[0114] Regarding step one, specifically, individual characters are randomly arranged and combined to generate word text information, which is then attached to a background image without text information. A synthetic script or other method is then used to automatically generate synthetic character-level annotated text image samples. Because synthetic script generation is used, the character position information is known, eliminating the need for manual annotation, significantly reducing the amount of annotation and the time required. Using synthetic character-level annotated text image samples to train the original model gives the original model the ability to predict character-level information. At the same time, through the massive amount of synthetic character-level annotated text image samples, the original model's generalized prediction ability for text information is guaranteed, laying the foundation for the subsequent generation of character-level pseudo-labels.

[0115] Regarding step 2, please refer to the relevant descriptions in the above steps S21 to S26 for details, which will not be repeated here.

[0116] Regarding the iteration stage, for ease of description, taking the kth iteration as an example, it may specifically include the following steps S401 to S409.

[0117] Step S401: perform data enhancement on each sample in the candidate sample set C. The original samples and the enhanced samples form a PATCH set C*.

[0118] Step S402: Infer each sample in the PATCH set C* to obtain a set of predicted boxes.

[0119] For the specific implementation of step S402, please refer to the relevant description of step S11 in the above embodiment, which will not be repeated here.

[0120] Step S403: For the PATCH set C*, the prediction result consistency index is calculated using IOU in units of PATCH.

[0121] For the specific implementation of step S403, please refer to the relevant description of step S12 in the above embodiment, which will not be repeated here.

[0122] Step S404: sort the prediction result consistency indexes in reverse order and select target samples.

[0123] For the specific implementation of step S404, please refer to the relevant description of step S13 in the above embodiment, which will not be repeated here.

[0124] Step S405 , manually annotating the target sample at the word level, adding the manually annotated target sample at the word level to the selected sample set S, and removing the target sample from the candidate sample set C.

[0125] Step S406: Use the selected sample set S to train the model M k-1 Perform training to obtain model M k .

[0126] For the specific implementation of step S406, please refer to the relevant description of step S15 in the above embodiment, which will not be repeated here.

[0127] Among them, when k is 1, the model M k-1 It is the initial iterative text detection model M0.

[0128] Step S407: Use test set A to test model M k Conduct an assessment.

[0129] Step S408: Determine whether the business indicator is met.

[0130] If the result of the judgment is yes, the process ends. If the result of the judgment is no, step S409 is executed to continue the next iterative training.

[0131] Step S409, assign k=k+1.

[0132] When entering the k+1th iteration, analysis can be performed based on the evaluation results, the data enhancement scheme V can be updated, and step S401 can be continued until the iteration ends.

[0133] The embodiment of the present invention also provides a text detection method, referring to Figure 6 , a flowchart of a text detection method in an embodiment of the present invention is given, which may specifically include the following steps:

[0134] Step S61, obtaining a text image to be detected;

[0135] Step S62: Using a character-level text detection model, the text image to be detected is detected to obtain a character detection result, wherein the character detection result includes a character probability heat map, and the character probability heat map is used to represent the probability of a character area.

[0136] In a specific implementation, the character-level text detection model can be trained using the training method of the character-level text detection model provided in any of the above embodiments. Figures 1 to 5 The description of the training method of the character-level text detection model provided in any of the above embodiments will not be repeated here.

[0137] Step S63: Connecting the character regions according to the character detection results and the connected domain prediction results between characters to obtain word-level detection results.

[0138] The embodiment of the present invention also provides a training device for a character-level text detection model, referring to Figure 7 , a structural diagram of a training device for a character-level text detection model in an embodiment of the present invention is given.

[0139] The training device 70 of the character-level text detection model may include:

[0140] An iterative unit 71 is configured to, during a k-th iteration, use the text detection model obtained during the k-1-th iteration to infer an enhanced sample set of each sample in the business candidate dataset, to obtain a prediction box set corresponding to the enhanced sample set of each sample, where the enhanced sample set includes the original sample and the enhanced sample of the original sample, and the prediction box set includes the prediction boxes corresponding to the original sample and the enhanced sample of the original sample, respectively, where k is an integer greater than 1;

[0141] A calculation unit 72 is configured to calculate, for each sample, a prediction result consistency index of each sample based on a prediction box set of an enhanced sample set of each sample;

[0142] A selection unit 73 is configured to select a target sample from the business candidate data set according to a consistency index of prediction results of each sample;

[0143] a training unit 74 configured to manually annotate the target samples at the word level and add the manually annotated target samples to a selected sample set, wherein the selected sample set includes a plurality of target samples annotated at the word level; use the text detection model obtained in the k-1th iteration to infer each target sample annotated at the word level to obtain a character-level pseudo-label for each target sample; and train the text detection model obtained in the k-1th iteration based on the character-level pseudo-labels of each target sample annotated at the word level and each target sample to obtain a text detection model for the kth iteration;

[0144] The evaluation unit 75 is used to evaluate the text detection model obtained in the kth iteration using a test set. If the evaluation passes, the character-level text detection model is obtained.

[0145] In a specific implementation, the specific working principle and workflow of the training device 70 for the character-level text detection model can be found in the description of the training method for the character-level text detection model in the above embodiment, and will not be repeated here.

[0146] An embodiment of the present invention also provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transient storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the training method of the character-level text detection model provided in any of the above embodiments.

[0147] An embodiment of the present invention also provides a terminal, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor runs the computer program, it executes the steps of the training method of the character-level text detection model provided in any of the above embodiments.

[0148] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in any computer-readable storage medium, which may include: ROM, RAM, disk or CD, etc.

[0149] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be based on the scope defined by the claims.

Claims

1. A training method for a character-level text detection model, characterized in that: include: During the kth iteration, the text detection model obtained in the k-1th iteration is used to infer the enhanced sample set of each sample in the business candidate data set to obtain a prediction box set corresponding to the enhanced sample set of each sample, where the enhanced sample set includes the original sample and the enhanced sample of the original sample, and the prediction box set includes the prediction boxes corresponding to the original sample and the enhanced sample of the original sample, respectively, where k is an integer greater than 1; For each sample, based on the prediction box set of the enhanced sample set of each sample, calculate the prediction result consistency index of each sample, wherein the prediction result consistency index is used to characterize the consistency degree of the prediction result; Selecting target samples from the business candidate data set according to the consistency index of the prediction results of each sample; Manually annotating the target sample at the word level, and adding the manually annotated target sample at the word level to a selected sample set, wherein the selected sample set includes a plurality of target samples annotated at the word level; Using the text detection model obtained in the k-1th iteration to infer each word-level annotated target sample, to obtain a character-level pseudo label for each target sample, and training the text detection model obtained in the k-1th iteration based on the character-level pseudo labels of each word-level annotated target sample and each target sample, to obtain a text detection model for the kth iteration; The test set is used to evaluate the text detection model obtained in the kth iteration. If the evaluation passes, the character-level text detection model is obtained.

2. The method for training a character-level text detection model according to claim 1, wherein: Also includes: If the evaluation fails, iterative training is continued based on the text detection model of the kth iteration until the evaluation passes, thereby obtaining the character-level text detection model.

3. The training method of the character-level text detection model according to claim 1, wherein: The method of calculating the prediction result consistency index of each sample based on the prediction box set of the enhanced data set of each sample includes: For each sample, for the target object in each sample, calculate the ratio of the union of the target object's prediction boxes to the intersection of the target object's prediction boxes, and obtain the prediction result consistency index of the target object according to the ratio; For each sample, the prediction result consistency index of each sample is obtained according to the prediction result consistency index of the target object in each sample.

4. The method for training a character-level text detection model according to claim 3, wherein: The method of obtaining the prediction result consistency index of each sample according to the prediction result consistency index of the target object in each sample includes: When the sample includes multiple target objects, determine the weight of each target object; According to the weight of each target object and the prediction result consistency index of each target object, the prediction result consistency index of multiple target objects is weighted, and the weighted result is used as the prediction result consistency index of the sample.

5. The method for training a character-level text detection model according to claim 4, wherein: Determining the weight of each target object includes: A weight is determined according to the size of the prediction box of each target object in the original sample, wherein the weight is positively correlated with the size of the prediction box of the target object in the original sample.

6. The method for training a character-level text detection model according to claim 1, wherein: The text detection model obtained in the k-1th iteration is used to infer each word-level annotated target sample to obtain a character-level pseudo label of each target sample, and the text detection model obtained in the k-1th iteration is trained based on the character-level pseudo labels of each word-level annotated target sample and each target sample to obtain a text detection model of the kth iteration, including: Slicing each target sample in the selected sample set at the word level according to the word-level annotation to obtain one or more slices; Using the text detection model obtained in the k-1th iteration to infer the slices of each target sample, a character-level region probability heat map is obtained; According to the character-level region probability heat map of each target sample slice, the image segmentation algorithm is used to cut each slice and predict the character prediction box of each character; Mapping the character prediction boxes of each character to produce a two-dimensional Gaussian heat map; For each target sample, obtain the character-level pseudo label of each target sample based on the two-dimensional Gaussian heat map and each target sample; The text detection model obtained in the k-1th iteration is trained according to the character-level pseudo labels of each target sample and each target sample to obtain a text detection model of the kth iteration.

7. The method for training a character-level text detection model according to claim 6, wherein: The training of the text detection model obtained in the k-1th iteration according to the character-level pseudo labels of each target sample and each target sample includes: For each slice, based on the character prediction box of each character in each slice, the word prediction length of each word in each slice is estimated; For each slice, the authenticity index of the prediction result of each slice is calculated according to the word prediction length and word authenticity of each slice; For each target sample, the learning weight of each target sample is determined according to the authenticity index of the prediction results of all slices in each target sample; The text detection model obtained in the k-1th iteration is trained by combining the learned weights of each target sample, the character-level pseudo-labels of each target sample, and the word-level annotations of each target sample.

8. The method for training a character-level text detection model according to claim 1, wherein: After selecting a target sample from the business candidate data set, the target sample is deleted from the business candidate data set to update the business candidate data set.

9. The method for training a character-level text detection model according to claim 1, wherein: Also includes: When k is 1, in the first iteration, the initial iterative text detection model is used to infer the enhanced sample set of each sample in the business candidate dataset.

10. The method for training a character-level text detection model according to claim 9, wherein: The initial iterative text detection model is obtained in the following way: Slicing each image sample in an open source training sample set at the word level to obtain a plurality of slices, wherein the open source training sample set includes a plurality of word-level annotated image samples; Using the original model to infer each slice obtained from the open source training sample set, a character-level region probability heat map is obtained; For each slice, estimate the predicted length of words in each slice based on the character-level region probability heat map of each slice; Calculate the authenticity index of the prediction results of each slice based on the predicted length of the words in each slice and the actual length of the words; For each image sample, determining a learning weight for each image sample according to a prediction result authenticity index of all slices in each image sample, wherein the prediction result authenticity index is positively correlated with the learning weight; The original model is trained by combining the learning weights of each image sample, each image sample and its character-level region probability heat map to obtain the initial iterative text detection model.

11. The method for training a character-level text detection model according to claim 10, wherein: The original model is trained in the following way: Generating the word text information by randomly arranging and combining single characters; Attach word text information to a background image without text information to generate synthetic character-level annotated text image samples; The original model is obtained by training with the synthesized character-level annotated text image samples.

12. The method for training a character-level text detection model according to claim 1, wherein: The enhanced sample of the original sample is obtained in the following way: Perform at least one of the following data enhancement operations on the original sample to obtain an enhanced sample of the original sample: motion blur operation, scaling operation, rotation operation, noise addition operation, flip operation, brightness adjustment, and color adjustment.

13. A text detection method, characterized in that: include: Get the text image to be detected; The character-level text detection model trained by the training method of the character-level text detection model according to any one of claims 1 to 12 is used to detect the text image to be detected to obtain a character detection result, wherein the character detection result includes: a character probability heat map, wherein the character probability heat map is used to represent the probability of a character area; According to the character detection results and the connected domain prediction results between characters, the character regions are connected to obtain word-level detection results.

14. A training device for a character-level text detection model, characterized in that: include: an iterative unit, configured to, during a k-th iteration, use the text detection model obtained during the k-1-th iteration to infer an enhanced sample set of each sample in the business candidate dataset, to obtain a prediction box set corresponding to the enhanced sample set of each sample, the enhanced sample set including the original sample and the enhanced sample of the original sample, the prediction box set including the prediction boxes corresponding to the original sample and the enhanced sample of the original sample, respectively, where k is an integer greater than 1; A calculation unit, configured to calculate, for each sample, a prediction result consistency index of each sample based on a prediction box set of an enhanced sample set of each sample; A selection unit, configured to select a target sample from the business candidate data set according to a consistency index of prediction results of each sample; a training unit, configured to manually annotate the target samples at the word level and add the manually annotated target samples to a selected sample set, wherein the selected sample set includes a plurality of target samples annotated at the word level; use the text detection model obtained in the k-1th iteration to infer each target sample annotated at the word level to obtain a character-level pseudo-label for each target sample; and train the text detection model obtained in the k-1th iteration based on the character-level pseudo-labels of each target sample annotated at the word level and each target sample to obtain a text detection model for the kth iteration; An evaluation unit is used to evaluate the text detection model obtained in the kth iteration using a test set. If the evaluation passes, the character-level text detection model is obtained.

15. A computer-readable storage medium, wherein the computer-readable storage medium is a non-volatile storage medium or a non-transient storage medium, and a computer program is stored thereon, wherein: When the computer program is executed by a processor, the steps of the method for training a character-level text detection model according to any one of claims 1 to 12 are performed.

16. A terminal comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor runs the computer program, the processor performs the steps of the method for training a character-level text detection model according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Scene text recognition method based on man-machine cooperation

    CN110796143A

  • End-to-end text detection and recognition method

    CN112733822A