Incremental learning method and device, electronic equipment and machine readable storage medium

By initializing the incremental model and applying regularization constraints and feature compression during incremental learning, the problems of storage space and data privacy protection are solved, enabling the preservation of old knowledge and the learning of new knowledge, thereby improving storage space and security.

CN114298197BActive Publication Date: 2026-04-24HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
Filing Date
2021-12-22
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In the incremental application of deep learning, existing technologies require models to maintain their performance in old scenarios while learning new knowledge, which results in large storage space requirements and is detrimental to data privacy protection.

Method used

By initializing the incremental model and applying regularization constraints at the feature level and/or parameter level to both the initial and incremental models during incremental training, combined with feature compression and balanced sampling, the loss weights are dynamically adjusted to ensure that old knowledge is not forgotten.

Benefits of technology

It effectively reduces the storage space requirements for incremental training, improves data security, avoids the forgetting of old knowledge, and achieves balanced training of new and old knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114298197B_ABST
    Figure CN114298197B_ABST
Patent Text Reader

Abstract

The application provides an incremental learning method and device, electronic equipment and machine readable storage medium. The method comprises: initializing an incremental model according to an initial model during incremental training to obtain an initialized incremental model; training the initialized incremental model according to incremental training data and the initial training data to obtain a trained incremental model; wherein the initial model and the incremental model are regularly constrained according to a regular strategy during the incremental training; the regular constraint comprises a feature-level regular constraint and / or a parameter-level regular constraint. The method can alleviate the forgetting of old knowledge in the incremental learning process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision technology, and in particular to an incremental learning method, apparatus, electronic device, and machine-readable storage medium. Background Technology

[0002] In incremental applications of deep learning, models are typically required to maintain their performance in old scenarios while learning new knowledge.

[0003] In existing technologies, all previous old data and new data are usually used together for joint training, which results in a large storage space requirement and is not conducive to data privacy protection. Summary of the Invention

[0004] In view of this, this application provides an incremental learning method, apparatus, electronic device, and machine-readable storage medium to reduce the storage space requirements of incremental training and improve data security.

[0005] Specifically, this application is implemented through the following technical solution:

[0006] According to a first aspect of the embodiments of this application, an incremental learning method is provided, comprising:

[0007] During incremental training, the incremental model is initialized based on the initial model to obtain the initialized incremental model; wherein, the initial model is obtained by training the model based on the initial training data;

[0008] Based on the incremental training data and the initial training data, the initialized incremental model is trained to obtain the trained incremental model; wherein, during the incremental training process, regularization constraints are applied to the initial model and the incremental model according to a regularization strategy; the regularization constraints include feature-level regularization constraints and / or parameter-level regularization constraints.

[0009] According to a second aspect of the embodiments of this application, an incremental learning device is provided, comprising:

[0010] An initialization unit is used to initialize the incremental model based on the initial model during incremental training to obtain the initialized incremental model; wherein the initial model is obtained by training the model based on the initial training data;

[0011] An incremental training unit is used to train the initialized incremental model based on incremental training data and the initial training data to obtain a trained incremental model; wherein, during the incremental training process, regularization constraints are applied to the initial model and the incremental model according to a regularization strategy; the regularization constraints include feature-level regularization constraints and / or parameter-level regularization constraints.

[0012] According to a third aspect of the embodiments of this application, an electronic device is provided, including a processor and a memory, the memory storing machine-executable instructions executable by the processor, the processor being configured to execute the machine-executable instructions to implement the method provided in the first aspect.

[0013] According to a fourth aspect of the embodiments of this application, a machine-readable storage medium is provided, wherein machine-executable instructions are stored therein, and when the machine-executable instructions are executed by a processor, the method provided in the first aspect is implemented.

[0014] The technical solution provided in this application can bring at least the following beneficial effects:

[0015] The incremental model is initialized using the initial model obtained from training the model based on the initial training data. The initialized incremental model is then trained using both the incremental training data and the initial training data. During the incremental training process, regularization constraints at the feature level and / or parameter level are applied to the initial model and the incremental model, which effectively alleviates the forgetting of old knowledge during the incremental learning process. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating an incremental learning method according to an exemplary embodiment of this application;

[0017] Figure 2 This is a schematic diagram of the functional modules of an incremental learning system shown in an exemplary embodiment of this application;

[0018] Figure 3A This is a schematic diagram illustrating a feature compression process according to an exemplary embodiment of this application;

[0019] Figure 3B This is a schematic diagram illustrating an incremental training framework as shown in an exemplary embodiment of this application;

[0020] Figure 3C This is a schematic diagram illustrating an exemplary embodiment of this application, showing how a regularization strategy is used to apply regularization constraints to the features and / or parameters of old data during incremental training.

[0021] Figure 3D This is a schematic diagram illustrating an exemplary embodiment of this application, demonstrating how to ensure balanced training of new and old knowledge from three perspectives: balanced sampling, balanced training, and balanced loss.

[0022] Figure 4 This is a schematic diagram of the structure of an incremental learning device shown in an exemplary embodiment of this application;

[0023] Figure 5 This is a schematic diagram of the structure of another incremental learning device illustrated in an exemplary embodiment of this application;

[0024] Figure 6 This is a schematic diagram of the hardware structure of an electronic device illustrated in an exemplary embodiment of this application. Detailed Implementation

[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0026] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0027] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.

[0028] Please see Figure 1 This is a flowchart illustrating an incremental learning method provided in an embodiment of this application, as shown below. Figure 1 As shown, this incremental learning method may include the following steps:

[0029] It should be noted that the sequence number of each step in the embodiments of this application does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0030] Step S100: During incremental training, the incremental model is initialized based on the initial model to obtain the initialized incremental model; wherein, the initial model is obtained by training the model based on the initial training data. Step S110: The initialized incremental model is trained based on the incremental training data and the initial training data; wherein, during incremental training, regularization constraints are applied to the initial model and the incremental model according to a regularization strategy; the regularization constraints include feature-level regularization constraints and / or parameter-level regularization constraints.

[0031] For example, the initial model refers to a network model that has been trained before incremental training, which may have undergone one or more incremental training sessions.

[0032] For example, suppose the network model needs to be trained for the fourth time, then the initial model can be the network model after the third time of training.

[0033] Accordingly, the initial training data may include the incremental training data used in the already completed incremental training process.

[0034] For example, when the initial model training process includes incremental training, the implementation of incremental training can be found in the relevant description below.

[0035] In this embodiment of the application, when incremental training of the network model is required, the incremental model can be initialized based on the initial model to obtain the initialized incremental model, and the initialized incremental model can be trained based on the incremental training data and the initial training data.

[0036] In this embodiment of the application, in order to prevent the forgetting of old knowledge, regularization constraints can be applied to the initial model and the incremental model according to the regularization strategy during the incremental training process of the incremental model.

[0037] For example, regularity constraints may include feature-level regularity constraints and / or parameter-level regularity constraints.

[0038] For example, feature-level regularization constraints can constrain the output probability distribution of old data on the old model and the incremental model to remain unchanged at the feature level, while parameter-level regularization constraints can constrain the network parameters that are important to old knowledge to remain unchanged during incremental training at the parameter level.

[0039] It can be seen that, in Figure 1 In the method flow shown, the incremental model is initialized by using the initial model obtained by training the model based on the initial training data, and the initialized incremental model is trained based on the incremental training data and the initial training data. During the incremental training process, regularization constraints at the feature level and / or parameter level are applied to the initial model and the incremental model, which effectively avoids the forgetting of old knowledge during the incremental learning process.

[0040] In some embodiments, when the regularization constraints include feature-level regularization constraints, the above-mentioned regularization constraints applied to the initial model and the incremental model according to the regularization strategy may include:

[0041] Based on the difference between the output of the initial training data processed by the initial model and the output of the initial training data processed by the incremental model, the parameters of the deep network and prediction layer of the incremental model are optimized.

[0042] For example, in order to avoid forgetting old knowledge and ensure the effectiveness of the incremental model in processing the initial training data, during the incremental training process, it can be ensured that the difference between the output of the initial training data after processing by the initial model and the output of the initial training data after processing by the incremental model is as small as possible.

[0043] Accordingly, during incremental training, the parameters of the incremental model can be optimized based on the difference between the output of the initial training data after passing through the initial model and the output of the initial training data after passing through the incremental model. The specific implementation can be explained in the following text with specific examples.

[0044] In one example, when regularization constraints include parameter-level regularization constraints, applying regularization constraints to the initial and incremental models according to the regularization strategy can include:

[0045] Based on the differences in parameters between layers in the initial model and the incremental model, the parameters of the incremental model are optimized.

[0046] For example, in order to avoid forgetting old knowledge and ensure the effectiveness of the incremental model in processing the initial training data, the differences between the parameters of the initial model and each layer in the incremental model can be kept as small as possible during the incremental training process.

[0047] Accordingly, during incremental training, the parameters of the incremental model can be optimized based on the differences between the parameters of each layer in the initial model and the incremental model. The specific implementation can be explained in the following text with specific examples.

[0048] In some embodiments, training the initialized incremental model based on the incremental training data and the initial training data may include:

[0049] The initial training data and the incremental training data are sampled equally to obtain the sampled initial training data and the sampled incremental training data.

[0050] The incremental model is trained based on the initial training data and the incremental training data.

[0051] For example, in order to achieve balanced learning between new and old data, the initial training data and the incremental training data can be kept as balanced as possible during the incremental training process.

[0052] Accordingly, by performing balanced sampling on the initial training data and the incremental training data, sampled initial training data and sampled incremental training data can be obtained, ensuring the balance between the initial training data and the incremental training data during the incremental training process.

[0053] During incremental training, the initialized incremental model can be trained based on the sampled initial training data and the sampled incremental training data.

[0054] In some embodiments, the incremental learning method provided in this application may further include:

[0055] The new model is obtained by training the model based on the incremental training data.

[0056] Apply regularization constraints to the new and incremental models based on regularization strategies;

[0057] Based on the first regularization loss corresponding to the initial model and the incremental model, the second regularization loss corresponding to the new model and the incremental model, and the task loss of the incremental model, the final loss of the incremental model is determined.

[0058] The training of the incremental model is fed back based on the final loss of the incremental model.

[0059] For example, in order to avoid forgetting old knowledge while ensuring the effectiveness of the incremental model in processing new knowledge (incremental training data), the incremental model needs to be trained in a balanced training manner during the incremental training process, and the model should be optimized based on the balanced loss.

[0060] For example, in order to ensure the effectiveness of the incremental model in processing new knowledge, the model can be trained based on the incremental training data to obtain a new model, and regularization constraints can be applied to the new model and the incremental model based on the regularization strategy.

[0061] In addition, to prevent the forgetting of old knowledge, regularization constraints can be applied to the initial model and the incremental model based on regularization strategies.

[0062] For example, when determining the loss of the incremental model, it is necessary to consider not only the task loss of the incremental model, but also the regularization loss between the initial model and the incremental model (referred to as the first regularization loss in this paper), and the regularization loss between the incremental model and the newly added model (referred to as the second regularization loss in this paper). Based on the first regularization loss, the second regularization loss, and the task loss, the final loss of the incremental model is determined.

[0063] In one example, determining the final loss of the incremental model based on the first regularization loss corresponding to the initial model and the incremental model, the second regularization loss corresponding to the new model and the incremental model, and the task loss of the incremental model can include:

[0064] Based on the first regularization loss, the second regularization loss, the task loss, and the weights of the first regularization loss, the second regularization loss, and the task loss, the final loss of the incremental model is determined.

[0065] The first regularization loss weight is determined based on the performance of the initial model on the first validation set and the performance of the incremental model on the first validation set; the second regularization loss weight is determined based on the performance of the new model on the second validation set and the performance of the incremental model on the second validation set.

[0066] For example, in order to ensure balanced training of new and old knowledge under different distributions of new and old data, when determining the final loss of the incremental model, the weights of the first regularization loss (referred to as the first regularization loss weight in this paper) and the second regularization loss (referred to as the second regularization loss weight in this paper) can be dynamically adjusted based on the performance differences of the initial model, the new model and the incremental model on the validation set.

[0067] In some embodiments, before training the initialized incremental model based on the incremental training data and the initial training data, the following may also be included:

[0068] The first output feature is compressed, and the compressed feature is stored; wherein, the first output feature is the output feature of the initial training data after being processed by the shallow network of the initial model.

[0069] The above-mentioned training of the initialized incremental model based on incremental training data and initial training data may include:

[0070] The incremental training data is processed based on the shallow network of the initialized incremental model to obtain the second output feature;

[0071] Furthermore, the compressed features are decompressed to obtain the third output feature;

[0072] Based on the second and third output features, the deep network and prediction layer of the initialized incremental model are trained.

[0073] For example, in order to reduce the storage space requirements of incremental learning for the initial training data and to ensure the security of the initial training data, the shallow network of the initial model can be used to process the initial training data. The output features of the initial training data after processing by the shallow network (referred to as the first output features in this paper) are compressed to obtain compressed features, and the compressed features are stored.

[0074] For example, a network model may include shallow networks, deep networks, and prediction layers. The division between shallow and deep networks can be made according to actual needs. The prediction layers can be determined based on the task requirements of the network model. For example, the prediction layers of network models used for classification, detection, or segmentation can be different; that is, different tasks can correspond to different prediction layers.

[0075] When incremental training of the network model is required, on the one hand, the incremental training data can be processed based on the shallow network of the initialized incremental model obtained in step S100 to obtain the processed output features (referred to as the second output features in this paper).

[0076] It should be noted that the incremental model's division of shallow networks, deep networks, and prediction layers is consistent with the initial model's division of shallow networks, deep networks, and prediction layers.

[0077] On the other hand, the compressed features corresponding to the initial training data can be decompressed to obtain the decompressed output features (referred to as the third output features in this paper).

[0078] It should be noted that, due to the information loss that occurs during the compression process, the output feature obtained after compressing and decompressing the first output feature (i.e., the third output feature) will have some differences from the first output feature.

[0079] When the second and third output features are obtained in the above manner, the deep network and prediction layer of the initialized incremental model can be trained based on the second and third output features.

[0080] For example, the second and third output features can be concatenated and the concatenated features can be input into the incremental model. The loss can be determined based on the output results of the deep network and prediction layer of the initialized incremental model and the preset label information, and feedback optimization can be performed to train the incremental model.

[0081] For example, during incremental training, the parameters of the shallow network of the incremental model are fixed and consistent with the parameters of the shallow network of the initial model. That is, based on the second output feature and the third output feature, the deep network and prediction layer of the initialized incremental model are trained while the parameters of the shallow network of the initial incremental model are fixed.

[0082] It should be noted that since the second and third output features are the output features processed by the shallow network of the initial model and the shallow network of the incremental model, respectively, and the structure and parameters of the shallow network of the initial model and the shallow network of the incremental model are the same, the shallow network of the incremental model will not process the second and third output features again when they are input into the incremental model.

[0083] It is evident that by using the shallow network of the initial model to process the initial training data, the first output feature is obtained, and the first output feature is compressed to obtain the compressed feature. The compressed feature is then saved, which improves the storage space requirement of the initial training data (old data) for incremental learning. Since the initial training data is not used during incremental training, but rather the initial training data after shallow network processing is obtained by decompressing the compressed feature, the security of the initial training data is improved.

[0084] In some embodiments, the above-described feature compression of the first output feature may include:

[0085] The autoencoder is trained based on the first output feature, and the autoencoder includes an encoding network and a decoding network;

[0086] The first output feature is encoded based on the encoding network in the trained autoencoder.

[0087] The above-mentioned decompression of compressed features may include:

[0088] The compressed features are decoded based on the decoding network in the trained autoencoder.

[0089] For example, in order to achieve compression and decompression of the first output feature, an autoencoder can be trained based on the first output feature.

[0090] For example, the autoencoder may include an encoding network and a decoding network. The encoding network can be used to encode the first output feature to achieve feature compression; the decoding network can be used to decode the encoded feature to achieve feature decompression.

[0091] For example, when the training of the autoencoder is completed, the first output feature can be encoded according to the encoding network in the trained autoencoder to achieve feature compression.

[0092] In one example, during the training of the autoencoder, the parameters of the autoencoder are optimized based on the difference between the first output feature and the third output feature, as well as the difference between the processing results of the third output feature by the deep network and prediction layer of the initial model and the preset label information.

[0093] For example, in the training process of an autoencoder, on the one hand, it is necessary to ensure that the difference between the feature obtained after encoding and decoding of the same output feature and the output feature before encoding is as small as possible. On the other hand, it is necessary to ensure that the task loss when processing the third output feature obtained after encoding and decoding the first output feature is as small as possible using the initial model.

[0094] Accordingly, during the training process of the autoencoder, the parameters of the autoencoder can be optimized based on the difference between the first output feature and the third output feature, as well as the difference between the processing results of the third output feature by the deep network and prediction layer of the initial model and the preset label information. The specific implementation can be explained in the following text with specific examples.

[0095] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, the technical solutions provided in the embodiments of this application are described below with reference to specific examples.

[0096] In this embodiment, balanced incremental learning based on feature compression is employed. Feature encoding / decoding techniques are used to compress and store the features of the old data (i.e., the initial training data), such as the first output feature mentioned above. This reduces data storage while protecting data security. During incremental training, the decoded and compressed old data features are trained together with the incremental training data. Regularization strategies are used to avoid the forgetting problem caused by old data compression. Through sampling balance between new and old samples, a new and old task loss balance strategy dynamically adjusts the new and old training weights to achieve the goal of balanced training of new and old data. The specific operation process is as follows:

[0097] 1. Feature compression: The network features of the old data (such as the first output feature mentioned above) are encoded and decoded for training, and the encoded compressed features are stored.

[0098] 2. Incremental training: The compressed features from step 1 are restored to network features (such as the third output feature mentioned above) through the decoding network and incrementally trained together with the new data.

[0099] 3. Preventing forgetting: During incremental training, regularization strategies (knowledge distillation, parameter regularization, etc.) are used to regularize and constrain basic knowledge (such as the output of the initial training data after processing by the initial model, the parameters of each layer of the initial model, etc.) to reduce the forgetting of old knowledge caused by feature compression.

[0100] 4. Balanced Optimization: The sampling ratio of new and old data and the loss weight are dynamically adjusted using a balanced strategy to achieve balanced training of new and old knowledge.

[0101] Based on the above process, a schematic diagram of the incremental learning system according to functional modules in this application embodiment can be found here. Figure 2 ,like Figure 2 As shown, it may include: a feature compression module, an incremental training module, a forgetting prevention module, and a balance optimization module.

[0102] The functions of each module are explained below.

[0103] I. Feature Compression Module

[0104] The feature compression module stores old data (i.e., the initial training data mentioned above) in the form of compressed features, reducing data storage space while improving data security and ensuring that the original images of old data are not involved in the online incremental training process.

[0105] For example, compressed features can be encrypted using a preset encryption method before storage. Accordingly, when it is necessary to decompress the compressed features, decryption can be performed first.

[0106] The feature compression process can be found in [reference]. Figure 3A .like Figure 3A As shown, deep convolutional networks can be divided into three parts: shallow networks, deep networks, and prediction layers. Shallow networks and deep networks correspond to shallow feature extractors and deep feature extractors for the task, respectively. Prediction layers are related to the task itself, such as fully connected layers for classification and head layers for detection.

[0107] 1.1 Fix all network parameters of the old model (i.e. the initial model mentioned above), and extract shallow features (i.e. the first output feature mentioned above) from the shallow network of the old model. The shallow feature x is then fed into the autoencoder for reconstruction training.

[0108] For example, an autoencoder is a neural network that learns an efficient representation of input data. The autoencoder framework consists of two main modules: an encoder network and a decoder network. The encoder network (g) maps the input sample x to the feature space z, which is the encoding process; then the decoder network (f) maps the abstract features z back to the original space to obtain the reconstructed sample x', which is the decoding process. The optimization objective is to simultaneously optimize the encoder and decoder networks by minimizing the reconstruction error, thereby learning the abstract feature representation z for the input sample x. The optimization objective function is as follows:

[0109] f, g = argmin f,g L mse (x, x′(f, g))

[0110] Even if the input sample x is encoded by the encoding network g and decoded by the decoding network f, the resulting reconstructed sample x' has the smallest difference from x.

[0111] 1.2 The decoded and restored shallow feature x' needs to minimize the task loss on the old model. Therefore, the compressed feature must still retain the ability to recognize the old data y (the label information of the initial training data corresponding to the shallow feature x) after being processed by the old model. Thus, the final overall optimization objective is as follows:

[0112] f, g = argmin f,g (L mse (x, x′(f, g))+Lo (x′(f,g),y))

[0113] Even if the difference between x' and x, and the difference between the output of x' after processing by the old model and y, the sum of the two is minimized.

[0114] II. Incremental Training Module

[0115] The incremental training framework involves jointly training the restored compressed features with new data (i.e., incremental training data). A schematic diagram can be found in [link to diagram]. Figure 3B ,like Figure 3B As shown, it may include:

[0116] 2.1 Initialize the incremental model using the old model;

[0117] For example, the structure of the incremental model is consistent with that of the old model.

[0118] 2.2. The decoding network obtained from training in 1.1 is used to decode the compressed features of the old data to obtain the decompressed shallow features (i.e., the third output feature mentioned above);

[0119] 2.3. Fix the shallow network parameters and extract shallow features of the new data (i.e., the second output feature mentioned above) through the shallow network;

[0120] 2.4: After concatenating the shallow features of the new data with the decompressed shallow features, the deep features are extracted through the deep network corresponding to the deep convolutional network. Finally, the prediction result is output through the task prediction layer. New and old data labels c j Compared with network prediction results Task loss L n Training the network.

[0121] For example, taking a classification task as an example, the loss is as follows:

[0122]

[0123] Where N is the number of labels in the sample, c j For the j-th label, This represents the prediction result for the j-th label.

[0124] III. Module to Prevent Forgetting

[0125] During incremental training, information loss occurs after the old data is compressed, and directly using the decompressed features for incremental training can easily lead to the forgetting of old knowledge.

[0126] For example, based on the above training, a regularization strategy is used to apply regularization constraints to the features and / or parameters of old data during incremental training, reducing the forgetting of old knowledge due to information loss. A schematic diagram can be shown as follows: Figure 3C As shown.

[0127] The following examples use knowledge distillation regularization constraints and parameter regularization constraints.

[0128] For example, knowledge distillation regularization constraint constrains the output probability distribution of old data on the old model and the incremental model to remain unchanged at the feature level; parameter regularization constraint constrains the network parameters that are important to old knowledge to remain unchanged during incremental training at the parameter level, as specifically implemented as follows:

[0129] 3.1 Knowledge distillation regularization constraint: Introduce the teacher network and use its output probability distribution to guide the training of the student network to achieve knowledge transfer.

[0130] Taking a classification task as an example, the compressed features of the old data are processed by the old model (which can be called the old teacher model) and output in softmax for the i-th class. The old data is processed by an incremental model (which can be called a student model) and output in the i-th class using softmax. The corresponding regularization loss is:

[0131]

[0132] Parameter regularization constraint: By regularizing the parameters while learning a new task, the optimization direction of the model is constrained, prompting the model to search for a parameter space that can take into account both old knowledge O (parameters of the deep network and task layer of the old model) and new knowledge N (parameters of the deep network and task layer of the incremental model), thereby solving the problem of catastrophic forgetting of old knowledge. The loss function is shown in the following formula:

[0133]

[0134] Among them, Ω i θ represents the diagonal elements of the Fisher information matrix (the number of which corresponds to the number of parameters in the deep network and prediction layer), used to measure the importance of each model parameter. i These are the parameters of the i-th layer of the incremental model (excluding the shallow network, whose parameters are fixed). These are the parameters of the i-th layer in the old model.

[0135] For example, Figure 3C L in r It can be L r1 With L r2 The sum of the two.

[0136] IV. Balanced Optimization Module

[0137] In incremental learning scenarios, there is often an imbalance in the quantity and distribution of new and old data. The balancing optimization module can ensure balanced training of new and old knowledge from three perspectives: balanced sampling, balanced training, and balanced loss. A diagram illustrating this can be seen as follows: Figure 3D As shown. Wherein:

[0138] 4.1 Balanced Sampling: Compress the features of the old data and perform balanced sampling on the new data to ensure that the old and new data are evenly distributed in a batch of samples during the deep learning training process;

[0139] 4.2 Balanced Training: The Finetune model is introduced to form a new teacher (i.e., the new model mentioned above). The ability to learn new knowledge is improved through knowledge distillation regularization constraints, which together with the regularization constraints of the old knowledge teacher model constitute balanced training.

[0140] The Finetune model is obtained by training it with separate new data in advance.

[0141] 4.3 Balanced Loss: The total incremental training loss (i.e., the final loss mentioned above) consists of the task loss L. n Prior knowledge regularization loss L r And new knowledge regularization loss L f constitute:

[0142] L all =λ n L n +λ r L r +λ f L f

[0143] Where, λ n λ represents the task loss weight. r The weights for the regularized loss based on prior knowledge (i.e., the first regularized loss weights mentioned above), λ f The new knowledge regularization loss weight (i.e., the second regularization loss weight mentioned above).

[0144] For example, to ensure balanced training of new and old knowledge under different distributions of new and old data, we dynamically adjust the weight coefficient λ based on the performance differences between the new and old teacher models and student models on the validation set. r and λ f .

[0145] For example, the performance of the old model teacher on the old data validation set is defined as: Acc old_teacher Define the performance of the incremental student model on the old data validation set as: Acc old_student .

[0146] If the student model performance is less than the teacher model performance β (the value can be set according to actual needs, and its value is less than 1) within a threshold range, then λ r =1; otherwise, decrease λ according to the following rule. r :

[0147]

[0148] Similarly, the performance of the Finetune model for new teachers on the new validation set is defined as: Acc new_teacher Define the performance of the incremental student model on the new validation set as: Acc new_student If the student model performance is less than a threshold range of β times the teacher model performance, then λ f =1, otherwise decrease λ according to a similar rule as described above. f .

[0149] Based on the above overall loss L all Train the incremental learning model.

[0150] It should be noted that the above-mentioned balanced incremental learning method based on feature compression is applicable to various image recognition tasks such as detection, classification, recognition, and segmentation.

[0151] The method provided in this application has been described above. The apparatus provided in this application is described below:

[0152] Please see Figure 4 This is a schematic diagram of the structure of an incremental learning device provided in an embodiment of this application, as shown below. Figure 4 As shown, the incremental learning device may include:

[0153] The initialization unit 410 is used to initialize the incremental model according to the initial model during the incremental training process, so as to obtain the initialized incremental model.

[0154] The incremental training unit 420 is used to train the initialized incremental model based on the incremental training data and the initial training data to obtain the trained incremental model; wherein, during the incremental training process, the initial model and the incremental model are subject to regularization constraints according to a regularization strategy; the regularization constraints include feature-level regularization constraints and / or parameter-level regularization constraints.

[0155] In some embodiments, when the regularization constraint includes feature-level regularization constraints, the incremental training unit applies regularization constraints to the initial model and the incremental model according to a regularization strategy, including:

[0156] Based on the difference between the output of the initial model and the output of the incremental model on the initial training data, the parameters of the incremental model are optimized.

[0157] In some embodiments, when the regularization constraint includes parameter-level regularization constraints, the incremental training unit 420 applies regularization constraints to the initial model and the incremental model according to a regularization strategy, including:

[0158] Based on the differences in parameters between layers in the initial model and the incremental model, the parameters of the deep network and prediction layer of the incremental model are optimized.

[0159] In some embodiments, the incremental training unit 420 trains the initialized incremental model based on the incremental training data and the initial training data, including:

[0160] The initial training data and the incremental training data are subjected to equal sampling to obtain sampled initial training data and sampled incremental training data.

[0161] The initial incremental model is trained based on the initial sampling training data and the incremental sampling training data.

[0162] In some embodiments, the incremental training unit 420 is further configured to perform model training based on the incremental training data to obtain a new model;

[0163] The new model and the incremental model are subject to regularization constraints based on a regularization policy; the final loss of the incremental model is determined based on the first regularization loss corresponding to the initial model and the incremental model, the second regularization loss corresponding to the new model and the incremental model, and the task loss of the incremental model; the training of the incremental model is fed back based on the final loss of the incremental model.

[0164] In some embodiments, the incremental training unit 420 determines the final loss of the incremental model based on the first regularization loss corresponding to the initial model and the incremental model, the second regularization loss corresponding to the new model and the incremental model, and the task loss of the incremental model, including:

[0165] The final loss of the incremental model is determined based on the first regularization loss, the second regularization loss, the task loss, the weights of the first regularization loss, the second regularization loss, and the task loss.

[0166] The first regularization loss weight is determined based on the performance of the initial model on the first validation set and the performance of the incremental model on the first validation set; the second regularization loss weight is determined based on the performance of the new model on the second validation set and the performance of the incremental model on the second validation set.

[0167] In some embodiments, such as Figure 5 As shown, the device further includes:

[0168] The feature compression unit 430 performs feature compression on the first output feature and stores the resulting compressed feature; wherein, the first output feature is the output feature of the initial training data after being processed by the shallow network of the initial model;

[0169] The data processing unit 440 is used to process the incremental training data based on the shallow network of the initialized incremental model to obtain the second output feature;

[0170] The feature decompression unit 450 is used to decompress the compressed feature to obtain the third output feature;

[0171] The incremental training unit 420 is specifically used to train the deep network and prediction layer of the initialized incremental model based on the second output feature and the third output feature.

[0172] In some embodiments, the feature compression unit 430 performs feature compression on the first output feature, including:

[0173] The autoencoder is trained based on the first output feature, and the autoencoder includes an encoding network and a decoding network;

[0174] The first output feature is encoded based on the encoding network in the trained autoencoder;

[0175] The feature decompression unit 450 decompresses the compressed feature, including:

[0176] The compressed features are decoded based on the decoding network in the trained autoencoder.

[0177] In some embodiments, during the training process of the autoencoder, the parameters of the autoencoder are optimized based on the difference between the first output feature and the third output feature, and the difference between the processing results of the third output feature by the deep network and prediction layer of the initial model and the preset label information.

[0178] This application provides an electronic device including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the incremental learning method described above.

[0179] Please see Figure 6 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device may include a processor 601 and a memory 602 storing machine-executable instructions. The processor 601 and the memory 602 can communicate via a system bus 603. Furthermore, by reading and executing the machine-executable instructions corresponding to the incremental learning logic in the memory 602, the processor 601 can execute the incremental learning method described above.

[0180] The memory 602 mentioned in this document can be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.

[0181] In some embodiments, a machine-readable storage medium, such as Figure 6 The memory 602 in the memory, which is a machine-readable storage medium, stores machine-executable instructions that, when executed by a processor, implement the incremental learning method described above. For example, the storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0182] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0183] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. An incremental learning method, characterized in that, include: During incremental training, the incremental model is initialized based on the initial model to obtain the initialized incremental model; wherein, the initial model is obtained by training the model based on the initial training data; Based on the incremental training data and the initial training data, the initialized incremental model is trained to obtain the trained incremental model; wherein, the training data used in the model training process is image data; during the incremental training process, regularization constraints are applied to the initial model and the incremental model according to the regularization strategy; the regularization constraints include feature-level regularization constraints and / or parameter-level regularization constraints. The method further includes: The new model is obtained by training the model based on the incremental training data. The new model and the incremental model are subject to regularization constraints based on a regularization strategy. Based on the first regularized loss corresponding to the initial model and the incremental model, the second regularized loss corresponding to the new model and the incremental model, and the task loss of the incremental model, the final loss of the incremental model is determined. Feedback is provided to the training of the incremental model based on the final loss of the incremental model; Wherein, when the regularization constraint includes feature-level regularization constraints, the step of applying regularization constraints to the initial model and the incremental model according to the regularization strategy includes: Based on the difference between the output of the initial model and the output of the incremental model using the initial training data, the parameters of the incremental model are optimized. And / or, When the regularization constraint includes parameter-level regularization constraints, applying regularization constraints to the initial model and the incremental model according to the regularization strategy includes: Based on the differences in parameters between layers in the initial model and the incremental model, the parameters of the deep network and prediction layer of the incremental model are optimized.

2. The method according to claim 1, characterized in that, The step of training the initialized incremental model based on the incremental training data and the initial training data includes: The initial training data and the incremental training data are subjected to equal sampling to obtain sampled initial training data and sampled incremental training data. The initial incremental model is trained based on the initial sampling training data and the incremental sampling training data.

3. The method according to claim 1, characterized in that, The step of determining the final loss of the incremental model based on the first regularized loss corresponding to the initial model and the incremental model, the second regularized loss corresponding to the new model and the incremental model, and the task loss of the incremental model includes: The final loss of the incremental model is determined based on the first regularization loss, the second regularization loss, the task loss, the weights of the first regularization loss, the second regularization loss, and the task loss. The first regularization loss weight is determined based on the performance of the initial model on the first validation set and the performance of the incremental model on the first validation set; the second regularization loss weight is determined based on the performance of the new model on the second validation set and the performance of the incremental model on the second validation set.

4. The method according to claim 1, characterized in that, Before training the initialized incremental model based on the incremental training data and the initial training data, the method further includes: The first output feature is compressed, and the resulting compressed feature is stored; wherein, the first output feature is the output feature of the initial training data after being processed by the shallow network of the initial model; The step of training the initialized incremental model based on the incremental training data and the initial training data includes: The incremental training data is processed based on the shallow network of the initialized incremental model to obtain the second output feature; Furthermore, the compressed feature is decompressed to obtain the third output feature; Based on the second output feature and the third output feature, the deep network and prediction layer of the initialized incremental model are trained.

5. The method according to claim 4, characterized in that, The feature compression of the first output feature includes: The autoencoder is trained based on the first output feature, and the autoencoder includes an encoding network and a decoding network; The first output feature is encoded based on the encoding network in the trained autoencoder; The decompression of the compressed feature includes: The compressed features are decoded based on the decoding network in the trained autoencoder.

6. The method according to claim 5, characterized in that, During the training process of the autoencoder, the parameters of the autoencoder are optimized based on the difference between the first output feature and the third output feature, as well as the difference between the processing results of the third output feature by the deep network and prediction layer of the initial model and the preset label information.

7. An incremental learning device, characterized in that, include: An initialization unit is used to initialize the incremental model based on the initial model during incremental training to obtain the initialized incremental model; wherein the initial model is obtained by training the model based on the initial training data; An incremental training unit is used to train the initialized incremental model based on incremental training data and the initial training data to obtain a trained incremental model; wherein the training data used in the model training process is image data; during the incremental training process, regularization constraints are applied to the initial model and the incremental model according to a regularization strategy; the regularization constraints include feature-level regularization constraints and / or parameter-level regularization constraints. The incremental training unit is further used to train the model based on the incremental training data to obtain a new model. Regularization constraints are applied to the new model and the incremental model according to a regularization policy; the final loss of the incremental model is determined based on the first regularization loss corresponding to the initial model and the incremental model, the second regularization loss corresponding to the new model and the incremental model, and the task loss of the incremental model; the training of the incremental model is fed back based on the final loss of the incremental model. Wherein, when the regularization constraint includes feature-level regularization constraints, the incremental training unit applies regularization constraints to the initial model and the incremental model according to the regularization strategy, including: Based on the difference between the output of the initial model and the output of the incremental model using the initial training data, the parameters of the incremental model are optimized. And / or, When the regularization constraint includes parameter-level regularization constraints, the incremental training unit applies regularization constraints to the initial model and the incremental model according to the regularization strategy, including: Based on the differences in parameters between layers in the initial model and the incremental model, the parameters of the deep network and prediction layer of the incremental model are optimized.

8. The apparatus according to claim 7, characterized in that, The incremental training unit trains the initialized incremental model based on the incremental training data and the initial training data, including: The initial training data and the incremental training data are subjected to equal sampling to obtain sampled initial training data and sampled incremental training data. The initialized incremental model is trained based on the initial sampling training data and the incremental sampling training data. And / or, The incremental training unit determines the final loss of the incremental model based on the first regularization loss corresponding to the initial model and the incremental model, the second regularization loss corresponding to the new model and the incremental model, and the task loss of the incremental model, including: The final loss of the incremental model is determined based on the first regularization loss, the second regularization loss, the task loss, the weights of the first regularization loss, the second regularization loss, and the task loss. Wherein, the first regularization loss weight is determined based on the performance of the initial model on the first validation set and the performance of the incremental model on the first validation set; the second regularization loss weight is determined based on the performance of the new model on the second validation set and the performance of the incremental model on the second validation set. And / or, The device further includes: The feature compression unit compresses the first output feature and stores the compressed feature; wherein the first output feature is the output feature of the initial training data after processing by the shallow network of the initial model; The data processing unit is used to process the incremental training data based on the shallow network of the initialized incremental model to obtain the second output feature; A feature decompression unit is used to decompress the compressed feature to obtain a third output feature; The incremental training unit is specifically used to train the deep network and prediction layer of the initialized incremental model based on the second output feature and the third output feature. The feature compression unit performs feature compression on the first output feature, including: The autoencoder is trained based on the first output feature, and the autoencoder includes an encoding network and a decoding network; The first output feature is encoded based on the encoding network in the trained autoencoder; The feature decompression unit decompresses the compressed features, including: The compressed features are decoded based on the decoding network in the trained autoencoder. During the training process of the autoencoder, the parameters of the autoencoder are optimized based on the difference between the first output feature and the third output feature, as well as the difference between the processing results of the third output feature by the deep network and prediction layer of the initial model and the preset label information.

9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method as described in any one of claims 1-6.

10. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Building feature learning method for incremental data of remote sensing image

    CN113139487A

  • Target detection method and device based on incremental learning

    CN113205142A