Continuous learning method and device for handwritten numeral recognition model
Through cascade training of the main recognition model, auxiliary recognition model and teacher model, the catastrophic forgetting problem of the handwritten digit recognition model is solved, continuous learning and effective utilization of large-scale unlabeled data are achieved, and the self-learning ability of the model is improved.
Patent Information
- Application Number
- CN202511135067.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-08-14
AI Technical Summary
Existing handwritten digit recognition models suffer from catastrophic forgetting problems, and the quality and labeling issues of training set data affect model performance, making it difficult to continuously learn and utilize large-scale unlabeled data.
By constructing a cascade of the main recognition model, auxiliary recognition model and teacher model, using labeled data sets to select erroneous samples, generating an auxiliary recognition model, and using the teacher model to guide the student model for distillation training, continuous learning capabilities are formed.
It reduces the scale of training data, improves the utilization value of unlabeled data, overcomes the catastrophic forgetting phenomenon, and realizes the continuous self-learning ability of the model.
Smart Images

Figure CN120726646A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a continuous learning method and device for a handwritten digit recognition model. Background Art
[0002] To build a handwritten digit recognition model, it is necessary to collect a large number of representative image samples in advance to form a training set. The classification model is then generated from the training set and used for actual handwritten digit image recognition. The data quality of the training set usually seriously affects the performance of the classification model. Furthermore, since data collection is limited by many conditions such as time, equipment, and location, it is impossible to obtain all representative samples at once. Therefore, acquiring limited amounts of data in batches is the norm. In order to train a high-performance model, the training set is often a mixture of all existing batches of data, resulting in an extremely large-scale training set. The overhead increases exponentially, making this unsustainable in the long run. Furthermore, data is often divided into two categories: labeled and unlabeled. However, because unlabeled data lacks credible annotation information, it faces problems such as unreliability and insufficient utilization during training.
[0003] In addition, existing deep learning models suffer from a major flaw called "catastrophic forgetting." This refers to the phenomenon where, after a model learns new knowledge, it almost completely forgets what it learned previously. This phenomenon results in huge differences in the performance of models trained with different batches of data, and is an important issue that needs to be addressed urgently in artificial intelligence research. Summary of the Invention
[0004] (1) Technical issues to be resolved In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method and device for continuous learning of a handwritten digit recognition model, which solves the technical problem of catastrophic forgetting existing in the prior art.
[0005] (2) Technical solution In order to achieve the above objectives, the main technical solutions adopted by the present invention include: In a first aspect, an embodiment of the present invention provides a continuous learning method for a handwritten digit recognition model, comprising: obtaining 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 unrecognizable image samples and their corresponding digit labels; training and generating an 11-classification main recognition model for recognizing handwritten digits based on the labeled dataset, and inputting each image sample in the labeled dataset into the main recognition model one by one for testing, so as to select image samples that are incorrectly recognized by the main 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 category of the main recognition model adds an unrecognizable category; the model training cascade steps are as follows: An auxiliary recognition model for recognizing handwritten digits is generated based on the training set of error samples, and the main recognition model and the auxiliary recognition model that can complement its performance are cascaded to obtain a teacher model; the teacher model is used to recognize samples in the unlabeled dataset to obtain recognition results of all samples in the unlabeled dataset, and the unlabeled dataset and all its corresponding recognition results are used as a pseudo label set, and the error sample training set is used as a true label set, and based on the pseudo label set and the true label set, the teacher model is used to guide the student model for training to obtain a distilled student model; when the recognition performance of the distilled student model reaches the recognition performance of the teacher model, the main recognition model is replaced by the distilled student model, and the model training cascade step is returned to wait for a new round of unlabeled dataset for continuous learning.
[0006] In one possible embodiment, the auxiliary recognition model is an 11-classification model, and an untrustworthy category is newly added to the output category of the auxiliary recognition model; 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 coded; the output module is used to construct an output code based on the binary code output by the 10 SVM binary classifiers, and if the output code has only one non-zero code bit, the recognition result is determined to be the digital recognition result corresponding to the non-zero code bit, and in other cases, an untrustworthy recognition result is output.
[0007] In one possible embodiment, the testing process of the teacher model includes: if the output result of the tested sample after the main recognition model is a category from 0 to 9, it is determined that the main recognition model has successfully identified it and the auxiliary recognition model does not work; if the output result of the tested sample after the main recognition model is an unrecognizable category, it is determined that the main recognition model has failed to identify it, and the tested sample is identified by the auxiliary recognition model, and the final recognition result is output.
[0008] In one possible embodiment, when the recognition performance of the student model after distillation reaches the recognition performance of the teacher model, the main recognition model is replaced by the student model after distillation, including: when the parameters during distillation are adjusted so that the recognition performance of the student model after distillation reaches the recognition performance of the teacher model, the main recognition model is replaced by the student model after distillation.
[0009] In a second aspect, an embodiment of the present invention provides 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 comprises a labeled dataset and an unlabeled dataset, and the labeled dataset comprises handwritten digit image samples and their corresponding digit labels as well as newly added unrecognizable image samples and their corresponding digit labels; a training selection module for generating an 11-classified main recognition model for recognizing handwritten digits based on the labeled dataset training, and inputting each image sample in the labeled dataset into the main recognition model one by one for testing, so as to select image samples that are incorrectly recognized by the main recognition model from the labeled dataset, and put the incorrectly recognized image samples and their corresponding labels into the error sample training set; wherein the output category of the main recognition model has newly added an unrecognizable category; a model training cascade module for executing the model training cascade steps , and the model training cascade step is to generate an auxiliary recognition model for recognizing handwritten digits according to 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 recognition training module is used to use the teacher model to recognize the samples in the unlabeled dataset, obtain the recognition results of all samples in the unlabeled dataset, and use the unlabeled dataset and all its corresponding recognition results as the pseudo label set, and also use the error sample training set as the true label set, and based on the pseudo label set and the true label set, use the teacher model to guide the student model for training 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.
[0010] In one possible embodiment, the auxiliary recognition model is an 11-classification model, and an untrustworthy category is newly added to the output category of the auxiliary recognition model; 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 coded; the output module is used to construct an output code based on the binary code output by the 10 SVM binary classifiers, and if the output code has only one non-zero code bit, the recognition result is determined to be the digital recognition result corresponding to the non-zero code bit, and in other cases, an untrustworthy recognition result is output.
[0011] In one possible embodiment, the model training cascade module is specifically used to: if the output result of the tested sample after the main recognition model is a category of 0 to 9, it is determined that the main recognition model has successfully recognized it and the auxiliary recognition model does not work; if the output result of the tested sample after the main recognition model is an unrecognizable category, it is determined that the main recognition model has failed to recognize it, and the tested sample is recognized by the auxiliary recognition model, and the final recognition result is output.
[0012] In one possible embodiment, the replacement module is specifically used to replace the main recognition model with the student model after distillation by adjusting the parameters during distillation so that the recognition performance of the student model after distillation reaches the recognition performance of the teacher model.
[0013] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory; 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.
[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes a continuous learning method for a handwritten digit recognition model as described above.
[0015] (3) Beneficial effects The beneficial effects of the present invention are: The embodiment of the present application provides a continuous learning method and device for a handwritten digit recognition model, which generates an 11-class main recognition model for recognizing handwritten digits based on a labeled data set, and inputs each image sample in the labeled data set into the main recognition model for testing one by one, so as to select image samples that are incorrectly recognized by the main recognition model from the labeled data set, and put the incorrectly recognized image samples and their corresponding labels into an error sample training set, and generates an auxiliary recognition model for recognizing handwritten digits based on the error sample training set, and cascades the main recognition model and the auxiliary recognition model that can complement its performance to obtain a teacher model, and uses the teacher model to recognize samples in an unlabeled data set to obtain all samples in the unlabeled data set. The recognition results of the samples are obtained, and the unlabeled dataset and all corresponding recognition results are used as the pseudo label set, and the error sample training set is used as the true label set. Based on the pseudo label set and the true label set, the teacher model is used to guide the student model for training to obtain the distilled student model. When the recognition performance of the student model after distillation reaches the recognition performance of the teacher model, the main recognition model is replaced with the student model after distillation, and the model training cascade step is returned to wait for a new round of unlabeled datasets for continuous learning, thereby greatly reducing the scale of training data for the entire system, improving the significant utilization value of large-scale unlabeled data, and not only giving the intelligent model the ability of continuous self-learning, but also achieving the purpose of overcoming the "catastrophic forgetting" phenomenon.
[0016] In order to make the above-mentioned objectives, features and advantages to be achieved by the embodiments of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A flowchart of a continuous learning method for a handwritten digit recognition model provided in an embodiment of the present application is shown; Figure 2 A specific flow chart of a continuous learning method for a handwritten digit recognition model provided in an embodiment of the present application is shown; Figure 3 A schematic structural diagram of an auxiliary recognition model provided in an embodiment of the present application is shown; Figure 4A structural block diagram of a continuous learning device for a handwritten digit recognition model provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation methods in conjunction with the accompanying drawings.
[0020] Currently, several existing handwritten digit recognition methods have explored building continuous learning systems through various approaches, including data diversion, feature space separation, data balancing, and randomly resetting less-used neurons to maintain network variability. However, these studies largely focus on designing the model's internal structure and adjusting weights, rarely considering practical engineering requirements such as multi-batch data collection and the integrated utilization of both labeled and unlabeled data.
[0021] Based on this, an embodiment of the present application provides a continuous learning method and device for a handwritten digit recognition model, which gradually constructs three recognition models by making full use of multiple batches of labeled data sets and unlabeled data sets, 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.
[0022] 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 accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. Instead, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0023] See Figure 1 , Figure 1 A flowchart of a continuous learning method for a handwritten digit recognition model provided in an embodiment of the present application is shown. It should be understood that the continuous learning method can be executed by a continuous learning device for a handwritten digit recognition model, and the specific device of the continuous learning device can be configured according to actual needs, and the embodiments of the present application are not limited thereto. For example, the continuous learning device can be a computer or a server. Specifically, the continuous learning method includes: Step S110: Acquire a handwritten digital dataset, wherein the handwritten digital dataset includes a labeled dataset and an unlabeled dataset, wherein the labeled dataset includes handwritten digital image samples and their corresponding digital labels, as well as newly added unrecognizable image samples and their corresponding digital labels.
[0024] Specifically, the handwritten digital dataset can be obtained in batches, and each batch of handwritten digital datasets includes a labeled dataset and an unlabeled dataset, and unrecognizable image samples and their corresponding digital labels can also be added to the labeled dataset.
[0025] Furthermore, multiple handwritten digit images from the labeled dataset can be randomly copied, and some of the digit pixels in the handwritten digit images can be replaced with background pixels to construct unrecognizable "non-0-9" digits. These images are then assigned corresponding digit labels and added to the labeled dataset, expanding the 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 the digit label is assigned to it as "10", indicating that it belongs to the unrecognizable category.
[0026] Step S120: Generate an 11-category main recognition model for recognizing handwritten digits based on the training of the annotated data set, and input each image sample in the annotated data set into the main recognition model one by one for testing, so as to select image samples that are incorrectly recognized by the main recognition model from the annotated data set, and put the incorrectly recognized image samples and their corresponding labels into the error sample training set.
[0027] 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 the present application are not limited thereto. For example, the main recognition model can be an existing handwritten digit recognition model.
[0028] To facilitate understanding of step S120, a specific embodiment is used to describe it below.
[0029] Specifically, if Figure 2 As shown in the figure, when multiple labeled datasets (e.g., A1, A2, etc.) are obtained in batches, the first batch of labeled datasets A1 can be used to train and generate a main recognition model Model_1 with 11 categories for recognizing handwritten digits, and a model test error flag can be set for the main recognition model Model_1. In addition to the output of the ten categories 0 to 9, the output classification of the main recognition model Model_1 has a new unrecognizable category, which indicates that the main recognition model Model_1 cannot recognize the input sample image.
[0030] If after testing the labeled dataset A1, if the model test error flag is equal to 0, it is determined that all images in the current batch of labeled dataset A1 have been correctly recognized by the main recognition model Model_1. Then the main recognition model Model_1 can be used to test the next batch of labeled dataset A2 until image samples whose recognition results of the main recognition model Model_1 do not match their corresponding true annotations (i.e., the annotations or labels in the labeled image dataset) are obtained (i.e., image samples that were incorrectly recognized by the main recognition model Model_1). This may include unrecognizable image samples and incorrectly recognized handwritten digit image samples. However, in actual applications, the main recognition model Model_1 is unable to completely correctly recognize samples in the labeled dataset A1. If the model test error flag is equal to 1, the image samples that are incorrectly recognized by the main recognition model and their corresponding labels can be selected from the labeled data set and put into the error sample training set.
[0031] For example, we can input sample images from the labeled dataset A1 one by one into the main recognition model Model_1 for testing. If Model_1's recognition result for a sample is consistent with the sample label, we consider that Model_1 has learned the sample. If Model_1's recognition result for a sample does not match the sample label, we consider that the sample has not been learned by Model_1. We can remove the sample from the labeled dataset A1 and place it in the error sample training set, with flag = 1.
[0032] Therefore, the main recognition model Model_1 is initially generated through iterative training. The purpose is to gradually exclude samples with incorrect recognition from the original categories 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 credibility.
[0033] Furthermore, the practical effect of this approach is to use the main recognition model Model_1 itself to select samples for the current training set, gradually picking out a small number of interfering samples. This makes the training set of the main recognition model Model_1 tend to be purer, ensuring better remodeling results. For example, when the model outputs the predicted category "0-9", the result is basically correct.
[0034] Step S130 , generating 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 can complement its performance to obtain a teacher model.
[0035] Specifically, the auxiliary recognition model is an 11-classification model, and the output category of the auxiliary recognition model has a new untrustworthy category; Figure 3As shown, the 11-class auxiliary recognition model includes 10 parallel SVM binary classifiers and an output module connected to all SVM binary classifiers.
[0036] Each of the 10 SVM binary classifiers is used to identify one of the handwritten digits 0 to 9, and the outputs of the 10 SVM binary classifiers are all binary coded (i.e., 0 or 1). For example, from top to bottom, the 10 SVM binary classifiers are used to identify the handwritten digits 0 to 9, and if the binary code of their output is 1, it means that they have recognized the current input sample, otherwise it is not recognized; The output module is used to construct an output code based on the binary codes output by 10 SVM binary classifiers (and the output code is constructed according to the binary codes output by the 10 SVM binary classifiers from top to bottom), and if there is only one non-zero code bit in the output code, the recognition result is determined to be the digital recognition result corresponding to the non-zero code bit, and in other cases, an unreliable recognition result is output. For example, if the output code is "1000000000", the recognition result is determined to be the handwritten number 0, and if the output code is "0100000000", the recognition result is determined to be the handwritten number 1, and so on. The output codes of other handwritten numbers 2 to 9 are similar; for another example, if the output code is "0000000000" or "0000000101", etc., the output result is determined to be unreliable.
[0037] In other words, the auxiliary recognition model specifically memorizes samples and their true labels that were incorrectly predicted by the primary recognition model. Furthermore, the auxiliary recognition model serves as a compensatory measure for prediction failures by the primary recognition model of the same generation. When a sample is incorrectly identified by the primary recognition model, the auxiliary recognition model provides an opportunity for a new prediction. Furthermore, by memorizing these special samples and their true labels, the auxiliary recognition model assists in decision-making after the primary recognition model fails. Because the sample size of the error sample training set is much smaller than that of the original data from the same batch, the derived set of labeled error samples is typically relatively refined.
[0038] In addition, the advantage of using SVM modeling is that as long as the number of samples in any category reaches one or more, the model can be built, and it is not sensitive to the problem of imbalance in the number of category samples.
[0039] Furthermore, if 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, and the specific testing process of the teacher model is as follows: if the output result of the tested sample after the main recognition model is a category from 0 to 9, it is determined that the main recognition model has successfully recognized it and the auxiliary recognition model has no effect; if the output result of the tested sample after the main recognition model is an unrecognizable category, it is determined that the main recognition model has failed to recognize it, and the tested sample is recognized by the auxiliary recognition model, and the final recognition result is output.
[0040] In step S140, the teacher model is used to identify samples in the unlabeled dataset to obtain recognition results of all samples in the unlabeled dataset, and the unlabeled dataset and all corresponding recognition results are used as a pseudo label set, and the error sample training set is used as a true label set. Based on the pseudo label set and the true label set, the teacher model is used to guide the student model to train, and the distilled student model is obtained.
[0041] It should be understood that the specific model of the student model can be set according to actual needs, and the embodiments of the present application are not limited to this.
[0042] For example, the student model can be a main recognition model or other handwritten digit recognition model, and the embodiments of the present application are not limited to this.
[0043] And, the distillation of the student model can be trained by comprehensively using the following distillation loss function: The teacher model generates a pseudo-label distribution on the new dataset, and the student model minimizes the error with this distribution. KL Divergence is used to imitate the teacher's knowledge; the main recognition model and the auxiliary recognition model are used for distillation, and the distillation loss function is defined as: ; Where, Represents the distillation loss function value; KL ( || )Divergence is used to measure the difference between two probability distributions; Represents the predicted output label probability distribution of the main recognition model; Represents the predicted output label probability distribution of the auxiliary recognition model; represents the predicted label probability distribution of the student model; T represents the distillation temperature used to smooth the probability distribution to retain more inter-class relationship information; In addition, in order to ensure the model's ability to discriminate real samples, the sample set with incorrect annotations provides the real category label, using the standard cross entropy loss ( Cross-Entropy Loss ) for supervised learning, specifically: ; Where,L CE represents the standard cross entropy loss; C Indicates the number of categories; y i Indicates the i The true label of the class; is the predicted probability of the student model; Furthermore, to further improve the student model’s ability to align with the teacher model’s intermediate structural features, the following two regularization terms are introduced: Feature Distillation Loss is used to maximize the consistency between the teacher model and the student model in the feature space, and is measured using cosine similarity: ; Where, L feat Represents the feature distillation loss value; F Represents the feature output of the model in the middle layer; The feature vector representing the output of the student model; The feature vector representing the output of the teacher model; Attention shift loss ( Attention Transfer Loss ) is used to express how the student model learns the spatial attention pattern of the teacher model by normalizing the mean squared error between attention maps: ; Where, L AT Indicates loss of attention shifting; A represents the attention mapping function; Furthermore, the student model is trained using the following total loss function, which integrates three sources of information: soft-label guided distillation, true label supervised learning, and intermediate layer feature alignment: ; Where, Indicates the total loss; Represents the weight between control supervised learning and distilled learning, and its ; Represents the regularization coefficient of feature distillation; The regularization coefficient representing attention transfer.
[0044] Furthermore, the distillation training process for the student model involves only the set of incorrectly labeled samples and unlabeled datasets generated from the most recent batch of labeled datasets, without requiring any previously labeled datasets. This is because the sample differences between the labeled and unlabeled datasets for handwritten digit images are minimal, with the vast majority of images in both being highly similar or even duplicated. Since the predictions from the primary recognition model are highly reliable, the reliability of using the pseudo-labels from the primary recognition model's predictions on the unlabeled data is also high. The practical effect of using pseudo-labels for distillation training is equivalent to that of using the true labels from the previously labeled dataset. This makes large-scale unlabeled datasets highly valuable for continuous learning in the present invention. Because the student model is trained through distillation, it inherits the combined recognition capabilities of both the primary and auxiliary recognition models on previously tested labeled data. Therefore, by continuously using the current primary recognition model to make predictions on the most recent, untested batch of labeled datasets, selecting a small set of incorrectly labeled samples from the current batch, and training the current auxiliary recognition model, the preparations for distillation training can be quickly completed.
[0045] In step S150, when the recognition performance of the student model after distillation reaches the recognition performance of the teacher model, the main recognition model is replaced with the student model after distillation, and the model training cascade step is returned to wait for a new round of unlabeled data sets for continuous learning.
[0046] Specifically, if 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 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 of the teacher model and the student model tested on the same test data set. For example, if the test accuracy of the student model is greater than or equal to the test accuracy of the teacher model, it is determined that the recognition performance of the distilled student model reaches that of the teacher model.
[0047] 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 the present application are not limited thereto.
[0048] For example, the temperature parameter can be adjusted, which usually affects the generalization ability of the student model. If the student model performance is much lower than 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. For example, the weighting coefficient alpha can be adjusted to balance the hard label loss (CE) and the soft label loss (KL). A larger alpha indicates a greater reliance on true labels (supervised learning), while a smaller alpha indicates a greater reliance on pseudo labels from the teacher model. If the student's performance is significantly lower than that of the teacher, it may be because alpha is too high (too dependent on true labels). In this case, alpha can be appropriately reduced (e.g., from 0.5 to 0.4) to encourage the student model to trust the teacher's knowledge.
[0049] It should be noted here that after returning to the model training cascade step, in order to increase the diversity of samples in the error sample training set, the new main recognition model can also be used to continue testing the subsequent labeled data sets to obtain more samples and add them to the error sample training set.
[0050] Therefore, with the help of the above technical solution, this application adopts a three-model collaborative architecture, and uses the previous batch of labeled data sets to build a main recognition model with good generalization performance for self-selection of subsequent training data, and builds an auxiliary recognition model with good specificity to specifically memorize special samples that are difficult to learn. With the help of large-scale unlabeled data, a student model that can inherit the comprehensive recognition ability of the previous generation teacher model is trained, thereby completing the sample self-selection, model self-construction and system self-evolution in the handwritten digit recognition modeling process, which can provide an effective example for the study of automatic evolution of intelligent systems and has good reference value for other application scenarios.
[0051] In addition, compared with the existing technology, the technology of the present 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 gives the intelligent model the ability of continuous self-learning, but also achieves the purpose of overcoming the "catastrophic forgetting" phenomenon.
[0052] It should be understood that the above-mentioned continuous learning method of the handwritten digit recognition model is only exemplary, and those skilled in the art can make various modifications based on the above-mentioned method, and the modified scheme also falls within the scope of protection of this application.
[0053] See Figure 4 , Figure 4The block diagram of the structure of a continuous learning device 400 for a handwritten digit recognition model provided in an embodiment of the present application is shown. It should be understood that the continuous learning device 400 is capable of executing each step in the above-mentioned method embodiment. The specific functions of the continuous learning device 400 can be found in the description above. To avoid repetition, a detailed description is appropriately omitted here. The continuous learning device 400 includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the continuous learning device 400. Specifically, the continuous learning device 400 includes: Acquisition module 410, for acquiring a handwritten digital dataset; wherein the handwritten digital dataset includes a labeled dataset and an unlabeled dataset, wherein the labeled dataset includes handwritten digital image samples and their corresponding digital labels, as well as newly added unrecognizable image samples and their corresponding digital labels; A training selection module 420 is configured to train and generate an 11-category primary recognition model for recognizing handwritten digits based on the annotated dataset, and to input each image sample in the annotated dataset into the primary recognition model for testing, thereby selecting image samples from the annotated dataset that were incorrectly recognized by the primary recognition model, and adding the incorrectly recognized image samples and their corresponding labels to an error sample training set; wherein, the output categories of the primary recognition model include an unrecognizable category; A model training cascade module 430 is configured to execute a model training cascade step, wherein the model training cascade step is to generate an auxiliary recognition model for recognizing handwritten digits based on an error sample training set, and to cascade the main recognition model with an auxiliary recognition model that can complement its performance to obtain a teacher model; The recognition training module 440 is configured to use the teacher model to recognize samples in the unlabeled dataset, obtain recognition results for all samples in the unlabeled dataset, use the unlabeled dataset and all corresponding recognition results as a pseudo label set, use the error sample training set as a true label set, and use the teacher model to guide the student model to train based on the pseudo label set and the true label set, thereby obtaining a distilled student model. The 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 data sets for continuous learning.
[0054] In one possible embodiment, the auxiliary recognition model is an 11-classification model, and an untrustworthy category is newly added to the output category of the auxiliary recognition model; 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 coded; the output module is used to construct an output code based on the binary code output by the 10 SVM binary classifiers, and if the output code has only one non-zero code bit, the recognition result is determined to be the digital recognition result corresponding to the non-zero code bit, and in other cases, an untrustworthy recognition result is output.
[0055] In one possible embodiment, the model training cascade module 430 is specifically used to: if the output result of the tested sample after the main recognition model is a category from 0 to 9, it is determined that the main recognition model has successfully recognized it and the auxiliary recognition model does not work; if the output result of the tested sample after the main recognition model is an unrecognizable category, it is determined that the main recognition model has failed to recognize it, and the tested sample is recognized by the auxiliary recognition model, and the final recognition result is output.
[0056] In one possible embodiment, the replacement module 450 is specifically used to replace the main recognition model with the distilled student model by adjusting the parameters during distillation so that the recognition performance of the distilled student model reaches the recognition performance of the teacher model.
[0057] Since the apparatus described in the above embodiments of the present invention is used to implement the method of the above embodiments of the present invention, those skilled in the art will be able to understand the specific structure and variations of the apparatus based on the method described in the above embodiments of the present invention, and thus will not be described in detail here. All apparatuses used in the method of the above embodiments of the present invention fall within the scope of protection of the present invention.
[0058] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0059] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each process flow and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.
[0060] It should be noted that the word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The present invention may be implemented by means of hardware comprising several distinct components and by means of a suitably programmed computer. Among the several devices listed, several of these devices may be embodied by the same hardware. The use of the words first, second, third, etc., is for convenience only and does not imply any order. These words should be understood as part of the component name.
[0061] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0062] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments after learning the basic creative concepts. Therefore, the technical solutions should be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0063] Obviously, those skilled in the art may make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if such modifications and variations fall within the scope of the technical solution of the present invention and its equivalents, the present invention shall also include such modifications and variations.
Claims
1. A continuous learning method for a handwritten digit recognition model, characterized in that: include: Obtain a handwritten digital dataset; wherein the handwritten digital dataset includes a labeled dataset and an unlabeled dataset, the labeled dataset including handwritten digital image samples and their corresponding digital labels and newly added unrecognizable image samples and their corresponding digital labels; A primary recognition model for recognizing handwritten digits with 11 categories is trained based on the annotated dataset, and each image sample in the annotated dataset is input into the primary recognition model one by one for testing, so as to select image samples from the annotated dataset that are incorrectly recognized by the primary recognition model, and place the incorrectly recognized image samples and their corresponding labels into an error sample training set; wherein the output categories of the primary recognition model include a new unrecognizable category; Model training cascade step: generating 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 can complement its performance to obtain a teacher model; Using the teacher model to identify samples in the unlabeled dataset, obtaining recognition results for all samples in the unlabeled dataset, using the unlabeled dataset and all corresponding recognition results as a pseudo label set, and using the error sample training set as a true label set, and using the teacher model to guide the student model to train based on the pseudo label set and the true label set, to obtain a distilled student model; When the recognition performance of the distilled student model reaches the recognition performance of the teacher model, the main recognition model is replaced by the distilled student model, and the model training cascade step is returned to wait for a new round of unlabeled data sets for continuous learning.
2. The continuous learning method according to claim 1, characterized in that The auxiliary recognition model is an 11-classification model, and an untrustworthy category is newly added to the output category of the auxiliary recognition model; 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 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 bit, the recognition result is determined to be the digital recognition result corresponding to the non-zero code bit, and in other cases, an untrustworthy recognition result is output.
3. The continuous learning method according to claim 1 or 2, characterized in that: The testing process of the teacher model includes: If the primary recognition model outputs a result of 0 to 9 for the tested sample, it is determined that the primary recognition model has successfully identified the sample, and the auxiliary recognition model does not work; If the main recognition model outputs a result that the tested sample is an unrecognizable category, it is determined that the main recognition model has failed to identify the tested sample, and the auxiliary recognition model is used to identify the tested sample and output a final recognition result.
4. The continuous learning method according to claim 1, characterized in that When the recognition performance of the distilled student model reaches the recognition performance of the teacher model, replacing the main recognition model with the distilled student model comprises: When the parameters during distillation are adjusted so that the recognition performance of the student model after distillation reaches the recognition performance of the teacher model, the main recognition model is replaced by the student model after distillation.
5. A continuous learning device for a handwritten digit recognition model, characterized in that: include: An acquisition module is configured to acquire a handwritten digital dataset; wherein the handwritten digital dataset includes a labeled dataset and an unlabeled dataset, wherein the labeled dataset includes handwritten digital image samples and their corresponding digital labels, as well as newly added unrecognizable image samples and their corresponding digital labels; a training and selection module, configured to train and generate an 11-category primary recognition model for recognizing handwritten digits based on the annotated dataset, and to input each image sample in the annotated dataset into the primary recognition model for testing, thereby selecting image samples from the annotated dataset that were incorrectly recognized by the primary recognition model, and adding the incorrectly recognized image samples and their corresponding labels to an error sample training set; wherein the output categories of the primary recognition model include newly recognized categories; A model training cascade module is used to perform a model training cascade step, wherein the model training cascade step is to generate an auxiliary recognition model for recognizing handwritten digits based on the error sample training set, and cascade the main recognition model with the auxiliary recognition model that can complement its performance to obtain a teacher model; a recognition training module, configured to use the teacher model to recognize samples in the unlabeled dataset, obtain recognition results for all samples in the unlabeled dataset, use the unlabeled dataset and all corresponding recognition results as a pseudo label set, use the error sample training set as a true label set, and use the teacher model to guide the student model to train based on the pseudo label set and the true label set, to obtain a distilled student model; A 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 data sets for continuous learning.
6. The continuous learning device according to claim 5, characterized in that The auxiliary recognition model is an 11-classification model, and an untrustworthy category is newly added to the output category of the auxiliary recognition model; 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 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 bit, the recognition result is determined to be the digital recognition result corresponding to the non-zero code bit, and in other cases, an untrustworthy 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 to: if the output result of the tested sample after the main recognition model is a category from 0 to 9, it is determined that the main recognition model has successfully identified the sample and the auxiliary recognition model does not work; if the output result of the tested sample after the main recognition model is an unrecognizable category, it is determined that the main recognition model has failed to identify the sample, and the tested sample is identified 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 by adjusting the parameters during distillation so that the recognition performance of the distilled student model reaches the recognition performance of the teacher model.
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
Label generation method, image classification method, and electronic device
US20240233348A1
Handwriting Recognition Method, Training Method and Training Device of Handwriting Recognition Model
US20250005946A1
