A continuous learning method and apparatus for a handwritten digit recognition model
By cascading the main recognition model, auxiliary recognition model, and teacher model, and using labeled datasets to select erroneous samples and generate pseudo-labels, combined with distillation training to generate student models, the catastrophic forgetting problem of handwritten digit recognition models is solved, enabling continuous learning and effective utilization of large-scale unlabeled data.
Patent Information
- Application Number
- CN202511135067.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-08-14
AI Technical Summary
Existing handwritten digit recognition models suffer from catastrophic forgetting problems, and the quality of training data and labeling issues affect model performance, making it difficult to continuously learn from and utilize large-scale unlabeled data.
By constructing a cascade of main recognition model, auxiliary recognition model and teacher model, using labeled dataset to select erroneous samples and generate pseudo-labels, and combining distillation training to generate student model, continuous learning is achieved.
It reduces the size of training data, enhances the utilization value of unlabeled data, overcomes catastrophic forgetting, and endows the model with continuous self-learning capabilities.
Smart Images

Figure CN120726646B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a continuous learning method and apparatus for a handwritten digit recognition model. Background Technology
[0002] Building a handwritten digit recognition model requires collecting a large number of representative image samples to form a training set. A classification model is then generated from this training set and applied to actual handwritten digit image recognition. The quality of the training set data typically significantly impacts the performance of the classification model. Furthermore, due to limitations in time, equipment, and context, data acquisition is rarely possible in a single batch; acquiring data in limited quantities is the norm. To train a high-performance model, the training set is often a mixture of all existing batches of data, resulting in an extremely large training set and exponentially increasing overhead, which is unsustainable in the long run. In addition, data is often divided into labeled and unlabeled categories. However, unlabeled data lacks reliable annotation information, leading to problems such as unreliability and underutilization during training.
[0003] In addition, existing deep learning models suffer from the major flaw of "catastrophic forgetting," which refers to the phenomenon where a model almost completely forgets the previously learned content after learning new knowledge. This causes huge differences in the performance of models trained with different batches of data, and is an important problem that urgently needs to be solved in artificial intelligence research. Summary of the Invention
[0004] (a) Technical problems to be solved
[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a continuous learning method and apparatus for a handwritten digit recognition model, which solves the technical problem of catastrophic forgetting in the prior art.
[0006] (II) Technical Solution
[0007] To achieve the above objectives, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, embodiments of the present invention provide a continuous learning method for a handwritten digit recognition model, comprising: acquiring a handwritten digit dataset; wherein the handwritten digit dataset includes a labeled dataset and an unlabeled dataset, the labeled dataset including handwritten digit image samples and their corresponding digit labels, and newly added indistinguishable image samples and their corresponding digit labels; training an 11-class master recognition model for recognizing handwritten digits based on the labeled dataset, and inputting each image sample in the labeled dataset into the master recognition model for testing, so as to select image samples that are incorrectly recognized by the master recognition model from the labeled dataset, and placing the incorrectly recognized image samples and their corresponding labels into an error sample training set; wherein the output categories of the master recognition model include newly added categories that cannot be recognized; and a model training cascade step: An auxiliary recognition model for recognizing handwritten digits is trained using the error sample training set. The main recognition model and an auxiliary recognition model that complements its performance are concatenated to obtain the teacher model. The teacher model is then used to recognize samples in the unlabeled dataset, obtaining the recognition results for all samples in the unlabeled dataset. The unlabeled dataset and all its corresponding recognition results are used as the pseudo-label set, and the error sample training set is used as the real label set. Based on the pseudo-label set and the real label set, the teacher model guides the student model for training, resulting in the distilled student model. When the recognition performance of the distilled student model reaches that of the teacher model, the main recognition model is replaced with the distilled student model, and the process returns to the model training concatenation step, awaiting a new round of unlabeled datasets for continuous learning.
[0009] In one possible embodiment, the auxiliary recognition model is an 11-class model, and the output category of the auxiliary recognition model adds an untrusted category; the auxiliary recognition model includes 10 SVM binary classifiers arranged in parallel and an output module connected to all SVM binary classifiers; each of the 10 SVM binary classifiers is used to recognize one of the handwritten digits 0 to 9, and the outputs of the 10 SVM binary classifiers are all binary codes; the output module is used to construct an output code based on the binary codes output by the 10 SVM binary classifiers, and if the output code has only one non-zero code point, the recognition result is determined to be the digit recognition result corresponding to the non-zero code point; otherwise, an untrusted recognition result is output.
[0010] In one possible embodiment, the testing process of the teacher model includes: if the test sample is output as a category from 0 to 9 by the main recognition model, it is determined that the main recognition model has successfully identified the sample and the auxiliary recognition model has no effect; if the test sample is output as an unrecognizable category by the main recognition model, it is determined that the main recognition model has failed to identify the sample; and the test sample is identified by the auxiliary recognition model, and the final recognition result is output.
[0011] In one possible embodiment, replacing the main recognition model with the distilled student model when the recognition performance of the distilled student model reaches the recognition performance of the teacher model includes: replacing the main recognition model with the distilled student model when the recognition performance of the distilled student model reaches the recognition performance of the teacher model by adjusting the parameters during distillation.
[0012] Secondly, embodiments of the present invention provide a continuous learning device for a handwritten digit recognition model, comprising: an acquisition module for acquiring a handwritten digit dataset; wherein the handwritten digit dataset includes a labeled dataset and an unlabeled dataset, the labeled dataset including handwritten digit image samples and their corresponding digit labels, and newly added indistinguishable image samples and their corresponding digit labels; a training selection module for training and generating an 11-class master recognition model for recognizing handwritten digits based on the labeled dataset, and inputting each image sample in the labeled dataset into the master recognition model for testing, so as to select image samples that are incorrectly recognized by the master recognition model from the labeled dataset, and putting the incorrectly recognized image samples and their corresponding labels into an error sample training set; wherein the output categories of the master recognition model include newly added unrecognizable categories; and a model training cascade module for executing model training cascade steps. The model training cascade steps involve training an auxiliary recognition model for recognizing handwritten digits based on the error sample training set, and cascading the main recognition model and the auxiliary recognition model that complements its performance to obtain the teacher model; the recognition training module is used to use the teacher model to recognize samples in the unlabeled dataset, obtain the recognition results of all samples in the unlabeled dataset, and use the unlabeled dataset and all corresponding recognition results as the pseudo-label set, as well as the error sample training set as the real label set; and based on the pseudo-label set and the real label set, the teacher model guides the student model to train, resulting in the distilled student model; the replacement module is used to replace the main recognition model with the distilled student model when the recognition performance of the distilled student model reaches the recognition performance of the teacher model, and then return to the model training cascade steps to wait for a new round of unlabeled datasets for continuous learning.
[0013] In one possible embodiment, the auxiliary recognition model is an 11-class model, and the output category of the auxiliary recognition model adds an untrusted category; the auxiliary recognition model includes 10 SVM binary classifiers arranged in parallel and an output module connected to all SVM binary classifiers; each of the 10 SVM binary classifiers is used to recognize one of the handwritten digits 0 to 9, and the outputs of the 10 SVM binary classifiers are all binary codes; the output module is used to construct an output code based on the binary codes output by the 10 SVM binary classifiers, and if the output code has only one non-zero code point, the recognition result is determined to be the digit recognition result corresponding to the non-zero code point; otherwise, an untrusted recognition result is output.
[0014] In one possible embodiment, the model training cascade module is specifically used for: if the test sample is output as a category from 0 to 9 by the main recognition model, then the main recognition model is determined to have successfully identified the sample and the auxiliary recognition model is not used; if the test sample is output as an unrecognizable category by the main recognition model, then the main recognition model is determined to have failed to identify the sample; and the test sample is identified by the auxiliary recognition model and the final recognition result is output.
[0015] In one possible embodiment, the replacement module is specifically used to replace the main recognition model with the distilled student model when the recognition performance of the distilled student model is achieved by adjusting the parameters during distillation to make the recognition performance of the distilled student model reach that of the teacher model.
[0016] Thirdly, embodiments of this application also provide an electronic device, the electronic device comprising: a memory for storing a computer program; and a processor for executing the computer program stored in the memory, wherein when the computer program is executed, the processor is used to execute a continuous learning method for a handwritten digit recognition model as described above.
[0017] Fourthly, embodiments of this application also provide a computer-readable storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform a continuous learning method for a handwritten digit recognition model as described above.
[0018] (III) Beneficial Effects
[0019] The beneficial effects of this invention are:
[0020] This application provides a continuous learning method and apparatus for a handwritten digit recognition model. It involves training an 11-category master recognition model for handwritten digit recognition based on a labeled dataset, and testing the master recognition model by inputting each image sample from the labeled dataset one by one to select image samples incorrectly recognized by the master recognition model. These incorrectly recognized image samples and their corresponding labels are then added to an error sample training set. An auxiliary recognition model for handwritten digit recognition is trained based on the error sample training set. The master recognition model and the auxiliary recognition model, which complements its performance, are cascaded to obtain a teacher model. Finally, the teacher model is used to recognize samples in an unlabeled dataset to obtain all the handwritten digits in the unlabeled dataset. The system identifies the sample results and uses the unlabeled dataset and all its corresponding identification results as a pseudo-label set, as well as the erroneous sample training set as the real label set. Based on the pseudo-label set and the real label set, the teacher model guides the student model for training, resulting in a distilled student model. When the recognition performance of the distilled student model reaches that of the teacher model, the main recognition model is replaced with the distilled student model, and the system returns to the model training cascade step, waiting for a new round of unlabeled datasets for continuous learning. This greatly reduces the scale of the training data for the entire system, enhances the significant utilization value of large-scale unlabeled data, and not only endows the intelligent model with continuous self-learning capabilities but also achieves the goal of overcoming the "catastrophic forgetting" phenomenon.
[0021] To make the above-mentioned objectives, features and advantages to be achieved by the embodiments of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating a continuous learning method for a handwritten digit recognition model provided in an embodiment of this application is shown.
[0024] Figure 2 A detailed flowchart of a continuous learning method for a handwritten digit recognition model provided in an embodiment of this application is shown.
[0025] Figure 3 This illustration shows a structural diagram of an auxiliary recognition model provided in an embodiment of this application;
[0026] Figure 4 This paper shows a structural block diagram of a continuous learning device for a handwritten digit recognition model provided in an embodiment of this application. Detailed Implementation
[0027] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0028] Currently, existing handwritten digit recognition methods employ various research paths to build continuous learning systems, including data splitting, feature space separation, data balancing, and randomly resetting less-used neurons to maintain network variability. However, most of these studies focus on internal model structure design and weight adjustment, rarely considering practical engineering needs such as multi-batch data collection and the integrated utilization of labeled and unlabeled data.
[0029] Based on this, the embodiments of this application provide a continuous learning method and apparatus for handwritten digit recognition models. By making full use of multiple batches of labeled and unlabeled datasets, three recognition models are gradually constructed, and each recognition model solves a specific stage problem. The combination of the three realizes data self-selection, model self-construction and system self-evolution in the modeling process.
[0030] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and that the scope of the present invention can be fully conveyed to those skilled in the art.
[0031] Please see Figure 1 , Figure 1 A flowchart illustrating a continuous learning method for a handwritten digit recognition model provided in an embodiment of this application is shown. It should be understood that this continuous learning method can be executed by a continuous learning device for the handwritten digit recognition model, and the specific device can be configured according to actual needs; this embodiment is not limited thereto. For example, the continuous learning device can be a computer or a server, etc. Specifically, the continuous learning method includes:
[0032] Step S110: Obtain the handwritten digit dataset. The handwritten digit dataset includes a labeled dataset and an unlabeled dataset. The labeled dataset includes handwritten digit image samples and their corresponding digit labels, as well as newly added unidentifiable image samples and their corresponding digit labels.
[0033] Specifically, handwritten digit datasets can be obtained in batches, and each batch of handwritten digit datasets includes labeled datasets and unlabeled datasets. Furthermore, unidentifiable image samples and their corresponding digit labels can be added to the labeled datasets.
[0034] Furthermore, multiple handwritten digit images from a labeled dataset can be randomly copied, and some digit pixels in the handwritten digit images can be replaced with background pixels to construct unrecognizable images of "non-0-9 digits," which are then assigned corresponding digit labels. These images are then added to the labeled dataset, expanding the number of sample categories in the labeled dataset from 10 to 11. For example, most of the digit pixels of the handwritten digit "8" can be replaced with background pixels, making it unrecognizable to the human eye, and its digit label can be "10," representing an unrecognizable category.
[0035] Step S120: Train an 11-class master recognition model for recognizing handwritten digits based on the labeled dataset, and input each image sample in the labeled dataset into the master recognition model for testing, so as to select the image samples that are incorrectly recognized by the master recognition model from the labeled dataset, and put the incorrectly recognized image samples and their corresponding labels into the error sample training set.
[0036] It should be understood that the specific model structure of the main recognition model can be set according to actual needs, and the embodiments of this application are not limited thereto. For example, the main recognition model can be an existing handwritten digit recognition model.
[0037] To facilitate understanding of step S120, it will be described below through specific embodiments.
[0038] Specifically, such as Figure 2 As shown, when multiple labeled datasets (e.g., A1, A2, etc.) are obtained in batches, the first batch of labeled dataset A1 can be used to train and generate an 11-class master recognition model Model_1 for recognizing handwritten digits. A model testing error flag can be set for the master recognition model Model_1. In addition to the ten categories of 0 to 9 in the output, the output classification of the master recognition model Model_1 adds an unrecognizable category, which indicates that the master recognition model Model_1 cannot recognize the input sample image.
[0039] If, after testing on labeled dataset A1, the error flag is equal to 0, it is determined that all images in this batch of labeled dataset A1 have been correctly recognized by the main recognition model Model_1. Then, Model_1 can be used to test the next batch of labeled dataset A2 until an image sample is found whose recognition result does not match its corresponding true label (i.e., the label or tag in the labeled image dataset). This means the image sample is incorrectly recognized by Model_1 and may include indistinguishable image samples and incorrectly recognized handwritten digit image samples. However, in practical applications, Model_1 cannot completely and correctly recognize all samples in labeled dataset A1.
[0040] If the error flag is equal to 1, then the image samples that were incorrectly identified by the main recognition model and their corresponding labels can be selected from the labeled dataset and added to the error sample training set.
[0041] For example, sample images from the labeled dataset A1 can be input one by one into the main recognition model Model_1 for testing. If Model_1's recognition result for a sample matches the sample's label, it is considered that Model_1 has learned the sample; if Model_1's recognition result for a sample does not match the sample's label, it is considered that the sample has not been learned by Model_1, and it can be removed from the labeled dataset A1 and placed into the error sample training set, with flag=1.
[0042] Therefore, the main recognition model Model_1 is initially generated through iterative training. The purpose is to gradually exclude incorrectly identified samples from the original category of the training set through model fine-tuning and collect them into the error sample training set for subsequent processing, thereby ensuring that the iteratively trained main recognition model Model_1 has a high prediction reliability.
[0043] Furthermore, the practical effect of the above approach is to utilize the main recognition model, Model_1, to select samples from the current training set, gradually removing a few interfering samples. This makes the training set of the main recognition model, Model_1, cleaner, ensuring better remodeling results. For example, when the model outputs a predicted category of "0~9", the result is basically error-free.
[0044] Step S130: Train an auxiliary recognition model for recognizing handwritten digits based on the error sample training set, and cascade the main recognition model and the auxiliary recognition model that can complement its performance to obtain the teacher model.
[0045] Specifically, the auxiliary recognition model is an 11-class model, and the output category of the auxiliary recognition model adds an untrusted category; such as Figure 3 As shown, the 11-class auxiliary recognition model includes 10 SVM binary classifiers arranged in parallel and an output module connected to all SVM binary classifiers.
[0046] In this system, each of the 10 SVM binary classifiers is used to identify one of the handwritten digits 0 to 9, and the output of each of the 10 SVM binary classifiers is a binary code (i.e., 0 or 1). For example, the 10 SVM binary classifiers from top to bottom are used to identify the handwritten digits 0 to 9, and if their output binary code is 1, it means that they have identified the current input sample; otherwise, they have not identified it.
[0047] This output module is used to construct an output code based on the binary codes output by 10 SVM binary classifiers (and this output code is constructed according to the binary codes output by the 10 SVM binary classifiers from top to bottom). If the output code has only one non-zero code point, the recognition result is determined to be the digit corresponding to the non-zero code point; otherwise, an unreliable recognition result is output. For example, if the output code is "1000000000", the recognition result is determined to be the handwritten digit 0; if the output code is "0100000000", the recognition result is determined to be the handwritten digit 1, and so on. The output codes for other handwritten digits 2 to 9 are similar. Furthermore, if the output code is "0000000000" or "0000000101", the output result is determined to be unreliable.
[0048] In other words, the auxiliary recognition model's role is to specifically memorize samples that the main recognition model mispredicted, along with their true labels. Furthermore, the auxiliary recognition model serves as a remedial measure after the main recognition model fails to predict correctly; when a sample is misidentified by the main recognition model, the auxiliary recognition model provides an opportunity for re-prediction. By memorizing these special samples and their true labels, the auxiliary recognition model assists in decision-making after the main recognition model's failure. Because the size of the erroneous sample training set is much smaller than the original data size in the same batch, the derived labeled erroneous sample set is usually relatively concise.
[0049] In addition, the advantage of using SVM modeling is that it can be modeled as long as the number of samples in any class reaches more than 1, and it is not sensitive to the problem of imbalance in the number of class samples.
[0050] Furthermore, such as Figure 2As shown, the main recognition model Model_1 and the auxiliary recognition model Model_2 are cascaded to form a teacher model with complementary performance. The specific testing process of this teacher model is as follows: if the test sample is output as a category from 0 to 9 by the main recognition model, it is determined that the main recognition model has successfully identified the sample and the auxiliary recognition model has no effect; if the test sample is output as an unrecognizable category by the main recognition model, it is determined that the main recognition model has failed to identify the sample, and the auxiliary recognition model is used to identify the test sample and output the final recognition result.
[0051] Step S140: Use the teacher model to identify samples in the unlabeled dataset to obtain the identification results of all samples in the unlabeled dataset. Use the unlabeled dataset and all its corresponding identification results as a pseudo-label set, and use the error sample training set as the real label set. Based on the pseudo-label set and the real label set, use the teacher model to guide the student model to train and obtain the distilled student model.
[0052] It should be understood that the specific model of the student model can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0053] For example, the student model can be the main recognition model or other handwritten digit recognition models; the embodiments of this application are not limited to this.
[0054] Furthermore, the distillation of this student model can be trained using the following distillation loss function:
[0055] The teacher model generates a pseudo-label distribution on the new dataset, and the student model minimizes the distribution with respect to that distribution. KL Divergence is used to mimic teacher knowledge; distillation is performed using the main recognition model and the auxiliary recognition model, and the distillation loss function is defined as:
[0056] ;
[0057] In the formula, This represents the value of the distillation loss function; KL (||) divergence is used to measure the difference between two probability distributions; This represents the probability distribution of the predicted output labels from the main recognition model. This represents the probability distribution of the predicted output labels from the auxiliary recognition model. This represents the probability distribution of predicted labels in the student model; T This represents the distillation temperature used to smooth the probability distribution and retain more information about inter-class relationships.
[0058] Furthermore, to ensure the model's ability to distinguish between real samples, the labeled error sample set provides the true class labels, using standard cross-entropy loss. Cross-Entropy LossSupervised learning will be conducted, specifically:
[0059] ;
[0060] In the formula, L CE This represents the standard cross-entropy loss; C Indicates the number of categories; y i Indicates the first i The true label of the class; The predicted probability for the student model;
[0061] Furthermore, to further improve the alignment ability of the student model with the intermediate layer structural features of the teacher model, the following two regularization terms are introduced:
[0062] Feature distillation loss is used to represent maximizing the consistency between the teacher and student models in the feature space, and is measured by cosine similarity.
[0063] ;
[0064] In the formula, L feat Indicates the characteristic distillation loss value; F This represents the feature output of the model in the intermediate layer; This represents the feature vector output by the student model; This represents the feature vector output by the teacher model;
[0065] Loss of attention transfer Attention Transfer Loss This is used to represent the spatial attention patterns of the student model that facilitate the learning of the teacher model by normalizing the mean squared error between attention maps.
[0066] ;
[0067] In the formula, L AT This indicates a loss of attention transfer; A Represents the attention mapping function;
[0068] Furthermore, the student model is trained using the following total loss function, which integrates three information sources: soft-label guided distillation, real-label supervised learning, and intermediate layer feature alignment:
[0069] ;
[0070] In the formula, Indicates the total loss; This represents the weights between supervised learning and distillation learning, and its... ; The regularity coefficient representing characteristic distillation; The regularization coefficient represents the attention transfer.
[0071] Furthermore, the distillation training process of the student model only involves the labeled error sample set and the unlabeled dataset generated from the most recent batch of labeled datasets, without the need for previous labeled datasets. This is because the sample differences between the labeled and unlabeled datasets of handwritten digit images are small, with most images showing high similarity or even repetition. Since the prediction results of the main recognition model are highly reliable, the reliability of using the prediction results of the main recognition model for pseudo-labels on unlabeled data is also high. The actual effect of using pseudo-labels for distillation training is equivalent to the effect of using the true labels from previous labeled sample sets. This makes large-scale unlabeled datasets of significant application value in the continuous learning of this invention. Since the student model is trained through distillation, it can inherit the comprehensive recognition capabilities of both the main and auxiliary recognition models for previously tested labeled data. Therefore, by continuously using the current main recognition model to predict the most recent batch of labeled datasets that have not yet been tested, selecting a small-scale labeled error sample set from the current batch, and training the current auxiliary recognition model, the preparation work for distillation training can be quickly completed.
[0072] In step S150, if the recognition performance of the distilled student model reaches that of the teacher model, the main recognition model is replaced with the distilled student model, and the model training cascade step is returned to wait for a new round of unlabeled dataset for continuous learning.
[0073] Specifically, such as Figure 2 As shown, after obtaining the distilled student model, it can be determined whether the recognition performance of the distilled student model reaches that of the teacher model. If the recognition performance of the distilled student model does not reach that of the teacher model, the parameters during distillation are adjusted until the recognition performance of the distilled student model reaches that of the teacher model, and the main recognition model is replaced with the distilled student model; if the recognition performance of the distilled student model still does not reach that of the teacher model, the main recognition model is replaced with the distilled student model. The comparison of recognition performance can be determined by the accuracy rates of the teacher model and the student model on the same test dataset. For example, if the test accuracy rate of the student model is greater than or equal to the test accuracy rate of the teacher model, then it is determined that the recognition performance of the distilled student model has reached that of the teacher model.
[0074] It should be understood that the specific coefficients for adjusting the parameters during distillation can be set according to actual needs, and the embodiments of this application are not limited thereto.
[0075] For example, the temperature parameter can be adjusted, which usually affects the generalization ability of the student model; if the performance of the student model is much lower than that of the teacher model, the temperature can be appropriately increased, for example from 3 to 4 or 5, so that the student model pays more attention to the prediction results of the teacher model.
[0076] For example, the weighting coefficient alpha can be adjusted to balance the weights of hard label loss (CE) and soft label loss (KL). A larger alpha indicates that the student model relies more on the true labels (supervised learning); a smaller alpha indicates that the student model relies more on the pseudo-labels of the teacher model. If the student's performance is significantly lower than the teacher's, it may be because alpha is too large (too reliant on true labels). In this case, alpha can be appropriately reduced (e.g., from 0.5 to 0.4) to allow the student model to trust the knowledge of the teacher model more.
[0077] It should be noted that after returning to the model training cascade step, in order to increase the diversity of the samples in the error sample training set, a new master recognition model can be used to continue testing on subsequent labeled datasets to obtain more samples and add them to the error sample training set.
[0078] Therefore, with the help of the above technical solutions, this application adopts a three-model collaborative architecture. It uses the labeled dataset from the previous batch to build a master recognition model with good generalization performance to select subsequent training data. It builds an auxiliary recognition model with good specificity to memorize special samples that are difficult to learn. It also uses large-scale unlabeled data to participate in distillation to train a student model that can inherit the comprehensive recognition ability of the previous generation of teacher models. In this way, it completes the sample self-selection, model self-construction and system self-evolution in the process of handwritten digit recognition modeling. It can provide an effective example for the research on automatic evolution of intelligent systems and has good reference value for other application scenarios.
[0079] Furthermore, compared to existing technologies, the technology of this invention can greatly reduce the scale of training data for the entire system and enhance the significant utilization value of large-scale unlabeled data; it not only endows intelligent models with continuous self-learning capabilities, but also achieves the goal of overcoming the phenomenon of "catastrophic forgetting".
[0080] It should be understood that the above-described continuous learning method for handwritten digit recognition models is merely exemplary, and those skilled in the art can make various modifications based on the above method, and the modified solutions also fall within the protection scope of this application.
[0081] Please see Figure 4 , Figure 4This diagram illustrates a structural block diagram of a continuous learning device 400 for a handwritten digit recognition model according to an embodiment of this application. It should be understood that the continuous learning device 400 is capable of performing the steps described in the above method embodiments. The specific functions of the continuous learning device 400 can be found in the description above; detailed descriptions are omitted here to avoid repetition. The continuous learning device 400 includes at least one software functional module that can be stored in memory or embedded in the operating system (OS) of the continuous learning device 400 in the form of software or firmware. Specifically, the continuous learning device 400 includes:
[0082] The acquisition module 410 is used to acquire a handwritten digit dataset; wherein, the handwritten digit dataset includes a labeled dataset and an unlabeled dataset, and the labeled dataset includes handwritten digit image samples and their corresponding digit labels as well as newly added indistinguishable image samples and their corresponding digit labels;
[0083] The training selection module 420 is used to train and generate an 11-class master recognition model for recognizing handwritten digits based on the labeled dataset, and to input each image sample in the labeled dataset into the master recognition model for testing, so as to select the image samples that are misrecognized by the master recognition model from the labeled dataset, and put the misrecognized image samples and their corresponding labels into the error sample training set; wherein, the output categories of the master recognition model have added categories that cannot be recognized.
[0084] The model training cascade module 430 is used to perform the model training cascade step, which is to train and generate an auxiliary recognition model for recognizing handwritten digits based on the error sample training set, and to cascade the main recognition model and the auxiliary recognition model that can complement its performance to obtain the teacher model.
[0085] The recognition training module 440 is used to recognize samples in the unlabeled dataset using the teacher model, obtain the recognition results of all samples in the unlabeled dataset, and use the unlabeled dataset and all corresponding recognition results as a pseudo-label set, as well as the error sample training set as the real label set, and use the teacher model to guide the student model to train based on the pseudo-label set and the real label set, to obtain the distilled student model.
[0086] Replacement module 450 is used to replace the main recognition model with the distilled student model when the recognition performance of the distilled student model reaches the recognition performance of the teacher model, and return to the model training cascade step and wait for a new round of unlabeled dataset for continuous learning.
[0087] In one possible embodiment, the auxiliary recognition model is an 11-class model, and the output category of the auxiliary recognition model adds an untrusted category; the auxiliary recognition model includes 10 SVM binary classifiers arranged in parallel and an output module connected to all SVM binary classifiers; each of the 10 SVM binary classifiers is used to recognize one of the handwritten digits 0 to 9, and the outputs of the 10 SVM binary classifiers are all binary codes; the output module is used to construct an output code based on the binary codes output by the 10 SVM binary classifiers, and if the output code has only one non-zero code point, the recognition result is determined to be the digit recognition result corresponding to the non-zero code point; otherwise, an untrusted recognition result is output.
[0088] In one possible embodiment, the model training cascade module 430 is specifically used to: if the output result of the main recognition model of the tested sample is a category from 0 to 9, then it is determined that the main recognition model has successfully recognized the sample and the auxiliary recognition model has no effect; if the output result of the main recognition model of the tested sample is an unrecognizable category, then it is determined that the main recognition model has failed to recognize the sample; and the tested sample is recognized by the auxiliary recognition model, and the final recognition result is output.
[0089] In one possible embodiment, the replacement module 450 is specifically used to replace the main recognition model with the distilled student model when the recognition performance of the distilled student model is achieved by adjusting the parameters during distillation to make the recognition performance of the distilled student model reach that of the teacher model.
[0090] Since the apparatus described in the above embodiments of the present invention is an apparatus used to implement the methods of the above embodiments of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the methods described in the above embodiments of the present invention, and therefore will not be described again here. All apparatuses used in the methods of the above embodiments of the present invention fall within the scope of protection of the present invention.
[0091] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0092] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.
[0093] It should be noted that the word "a" or "an" preceding a component does not preclude the existence of multiple such components. This invention can be implemented using hardware comprising several different components and using a suitably programmed computer. Among the listed devices, several of these devices may be embodied by the same hardware. The use of terms such as "first," "second," "third," etc., is merely for convenience and does not indicate any order. These terms can be understood as part of the component names.
[0094] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0095] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the technical solution should be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.
[0096] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the invention's technical solutions and their equivalents, then the invention should also include these modifications and variations.
Claims
1. A continuous learning method for a handwritten digit recognition model, characterized in that, include: Obtain a handwritten digit dataset; wherein the handwritten digit dataset includes a labeled dataset and an unlabeled dataset, the labeled dataset includes handwritten digit image samples and their corresponding digit labels as well as newly added indistinguishable image samples and their corresponding digit labels; An 11-category master recognition model for recognizing handwritten digits is trained based on the labeled dataset. Each image sample in the labeled dataset is input into the master recognition model for testing. Image samples that are misrecognized by the master recognition model are selected from the labeled dataset, and the misrecognized image samples and their corresponding labels are added to the error sample training set. The output categories of the master recognition model include categories that cannot be recognized. Model training cascade steps: Train an auxiliary recognition model for recognizing handwritten digits based on the error sample training set, and cascade the main recognition model and the auxiliary recognition model that can complement its performance to obtain the teacher model; The teacher model is used to identify samples in the unlabeled dataset to obtain the identification results of all samples in the unlabeled dataset. The unlabeled dataset and all its corresponding identification results are used as a pseudo-label set, and the error sample training set is used as the real label set. Based on the pseudo-label set and the real label set, the teacher model is used to guide the student model to train, resulting in a distilled student model. If the recognition performance of the distilled student model reaches that of the teacher model, the main recognition model is replaced with the distilled student model, and the model training cascade step is returned to wait for a new round of unlabeled dataset for continuous learning.
2. The continuous learning method according to claim 1, characterized in that, The auxiliary recognition model is an 11-class model, and the output category of the auxiliary recognition model adds an untrusted category; the auxiliary recognition model includes 10 SVM binary classifiers arranged in parallel and an output module connected to all the SVM binary classifiers; each of the 10 SVM binary classifiers is used to recognize one of the handwritten digits 0 to 9, and the output of the 10 SVM binary classifiers is a binary code; the output module is used to construct an output code based on the binary code output by the 10 SVM binary classifiers, and if there is only one non-zero code point in the output code, the recognition result is determined to be the digit recognition result corresponding to the non-zero code point; otherwise, an untrusted recognition result is output.
3. The continuous learning method according to claim 1 or 2, characterized in that, The testing process for the teacher model includes: If the test sample is classified as a category from 0 to 9 by the main recognition model, then the main recognition model is considered to have successfully identified the sample, and the auxiliary recognition model is not effective. If the test sample is identified as an unrecognizable category by the main recognition model, it is determined that the main recognition model has failed to recognize the sample. The auxiliary recognition model is then used to identify the test sample and output the final recognition result.
4. The continuous learning method according to claim 1, characterized in that, If the recognition performance of the distilled student model reaches the recognition performance of the teacher model, the main recognition model is replaced with the distilled student model, including: If the distillation parameters are adjusted to make the recognition performance of the distilled student model reach the recognition performance of the teacher model, the main recognition model is replaced with the distilled student model.
5. A continuous learning device for a handwritten digit recognition model, characterized in that, include: An acquisition module is used to acquire a handwritten digit dataset; wherein, the handwritten digit dataset includes a labeled dataset and an unlabeled dataset, and the labeled dataset includes handwritten digit image samples and their corresponding digit labels as well as newly added indistinguishable image samples and their corresponding digit labels; The training selection module is used to train and generate an 11-category master recognition model for recognizing handwritten digits based on the labeled dataset, and to input each image sample in the labeled dataset into the master recognition model for testing, so as to select the image samples that are misrecognized by the master recognition model from the labeled dataset, and put the misrecognized image samples and their corresponding labels into the error sample training set; wherein, the output categories of the master recognition model include categories that cannot be recognized. The model training cascade module is used to execute the model training cascade step, wherein the model training cascade step is to train and generate an auxiliary recognition model for recognizing handwritten digits based on the error sample training set, and to cascade the main recognition model and the auxiliary recognition model that can complement its performance to obtain a teacher model; The recognition training module is used to recognize samples in the unlabeled dataset using the teacher model, obtain the recognition results of all samples in the unlabeled dataset, and use the unlabeled dataset and all corresponding recognition results as a pseudo-label set, as well as the error sample training set as the real label set, and use the teacher model to guide the student model to train based on the pseudo-label set and the real label set, to obtain the distilled student model. The replacement module is used to replace the main recognition model with the distilled student model when the recognition performance of the distilled student model reaches the recognition performance of the teacher model, and return to the model training cascade step and wait for a new round of unlabeled dataset for continuous learning.
6. The continuous learning device according to claim 5, characterized in that, The auxiliary recognition model is an 11-class model, and the output category of the auxiliary recognition model adds an untrusted category; the auxiliary recognition model includes 10 SVM binary classifiers arranged in parallel and an output module connected to all the SVM binary classifiers; each of the 10 SVM binary classifiers is used to recognize one of the handwritten digits 0 to 9, and the output of the 10 SVM binary classifiers is a binary code; the output module is used to construct an output code based on the binary code output by the 10 SVM binary classifiers, and if there is only one non-zero code point in the output code, the recognition result is determined to be the digit recognition result corresponding to the non-zero code point; otherwise, an untrusted recognition result is output.
7. The continuous learning device according to claim 5 or 6, characterized in that, The model training cascade module is specifically used for: if the output result of the main recognition model of the tested sample is a category from 0 to 9, then it is determined that the main recognition model has successfully recognized the sample and the auxiliary recognition model has no effect; if the output result of the main recognition model of the tested sample is an unrecognizable category, then it is determined that the main recognition model has failed to recognize the sample, and the tested sample is recognized by the auxiliary recognition model, and the final recognition result is output.
8. The continuous learning device according to claim 5, characterized in that, The replacement module is specifically used to replace the main recognition model with the distilled student model when the recognition performance of the distilled student model is made to match the recognition performance of the teacher model by adjusting the parameters during distillation.
Citation Information
Patent Citations
Method and device for training image recognition model and image recognition
CN113326764A
Handwritten character recognition method for multi-branch lightweight residual network of intelligent table lamp
CN113850266A