Semi-supervised text recognition method based on self-distillation

By using a self-distillation semi-supervised learning framework, and optimizing the text recognition algorithm with a teacher-student model and attention map, the problems of unstable performance and data dependence of existing algorithms are solved, and more efficient text recognition model training and application are achieved.

CN117746449BActive Publication Date: 2026-05-19FUDAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUDAN UNIVERSITY
Filing Date
2022-09-09
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing semi-supervised text recognition algorithms fail to effectively utilize the rich prior information of text recognition tasks, resulting in insignificant improvements in model performance and large fluctuations in the training process. Furthermore, their reliance on a large amount of labeled data increases the barrier to model deployment.

Method used

We employ a self-distillation semi-supervised learning framework, utilizing a teacher-student model architecture and unlabeled data for semi-supervised training. We also combine attention maps as pseudo-labels and light to heavy data augmentation to optimize the semi-supervised learning process.

Benefits of technology

It improves the stability and training effect of semi-supervised learning, reduces the dependence on labeled data, lowers the threshold for model implementation, and achieves better text recognition performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117746449B_ABST
    Figure CN117746449B_ABST
Patent Text Reader

Abstract

The application provides a semi-supervised text recognition method based on self-distillation, comprising the following steps: S1-1, preprocessing a text image to be recognized to obtain a preprocessed text image; S1-2, inputting the preprocessed text image into a pre-trained text recognition model for inference to iteratively obtain a line text recognition result of each position in a text line; and S1-3, performing character splicing on the line text recognition result to obtain a final text recognition result, wherein the training process of the text recognition model comprises a supervised learning training stage and a semi-supervised learning training stage based on a semi-supervised learning framework. Therefore, the semi-supervised text recognition method based on self-distillation provided by the application realizes semi-supervised learning using unlabeled data on the basis of the semi-supervised learning framework, and realizes semi-supervised learning with better effect and higher stability through a self-distillation algorithm based on attention alignment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing, specifically relating to a semi-supervised text recognition method based on self-distillation. Background Technology

[0002] With the development of computer-related science and technology, human production activities are gradually shifting towards an intelligent era of human-machine collaborative work, and image text recognition is one of the important applications of this. The task of image text recognition is to transcribe the text in an image into a computer-understandable form, such as a sequence of computer symbols. The text in an image usually contains extremely important semantic and contextual information, serving as a crucial channel for human understanding of images. Text recognition technology has broad practical application prospects, such as road sign understanding in autonomous driving, ticket information extraction, and document recognition, all of which involve text recognition tasks.

[0003] Text recognition tasks face numerous uncertainties in natural scenes due to complex backgrounds, uneven lighting, image variations caused by shooting angles, text occlusion leading to incompleteness, and low image resolution causing blurring. This complexity places high demands on the quantity and diversity of training data for text recognition algorithms. In practice, developers typically collect and label large amounts of real-world data from business scenarios before model deployment for training. However, the high cost of data labeling significantly raises the barrier to entry for deploying scenario-based text recognition models, and manually labeled data often fails to meet the needs of complex business scenarios, resulting in poor model performance in real-world situations. Another mainstream approach to address the dependence of text recognition models on training data is to synthesize large amounts of data for training, with SynthText and MJSynth being the most representative synthetic scenario text datasets. However, existing data synthesis algorithms produce data that differs significantly from real-world application data. The complexity of synthesized data differs considerably from that of real-world data, and the large volume of synthesized data necessitates high computational power, hindering the application of models in real-world scenarios.

[0004] In recent years, many scholars and developers have begun to try to use unlabeled real-world data from business scenarios to compensate for the scarcity of labeled data. One of the mainstream methods is semi-supervised learning algorithms. Existing semi-supervised text recognition algorithms attempt to apply the semi-supervised learning framework to the field of text recognition. However, existing works have not optimized the semi-supervised learning framework for text recognition tasks and have not utilized the rich prior information in text recognition tasks. This results in insignificant performance improvements after semi-supervised training, and the semi-supervised learning process is highly volatile. Summary of the Invention

[0005] This invention is made to solve the above-mentioned problems, and aims to provide a semi-supervised text recognition method based on self-distillation.

[0006] This invention provides a semi-supervised text recognition method based on self-distillation, characterized by the following steps: Step S1-1, preprocessing the text image to be recognized to obtain a preprocessed text image; Step S1-2, inputting the preprocessed text image into a pre-trained text recognition model for inference, iteratively obtaining the line text recognition result for each position in the text line; Step S1-3, concatenating characters in the line text recognition result to obtain the final text recognition result. The training process of the text recognition model includes a supervised learning training phase and a semi-supervised learning training phase based on a semi-supervised learning framework. The semi-supervised learning framework includes at least a teacher text recognition module, a prediction result filtering module, an attention caching module, a student text recognition module, and an attention alignment module. The teacher text recognition module includes a teacher model used to predict the corresponding attention map for lightly data-enhanced samples. The first prediction result filtering module uses the prediction confidence of the teacher text recognition module to filter the prediction results of the teacher text recognition module, thereby obtaining high-confidence filtering results. The attention caching module caches the attention maps corresponding to the filtering results using an exponential moving average to form an attention cache. The student text recognition module contains a student model for training, which is used to predict heavily augmented data samples to obtain a second prediction result. The classification loss and attention alignment loss are calculated using the second prediction result. The model parameters of the student model are then updated through backpropagation, and the updated model parameters are synchronized to the teacher model. During the training process of the student model, the attention alignment module extracts the corresponding attention map from the attention cache and uses it to calculate the attention alignment loss of the student model. The initial state of the student model is the text recognition model after the supervised learning training phase.

[0007] The self-distillation-based semi-supervised text recognition method provided by the present invention may also have the following technical features, wherein the semi-supervised learning training stage includes the following steps: Step S3-1, collecting labeled text images and corresponding label information from the labeled text image dataset used for training, and collecting unlabeled text images from the unlabeled text image dataset used for training; Step S3-2, randomly selecting the intensities of a light data augmentation algorithm and a heavy data augmentation algorithm within a preset intensity range, and using the selected intensities as initialization parameters for the data augmentation algorithm, wherein the intensity of the light data augmentation algorithm is lower than that of the heavy data augmentation algorithm; Step S3-3, processing the labeled text images and unlabeled text images using the light and heavy data augmentation algorithms, and preprocessing the processed images to obtain light data augmentation samples and heavy data augmentation samples; Step S3-4, inputting the light data augmentation samples into the teacher model for prediction to obtain a first prediction result, and obtaining a selection result and a base result based on the prediction result selection module. The attention cache is obtained from the attention cache module; in step S3-5, the heavily augmented data samples are input into the student model to obtain the second prediction result. When the heavily augmented data samples correspond to the labeled text image dataset used for training, the loss function is calculated using the label information and attention map information. When the heavily augmented data samples correspond to the unlabeled text image dataset used for training, the loss function is calculated using the pseudo-labels generated by the teacher model and the attention map information. The loss functions are the classification loss function used to calculate the classification loss and the attention alignment loss function used to calculate the attention alignment loss, respectively; in step S3-6, the model parameters of the student model are differentiated using the classification loss and the attention alignment loss, and then the model parameters are updated using backpropagation. The updated model parameters are synchronized to the teacher model as the new teacher model; in step S3-7, it is determined whether the updated model parameters meet the termination condition. If the condition is not met, proceed to step S3-2; if the condition is met, proceed to the next step; in step S3-8, the updated model parameters are saved to obtain the trained text recognition model.

[0008] The semi-supervised text recognition method based on self-distillation provided by the present invention may also have the following technical feature, wherein the classification loss function is the cross-entropy loss:

[0009]

[0010] In the formula, the labeled text image dataset used for training is represented as Z={(z n ,p n ):n∈(1,...,N)}, This represents the label of the i-th image in the labeled text-image dataset used for training. Let t be the t-th character in the label, and let L1 loss be the attention alignment loss function:

[0011]

[0012] In the formula, A student The attention map generated by the text recognition model for the student branch of the heavily augmented data samples, while A cache For the attention map generated by the text recognition model using the teacher branch cached via exponential moving average, the loss function during the semi-supervised learning training phase is:

[0013]

[0014]

[0015]

[0016] In the formula, and Let λ represent the loss for the labeled data portion and the loss for the unlabeled data portion, respectively. SSL With λ attn This is the balance factor, which is a constant.

[0017] The semi-supervised text recognition method based on self-distillation provided by the present invention may also have the following technical feature, wherein the formula for the exponential moving average is:

[0018] EMA(x n )=β·EMA(x n-1 )+(1-β)·x n

[0019] In the formula, EMA(x) n Defined as x n Let β be the exponential moving average of the nth term in the sequence, and let β be the weighting weight of the exponential moving average.

[0020] The self-distillation-based semi-supervised text recognition method provided by the present invention may also have the following technical features, wherein the supervised learning training stage includes the following steps: Step S2-1, collecting labeled text images and corresponding label information for supervised training from the labeled text image dataset used for training; Step S2-2, constructing an initial text recognition model and inputting the labeled text images and corresponding label information into the initial text recognition model, the initial text recognition model consisting of an image feature extraction module, a sequence context feature modeling module, and a result transcription module; Step S2-3, using the cross-entropy loss function to calculate the classification loss based on the character sequence prediction results and label information output by the initial text recognition model; Step S2-4, using the classification loss to differentiate the model parameters of the initial text recognition model, and then using backpropagation to update the model parameters.

[0021] The self-distillation-based semi-supervised text recognition method provided by the present invention may also have the following technical features: the text recognition model includes an image feature extraction module, a sequence context feature modeling module, and a result transcription module. The image feature extraction module is composed of a convolutional neural network and is used to extract a fixed-scale feature map as the output feature map based on the text image. The sequence context feature modeling module is composed of an encoder-decoder network and is used to extract sequence context features. The result transcription module is used to process the output feature map and the sequence context features, and through iteration, obtains the confidence level of each position in the character sequence corresponding to all preset categories, and takes the class with the highest confidence level as the current prediction result.

[0022] The semi-supervised text recognition method based on self-distillation provided by the present invention may also have the following technical features, wherein the convolutional neural network includes, but is not limited to, ResNet and DenseNet.

[0023] The semi-supervised text recognition method based on self-distillation provided by the present invention may also have the following technical features, wherein the core model of the encoder-decoder includes, but is not limited to, LSTM and Transformer.

[0024] The self-distillation-based semi-supervised text recognition method provided by the present invention may also have the following technical features: the semi-supervised learning framework further includes a data acquisition module and an image preprocessing module. The data acquisition module is used to acquire labeled text images, corresponding label information, and unlabeled text images. The image preprocessing module is used to process the labeled text images and unlabeled text images using light data augmentation algorithms and heavy data augmentation algorithms, and to preprocess the processed images, including normalization and scaling.

[0025] The semi-supervised text recognition method based on self-distillation provided by the present invention may also have the following technical feature, wherein the attention alignment loss can be L1 loss or L2 loss.

[0026] The role and effect of invention

[0027] According to the self-distillation-based semi-supervised text recognition method provided by this invention, the initial text recognition model provided by the algorithm can roughly locate the text in the image through attention maps and perform classification prediction. Based on this, this invention introduces a teacher-student model-based semi-supervised learning framework, thereby enabling semi-supervised training using unlabeled data as a supplement to labeled data, thus overcoming the deficiency of text recognition models' dependence on large amounts of labeled data.

[0028] Furthermore, based on the premise that the attention map generated by the text recognition model can indicate the approximate position of characters in an image, this invention further introduces a self-distillation algorithm based on attention maps on the basis of a semi-supervised learning framework. The attention map obtained by the teacher model on lightly augmented data is used as an additional label, which, together with the teacher model's prediction results as pseudo-labels, is used to supervise the training of the student model, thereby improving the effect of the data augmentation algorithm. This optimizes the stability and training effect of the semi-supervised learning algorithm, and ultimately makes better use of unlabeled data for model training. Attached Figure Description

[0029] Figure 1 This is a flowchart illustrating the application of the self-distillation-based semi-supervised text recognition method to a text recognition task in an embodiment of the present invention.

[0030] Figure 2 This is a structural diagram of the semi-supervised learning framework in an embodiment of the present invention;

[0031] Figure 3 This is a model structure diagram of the text recognition model in this embodiment of the invention;

[0032] Figure 4 This is a flowchart of the supervised learning training phase of the semi-supervised text recognition method based on self-distillation in an embodiment of the present invention;

[0033] Figure 5 This is a flowchart of the semi-supervised learning and training phase of the semi-supervised text recognition method based on self-distillation in this embodiment of the invention. Detailed Implementation

[0034] To make the technical means, creative features, objectives and effects of this invention easy to understand, the following embodiments, in conjunction with the accompanying drawings, specifically illustrate the self-distillation-based semi-supervised text recognition method of this invention.

[0035] <Example>

[0036] Figure 1 This is a flowchart illustrating the application of the self-distillation-based semi-supervised text recognition method to a text recognition task in an embodiment of the present invention.

[0037] like Figure 3 As shown, the process of applying a self-distillation-based semi-supervised text recognition method in an embodiment of the present invention to a text recognition task includes steps S1-1 to S1-2.

[0038] Step S1-1: The text image to be recognized is preprocessed to obtain a preprocessed text image.

[0039] Step S1-2: Input the pre-processed text image into the pre-trained text recognition model for inference, and iteratively obtain the text recognition result for each position in the text line.

[0040] Step S1-3: Concatenate the characters before the terminator "$" in the prediction result to obtain the final text recognition result.

[0041] In this embodiment, the text recognition model is used to process the input natural scene image to identify the labels contained in the natural scene image. Its training process includes a supervised learning training stage and a semi-supervised learning training stage based on a semi-supervised learning framework.

[0042] Among them, the semi-supervised learning framework is used to perform semi-supervised training of text recognition models using unlabeled data.

[0043] Figure 2 This is a structural diagram of the semi-supervised learning framework in an embodiment of the present invention.

[0044] like Figure 2 As shown, the semi-supervised learning framework 1000 is a two-branch framework, which includes a data acquisition module 1001, an image preprocessing module 1002, a teacher text recognition module 1003, a prediction result filtering module 1004, an attention caching module 1005, a student text recognition module 1006, and an attention alignment module 1007.

[0045] The data acquisition module 1001 first acquires text images and corresponding labels for supervised training from the labeled text image dataset used for training, and acquires text images for semi-supervised training from the unlabeled text image dataset used for training. The two types of samples are then sent to the image preprocessing module 1002 for further processing.

[0046] The image preprocessing module 1002 processes the two types of images from the data acquisition module using pre-initialized light and heavy data augmentation algorithms to obtain two types of data augmentation samples, and scales the spatial size of the data augmentation samples to 128*400*3 for subsequent training.

[0047] The image preprocessing module 1002 uses data augmentation algorithms including contrast adjustment, exposure adjustment, rotation, and cropping. In this embodiment of the invention, the data augmentation algorithms are divided into two categories: mild and severe, based on their intensity.

[0048] The teacher text recognition module 1003 predicts lightly augmented samples, that is, it recognizes the text content in the image and obtains the corresponding attention map.

[0049] The prediction result filtering module 1004 filters the prediction results of the teacher text recognition module 1003 based on the prediction confidence of the teacher text recognition module 1003, thereby filtering out the results with low prediction confidence and obtaining prediction results with high confidence for use in training the student model.

[0050] The prediction result filtering module 1004 first collects the prediction results and confidence scores from the teacher text recognition module 1003. For a single line of text, the prediction result filtering module 1004 selects the lowest confidence score of the prediction result for each text image as the filtering criterion, filters it through a preset threshold, and retains prediction results with a lowest confidence score not lower than the threshold.

[0051] Based on the filtering results of the prediction result filtering module 1004, the attention caching module 1005 caches the attention maps corresponding to the high-confidence results that have passed the filtering by using an exponential moving average, for subsequent semi-supervised learning.

[0052] The student text recognition module 1006 contains a text recognition model for training. Its initial state is a supervised training text recognition model. After each backpropagation calculation, the updated parameters are copied to the teacher text recognition model 1003 to achieve real-time updates of the teacher model.

[0053] The attention alignment module 1007 extracts the corresponding attention map from the attention cache during the training process of the student model and uses it to calculate the attention loss of the student model.

[0054] Figure 3 This is a model structure diagram of the text recognition model in this embodiment of the invention.

[0055] like Figure 3As shown, the text recognition model 1008 includes an image feature extraction module 1009, a sequence context feature modeling module 1010, and a result transcription module 1011.

[0056] The image feature extraction module 1009 is composed of convolutional neural networks, including but not limited to ResNet, DenseNet, etc., and is used to extract fixed-scale feature maps as output feature maps based on the training text image dataset.

[0057] The Sequence Context Feature Modeling Module 1010 consists of a language model with an encoder-decoder structure. It can extract sequence context information and fuse image information with text semantic information, making the model more robust to predicting characters in the text. The core models of the encoder-decoder include, but are not limited to, LSTM and Transformer.

[0058] The transcription module 1011 is used to process the output feature map and sequence context features. Through iteration, it obtains the confidence level of each position in the character sequence corresponding to all preset categories, and identifies the category with the highest confidence level as the current prediction result.

[0059] Figure 4 This is a flowchart of the supervised learning training phase in an embodiment of the present invention.

[0060] like Figure 4 As shown, the supervised training of the text recognition model includes steps S2-1 to S2-4.

[0061] Step S2-1: Collect text image data and corresponding label information for supervised training from the labeled text image dataset used for training.

[0062] Step S2-2: Construct an initial text recognition model and input the labeled text image data and corresponding label information used for training into the initial text recognition model. The initial text recognition model consists of an image feature extraction module, a sequence context feature modeling module, and a result transcription module.

[0063] Before inputting text image data and corresponding label information into the text recognition model, the text image data and annotation information need to be preprocessed. In this embodiment, the preprocessing specifically includes label processing, data adjustment, and data augmentation.

[0064] The tagging operation used in this embodiment is as follows: tag the text content in the text image in the form of text lines, and add a terminator "$" at the end.

[0065] The data adjustment operations used in this embodiment are as follows: transforming the image using algorithms such as contrast adjustment, exposure adjustment, rotation, and cropping; subtracting the mean from the three RGB channels in the image and normalizing the image pixel values ​​to between -1 and 1; scaling the image to 128*400*3.

[0066] The data augmentation algorithms used in this embodiment include, but are not limited to, contrast adjustment, exposure adjustment, rotation, and cropping algorithms.

[0067] Step S2-3: Use the cross-entropy loss function to calculate the classification loss based on the prediction results of the output character sequence and the label information.

[0068] The optimizer used in this training is Adam, and the classification loss function is cross-entropy loss, in the following form:

[0069]

[0070] In this embodiment, the labeled training set is represented as Z = {(zn, pn): n ∈ (1, ..., N)}. This represents the label of the i-th image in the dataset, i.e., the content of the characters in that image. This represents the t-th character in the tag.

[0071] Step S2-4: Use the classification loss to differentiate the model parameters of the initial text recognition model, and then use backpropagation to update the model parameters.

[0072] Figure 5 This is a flowchart of the semi-supervised learning training phase in an embodiment of the present invention.

[0073] like Figure 5 As shown, the semi-supervised training of the model includes steps S3-1 to S3-8.

[0074] Step S3-1: Collect labeled text images and their corresponding label information from the labeled text image dataset used for training, and collect unlabeled text images from the unlabeled text image dataset used for training.

[0075] Step S3-2: Within a preset intensity range, randomly select the intensity of light and heavy data augmentation algorithms, and use the selected intensity as the initialization parameter of the data augmentation algorithm to initialize the data augmentation algorithm. The light data augmentation algorithm has a lower intensity, while the heavy data augmentation algorithm has a higher intensity.

[0076] The data augmentation algorithms used in this embodiment include, but are not limited to, contrast adjustment, exposure adjustment, rotation, and cropping algorithms.

[0077] Step S3-3: Use light and heavy data augmentation algorithms to process the labeled text image dataset and the unlabeled text image dataset used for training to obtain images after light and heavy data augmentation. Subtract the mean from the three RGB channels of the data-augmented image to normalize the image pixel values ​​to between -1 and 1, and scale the image to 128*400*3 for subsequent training.

[0078] Steps S3-4: The text recognition model obtained through supervised learning training or the previous round of semi-supervised training is used as the teacher model. The image with light data augmentation is input into the teacher model for prediction. The lowest value of the prediction confidence of each character in the text sequence is used for threshold filtering. If the lowest value is higher than the threshold, the prediction result of the text recognition model and the attention map generated by the text recognition model are recorded and cached using the exponential moving average for subsequent training. If the lowest value is lower than the threshold, the corresponding prediction result is discarded.

[0079] The formula for the exponential moving average used to implement the attention cache is:

[0080] EMA(x n )=β·EMA(x n-1 )+(1-β)·x n

[0081] In the formula, EMA(x) n Defined as x n Let β be the exponential moving average of the nth term in the sequence, and let β be the weighting weight of the exponential moving average.

[0082] Steps S3-5 involve inputting heavily augmented data samples into the student text recognition model to obtain prediction results. For the labeled text image dataset used for training, loss is calculated using label information and attention map information. For the unlabeled text image dataset used for training, loss functions are calculated using pseudo-labels generated by the teacher model and attention map information. Here, the loss functions are the cross-entropy loss used to calculate the classification loss and the L1 loss used to calculate the attention alignment loss, respectively.

[0083] The formula for the L1 loss used to achieve attention alignment is:

[0084]

[0085] In the formula, A student The attention map generated by the text recognition model for the student branch, which is augmented with heavily processed input data, and A cache The attention map is generated by the text recognition model for the teacher branch cached by EMA (Exponential Moving Average).

[0086] The loss function for the final semi-supervised learning stage is:

[0087]

[0088]

[0089]

[0090] In the formula, and Let λ represent the loss for the labeled data portion and the loss for the unlabeled data portion, respectively. SSL With λ attn This is the balance factor, which is a constant.

[0091] In practical applications, the loss for attention alignment can also be L2 loss in addition to L1 loss or other similar loss functions.

[0092] Steps S3-6: Differentiate the model parameters of the text recognition model using classification loss and attention alignment loss, then use backpropagation to update the parameters of the student text recognition model, and use the updated student text model as the new teacher text recognition model.

[0093] Step S3-7: Determine whether the updated model parameters meet the termination condition. If yes, proceed to step S3-8; otherwise, proceed to step S3-2.

[0094] In this embodiment, the training termination condition is that the text recognition model performs 20 rounds of semi-supervised training using all training datasets during the training process.

[0095] Step S3-8: Save the updated model parameters to obtain the final text recognition model.

[0096] The role and effect of the embodiments

[0097] According to the self-distillation-based semi-supervised text recognition method provided in this embodiment, since the method introduces a semi-supervised learning framework on the basis of the text recognition algorithm, it can learn the information of data distribution from unlabeled data on the basis of labeled data, reduce the dependence of the text recognition model on labeled text image data, and lower the threshold for the practical application of the text recognition model.

[0098] Furthermore, this method introduces a knowledge distillation algorithm based on attention alignment into a semi-supervised learning framework. Compared with existing semi-supervised learning frameworks, this method further mines prior knowledge in the field of text recognition, uses attention maps as the basis for achieving consistency regularization, and introduces additional supervision information of attention maps on the basis of pseudo-labels, thereby achieving more stable semi-supervised training and obtaining better semi-supervised learning results.

[0099] Furthermore, because this method uses an exponential moving average to cache the attention map, compared to directly caching the latest attention map or caching the average value of the attention map, this method preserves existing attention information while ensuring the weights of new attention information generated during model iterations. This achieves a more stable and flexible attention caching, improving the robustness of semi-supervised training. Compared to directly caching model parameters, caching the attention map does not introduce excessive interference into the model training process, ensuring the efficiency of model training.

[0100] In this embodiment, the introduction of a semi-supervised learning framework allows developers to further utilize unlabeled data on top of labeled data, avoiding poor model performance caused by insufficient labeled data.

[0101] In this embodiment, the introduction of the self-distillation algorithm constrains the training process of the model through attention maps, which can yield better results.

[0102] The above embodiments are preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention.

Claims

1. A semi-supervised text recognition method based on self-distillation, characterized in that, include: Step S1-1: The text image to be recognized is preprocessed to obtain a preprocessed text image; Step S1-2: Input the pre-processed text image into the pre-trained text recognition model for inference, and iteratively obtain the text recognition result of each position in the text line; Steps S1-3 involve concatenating characters in the line text recognition results to obtain the final text recognition result. The training process of the text recognition model includes a supervised learning training phase and a semi-supervised learning training phase based on a semi-supervised learning framework. The semi-supervised learning framework includes at least a teacher text recognition module, a prediction result filtering module, an attention caching module, a student text recognition module, and an attention alignment module. The teacher text recognition module includes a teacher model, which is used to predict lightly data-augmented samples to obtain the corresponding attention map as the first prediction result. The prediction result filtering module uses the prediction confidence of the teacher text recognition module to filter the prediction results of the teacher text recognition module, thereby obtaining high-confidence filtering results. The attention caching module caches the attention map corresponding to the filtering results using an exponential moving average to form an attention cache. The student text recognition module includes a student model for training, used to predict heavily augmented samples to obtain a second prediction result, and to calculate classification loss and attention alignment loss using this second prediction result. Furthermore, the model parameters of the student model are updated through backpropagation, and the updated model parameters are synchronized to the teacher model. The attention alignment module extracts the corresponding attention map from the attention cache during the training process of the student model and uses it to calculate the attention alignment loss of the student model. The initial state of the student model is the text recognition model after the supervised learning training phase has been performed.

2. The semi-supervised text recognition method based on self-distillation according to claim 1, Its features are: The semi-supervised learning training phase includes the following steps: Step S3-1: Collect labeled text images and their corresponding label information from the labeled text image dataset used for training, and collect unlabeled text images from the unlabeled text image dataset used for training. Step S3-2: Within a preset intensity range, randomly select the intensity of a light data augmentation algorithm and a heavy data augmentation algorithm, and use the selected intensity as the initialization parameter of the data augmentation algorithm to initialize the data augmentation algorithm. The intensity of the light data augmentation algorithm is lower than that of the heavy data augmentation algorithm. Step S3-3: Use light and heavy data augmentation algorithms to process the labeled text image and the unlabeled text image, and preprocess the processed images to obtain light data augmentation samples and heavy data augmentation samples. Steps S3-4: Input the lightly data-enhanced sample into the teacher model to make a prediction and obtain the first prediction result; obtain the filtering result based on the prediction result filtering module and obtain the attention cache based on the attention cache module. Step S3-5: Input the heavily augmented data sample into the student model to obtain the second prediction result. When the heavily augmented data sample corresponds to the labeled text image dataset used for training, the loss function is calculated using the label information and attention map information. When the heavily augmented data sample corresponds to the unlabeled text image dataset used for training, the loss function is calculated using the pseudo-labels and attention map information generated by the teacher model. The loss functions are a classification loss function used to calculate the classification loss and an attention alignment loss function used to calculate the attention alignment loss. Steps S3-6: Differentiate the model parameters of the student model using the classification loss and the attention alignment loss, then update the model parameters using backpropagation, and synchronize the updated model parameters to the teacher model as the new teacher model. Step S3-7: Determine whether the updated model parameters meet the termination condition. If the determination is no, proceed to step S3-2; if the determination is yes, proceed to the next step. Steps S3-8: Save the updated model parameters to obtain the trained text recognition model.

3. The semi-supervised text recognition method based on self-distillation according to claim 2, characterized in that: in, The classification loss function is the cross-entropy loss: In the formula, the training uses a labeled text image dataset, represented as Z = {(z...} n ,p n ):n∈(1,...,N)}, This represents the label of the i-th image in the labeled text image dataset used for training. This represents the t-th character in the label. The attention alignment loss function is L1 loss: In the formula, A student The attention map generated by the text recognition model for the student branch of the heavily augmented data sample, while A cache The attention map generated by the text recognition model for the teacher branch cached by the exponential moving average. The loss function for the semi-supervised learning training phase is: In the formula, and Let λ represent the loss for the labeled data portion and the loss for the unlabeled data portion, respectively. SSL With λ attn This is the balance factor, which is a constant.

4. The semi-supervised text recognition method based on self-distillation according to any one of claims 1 to 3, characterized in that: in, The formula for the exponential moving average is: EMA(x n )=β·EMA(x n-1 )+(1-β)·x n In the formula, EMA(x) n Defined as x n β is the exponential moving average of the sequence of the nth term, and β is the weighting weight of the exponential moving average.

5. The semi-supervised text recognition method based on self-distillation according to claim 1, Its features are: The supervised learning training phase includes the following steps: Step S2-1: Collect labeled text images and corresponding label information for supervised training from the labeled text image dataset used for training. Step S2-2: Construct an initial text recognition model, and input the labeled text image and the corresponding label information into the initial text recognition model. The initial text recognition model consists of an image feature extraction module, a sequence context feature modeling module, and a result transcription module. Step S2-3: Use the cross-entropy loss function to calculate the classification loss based on the character sequence prediction results output by the initial text recognition model and the label information; Step S2-4: Use the classification loss to differentiate the model parameters of the initial text recognition model, and then use backpropagation to update the model parameters.

6. The semi-supervised text recognition method based on self-distillation according to claim 1, characterized in that: The text recognition model includes an image feature extraction module, a sequence context feature modeling module, and a result transcription module. The image feature extraction module, composed of a convolutional neural network, is used to extract a fixed-scale feature map from the text image as the output feature map. The sequence context feature modeling module consists of an encoder-decoder network and is used to extract sequence context features. The result transcription module is used to process the output feature map and the sequence context features. Through iteration, it obtains the confidence level of each position in the character sequence corresponding to all preset categories, and identifies the class with the highest confidence level as the current prediction result.

7. The semi-supervised text recognition method based on self-distillation according to claim 6, characterized in that: in, The convolutional neural networks include, but are not limited to, ResNet and DenseNet.

8. The semi-supervised text recognition method based on self-distillation according to claim 6, characterized in that: in, The core models of the encoder-decoder include, but are not limited to, LSTM and Transformer.

9. The semi-supervised text recognition method based on self-distillation according to claim 1, characterized in that: The semi-supervised learning framework also includes a data acquisition module and an image preprocessing module. The data acquisition module is used to acquire labeled text images, the corresponding label information, and unlabeled text images. The image preprocessing module is used to process the labeled text image and the unlabeled text image using light data augmentation algorithms and heavy data augmentation algorithms, and to preprocess the resulting images. The preprocessing includes normalization and scaling.

10. The semi-supervised text recognition method based on self-distillation according to claim 1, characterized in that: in, The attention alignment loss can be either L1 loss or L2 loss.