A sequential style consistency learning method and system for domain-generalizable text recognition

Through the sequence style consistency learning method, the feature information of text images is extracted and decoupled, and the entropy loss and comparison learning loss are optimized, which solves the problem of low recognition accuracy of existing text recognition models on different styles of pictures, achieving higher The domain generalization capability and text recognition accuracy.

CN114973227BActive Publication Date: 2025-02-11ZHEJIANG UNIV +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210571707.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-24
Publication Date
2025-02-11
Estimated Expiration
2042-05-24

AI Technical Summary

Technical Problem

Existing text recognition methods use data samples of the same style during training and testing, resulting in low accuracy when encountering new style pictures and lack of domain generalization capabilities.

Method used

By extracting feature information of text images in different styles, data enhancement and feature sequence decoupling are performed, and style-related and task-related sequence encoder are used for encoding, and entropy loss and comparison learning loss are optimized to improve the entropy loss and comparison learning loss. The domain generalization capability of the model.

Benefits of technology

The text recognition model effectively recognizes images of different styles, improves the generalization ability of the model's domain, and provides a common new text recognition framework.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114973227B_ABST
    Figure CN114973227B_ABST
Patent Text Reader

Abstract

The present invention discloses a sequence style consistency learning method and system for domain-generalizable text recognition, which belongs to the field of text recognition. The method includes: 1. Extracting image feature sequences; 2. Performing data enhancement processing on the extracted image feature sequences; 3. Decoupling the initial feature sequence and the enhanced feature sequence and optimizing the entropy loss; 4. Reducing the correlation between style-related features and task features through style consistency learning, and optimizing the contrastive learning loss; 5. Only using task-related sequence features for prediction in the model prediction stage. Compared with the existing traditional methods, the present invention proposes a domain-generalizable method for text recognition tasks for the first time, filling the gap in this technology and achieving better performance than the most advanced domain generalization model currently available.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text recognition, and in particular to a sequence style consistency learning method and system for domain-generalizable text recognition. Background Art

[0002] Many text recognition methods based on deep learning have good performance, but due to their low generalization, they are difficult to meet the text recognition needs of the real world. Most of the existing text recognition methods use data samples of the same style in the training and testing process of the model, without considering the independence and distribution uniqueness between data samples. When the trained model encounters new styles of pictures, such as different fonts or different angles, its accuracy is not high, indicating that the model's domain generalization is poor. The cause of this problem is domain shift.

[0003] Domain generalization methods for image classification tasks can solve the domain shift problem well. However, due to the differences between image classification tasks and text recognition tasks, the existing domain generalization methods for image classification tasks cannot be directly used for text recognition tasks, and text recognition models lack effective domain generalization methods. Summary of the invention

[0004] In view of the above problems, the present invention provides a sequence style consistency learning method and system for domain-generalizable text recognition, so as to improve the domain generalization ability of the text recognition model.

[0005] To this end, the technical solution adopted in the present invention is as follows:

[0006] A sequential style consistency learning method for domain-generalizable text recognition includes the following steps:

[0007] S1: Extract feature information of text images of different styles to obtain the initial feature sequence S;

[0008] S2: Perform data enhancement processing on the initial feature sequence S obtained in step S1 to obtain an enhanced feature sequence

[0009] S3: Initial feature sequence S and enhanced feature sequence Perform feature sequence decoupling processing to obtain the initial style-related feature sequence S with the same dimension as the initial feature sequence S s , initial task-related feature sequence S t , Enhanced style-related feature sequences And enhance the task-related feature sequence

[0010] S4: The initial style-related feature sequence S is encoded by the style-related sequence encoder sand enhanced style-related feature sequences Encode to obtain the encoded initial style-related feature sequence S′ s , the encoded enhanced style-related feature sequence

[0011] The initial task-related feature sequence S is encoded by the task-related sequence encoder t and enhance task-related feature sequences Encode and obtain the encoded initial task-related feature sequence S′ t , the encoded enhanced task-related feature sequence

[0012] S5: Using the four encoded feature sequences S′ obtained in step S4 s , S′ t , Optimize the entropy loss of the text recognition model during training;

[0013] S6: Using the four encoded feature sequences S′ obtained in step S4 s , S′ t , Reduce the correlation between style-related features and task features through style consistency learning, and optimize the contrastive learning loss of the text recognition model during training;

[0014] S7: Use the trained text recognition model to obtain the encoded initial task-related feature sequence S′ of the text image to be recognized t , using S′ t Generate text recognition results.

[0015] Furthermore, the data enhancement processing method in step S2 is slice replacement, random rearrangement or random masking.

[0016] Furthermore, the feature sequence decoupling process described in step S3 comprises the following specific steps:

[0017] S3-1: Input the initial feature sequence S into the multilayer perceptron to generate the weight vector α; Input into the multilayer perceptron to generate the weight vector

[0018] S3-2: Using the weight vector α obtained in step S3-1 above, calculate the initial style-related feature sequence S s , initial task-related feature sequence S t , the calculation formula is:

[0019] S s=(1-α)S

[0020] S s =αS

[0021] Using the weight vector obtained in step S3-1 above Calculate the enhanced style-related feature sequence Enhance task-related feature sequences The calculation formula is:

[0022]

[0023]

[0024] Furthermore, the entropy loss described in step S5 includes cross entropy loss and inverse entropy loss, and the specific steps of optimizing the loss are:

[0025] S5-1: To S′ s , S′ t , Perform average pooling operations respectively, and then use the softmax layer to obtain the probability distribution vector p of N style categories. s , p t ,

[0026] S5-2: Using the probability distribution vector p obtained in step S5-1 above s , Calculate the cross entropy loss and minimize it during training. The calculation formula is:

[0027]

[0028]

[0029] Among them, q i is the one-hot label of the i-th style category, N is the number of style categories, and p s,i Represents the probability distribution vector p s The probability of the i-th style category in Represents the probability distribution vector The probability of the i-th style category in represents the initial style-related cross entropy loss, represents the enhanced style-related cross entropy loss;

[0030] S5-3: Using the probability distribution vector p obtained in step S5-1 above t , Calculate the inverse entropy loss and minimize it during training as follows:

[0031]

[0032]

[0033] Where N is the number of style categories, p t,i Represents the probability distribution vector p t The probability of the i-th style category in Represents the probability distribution vector The probability of the i-th style category in represents the initial task-related inverse entropy loss, Represents the enhanced task-related inverse entropy loss.

[0034] Furthermore, the optimization steps of the contrastive learning loss described in step S6 are:

[0035] S6-1: Using S′ obtained in step S4 s , S′ t , Nonlinear projection via multilayer perceptron

[0036] S6-2: Define the first feature set right Perform average pooling operation to obtain the initial style-related features s after pooling p ;

[0037] S6-3: Using sample pairs Calculate p and The contrast loss between them is minimized during the training process and is calculated as follows:

[0038]

[0039] in, express The characteristics of a certain style category in; τ is the temperature parameter, sim(.) is the cosine similarity of the vector, is the original to enhanced contrastive learning loss, s i ∈S all Denotes the first feature set S all Features of the i-th style category in ;

[0040] S6-4: Defining the second feature set right Perform average pooling operation to obtain the initial style-related features after pooling

[0041] S6-5: Using sample pairs (sp ,s j )calculate and The contrast loss between them is minimized during the training process and is calculated as follows:

[0042]

[0043] in, express A sample of a certain style category in is the contrastive learning loss enhanced to the original one, s′ i ∈S′ all Denotes the second feature set S′ all Features of the i-th style category in ;.

[0044] Furthermore, the final loss function of the text recognition model training phase is It is expressed as:

[0045]

[0046]

[0047] Among them, λ is a hyperparameter, is the sum of contrastive learning losses, represents the initial style-related cross entropy loss, represents the enhanced style-related cross entropy loss, represents the initial task-related inverse entropy loss, represents the enhanced task-related inverse entropy loss, is the original loss used for training the text recognition model.

[0048] Compared with the prior art, the advantages of the present invention are: the present invention proposes a sequence style consistency learning method for domain-generalizable text recognition, which combines feature sequence enhancement, decoupling of style-related features and task-related features, and encourages the model to learn style-related features and task-related features from text images of various styles during the training phase, so as to better generalize to other style text images that are not involved in the training, thereby realizing the model's text recognition of images of different styles and proposing a general new framework for text recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of the overall architecture of a sequential style consistency learning method for domain-generalizable text recognition shown in the present invention;

[0050] Figure 2 It is a schematic diagram of a data enhancement processing feature sequence slice replacement method shown in the present invention;

[0051] Figure 3 : is the visualized text recognition results of five examples in the MSDA dataset shown in the present invention. DETAILED DESCRIPTION

[0052] The present invention is further described and illustrated below in conjunction with the accompanying drawings and specific embodiments of the specification, so as to make the present invention more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures or characteristics may be combined in any suitable manner in one or more embodiments.

[0053] In addition, the drawings are merely schematic illustrations of the present invention, and some of the block diagrams shown in the drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0054] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.

[0055] like Figure 1 Shown is a schematic diagram of the overall architecture of the present invention, which consists of three main parts: feature sequence enhancement, feature sequence decoupling, and minimax entropy and style consistency learning.

[0056] In this embodiment, a sequential style consistency learning method for domain-generalizable text recognition includes the following steps:

[0057] S1: Extract the feature information of the image through the feature extractor to obtain the initial feature sequence, recorded as Τ is the number of features, d is the feature dimension;

[0058] S2: Perform data enhancement processing on S obtained in step S1 to obtain an enhanced feature sequence, denoted as Τ is the number of features, d is the feature dimension;

[0059] like Figure 2 As shown, the data enhancement processing method used in this embodiment is slice replacement, that is, the feature sequence is evenly divided into two segments, the front and back segments, and the positions of the two segments are swapped. In addition, other methods can also be used to achieve data enhancement, such as random rearrangement, that is, rearranging the elements in the feature sequence; or random masking, that is, randomly masking the elements in the feature sequence.

[0060] S3: For S and The feature sequence is decoupled to obtain the initial style-related feature sequence, the initial task-related feature sequence, the enhanced style-related feature sequence, and the enhanced task-related feature sequence, which are denoted as S s , S t , Τ is the number of features, d is the feature dimension;

[0061] The feature sequence decoupling method used in this embodiment is as follows:

[0062] First, the initial feature sequence S is input into the multilayer perceptron to obtain the weight vector Wherein, d is the feature dimension; the multilayer perceptron includes an average pooling layer and an activation layer in sequence, and the calculation formula is:

[0063] α=σ(W2ReLU(W1pool(S)))

[0064] Among them, σ is the sigmoid function, pool is the average pooling operation, and W1 and W2 are learnable weight matrices.

[0065] Next, the weight vector α obtained in the above steps is used to calculate the initial style-related feature sequence S s , initial task-related feature sequence S t , the calculation formula is:

[0066] S s =(1-α)S

[0067] S t =αS

[0068] For enhanced feature sequences The decoupling process is the same as above, and the enhanced feature sequence is obtained through the multi-layer perceptron The weight vector Calculate the enhanced style-related feature sequence Enhance task-related feature sequences

[0069] S4: S is encoded by a style-related sequence encoder s and Encode and get S′ s , Τ is the number of features, d′ is the feature dimension; S is encoded by the task-related sequence encoder t and Encode and get S′ t , Τ is the number of features, d′ is the feature dimension; in this embodiment, a bidirectional LSTM (BiLSTM) network is used to implement sequence modeling.

[0070] S5: Using S′ obtained in step S4 s , S′ t , Optimize entropy loss during training;

[0071] In this embodiment, first, S′ s , S′ t , Perform average pooling operations respectively, and then pass through the softmax layer to obtain the probability distribution vector p of N style categories s , p t , The calculation formula is:

[0072] p s =softmax(W3pool(S′ s ))

[0073]

[0074] p t =softmax(W4pool(S′ t ))

[0075]

[0076] Among them, W3 and W4 are learnable weight matrices, and pool is the average pooling operation.

[0077] Next, we use the probability distribution vector p obtained in the above steps s , Calculate the cross entropy loss and minimize it during training. The calculation formula is:

[0078]

[0079]

[0080] Among them, q i is the one-hot label of the i-th style category, N is the number of style categories, and p s,i Represents the probability distribution vector p s The probability of the i-th style category in Represents the probability distribution vector The probability of the i-th style category in represents the initial style-related cross entropy loss, represents the enhanced style-related cross entropy loss;

[0081] Finally, the probability distribution vector p obtained by the above steps ist , Calculate the inverse entropy loss and minimize it during training to better decouple style-related sequences from task-related sequences. The calculation formula is:

[0082]

[0083]

[0084] Where N is the number of style categories, p t,i Represents the probability distribution vector p t The probability of the i-th style category in Represents the probability distribution vector The probability of the i-th style category in represents the initial task-related inverse entropy loss, Represents the enhanced task-related inverse entropy loss.

[0085] S6: Using S′ obtained in step S4 s , S′ t , The relationship between the initial feature sequence and the corresponding enhanced feature sequence is learned through style consistency, while the correlation between the style-related feature sequence and the task-related feature sequence is reduced, so as to better achieve the decoupling of style correlation and task correlation; style consistency learning is carried out in two directions: original to enhanced (O2A) and from enhanced to original (A2O).

[0086] In this embodiment, first, using S′ obtained in step S4 s , S′ t , Nonlinear projection obtained through multi-layer perceptron (MLP) The calculation formula is:

[0087]

[0088]

[0089]

[0090]

[0091] Among them, W p is a learnable weight matrix and g(.) represents multilayer perceptron processing.

[0092] Next, define the first feature set right Perform average pooling operation to obtain the initial style-related features s after pooling p;

[0093] Then, use the sample pair Calculate p and The contrast loss between them is minimized during training and is calculated as follows:

[0094]

[0095] in, express The sample of a certain style category in , τ is the temperature coefficient, sim(.) is the cosine similarity of the vector, is the original to enhanced contrastive learning loss, s i ∈S all Denotes the first feature set S all The features of the i-th style category in .

[0096] Define the second feature set right Perform average pooling operation to obtain the initial style-related features after pooling

[0097] Finally, using the sample pair calculate and The contrast loss between them is minimized during training and is calculated as follows:

[0098]

[0099] in, express The characteristics of a certain style category in , τ is the temperature coefficient, sim(.) is the cosine similarity of the vector, is the contrastive learning loss enhanced to the original one, s′ i ∈S′ all Denotes the second feature set S′ all The features of the i-th style category in .

[0100] S7: During the model training phase, meta-learning methods are used to complete model training.

[0101] Suppose the original loss function used for text recognition model training is Final loss function It can be obtained by the following formula:

[0102]

[0103]

[0104] Among them, λ is a hyperparameter, is the sum of contrastive learning losses. The original loss for training the text recognition model, for example, can be the mean square error loss between the predicted text and the actual text.

[0105] In the model prediction process, only the encoded task-related feature sequence S′ t As effective semantic information used for prediction, it only requires a small computational cost in the prediction stage and has a fast inference speed.

[0106] Corresponding to the aforementioned embodiment of a sequential style consistency learning method for domain-generalizable text recognition, the present application also provides an embodiment of a sequential style consistency learning system for domain-generalizable text recognition, the sequential style consistency learning system comprising:

[0107] An initial feature extraction module is used to extract feature information of text images and obtain an initial feature sequence S;

[0108] The initial feature enhancement module is used to perform data enhancement processing on the initial feature sequence S to obtain an enhanced feature sequence

[0109] The feature sequence decoupling module is used to decouple the initial feature sequence S and the enhanced feature sequence Perform feature sequence decoupling processing to obtain the initial style-related feature sequence S with the same dimension as the initial feature sequence S s , initial task-related feature sequence S t , Enhanced style-related feature sequences And enhance the task-related feature sequence

[0110] The style-related sequence encoder is used to encode the initial style-related feature sequence S s and enhanced style-related feature sequences Encode to obtain the encoded initial style-related feature sequence S′ s , the encoded enhanced style-related feature sequence

[0111] The task-related sequence encoder is used to encode the initial task-related feature sequence S t and enhance task-related feature sequences Encode and obtain the encoded initial task-related feature sequence S′ t , the encoded enhanced task-related feature sequence

[0112] The loss calculation module is used to use the four encoded feature sequences S′ s , S′ t , Calculate the entropy loss, contrastive learning loss, and original loss of the text recognition model used for training during the training process;

[0113] The text recognition model training module is used to train the text recognition model based on the calculation results of entropy loss, contrastive learning loss and original loss;

[0114] The text recognition module is used to obtain the encoded initial task-related feature sequence S′ of the text image to be recognized based on the trained text recognition model. t , using S′ t Generate text recognition results. Specifically, use the trained initial feature extraction module to obtain the initial feature sequence S of the text image to be recognized, and use the trained feature sequence decoupling module to perform feature sequence decoupling processing on the initial feature sequence S to obtain the initial task-related feature sequence S t ; Use the trained task-related sequence encoder to encode the initial task-related feature sequence S t Encode and obtain the encoded initial task-related feature sequence S′ t ; Using S′ t Generate text recognition results.

[0115] Regarding the system in the above embodiment, the specific manner in which each unit or module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0116] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only schematic, and each module therein may or may not be physically separated. In addition, each functional module in the present invention can be integrated into a processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned integrated modules or units can be implemented in the form of hardware or in the form of software functional units, so as to select some or all of the modules according to actual needs to achieve the purpose of the present application scheme.

[0117] This paper proposes a sequential style consistency learning method and system for domain-generalizable text recognition, and proposes a domain-generalizable text recognition model SSC based on this method. During training, the SSC model can be generalized to text images of other styles by learning their style-related features and task-related features from text images of different styles. Compared with the existing state-of-the-art domain generalization models, the SSC model proposed in this paper can achieve higher recognition accuracy in text recognition tasks.

[0118] The present invention uses the MSDA dataset. The dataset includes the synthetic domain (Sy), the handwritten domain (H), the document domain (D), the street scene domain (St) and the license plate domain (C), and contains a total of 5,209,215 pictures, involving 3,754 Chinese characters and 62 alphanumeric characters. The style of each domain is different, and the ratio of the training data set to the test data set is 9:1. The experiment was carried out 5 times, and 4 domains were selected as training data sets each time, and the remaining domains were used as test data sets.

[0119] The configuration is as follows: a single NVIDIA GeForce GTX 1080Ti graphics card is used for model training and testing; the feature extractor is a ResNet network; the Adam optimizer with a decay rate of 0.95 is used; the batch-size is 192, the number of training iterations is 300,000, the temperature coefficient τ is 0.1, and the meta-learning learning rates γ and η are both 5e -4 ;

[0120] The present invention uses character error rate (CER) and word error rate (WER) to evaluate model performance. The lower the percentage of the two, the better the model performance. The models involved in the comparison are ERM, MLDG, Reptile, MetaReg, MixStyle, DTN, SFA, and the ERM model is the baseline of the present invention. The statistical results are shown in Table 1.

[0121] Table 1 Statistics of character error rate and word error rate of each model in MSDA dataset

[0122]

[0123] As can be seen from the table, the SSC model of the present invention has lower character error rate and word error percentage than other models, which means that the SSC model is superior to other domain generalization models. The MLDG, Reptile, MetaReg, and DTN models only consider the generalization of the model and are not designed for text recognition tasks. The MixStyle and SFA models are only for image classification tasks and do not take into account the characteristics of sequences in text recognition tasks. Their character error rates and word error rates are relatively high, so they cannot be directly used for text recognition tasks. The SSC model of the present invention is specifically designed for text recognition tasks and has good domain generalization.

[0124] In this embodiment, five examples in the MSDA data set are visualized, such as Figure 3 As shown, the ERM model and the SSC model of the present invention are compared, and real text is provided as a reference. From the comparison results, it can be seen that the text recognition accuracy of the SSC model of the present invention is higher than that of the ERM model, and some key information can be accurately recognized.

[0125] The above examples are only specific embodiments of the present invention. Obviously, the present invention is not limited to the above examples, and many variations are possible. All variations that can be directly derived or associated with the contents disclosed by a person skilled in the art should be considered as the protection scope of the present invention.

Claims

1. A sequential style consistency learning method for domain-generalizable text recognition, characterized in that: The steps include: S1: Extract feature information of text images of different styles to obtain the initial feature sequence S; S2: Perform data enhancement processing on the initial feature sequence S obtained in step S1 to obtain an enhanced feature sequence S3: Initial feature sequence S and enhanced feature sequence Perform feature sequence decoupling processing to obtain the initial style-related feature sequence S with the same dimension as the initial feature sequence S s , initial task-related feature sequence S t , Enhanced style-related feature sequences And enhance the task-related feature sequence S4: The initial style-related feature sequence S is encoded by the style-related sequence encoder s and enhanced style-related feature sequences Encode to obtain the encoded initial style-related feature sequence S′ s , the encoded enhanced style-related feature sequence The initial task-related feature sequence S is encoded by the task-related sequence encoder t and enhance task-related feature sequences Encode and obtain the encoded initial task-related feature sequence S′ t , the encoded enhanced task-related feature sequence S5: Using the four encoded feature sequences S′ obtained in step S4 s , S′ t , Optimize the entropy loss of the text recognition model during training; S6: Using the four encoded feature sequences S′ obtained in step S4 s , S′ t , Reduce the correlation between style-related features and task features through style consistency learning, and optimize the contrastive learning loss of the text recognition model during training; S7: Use the trained text recognition model to obtain the encoded initial task-related feature sequence S′ of the text image to be recognized t , using S′ t Generate text recognition results.

2. The method for learning sequential style consistency for domain-generalizable text recognition according to claim 1, characterized in that: The data enhancement processing method in step S2 is slice replacement, random rearrangement or random masking.

3. The method for learning sequential style consistency for domain-generalizable text recognition according to claim 1, characterized in that: The characteristic sequence decoupling process described in step S3 includes the following specific steps: S3-1: Input the initial feature sequence S into the multilayer perceptron to generate the weight vector α; Input into the multilayer perceptron to generate the weight vector S3-2: Using the weight vector α obtained in step S3-1 above, calculate the initial style-related feature sequence S s , initial task-related feature sequence S t , the calculation formula is: S s =(1-α)S S s =αS Using the weight vector obtained in step S3-1 above Calculate the enhanced style-related feature sequence Enhance task-related feature sequences The calculation formula is:

4. The method for learning sequential style consistency for domain-generalizable text recognition according to claim 1, characterized in that: The entropy loss described in step S5 includes cross entropy loss and inverse entropy loss. The specific steps of optimizing the loss are: S5-1: To S′ s , S′ t , Perform average pooling operations respectively, and then use the softmax layer to obtain the probability distribution vector p of N style categories. s , p t , S5-2: Using the probability distribution vector p obtained in step S5-1 above s , Calculate the cross entropy loss and minimize it during training. The calculation formula is: Among them, q i is the one-hot label of the i-th style category, N is the number of style categories, and p s,i Represents the probability distribution vector p s The probability of the i-th style category in Represents the probability distribution vector The probability of the i-th style category in represents the initial style-related cross entropy loss, represents the enhanced style-related cross entropy loss; S5-3: Using the probability distribution vector p obtained in step S5-1 above t , Calculate the inverse entropy loss and minimize it during training as follows: Where N is the number of style categories, p t,i Represents the probability distribution vector p t The probability of the i-th style category in Represents the probability distribution vector The probability of the i-th style category in represents the initial task-related inverse entropy loss, Represents the enhanced task-related inverse entropy loss.

5. The method for learning sequential style consistency for domain-generalizable text recognition according to claim 1, characterized in that: The optimization steps of the contrastive learning loss described in step S6 are: S6-1: Using S′ obtained in step S4 s , S′ t , Nonlinear projection via multilayer perceptron S6-2: Define the first feature set right Perform average pooling operation to obtain the initial style-related features s after pooling p ; S6-3: Using sample pairs Calculate p and The contrast loss between them is minimized during the training process and is calculated as follows: in, express The characteristics of a certain style category in; τ is the temperature parameter, sim(.) is the cosine similarity of the vector, is the original to enhanced contrastive learning loss, s i ∈S all Denotes the first feature set S all Features of the i-th style category in ; S6-4: Defining the second feature set right Perform average pooling operation to obtain the initial style-related features after pooling S6-5: Using sample pairs (s p ,s j )calculate and The contrast loss between them is minimized during the training process and is calculated as follows: in, express A sample of a certain style category in is the contrastive learning loss enhanced to the original one, s′ i ∈S′ all Denotes the second feature set S′ all Features of the i-th style category in ;.

6. The method for learning sequential style consistency for domain-generalizable text recognition according to claim 1, characterized in that: Final loss function during the text recognition model training phase It is expressed as: Among them, λ is a hyperparameter, is the sum of contrastive learning losses, represents the initial style-related cross entropy loss, represents the enhanced style-related cross entropy loss, represents the initial task-related inverse entropy loss, represents the enhanced task-related inverse entropy loss, is the original loss used for training the text recognition model.

7. A sequential style consistency learning system for domain-generalizable text recognition, characterized in that: include: An initial feature extraction module is used to extract feature information of text images and obtain an initial feature sequence S; The initial feature enhancement module is used to perform data enhancement processing on the initial feature sequence S to obtain an enhanced feature sequence The feature sequence decoupling module is used to decouple the initial feature sequence S and the enhanced feature sequence Perform feature sequence decoupling processing to obtain the initial style-related feature sequence S with the same dimension as the initial feature sequence S s , initial task-related feature sequence S t , Enhanced style-related feature sequences And enhance the task-related feature sequence The style-related sequence encoder is used to encode the initial style-related feature sequence S s and enhanced style-related feature sequences Encode to obtain the encoded initial style-related feature sequence S′ s , the encoded enhanced style-related feature sequence The task-related sequence encoder is used to encode the initial task-related feature sequence S t and enhance task-related feature sequences Encode and obtain the encoded initial task-related feature sequence S′ t , the encoded enhanced task-related feature sequence The loss calculation module is used to use the four encoded feature sequences S′ s , S′ t , Calculate the entropy loss, contrastive learning loss, and original loss of the text recognition model used for training during the training process; The text recognition model training module is used to train the text recognition model based on the calculation results of entropy loss, contrastive learning loss and original loss; The text recognition module is used to obtain the encoded initial task-related feature sequence S′ of the text image to be recognized based on the trained text recognition model. t , using S′ t Generate text recognition results.

Citation Information

Patent Citations

  • Method and system of sequential style consistency learning for domain-generalizable text recognition

    LU502693B1