Adaptive fitting model training method and device, computer device and storage medium

By employing an adaptive fitting model training method, and utilizing batch normalization and feature weight sorting, the problem of the gap between synthetic text and real text was solved, thereby improving the accuracy and efficiency of scene text detection.

CN115482544BActive Publication Date: 2026-01-09SHENZHEN SMARTMORE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211135932.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-19
Publication Date
2026-01-09
Estimated Expiration
2042-09-19

AI Technical Summary

Technical Problem

In existing technologies, the gap between synthetic text and real text leads to low fitting efficiency and low accuracy in scene text detection, especially when there is insufficient labeled data. The distribution gap between synthetic and real data and the background view bias problem have not been effectively solved.

Method used

The adaptive fitting model training method is used to obtain training scene text images, fill the preset scene text images with synthetic text, perform batch normalization on the synthetic text and real text respectively, sort the feature weights, adjust the model parameters until the training termination condition is met, and generate target text that meets the preset text effect.

Benefits of technology

It effectively improves the accuracy and efficiency of synthesized text, bridges the gap between synthesized text and real text, and enhances the performance of scene text detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115482544B_ABST
    Figure CN115482544B_ABST
Patent Text Reader

Abstract

The application discloses a self-adaptive fitting model training method and device, computer equipment and a storage medium. The method comprises the following steps: obtaining a training scene text image; performing batch normalization processing on each text in the training scene text image through a text self-adaptive model to be trained to obtain synthesized text normalization features and real text normalization features; performing feature weight sorting on each real text normalization feature to obtain a first sorting result, and determining real text loss information according to the first sorting result; performing feature weight sorting on each synthesized text normalization feature to obtain a second sorting result, and determining synthesized text loss information according to the second sorting result; and adjusting model parameters of the text self-adaptive model to be trained according to the real text loss information and the synthesized text loss information until a preset training end condition is met, so that a trained text self-adaptive model is obtained. The method can make up for the gap between synthesized texts and real texts in scene texts.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and relates to a self-adaptive fitting model training method and device, computer equipment and a storage medium. BACKGROUND

[0002] With the development of artificial intelligence technology, a character recognition technology has appeared. The character recognition technology is a common computer vision task and has been well researched from the perspective of algorithms. However, scene text detection technology with the help of deep learning has made great progress. Most of the traditional obstacles, such as characters of various sizes and shapes, curved characters, complex lighting and perspective distortion, have been largely solved by DNN models. A common requirement of this method is sufficient labeled data for training to handle the above-mentioned various cases.

[0003] However, the amount of labeled data is usually lower than the requirement, and using synthetic data is a makeshift solution that can alleviate the disadvantage of the lack of labeled real data. With the help of advanced text generation technology, computers can generate a large amount of text on any background, which not only has low cost but also has accurate labels. However, it cannot be simply assumed that synthetic data is exactly the same as real data. One of the main reasons is the distribution gap between real text and synthetic text, which leads to poor generalization effect. Another potential reason is that the data set is generated on a background unrelated to scene text data, which may contain some bias compared to the background view of scene text data. Therefore, it leads to low fitting efficiency and low accuracy. SUMMARY

[0004] The present application provides a self-adaptive fitting model training method and device, computer equipment and a storage medium, which can make up for the gap between synthetic text and real text in scene text.

[0005] In a first aspect, the present application provides a self-adaptive fitting model training method, comprising:

[0006] obtaining a training scene text image; the training scene text image is obtained by filling synthetic text into at least one preset scene text image; the synthetic text is obtained by adjusting the style of at least one training text; and the preset scene text image is a scene image including at least one real text;

[0007] performing batch normalization processing on the synthetic text and the real text in the training scene text image by a text self-adaptive model to be trained, to obtain synthetic text normalization features corresponding to at least two synthetic texts and real text normalization features corresponding to at least two real texts;

[0008] The feature weight of each real text normalization feature is sorted to obtain a first sorting result, and real text loss information corresponding to the real text is determined according to the first sorting result; and the feature weight of each synthetic text normalization feature is sorted to obtain a second sorting result, and synthetic text loss information corresponding to the synthetic text is determined according to the second sorting result.

[0009] According to the real text loss information and the synthetic text loss information, the model parameters of the text adaptive model to be trained are adjusted until a preset training end condition is met, and a trained text adaptive model is obtained; the trained text adaptive model is used to generate a target text meeting a preset text effect.

[0010] In a second aspect, the present application further provides an adaptive fitting model training device, comprising:

[0011] The acquisition module is configured to acquire a training scene text image; the training scene text image is obtained by filling a synthetic text into at least one preset scene text image; the synthetic text is obtained by performing style adjustment on at least one training text; and the preset scene text image is a scene image including at least one real text.

[0012] The processing module is configured to perform batch normalization processing on the synthetic text and the real text in the training scene text image respectively by using the text adaptive model to be trained, to obtain synthetic text normalization features corresponding to at least two synthetic texts and real text normalization features corresponding to at least two real texts.

[0013] The sorting module is configured to sort the feature weight of each real text normalization feature to obtain a first sorting result, and determine real text loss information corresponding to the real text according to the first sorting result; and sort the feature weight of each synthetic text normalization feature to obtain a second sorting result, and determine synthetic text loss information corresponding to the synthetic text according to the second sorting result.

[0014] The training module is configured to adjust the model parameters of the text adaptive model to be trained according to the real text loss information and the synthetic text loss information until a preset training end condition is met, to obtain a trained text adaptive model; and the trained text adaptive model is used to generate a target text meeting a preset text effect.

[0015] In a third aspect, the present application further provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps in the adaptive fitting model training method described above when executing the computer program.

[0016] In a fourth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which when executed by a processor implements the steps of the adaptive fitting model training method described above.

[0017] In a fifth aspect, the present application also provides a computer program product, comprising a computer program which when executed by a processor implements the steps of the adaptive fitting model training method described above.

[0018] The adaptive fitting model training method, device, computer device and storage medium described above use a convolutional neural network to extract features from real text and synthetic text, and it is observed that batch normalization features show different responses at different positions of synthetic text and real text. Then the batch normalization features lost in real text are sorted, and a weighting mechanism is introduced on this basis, so that the model pays more attention to the active features of real text while optimizing synthetic text and real text. A large amount of real text and synthetic text is used to train the model, so that the adaptive fitting model is effective in making up for the gap between synthetic text and real text in scene text detection, and can effectively improve the accuracy and efficiency of generating synthetic text. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 An application environment diagram of the adaptive fitting model training method provided by the embodiments of the present application;

[0020] Figure 2 A flowchart of the adaptive fitting model training method provided by the embodiments of the present application;

[0021] Figure 3 A flowchart of the first method for obtaining text normalization features provided by the embodiments of the present application;

[0022] Figure 4 A flowchart of the second method for obtaining text normalization features provided by the embodiments of the present application;

[0023] Figure 5 A flowchart of the third method for obtaining text normalization features provided by the embodiments of the present application;

[0024] Figure 6 A flowchart of the method for determining real text loss information provided by the embodiments of the present application;

[0025] Figure 7 A flowchart of the method for determining synthetic text loss information provided by the embodiments of the present application;

[0026] Figure 8A flowchart of a method for obtaining a second ranking result provided by an embodiment of the present application is shown in FIG. 1.

[0027] Figure 9 An example diagram of synthesizing a text and a real text provided by an embodiment of the present application is shown in FIG. 2.

[0028] Figure 10 A flowchart of a method for calculating a loss value of a synthesized text and a real text provided by an embodiment of the present application is shown in FIG. 3.

[0029] Figure 11 A flowchart of a method for training a text adaptive model provided by an embodiment of the present application is shown in FIG. 4.

[0030] Figure 12 A comparison diagram of different text adaptive models provided by an embodiment of the present application is shown in FIG. 5.

[0031] Figure 13 A structural block diagram of a training device of an adaptive fitting model provided by an embodiment of the present application is shown in FIG. 6.

[0032] Figure 14 An internal structure diagram of a computer device provided by an embodiment of the present application is shown in FIG. 7.

[0033] Figure 15 An internal structure diagram of a computer readable storage medium provided by an embodiment of the present application is shown in FIG. 8. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0035] The adaptive fitting model training method provided by the embodiments of the present application can be applied to, for example, Figure 1The computer device 102 obtains data, the server 104 receives the data of the computer device 102 in response to the instruction of the computer device 102, and calculates the obtained data, the server 104 transmits the calculation result of the data back to the computer device 102, and the computer device 102 displays the calculation result. Wherein, the computer device 102 communicates with the server 104 through a communication network. The data storage system can store the data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The server 104 obtains a training scene text image through the computer device 102; the training scene text image is obtained by filling a synthetic text into at least one preset scene text image; the synthetic text is obtained by adjusting the style of at least one training text; the preset scene text image is a scene image including at least one real text; the synthetic text and the real text in the training scene text image are respectively subjected to batch normalization processing through a text adaptive model to be trained, to obtain synthetic text normalization features corresponding to at least two synthetic texts and real text normalization features corresponding to at least two real texts; the feature weight of each real text normalization feature is sorted to obtain a first sorting result, and real text loss information corresponding to the real text is determined according to the first sorting result; and the feature weight of each synthetic text normalization feature is sorted to obtain a second sorting result, and synthetic text loss information corresponding to the synthetic text is determined according to the second sorting result; the model parameters of the text adaptive model to be trained are adjusted according to the real text loss information and the synthetic text loss information until a preset training end condition is met, to obtain a trained text adaptive model; the trained text adaptive model is used to generate a target text meeting a preset text effect. Wherein, the computer device 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle-mounted device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0036] In some embodiments, as shown in Figure 2 , a self-adaptive fitting model training method is provided, which is applied to the server in Figure 1 for example, including the following steps:

[0037] Step 202, obtaining a training scene text image.

[0038] The scene text image can be a sample image for training, wherein the scene text image includes synthetic text, real text and a real scene image, the synthetic text and the real text are located above the scene image, but the synthetic text does not overlap with the real text.

[0039] Specifically, the server obtains a plurality of scene text images for training from the computer device in response to an instruction of the computer device, and stores the obtained scene text images for training in a storage unit, and when the server needs to process any image information in the scene text images for training, the scene text images for training are called from the storage unit to a volatile storage resource for calculation by a central processing unit. The scene text image for training is obtained by filling synthetic text into at least one preset scene text image; the synthetic text is obtained by adjusting the style of at least one training text; and the preset scene text image is a scene image including at least one real text.

[0040] For example, the server 104 obtains a plurality of scene text images for training from the computer device 102 in response to an instruction of the computer device 102, and stores the obtained scene text images for training in a storage unit in the server 104, wherein the server 104 obtains 10 scene text images for training, which can be sequentially input to the server 104 for processing.

[0041] In step 204, the synthetic text and the real text in the scene text image for training are respectively subjected to batch normalization processing by the text adaptive model to be trained, to obtain synthetic text normalization features corresponding to at least two synthetic texts and real text normalization features corresponding to at least two real texts.

[0042] The text adaptive model to be trained can be an untrained text adaptive model, which can be used to make the synthetic text in the scene text image real, that is, to make the synthetic text as close to the real text as possible.

[0043] The synthetic text can be a text synthesized by a computer, and the synthetic text can be in the form of a word, a character string or a synthetic picture with semantics.

[0044] The real text can be a text obtained by photographing in a real situation, and the real text can be in the form of a word, a character string or a real picture with semantics.

[0045] The batch normalization processing can be data standardization processing to eliminate the dimensional influence between indicators, so as to solve the comparability between data indicators. After the original data is subjected to data standardization processing, the indicators are in the same order of magnitude, and are suitable for comprehensive comparison and evaluation. Data normalization generally includes [0, 1] normalization and normal distribution normalization.

[0046] The synthetic text normalization feature can be a normalization feature obtained by batch normalization processing of a feature value corresponding to the synthetic text.

[0047] The real text normalization feature can be a normalization feature obtained by batch normalization processing of a feature value corresponding to the real text.

[0048] Specifically, the generation process of the training scene text image is as follows: first, synthetic text instances are generated using an open-source text generation tool, wherein the words of the text instances are randomly selected from a dictionary of a specific language, and then images of the words are generated according to specified fonts, backgrounds, and modifications (tilt, blur, etc.); second, scene text images are collected from a real data set as backgrounds, wherein all the backgrounds are real and have real text data labels; third, the synthetic text instances are pasted onto the scene images, wherein the positions of the synthetic texts are randomly selected. As shown in FIG. 2. Figure 9

[0049] For the generated training scene text image, it has real text, synthetic text, and a scene image. The training scene text image is input into the text adaptive model to be trained, the convolutional neural network in the text adaptive model to be trained is used to extract features of the synthetic text and the real text in the scene text image, to obtain synthetic text extraction feature values corresponding to the synthetic text and real text extraction feature values corresponding to the real text, and then the synthetic text extraction feature values and the real text extraction feature values are input into the batch normalization processing layer in the text adaptive model to be trained to perform batch normalization calculation. The statistics of the batch normalization processing layer include the features of the data domain. Therefore, by replacing the batch normalization processing statistics of the source data with the target data, the domain shift problem can be largely solved. The conversion of the input features of the batch normalization processing layer into the output features of the batch normalization processing layer can be expressed by the following expression:

[0050]

[0051] wherein γ i and β i are learning parameters, x i is the input feature value, z i is the output feature value, E[X i ] is the batch mean, and Var[X i ] is the variance.

[0052] Given the batch mean and the variance, the batch normalization feature is defined as:

[0053]

[0054] where x is a feature value, E[X i ] is the batch mean, and Var[X i ] is the variance.

[0055] The process of batch normalization is as follows: 1. Calculate the mean of each training batch data; 2. Calculate the variance of each training batch data; 3. Use the calculated mean and variance to normalize the training data of the batch to obtain a normal distribution of (0, 1). A small positive number is introduced to avoid division by zero; 4. Calculate the scale transformation and offset. Based on the above process, the normalized features of at least two synthetic texts and the normalized features of at least two real texts can be calculated.

[0056] It should be noted that because the online synthetic text generation strategy is adopted, i.e., real text and synthetic text may exist simultaneously in an image. The real text and synthetic text pairs are extracted, however, there is an important implication that the source and target batch normalization statistics are separable, which means that the source data and target data can be distinguished by the mean and variance. Similarly, after the domain batch normalization statistics of the batch normalization features, the response should be similar to the source data and the target data.

[0057] In step 206, the feature weight of each real text normalized feature is sorted to obtain a first sorting result, and the real text loss information corresponding to the real text is determined according to the first sorting result; and the feature weight of each synthetic text normalized feature is sorted to obtain a second sorting result, and the synthetic text loss information corresponding to the synthetic text is determined according to the second sorting result.

[0058] Wherein, the feature weight sorting can be sorting the real text normalized features or the synthetic text normalized features according to the preset weight rule.

[0059] Wherein, the first sorting result can be a sorting result obtained by combining a plurality of real text normalized features after the feature weight sorting of the real text normalized features.

[0060] Wherein, the second sorting result can be a sorting result obtained by combining a plurality of synthetic text normalized features after the feature weight sorting of the synthetic text normalized features.

[0061] Wherein, the real text loss information can be a loss value obtained by using a loss function to calculate the real text normalized features.

[0062] Wherein, the synthetic text loss information can be a loss value obtained by using a loss function to calculate the synthetic text normalized features.

[0063] Specifically, since the responses of the batch normalization features to the real text and the synthetic text are similar, it means that the neural network learns the useful features of the text. Since there are both real text and synthetic text in an image, it is difficult to extract the corresponding features, therefore, the importance of the batch normalization features of the real text and the synthetic text is sorted, and then their rankings are compared. Based on the filter pruning, a method based on Taylor expansion criterion is used to identify and evaluate the importance of neurons. Therefore, for each real text normalization feature and synthetic text normalization feature, the Taylor expansion is used to calculate the feature weight, the weight value corresponding to each real text normalization feature can be obtained, and the first ranking result is obtained by sorting; and the weight value corresponding to each synthetic text normalization feature can be obtained, and the intermediate ranking result is obtained by sorting, and the intermediate ranking result obtained by sorting is multiplied by the first ranking result of each real text normalization feature, to obtain the second ranking result corresponding to each synthetic text normalization feature.

[0064] For the real text, the first ranking result, the probability of any pixel in the scene image, the height and width of the scene image are input into the classification layer in the text adaptive model to be trained to calculate the loss value, and the real text loss information corresponding to the real text is obtained, wherein the calculation formula of the real text loss information is as follows:

[0065]

[0066] Where H and W represent the height and width of the corresponding scene image, respectively. y represents the probability of the real text at the pixel.

[0067] For the synthetic text, detailed label information such as character level and word level can be obtained, the second ranking result, the region corresponding to the scene image and the region corresponding to the synthetic text are input into the classification layer in the text adaptive model to be trained to calculate the loss value, and the synthetic text loss information corresponding to the synthetic text is obtained; wherein the calculation formula of the synthetic text loss information is as follows:

[0068]

[0069] Where U is the region of the image corresponding to the scene image, and V is the region of the predicted synthetic text in the scene image. The calculation process of the real text loss information and the synthetic text loss information is as shown in Figure 10

[0070] Step 208, according to the real text loss information and the synthetic text loss information, adjusting the model parameters of the text adaptive model to be trained until the preset training end condition is met, obtaining the trained text adaptive model.

[0071] ​The trained text self-adaption model is used to generate target text meeting a preset text effect. The trained text self-adaption model can be used to realize the synthesized text in the scene text image, that is, to make the synthesized text as close as possible to the real text in the scene.

[0072] Specifically, the real text loss information and the synthesized text loss information calculated by the real text loss function and the synthesized text loss function of the text self-adaption model to be trained are taken as references to adjust the model parameters of the text self-adaption model to be trained. The calculation of the text loss information of the above two is repeated multiple times, and the model parameters of the text self-adaption model to be trained are adjusted according to the text loss information until a preset training end neural network convergence condition is met, and a trained text self-adaption model is obtained. The training process of the text self-adaption model is as shown in Figure 11 .

[0073] In the above adaptive fitting model training method, the convolutional neural network is used to extract features of the real text and the synthesized text, and it is observed that the batch normalization features show different responses at different positions of the synthesized text and the real text. Then, the batch normalization features lost in the real text are sorted, and a weighting mechanism is introduced on this basis, so that the model pays more attention to the active features of the real text while optimizing the synthesized text and the real text. A large amount of real text and synthesized text is used to train the model, so that the adaptive fitting model is effective in making up for the gap between the synthesized text and the real text in scene text detection, and can effectively improve the accuracy and efficiency of generating synthesized text.

[0074] In some embodiments, as shown in Figure 3 , the synthesized text and the real text in the training scene text image are respectively subjected to batch normalization processing by the text self-adaption model to be trained, to obtain synthesized text normalization features corresponding to at least two synthesized texts and real text normalization features corresponding to at least two real texts, including:

[0075] In step 302, the synthesized text and the real text in the training scene text image are respectively subjected to feature extraction by the text self-adaption model to be trained, to obtain synthesized text extraction feature values corresponding to the synthesized text and real text extraction feature values corresponding to the real text.

[0076] The synthesized text extraction feature value can be a feature vector obtained after the synthesized text in the scene text image is subjected to feature extraction by the convolutional neural network.

[0077] The real text extraction feature value can be a feature vector obtained after the real text in the scene text image is subjected to feature extraction by the convolutional neural network.

[0078] Specifically, for the generated training scene text image, there are real text, synthetic text and scene image in it. The training scene text image is input into the text adaptive model to be trained, and the convolutional neural network in the text adaptive model to be trained is used to extract features of the synthetic text and the real text in the scene text image, to obtain synthetic text extraction feature values corresponding to the synthetic text and real text extraction feature values corresponding to the real text. Since the convolutional neural network uses the gradient descent algorithm for learning, the input features of the convolutional neural network need to be standardized. Specifically, before the learning data is input into the convolutional neural network, the input data needs to be normalized in the channel or time / frequency dimension. If the input data is pixels, the original pixel values distributed in [0, 255] can also be normalized to the interval [0, 1]. The hidden layer of the convolutional neural network for feature extraction includes three common structures of convolutional layer, pooling layer and fully connected layer, and can also have Inception module, residual block and other complex structures. Generally, the convolutional layer and the pooling layer are unique to the convolutional neural network, and the convolution kernel in the convolutional layer includes weight coefficients, while the pooling layer does not include weight coefficients. The common structure in the hidden layer is usually in the order of: input-convolutional layer-pooling layer-fully connected layer-output.

[0079] In step 304, the synthetic text extraction feature values and the real text extraction feature values are respectively batch normalized to obtain at least two synthetic text normalization features corresponding to the synthetic text and at least two real text normalization features corresponding to the real text.

[0080] In step 304, the synthetic text extraction feature values and the real text extraction feature values are respectively batch normalized to obtain at least two synthetic text normalization features corresponding to the synthetic text and at least two real text normalization features corresponding to the real text.

[0081] In this embodiment, after the synthetic text and the real text are extracted by the convolutional neural network, they are input into the batch normalization layer for batch normalization processing to obtain the synthetic text normalization features and the real text normalization features. Since batch normalization is an important measure of the importance of each channel in deep learning, it has good properties. It can accelerate the training of the text adaptive model to be trained, and even improve the accuracy of the text adaptive model to be trained.

[0082] In some embodiments, as shown in Figure 4 The synthetic text extraction feature values and the real text extraction feature values are respectively batch normalized to obtain at least two synthetic text normalization features corresponding to the synthetic text and at least two real text normalization features corresponding to the real text, including:

[0083] At step 402, the feature values of the synthetic text and the feature values of the real text are respectively subjected to feature value conversion to obtain synthetic text conversion feature values corresponding to the feature values of the synthetic text and real text conversion feature values corresponding to the feature values of the real text.

[0084] The synthetic text conversion feature values can be feature values obtained by adjusting the learning parameters, the batch mean value and the variance of the feature values of the synthetic text for batch normalization calculation.

[0085] The real text conversion feature values can be feature values obtained by adjusting the learning parameters, the batch mean value and the variance of the feature values of the real text for batch normalization calculation.

[0086] Specifically, the feature values of the synthetic text and the feature values of the real text are input into the batch normalization processing layer of the text adaptive model to be trained for batch normalization calculation, wherein the statistics of the batch normalization processing layer contain the features of the data domain. Therefore, by replacing the batch normalization processing statistics of the source data with the target data, the domain shift problem can be largely solved. The conversion of the input feature of the batch normalization processing layer to the output feature of the batch normalization processing layer can be expressed by the following expression:

[0087]

[0088] wherein γ i and β i are learning parameters, x i is the input feature value, z i is the output feature value, E[X i ] is the batch mean value, and Var[X i ] is the variance.

[0089] At step 404, the synthetic text conversion feature values and the real text conversion feature values are respectively subjected to batch normalization calculation to obtain synthetic text normalization features corresponding to at least two synthetic texts and real text normalization features corresponding to at least two real texts.

[0090] At step 404, refer to the related description of step 204, which will not be described here.

[0091] In this embodiment, by respectively converting the feature values of the synthetic text and the feature values of the real text, and inputting the converted synthetic text conversion feature values and real text conversion feature values as input feature values into the batch normalization layer for batch normalization calculation, the domain shift problem can be largely solved, and the accuracy of the text adaptive model to be trained can be improved.

[0092] In some embodiments, as shown in Figure 5 The batch normalization calculation is performed on the synthetic text conversion feature values and the real text conversion feature values respectively to obtain synthetic text normalization features corresponding to the at least two synthetic texts and real text normalization features corresponding to the at least two real texts, including:

[0093] In step 502, batch mean calculation is performed on the synthetic text conversion feature values and the real text conversion feature values respectively to obtain synthetic text batch means corresponding to the synthetic text conversion feature values and real text batch means corresponding to the real text conversion feature values.

[0094] The synthetic text batch means can be calculated values obtained by performing batch mean calculation on the synthetic text conversion feature values.

[0095] The real text batch means can be calculated values obtained by performing batch mean calculation on the real text conversion feature values.

[0096] Specifically, batch mean calculation is performed on the synthetic text conversion feature values and the real text conversion feature values respectively to obtain synthetic text batch means corresponding to the synthetic text conversion feature values and real text batch means corresponding to the real text conversion feature values. The calculation formula of the batch mean is E[X i ], and the batch mean calculation divides the synthetic text conversion feature values and the real text conversion feature values into several equal-length intervals respectively, and regards each interval as an independent simulation run, so as to obtain that the random variable sequence is approximately independent and identically distributed variables, thereby obtaining the synthetic text batch means and the real text batch means. Factors such as how many intervals the data is divided into, how many observation values each interval contains, and whether the obtained random variable sequence is mutually independent need to be considered. Generally, the sampling number of each interval is required to be large enough, and the number of segments is required to be large enough, so as to ensure the mutual independence of the random variable sequence.

[0097] In step 504, variance calculation is performed on the synthetic text conversion feature values and the real text conversion feature values respectively to obtain synthetic text variances corresponding to the synthetic text conversion feature values and real text variances corresponding to the real text conversion feature values.

[0098] The synthetic text variances can be calculated values obtained by performing variance calculation on the synthetic text conversion feature values.

[0099] The real text variances can be calculated values obtained by performing variance calculation on the real text conversion feature values.

[0100] Specifically, the variance of the synthetic text conversion feature value and the variance of the real text conversion feature value are calculated respectively to obtain the synthetic text variance corresponding to the synthetic text conversion feature value and the real text variance corresponding to the real text conversion feature value. The calculation formula of the variance is Var[X i ], assuming that X is a discrete random variable, if E((X-E(X)) 2 ) exists, then E((X-E(X)) 2 ) is called the variance of X, that is, Var[X i ], wherein E(X) is the expected value of X, X is the variable value, and E in the formula is the abbreviation of expected value, and the variance calculation formula is:

[0101] Var[X i ] = E((X-E(X)) 2 ) = E(X 2 )-E 2 (X)

[0102] In step 506, batch normalization calculation is performed on the synthetic text batch mean and the synthetic text variance to obtain synthetic text normalization features corresponding to at least two synthetic texts; and batch normalization calculation is performed on the real text batch mean and the real text variance to obtain real text normalization features corresponding to at least two real texts.

[0103] In step 506, refer to the related description of step 204, which will not be described here.

[0104] In this embodiment, by calculating the batch mean and the variance corresponding to the synthetic text and the real text, the synthetic text normalization features and the real text normalization features after batch normalization calculation can be distinguished by the mean and the variance, and the batch normalization calculation can be used as a measure of the importance of the channel in deep learning, and the accuracy of the text adaptive model to be trained can be improved.

[0105] In some embodiments, as shown in Figure 6 , the feature weight of each real text normalization feature is sorted to obtain a first sorting result, and the real text loss information corresponding to the real text is determined according to the first sorting result, including:

[0106] In step 602, the feature weight of each real text normalization feature is calculated according to Taylor expansion to obtain a first feature weight calculation result, and each real text normalization feature is sorted based on the first feature weight calculation result to obtain a first sorting result.

[0107] The first feature weight calculation result can be the weight obtained by calculating each real text normalization feature using Taylor expansion.

[0108] Specifically, for the real text normalization features, the feature weights of each real text normalization feature are calculated respectively using Taylor expansion, the weight values corresponding to each real text normalization feature are obtained, and a first ranking result is obtained by ranking according to a preset ranking method. Wherein, if the function f corresponding to the real text normalization feature can be derived in the open interval I (for example, polynomial, power function, trigonometric function, exponential function, logarithmic function, etc.), the function can be approximated by a polynomial, and in a certain sense, the more the total number N, the more accurate the approximation. To be precise, for any x0 belongs to I, there is a unique sequence {c n} such that for any positive integer N, all have:

[0109]

[0110] Where (x-x0) 0 is always 1, even if x=x0, for each coefficient c n , the nth order derivative of the function at x0 is:

[0111]

[0112] Where 0! = 1. In addition, when x=x0, the function value is equal to the polynomial value. When the number of terms N is finite, generally the smaller |x-x0|, the closer the polynomial to the function.

[0113] Step 604, according to the first ranking result, the probability of the real text in any pixel of the training scene text image, and the height and width corresponding to the training scene text image, determine the real text loss information corresponding to the real text.

[0114] Wherein, step 604 refers to the related description of step 206, which will not be described here.

[0115] In this embodiment, the feature weights corresponding to each real text normalization feature are calculated by Taylor expansion and ranked to obtain a first ranking result, and the real text loss information is calculated according to the first ranking result, which can evaluate the importance of different real text batch normalization features based on Taylor expansion criteria, further affect the weight of real text loss information calculation, and improve the training speed and accuracy of the text adaptive model.

[0116] In some embodiments, as Figure 7 shown, the feature weights of each synthetic text normalization feature are ranked to obtain a second ranking result, and the synthetic text loss information corresponding to the synthetic text is determined according to the second ranking result, including:

[0117] At step 702, the feature weights corresponding to each normalized feature of the synthetic text are calculated according to Taylor expansion to obtain a second feature weight calculation result, and each normalized feature of the synthetic text is sorted based on the second feature weight calculation result to obtain a second sorting result.

[0118] Specifically, for the normalized feature of the synthetic text, the feature weights of each normalized feature of the synthetic text are calculated respectively using Taylor expansion, the weight values corresponding to each normalized feature of the synthetic text are obtained, and the second sorting result is obtained according to the preset sorting method. Wherein, if the function f corresponding to the normalized feature of the synthetic text can be derived in the open interval I (for example, polynomial, power function, trigonometric function, exponential function, logarithmic function, etc.), then this function can be approximated by a polynomial, and in a certain sense, the more the total number N, the more accurate the approximation. To be precise, for any x0 belongs to I, there is a unique sequence {c n} such that for any positive integer N, all have:

[0119]

[0120] Where (x-x0) 0 is always 1, even if x=x0, for each coefficient c n , the nth-order derivative of the function at x0 is:

[0121]

[0122] Where 0! = 1. In addition, when x=x0, the function value is equal to the polynomial value. When the number of terms N is finite, generally the smaller the |x-x0|, the closer the polynomial to the function.

[0123] At step 704, the synthetic text loss information corresponding to the synthetic text is determined according to the second sorting result, the region corresponding to the scene text image, and the region corresponding to the synthetic text.

[0124] Wherein, the region corresponding to the scene image can be the region surrounded by connecting each pixel in the scene image.

[0125] Wherein, the region corresponding to the synthetic text can be the region surrounded by connecting each pixel corresponding to the synthetic text in the scene image.

[0126] Specifically, for the synthetic text, detailed label information such as character level and word level can be obtained, the second sorting result, the region corresponding to the scene image, and the region corresponding to the synthetic text are input into the classification layer in the text adaptive model to be trained to calculate the loss value, and the real text loss information corresponding to the synthetic text is obtained, wherein the calculation formula of the synthetic text loss information is as follows:

[0127]

[0128] wherein, U is the region of the image corresponding to the scene image, and V is the region of the predicted synthesized text in the scene image.

[0129] In this embodiment, the feature weights corresponding to each synthesized text normalization feature are calculated by Taylor expansion and then sorted to obtain a second sorting result, and the synthesized text loss information is calculated according to the second sorting result, which can evaluate the importance of different synthesized text batch normalization features based on the Taylor expansion criterion, further affect the weight of the synthesized text loss information calculation, and improve the training speed and accuracy of the text adaptive model.

[0130] In some embodiments, as shown in Figure 8 the second feature weight calculation result is used to sort each synthesized text normalization feature to obtain a second sorting result, including:

[0131] Step 802, based on the second feature weight calculation result, each synthesized text normalization feature is sorted to obtain an intermediate sorting result.

[0132] Among them, the intermediate sorting result can be a sorting result obtained by reordering the synthesized text normalization features using the second feature weight calculation result.

[0133] Specifically, for the synthesized text normalization features, the feature weights of each synthesized text normalization feature are calculated using Taylor expansion, the weight values corresponding to each synthesized text normalization feature can be obtained, and the intermediate sorting result is obtained according to the preset sorting method.

[0134] Step 804, the intermediate sorting result and the first sorting result are weighted and calculated to obtain a second sorting result.

[0135] Specifically, the intermediate sorting result is multiplied by the first sorting result of each real text normalization feature to satisfy the influence of using the first sorting result to sort the feature weights calculated by Taylor expansion of the synthesized text, and the second sorting result corresponding to each synthesized text normalization feature can be obtained. As shown in the right graph of Figure 10

[0136] In this embodiment, the sorting result obtained by using the second feature weight calculation result to sort the synthesized text normalization features is combined with the weight influence of the first sorting result to generate a second sorting result with similar properties to the first sorting result, which can make the gap between the synthesized text and the real text smaller, and help improve the accuracy of model training.

[0137] In some embodiments, as shown in Figure 12 ​Dice, Ent, Ada, respectively, represent the dice loss of synthetic text, the entropy loss of real text, and the model adaptation. P, R, and F represent precision, recall, and F-measure, respectively. Using the SynthText 800k pre-trained model as a baseline, which can be obtained from the official DBNet source code (note that the baseline result does not access any actual data). According to the pre-trained model, the real data is fine-tuned, including entropy, dice, and adaptation.

[0138] From Figure 12 It can be seen that the proposed adaptation method has greatly improved compared with the baseline, that is, without adaptation. The corresponding entropy loss, dice loss, and adaptation component all contribute to improving the overall performance. Without synthetic text, W. Ent can serve as an important benchmark, and pure text data improves performance. On the other hand, optimizing synthetic text loss, i.e., dice loss, can also improve performance without actual text loss, which proves the effectiveness of the online synthetic text generation strategy. Figure 12 From

[0139] It should be understood that although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.

[0140] Based on the same inventive concept, the embodiments of the present application also provide an adaptive fitting model training device. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in the adaptive fitting model training device embodiments provided below can refer to the limitations of the adaptive fitting model training method in the above text, which will not be repeated here.

[0141] In some embodiments, as Figure 13 shown, an adaptive fitting model training device is provided, comprising:

[0142] The acquisition module 1302 is configured to acquire a training scene text image. The training scene text image is obtained by filling synthetic text into at least one preset scene text image. The synthetic text is obtained by performing style adjustment on at least one training text. The preset scene text image is a scene image including at least one real text.

[0143] The processing module 1304 is configured to perform batch normalization processing on the synthetic text and the real text in the training scene text image respectively by using the text adaptive model to be trained, to obtain synthetic text normalization features corresponding to the at least two synthetic texts and real text normalization features corresponding to the at least two real texts.

[0144] The sorting module 1306 is configured to perform feature weight sorting on the real text normalization features to obtain a first sorting result, and determine real text loss information corresponding to the real texts according to the first sorting result; and perform feature weight sorting on the synthetic text normalization features to obtain a second sorting result, and determine synthetic text loss information corresponding to the synthetic texts according to the second sorting result.

[0145] The training module 1308 is configured to adjust model parameters of the text adaptive model to be trained according to the real text loss information and the synthetic text loss information until a preset training end condition is met, to obtain a trained text adaptive model. The trained text adaptive model is used to generate a target text satisfying a preset text effect.

[0146] In some embodiments, in the process of performing batch normalization processing on the synthetic text and the real text in the training scene text image respectively to obtain synthetic text normalization features corresponding to the at least two synthetic texts and real text normalization features corresponding to the at least two real texts, the processing module 1304 is specifically configured to:

[0147] Perform feature extraction on the synthetic text and the real text in the training scene text image respectively by using the text adaptive model to be trained, to obtain synthetic text extraction feature values corresponding to the synthetic texts and real text extraction feature values corresponding to the real texts.

[0148] Perform batch normalization processing on the synthetic text extraction feature values and the real text extraction feature values respectively, to obtain the synthetic text normalization features corresponding to the at least two synthetic texts and the real text normalization features corresponding to the at least two real texts.

[0149] In some embodiments, in the process of performing batch normalization processing on the synthetic text extraction feature values and the real text extraction feature values respectively to obtain the synthetic text normalization features corresponding to the at least two synthetic texts and the real text normalization features corresponding to the at least two real texts, the processing module 1304 is specifically configured to:

[0150] The feature values of the synthesized text and the feature values of the real text are respectively subjected to feature value conversion to obtain synthesized text conversion feature values corresponding to the feature values of the synthesized text and real text conversion feature values corresponding to the feature values of the real text;

[0151] The synthesized text conversion feature values and the real text conversion feature values are respectively subjected to batch normalization calculation to obtain synthesized text normalization features corresponding to the at least two synthesized texts and real text normalization features corresponding to the at least two real texts.

[0152] In some embodiments, in the aspect of respectively subjecting the synthesized text conversion feature values and the real text conversion feature values to batch normalization calculation to obtain synthesized text normalization features corresponding to the at least two synthesized texts and real text normalization features corresponding to the at least two real texts, the processing module 1304 is specifically configured to:

[0153] The synthesized text conversion feature values and the real text conversion feature values are respectively subjected to batch mean calculation to obtain synthesized text batch means corresponding to the synthesized text conversion feature values and real text batch means corresponding to the real text conversion feature values;

[0154] The synthesized text conversion feature values and the real text conversion feature values are respectively subjected to variance calculation to obtain synthesized text variances corresponding to the synthesized text conversion feature values and real text variances corresponding to the real text conversion feature values;

[0155] The synthesized text batch means and the synthesized text variances are subjected to batch normalization calculation to obtain synthesized text normalization features corresponding to the at least two synthesized texts, and the real text batch means and the real text variances are subjected to batch normalization calculation to obtain real text normalization features corresponding to the at least two real texts.

[0156] In some embodiments, in the aspect of respectively subjecting the synthesized text conversion feature values and the real text conversion feature values to batch normalization calculation to obtain synthesized text normalization features corresponding to the at least two synthesized texts and real text normalization features corresponding to the at least two real texts, the processing module 1304 is specifically configured to:

[0157] According to the Taylor expansion, the feature weights corresponding to the real text normalization features are calculated to obtain a first feature weight calculation result, and the real text normalization features are sorted based on the first feature weight calculation result to obtain a first sorting result;

[0158] According to the first sorting result, the probability of any pixel of the real text in the training scene text image, the height and the width corresponding to the training scene text image, the real text loss information corresponding to the real text is determined.

[0159] In some embodiments, in the feature weight ordering of the normalized features of each synthetic text, obtaining a second ordering result, and determining the synthetic text loss information corresponding to the synthetic text according to the second ordering result, the ordering module 1306 is specifically configured to:

[0160] According to the Taylor expansion, the feature weight corresponding to each normalized feature of the synthetic text is calculated to obtain a second feature weight calculation result, and each normalized feature of the synthetic text is sorted based on the second feature weight calculation result to obtain a second ordering result;

[0161] According to the second ordering result, the region corresponding to the scene text image for training, and the region corresponding to the synthetic text, the synthetic text loss information corresponding to the synthetic text is determined.

[0162] In some embodiments, in the sorting of each normalized feature of the synthetic text based on the second feature weight calculation result to obtain a second ordering result, the ordering module 1306 is specifically configured to:

[0163] Each normalized feature of the synthetic text is sorted based on the second feature weight calculation result to obtain an intermediate ordering result;

[0164] The intermediate ordering result and the first ordering result are weighted and calculated to obtain a second ordering result.

[0165] Each module in the above adaptive fitting model training apparatus can be realized by software, hardware, and combinations thereof, in whole or in part. Each module described above can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to call and execute the operations corresponding to each module by the processor.

[0166] In some embodiments, a computer device is provided, which can be a server, and its internal structure diagram can be as shown in Figure 14 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store server data. The communication interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the steps in the above adaptive fitting model training method.

[0167] Those skilled in the art can understand that Figure 14 The structure shown in the above is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0168] In some embodiments, a computer device is also provided, which includes a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0169] In some embodiments, a computer readable storage medium is provided, Figure 15 The structure shown in the above stores a computer program, and the computer program implements the steps in the above method embodiments when executed by a processor.

[0170] In some embodiments, a computer program product is provided, which includes a computer program. The computer program implements the steps in the above method embodiments when executed by a processor.

[0171] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0172] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. The non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. The volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0173] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0174] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. An adaptive fitting model training method, characterized in that, The method comprises the following steps: obtaining a training scene text image; the training scene text image is obtained by filling synthetic text into at least one preset scene text image; the synthetic text is obtained by performing style adjustment on at least one training text; and the preset scene text image is a scene image comprising at least one real text; performing batch normalization processing on the synthetic text and the real text in the training scene text image by using a text adaptive model to be trained, to obtain synthetic text normalization features corresponding to at least two synthetic texts and real text normalization features corresponding to at least two real texts; calculating feature weights corresponding to each real text normalization feature according to Taylor expansion, to obtain a first feature weight calculation result, and sorting each real text normalization feature based on the first feature weight calculation result, to obtain a first sorting result; determining real text loss information corresponding to the real text according to the first sorting result, a probability of any pixel of the real text in the training scene text image, a height and a width corresponding to the training scene text image; and calculating feature weights corresponding to each synthetic text normalization feature according to Taylor expansion, to obtain a second feature weight calculation result, and sorting each synthetic text normalization feature based on the second feature weight calculation result, to obtain a second sorting result; determining synthetic text loss information corresponding to the synthetic text according to the second sorting result, a region corresponding to the training scene text image, and a region corresponding to the synthetic text; adjusting model parameters of the text adaptive model to be trained according to the real text loss information and the synthetic text loss information until a preset training end condition is met, to obtain a trained text adaptive model; and the trained text adaptive model is used to generate a target text meeting a preset text effect.

2. The method of claim 1, wherein, The method comprises the following steps: performing feature extraction on the synthetic text and the real text in the training scene text image by using the text adaptive model to be trained, to obtain synthetic text extraction feature values corresponding to the synthetic text and real text extraction feature values corresponding to the real text; performing batch normalization processing on the synthetic text extraction feature values and the real text extraction feature values, to obtain synthetic text normalization features corresponding to at least two synthetic texts and real text normalization features corresponding to at least two real texts.

3. The method of claim 2, wherein, The method comprises the following steps: performing batch normalization processing on the synthetic text extraction feature values and the real text extraction feature values, to obtain synthetic text normalization features corresponding to at least two synthetic texts and real text normalization features corresponding to at least two real texts. The feature values of the synthetic text and the feature values of the real text are respectively subjected to feature value conversion to obtain synthetic text conversion feature values corresponding to the feature values of the synthetic text and real text conversion feature values corresponding to the feature values of the real text. The synthetic text conversion feature values and the real text conversion feature values are respectively subjected to batch normalization calculation to obtain synthetic text normalization features corresponding to the at least two synthetic texts and real text normalization features corresponding to the at least two real texts.

4. The method of claim 3, wherein, The synthetic text conversion feature values and the real text conversion feature values are respectively subjected to batch normalization calculation to obtain synthetic text normalization features corresponding to the at least two synthetic texts and real text normalization features corresponding to the at least two real texts, including: The synthetic text conversion feature values and the real text conversion feature values are respectively subjected to batch mean calculation to obtain synthetic text batch means corresponding to the synthetic text conversion feature values and real text batch means corresponding to the real text conversion feature values. The synthetic text conversion feature values and the real text conversion feature values are respectively subjected to variance calculation to obtain synthetic text variances corresponding to the synthetic text conversion feature values and real text variances corresponding to the real text conversion feature values. The synthetic text batch means and the synthetic text variances are subjected to batch normalization calculation to obtain synthetic text normalization features corresponding to the at least two synthetic texts, and the real text batch means and the real text variances are subjected to batch normalization calculation to obtain real text normalization features corresponding to the at least two real texts.

5. The method of claim 1, wherein, The synthetic text conversion feature values and the real text conversion feature values are respectively subjected to batch normalization calculation to obtain synthetic text normalization features corresponding to the at least two synthetic texts and real text normalization features corresponding to the at least two real texts, including: The synthetic text conversion feature values and the real text conversion feature values are respectively subjected to batch normalization calculation to obtain synthetic text normalization features corresponding to the at least two synthetic texts and real text normalization features corresponding to the at least two real texts, including: The intermediate sorting result and the first sorting result are subjected to weighted calculation to obtain a second sorting result.

6. An adaptive fitting model training apparatus characterized by comprising: Including: The acquisition module is configured to acquire a training scene text image; the training scene text image is obtained by filling a synthetic text into at least one preset scene text image; the synthetic text is obtained by performing style adjustment on at least one training text; and the preset scene text image is a scene image including at least one real text. The processing module is configured to perform batch normalization processing on the synthetic text and the real text in the training scene text image through a text adaptive model to be trained, to obtain synthetic text normalization features corresponding to the at least two synthetic texts and real text normalization features corresponding to the at least two real texts. The sorting module is configured to calculate feature weights corresponding to each of the normalized features of the real text according to Taylor expansion to obtain a first feature weight calculation result, and sort each of the normalized features of the real text based on the first feature weight calculation result to obtain a first sorting result; and determine real text loss information corresponding to the real text according to the first sorting result, probabilities of any pixels of the real text in the training scene text image, a height and a width corresponding to the training scene text image. The sorting module is configured to calculate feature weights corresponding to each of the normalized features of the real text according to Taylor expansion to obtain a first feature weight calculation result, and sort each of the normalized features of the real text based on the first feature weight calculation result to obtain a first sorting result; and determine real text loss information corresponding to the real text according to the first sorting result, probabilities of any pixels of the real text in the training scene text image, a height and a width corresponding to the training scene text image. The sorting module is configured to calculate feature weights corresponding to each of the normalized features of the real text according to Taylor expansion to obtain a first feature weight calculation result, and sort each of the normalized features of the real text based on the first feature weight calculation result to obtain a first sorting result; and determine real text loss information corresponding to the real text according to the first sorting result, probabilities of any pixels of the real text in the training scene text image, a height and a width corresponding to the training scene text image. The training module is configured to adjust model parameters of the text adaptive model to be trained according to the real text loss information and the synthesized text loss information until a preset training end condition is met, to obtain a trained text adaptive model; and the trained text adaptive model is used to generate a target text satisfying a preset text effect.

7. The apparatus of claim 6, wherein, In the aspect of processing the synthesized text and the real text in the training scene text image by the text adaptive model to be trained respectively for batch normalization to obtain at least two synthesized text normalization features corresponding to the synthesized text and at least two real text normalization features corresponding to the real text, the processing module is specifically configured to: extract feature values of the synthesized text and the real text in the training scene text image by the text adaptive model to be trained respectively to obtain synthesized text extraction feature values corresponding to the synthesized text and real text extraction feature values corresponding to the real text; perform batch normalization on the synthesized text extraction feature values and the real text extraction feature values respectively to obtain at least two synthesized text normalization features corresponding to the synthesized text and at least two real text normalization features corresponding to the real text.

8. The apparatus of claim 7, wherein, In the aspect of performing batch normalization on the synthesized text extraction feature values and the real text extraction feature values respectively to obtain at least two synthesized text normalization features corresponding to the synthesized text and at least two real text normalization features corresponding to the real text, the processing module is specifically configured to: perform feature value conversion on the synthesized text extraction feature values and the real text extraction feature values respectively to obtain synthesized text conversion feature values corresponding to the synthesized text extraction feature values and real text conversion feature values corresponding to the real text extraction feature values; perform batch normalization calculation on the synthesized text conversion feature values and the real text conversion feature values respectively to obtain at least two synthesized text normalization features corresponding to the synthesized text and at least two real text normalization features corresponding to the real text. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Text sequence recognition model calibration method based on CTC decoder

    CN114495114A

  • Methods and apparatus for using machine learning to securely and efficiently retrieve and present search results

    US20210191925A1