An image classification method based on online continuous learning

By employing parameter importance assessment and a two-layer re-initialization replication weight algorithm, the problems of high model prediction bias and resource consumption in online continuous learning are solved, improving the model's adaptability and accuracy on dynamic tasks and simplifying the training process.

CN119723156BActive Publication Date: 2025-10-31TONGJI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411688556.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-10-31
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

Existing online continuous learning methods based on experience replay suffer from significant prediction biases after training when faced with dynamic and non-stationary tasks. They also consume a lot of resources and are difficult to effectively correct prediction biases in different parts of the model during task transitions.

Method used

The importance of each parameter is evaluated using a parameter importance balancing method. The correlation between parameters and tasks is quantified by Manhattan distance and min-max normalization techniques. The parameter update strategy is dynamically adjusted by combining a real-time gradient modification algorithm and a two-layer re-initialization copy weight algorithm, simulating the human memory system to correct prediction bias.

Benefits of technology

It effectively reduces the prediction bias of the model during task transition, improves the model's adaptability and accuracy on dynamic and non-stationary tasks, simplifies the training process, saves resource consumption, and enables real-time training and validation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723156B_ABST
    Figure CN119723156B_ABST
Patent Text Reader

Abstract

This invention relates to an image classification method based on online continuous learning, comprising the following steps: training a deep neural network for each task; evaluating the importance of parameters in the network after training for each task and determining importance coefficients; modifying gradients in real time during continuous network training based on the importance coefficients; initializing the weights of the deep neural network for the next task training using a two-layer re-initialization copy weight algorithm; repeating the above steps for continuous online learning until the deep neural network training for all tasks is completed; inputting the different categories of images to be verified into the trained deep neural network, performing single-head image classification, and obtaining the image classification results. Compared with existing technologies, this invention has advantages such as maintaining network stability and accuracy when facing task transfer and high training efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image classification technology, and in particular to an image classification method based on online continuous learning. Background Technology

[0002] Image classification is a crucial computer vision task, widely used in fields such as face recognition, medical image analysis, and automatic label generation. With the rapid development of deep learning technology, neural network-based models have demonstrated superior performance when handling complex datasets. These models can effectively extract features from large-scale data and perform accurate classification. However, traditional models often require retraining when faced with new categories, leading to inefficiency and wasted resources. To address this issue, continuous learning-based image classification models have emerged, which can effectively retain existing knowledge while continuously receiving new data. This advancement allows image classification tasks to adapt more flexibly to dynamically changing environments, further propelling the development of the computer vision field.

[0003] Deep neural networks (DNNs) are widely used in the field of artificial intelligence due to their superior learning capabilities. However, when dealing with non-stationary sequence data, a phenomenon commonly known as catastrophic forgetting has been observed, where models forget previously learned knowledge after acquiring new experiences. This phenomenon is essentially the stability-plasticity dilemma faced by DNNs. To alleviate the stability-plasticity dilemma and achieve human-like learning capabilities, continuous learning methods have been extensively studied. Especially in more realistic online environments, sequence training data is presented as dynamic, one-off data streams. In this case, models not only need to contend with the stability-plasticity dilemma caused by catastrophic forgetting but also with the accuracy-efficiency dilemma. Existing effective methods mainly employ strategies that replay past samples or representations. These methods are often referred to as experience-based online continuous learning (ER-based OCL). In recent years, research on these methods has been considered crucial for enabling DNNs to continuously acquire new knowledge in dynamic and non-stationary sequence tasks. However, existing ER-based OCL methods still face the problem of significant prediction bias after training.

[0004] Several existing continuous learning methods related to parameter isolation demonstrate that different parts of a neural network have varying importance in correcting prediction bias for different tasks. In these parameter isolation methods, masks are typically used to fix or adjust parameters closely related to previously learned tasks. These methods are effective in improving the overall accuracy of the model. However, they require assigning different model parameters to each task, which increases storage consumption as the task changes, making them unsuitable for dynamic, non-stationary sequence tasks faced by online continuous learning. Experience-based replay-based online continuous learning methods are considered capable of correcting prediction bias while maintaining relatively low resource consumption. Researchers have made various improvements to ER-based OCL, such as sample selection methods and loss function adjustments. However, research on ER-based OCL has rarely focused on the impact of independent parameter changes in different parts of the model during training, which could further reduce prediction bias on dynamic, non-stationary tasks. Summary of the Invention

[0005] The purpose of this invention is to provide an image classification method based on online continuous learning, which optimizes the prediction bias of deep neural networks on dynamic and non-stationary tasks.

[0006] The objective of this invention can be achieved through the following technical solutions:

[0007] This invention first proposes a Parameter Importance Balancing (PIB) method, which updates all model parameters and output layer parameters at different stages to correct prediction biases for all neurons and output layer neurons respectively. First, to evaluate the importance of each individual parameter in preserving prior task knowledge, this invention monitors parameter changes in each Online Continuous Learning (OCL) task. The relevance of parameters to the task is quantified by using Manhattan distance measurements before and after task transitions, supplemented by a min-max normalization technique. To reduce time and space overhead, only the maximum value of each parameter's real-time importance update is retained throughout the training process.

[0008] Using this importance metric, this invention designs a unique gradient descent coefficient for each parameter and incorporates asymmetric cross-entropy. This method encourages the network to retain parameters that are more important to previous tasks during backpropagation, while rapidly updating parameters with less impact, thereby correcting prediction biases caused by updates to individual parameters during task transitions.

[0009] This invention draws inspiration from the human memory system and proposes a novel method called the Two-Layer Reinitialization Copy Weight Algorithm to address the catastrophic forgetting problem caused by rapid updates to the output classifier. In the human memory system, there are three distinct storage mechanisms: sensory memory, short-term memory, and long-term memory. These memory forms interact to overcome forgetting and consolidate knowledge. In the Two-Layer Reinitialization Copy Weight Algorithm, the parameters obtained through gradient descent are considered sensory memory, and the first layer of consolidation transfers knowledge to the short-term memory pool. Then, based on defined probabilistic knowledge, it is further consolidated into the long-term memory pool. Finally, the knowledge stored in the long-term memory pool is used for prediction. This two-layer consolidation strategy can correct prediction biases caused by the output classifier.

[0010] The online continuous learning method proposed in this invention needs to achieve the following:

[0011] (1) Parameter importance evaluation algorithm: This algorithm is responsible for monitoring and evaluating the importance of each parameter in different tasks. It uses Manhattan distance to calculate parameter changes and performs min-max normalization to quantify the relevance of parameters to tasks.

[0012] (2) Real-time gradient modification algorithm: This algorithm dynamically adjusts the gradient descent coefficients according to the importance of the evaluated parameters to ensure that the network retains important parameters during backpropagation, while allowing minor parameters to be updated quickly to reduce prediction bias.

[0013] (3) Double-layer reinitialization copy weight algorithm: This algorithm simulates the storage mechanism of human memory, regards the parameters obtained by gradient descent as sensory memory, and transfers knowledge to short-term and long-term memory pools through the first layer of consolidation and defined probabilities, so as to effectively utilize the knowledge stored in long-term memory during prediction and prevent catastrophic forgetting.

[0014] In summary, this invention provides an image classification method based on online continuous learning, comprising the following steps:

[0015] Step S1: Train a deep neural network for each task, evaluate the importance of the parameters in the network after training for each task, and determine the importance coefficients;

[0016] Step S2: Modify the gradient in real time during continuous network training based on the importance coefficient;

[0017] Step S3: Initialize the weights of the deep neural network for the next task training using the double-layer re-initialization copy weight algorithm;

[0018] Step S4: Repeat steps S1 to S3 for continuous online learning until the deep neural network training for all tasks is completed;

[0019] Step S5: Input the different categories of images to be verified into the trained deep neural network to perform single-head image classification and obtain the image classification results.

[0020] Compared with the prior art, the present invention has the following beneficial effects:

[0021] (1) This invention improves upon traditional continuous learning methods by proposing a parameter importance evaluation mechanism. By monitoring changes in parameters across different tasks, the update strategy for parameters is dynamically adjusted. This innovation effectively corrects prediction bias and enhances the model's adaptability across different tasks.

[0022] (2) This invention introduces a real-time gradient modification algorithm, which dynamically adjusts the gradient descent coefficient according to the importance of the parameters, ensuring that parameters important to previous tasks are better preserved during backpropagation, while minor parameters are updated quickly, thereby maintaining the stability and accuracy of the model when facing task transfer.

[0023] (3) This invention proposes a two-layer reinitialization copy weight algorithm to simulate the human memory system. It adopts a two-layer consolidation strategy to effectively solve the catastrophic forgetting problem of the output classifier by transferring knowledge from sensory memory to short-term and long-term memory pools, thereby improving the overall performance of the model.

[0024] (4) This invention supports online training and optimization, simplifies the training process of the entire continuous learning process, saves the required time, realizes real-time training and verification, and the model has practicality and efficiency. Attached Figure Description

[0025] Figure 1 This is a flowchart of the method of the present invention;

[0026] Figure 2 This is a schematic diagram of the image classification process of the present invention;

[0027] Figure 3 This is a schematic diagram of the parameter importance assessment and real-time gradient modification method.

[0028] Figure 4 A schematic diagram of the process of re-initializing the replication weight algorithm for two layers. Detailed Implementation

[0029] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0030] like Figure 1As shown, this embodiment provides an image classification method based on online continuous learning, which mainly includes a parameter importance evaluation method, a real-time gradient modification method, and a two-layer reinitialization and replication weight method. These three methods together constitute a continuously learning deep neural network training process, thus enabling its application to image classification. Figure 2 As shown. Specifically, the method includes the following steps:

[0031] Step S1: Train a deep neural network for each task, evaluate the importance of the parameters in the network after training for each task, and determine the importance coefficients.

[0032] Specifically, the Manhattan distance of parameter changes per task is used to represent the importance of the parameter to the task, and two normalizations are performed to preserve the relative changes of the parameter and limit the range of changes in the parameter importance. This includes the following steps:

[0033] Step S11: After training for each task k (k>1), the optimized network parameters θ are recorded by capturing the state of the deep neural network when the sample of task k+1 first appears. k The network parameters include network weights {w} {1,k} ,…,w {m,k} ,…,w {M,k}}, where M represents the total number of parameters.

[0034] Step S12: To measure the change in specific weights, calculate the Manhattan distance between the network weight parameters after training for the current task and the network weight parameters after training for the previous task:

[0035] δ {m,k} =|w {m,k} -w {m,k-1} |,

[0036] Where, δ {m,k} The weight w represents the weight between task k and k-1. {m,k} Manhattan distance.

[0037] Step S13: Perform mean-based normalization and min-max normalization on the Manhattan distance to obtain the importance measure of each parameter on the current task k.

[0038] Due to the change in the network model, δ {m,k} The magnitudes can vary significantly. To address this issue, we can compare δ with its mean. {m,k} Normalization is performed to reduce the influence of its original scale, retaining only relative changes:

[0039]

[0040] Where, δ ′m,k δ m,k The mean normalized value is used. This normalization ensures that the impact of changes in each parameter is proportional to its relative importance, rather than being directly affected by its absolute scale. Through this method, the present invention effectively mitigates the variability introduced by different network architectures, thereby achieving a more consistent assessment of parameter importance across tasks.

[0041] Changes between neurons can vary considerably. For example, one neuron might change by 10, while another neuron might change by 1 × 10. -6 The former may vary by several orders of magnitude more than the latter. This difference does not necessarily mean that the first neuron is more important than the second neuron in task k. To address this issue, this invention applies min-max normalization to limit the importance of each neuron to a standardized range. Using V... k ={δ { ′ 1,k} ,…,δ { ′ M,k} Let} represent the set of Manhattan distances after mean-based normalization, i.e., the set of parameter variations. Then, the importance metric for each parameter related to task k is given by the following min-max normalization:

[0042]

[0043] Among them, I m,k Let α and β represent the importance measure of parameter m related to task k, where α and β are hyperparameters defining the range of importance of task-related parameters. m,k It is normalized to the range [α,β]. Typically, I... m,k The default value is 1, which means that when I m,k When α = 1, parameter m is considered to be of average importance in task k. Therefore, the value of the interval [α, β] also determines the standard for measuring parameter importance. When α > 1, it is assumed that all parameters are considered important for any task and should be preserved to some extent. Conversely, when β < 1, it is assumed that all parameters are considered unimportant for any task, suggesting that these parameters should encourage faster updates, which is clearly unrealistic. Therefore, when choosing the values ​​of α and β, it is common to set α < 1 and β > 1.

[0044] By applying the above method, a task-related importance metric can be derived for each parameter in the network across all observed tasks k.

[0045] Step S14: Based on the principle that the deep neural network maintains the maximum task-related importance metric of each parameter throughout the continuous training process, determine the importance coefficient.

[0046] To ensure that parameter importance metrics consistently reflect their relevance and reduce computational and storage overhead, this invention maintains the maximum task-relevant importance of each parameter throughout the training process, resulting in an importance coefficient:

[0047]

[0048] Among them, I m This represents the importance coefficient of parameter m across all previous tasks, and can be calculated in real-time during training, k t Indicates the current task.

[0049] Step S2: Modify the gradient in real time during continuous network training based on the importance coefficient.

[0050] This embodiment adopts the method of directly modifying the gradient of neurons in the neural network training, and incorporates the parameter importance information into the training process to alleviate catastrophic forgetting and retain knowledge of previous tasks.

[0051] The core idea of ​​parameter importance is to prioritize parameters that are critical to the learned task. To this end, after performing stochastic gradient descent (SGD) at each training time step t, the gradients of the parameters are adjusted based on their importance coefficients. Specifically, for each parameter m, its gradient is denoted as g. m,t And the parameter importance coefficient I m As a correction factor, the gradient is corrected using the correction factor:

[0052]

[0053] Among them, g ′ m,t This represents the gradient after adjusting parameter m at time step t, taking into account the importance of this parameter. This correction ensures that more important parameters are updated more cautiously, thus preserving their contribution to previous tasks.

[0054] Deep neural networks use the corrected gradient {g} ′ 1,t ,…,g ′ M,t This update effectively incorporates parameter importance information into the training process. This approach helps manage the trade-off between learning new tasks and retaining knowledge from older tasks, ultimately improving the model's ability to adapt to new tasks without forgetting.

[0055] Step S3: Use the double-layer re-initialization copy weight algorithm to initialize the weights of the deep neural network during the training of the next task, so as to solve the problem of the output classifier parameters being updated too quickly.

[0056] The two-layer reinitialized copy weight algorithm is applied to the deep neural network after each training task during the learning process. It consists of two layers. The first layer simulates the conversion of sensory memory to short-term memory. The weights assigned to the first layer are positively correlated with the intensity of the memory stimulus, which is measured by the proportion of such samples appearing in the current memory versus the proportion of such samples appearing in past memories. In this process, the human brain naturally experiences forgetting, a mechanism designed to prioritize the retention of more important knowledge. The second layer simulates the conversion of short-term memory to long-term memory. The weights assigned to the second process have a weaker positive correlation with the intensity of the memory stimulus, and therefore a square root function is used for modeling.

[0057] Specifically, the double-layer re-initialization replication weight algorithm performs the following steps:

[0058] S31: First, sensory memory originates from knowledge acquired during training, specifically the model parameters obtained through gradient descent. Mean shift can easily normalize the output classification layer model parameters, maintaining their size within a certain range and highlighting single-class features; therefore, this technique is used to simulate sensory memory. The sensory memory of the output classifier is defined as the weights of the parameters defined for each class appearing after each training round, minus the mean of the weights for all classes appearing in that round, i.e.:

[0059]

[0060] in, ω represents the network's sensory memory of class j at time step t. j,t S represents the j-th parameter of the classification layer at time step t. t This represents the set of sample labels input to the network at time step t. It's worth noting that mapping the output layer parameters to each class is determined by the properties of the softmax activation function. The softmax function connected to the last linear layer transforms the output layer parameters into the classification probability of each class.

[0061] S32: In complementary memory systems, the hippocampus is responsible for converting sensory memories into short-term memories by selectively processing certain information. The first layer of the two-layer reinitialization copy weighting algorithm simulates this process in the hippocampus. When sensory memories are received, the two-layer reinitialization copy weighting algorithm randomly selects one of the following two actions to perform:

[0062] 1) Integrate current sensory memories with existing short-term memories;

[0063] 2) Retain previous short-term memories, without processing current sensory memories;

[0064] The short-term memory of the network at time step t for processing category j is calculated as follows:

[0065]

[0066] Where ∈ is a random variable uniformly distributed in the interval [0,1], and p is a hyperparameter representing the probability that the network converts sensory memory into short-term memory. The short-term memory retention coefficient of category j at time step t is calculated as follows:

[0067]

[0068] Among them, P j,t U represents the number of times category j appears at time step t during network training. j,t This indicates the number of times category j appears in the label set.

[0069] S33: The neocortex is responsible for converting short-term memories into long-term memories, and the more frequently a particular type of memory is reviewed, the more consolidated that memory becomes. The second layer of the two-layer re-initialization copy weighting algorithm simulates this process in the neocortex by fusing short-term memories with existing long-term memories according to a specified retention ratio.

[0070] The network's long-term memory for processing class j at time step t is calculated as follows:

[0071]

[0072] in, The long-term memory retention coefficient of category j at time step t is represented by the following method:

[0073]

[0074] Step S4: Repeat steps S1 to S3 for continuous online learning until the deep neural network training for all tasks is completed.

[0075] Based on the first three steps and combined with the asymmetric cross-entropy loss function, the loss function for continuous training of deep neural networks is constructed as follows:

[0076]

[0077] in, Represents the cross-entropy loss function. and These represent the cross-entropy loss of the data stream and the data retrieved from the memory buffer, respectively. and This represents the subset of training samples at time step t. This indicates the categories encountered so far. Refers to the current training category.

[0078] Step S5: Input the different categories of images to be verified into the trained deep neural network to perform single-head image classification and obtain the image classification results.

[0079] According to experimental results, the present invention can still maintain a certain accuracy in image classification even in scenarios where new categories appear and continuous learning is performed.

[0080] This embodiment applies the method to the CIFAR-10 dataset and compares it with some classic methods in online continuous learning (ER, iCaRL, MIR, DER++, ER-ACE, AR1*). The results are shown in Table 1 below (M represents the number of samples in the replay memory pool, ACC represents the method accuracy (the higher the better), and FR represents the method forgetting rate (the lower the better).

[0081] Table 1 Comparison of experimental results

[0082]

[0083]

[0084] In experiments on CIFAR-10 under the standard OCL scenario, different memory buffer sizes significantly impacted performance metrics. The iid method revealed the upper limit of network model learning accuracy on this dataset (without forgetting issues). In scenarios with M=20, M=100, and M=500, this invention demonstrated a significant accuracy advantage over other baseline methods, achieving an average accuracy improvement of 39.2% compared to the ER method. Furthermore, this invention further reduces the FR metric based on ER-ACE and AR1*, exhibiting the lowest FR metric at M=20 and M=100 settings, demonstrating its superior performance in effectively consolidating past knowledge.

[0085] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. An image classification method based on online continuous learning, characterized in that, Includes the following steps: Step S1: Train a deep neural network for each task, evaluate the importance of the parameters in the network after training for each task, and determine the importance coefficients; Step S2: Modify the gradient in real time during continuous network training based on the importance coefficient; Step S3: Initialize the weights of the deep neural network for the next task training using the double-layer re-initialization copy weight algorithm; The two-layer re-initialization replication weight algorithm comprises two layers. The first layer simulates the conversion from sensory memory to short-term memory. The weights assigned to the first layer are positively correlated with the intensity of the memory stimulus, which is measured by the proportion of such samples appearing in the current memory versus the proportion of such samples appearing in past memories. The second layer simulates the conversion from short-term memory to long-term memory. The weights assigned to the second process are weakly positively correlated with the intensity of the memory stimulus, and are modeled using a square root function. The two-layer re-initialization replication weight algorithm performs the following steps: S31: Define the sensory memory of the output classifier as the weights of the parameters defined for each class that appears after each round of training, minus the average weights of all classes that appear in that round, i.e.: in, Represents time step Time network for class Sensory memory Indicates time step Output the class of the classification layer at time Classification weights Represents time step The set of sample labels input into the network; S32: The first layer of the double-layer reinitialization copy weight algorithm simulates the hippocampal process. When sensory memories are received, the double-layer reinitialization copy weight algorithm randomly selects one of the following two actions to execute: 1) Integrate current sensory memories with existing short-term memories; 2) Retain previous short-term memories, without processing current sensory memories; The network is calculated at time step as follows: Processing Category Short-term memory : in, It is a random variable that is uniformly distributed in the interval [0, 1]. It is a hyperparameter that represents the probability that the network will convert sensory memories into short-term memories. Indicates time step Previous category The short-term memory retention factor is calculated as follows: in, Indicate category During network training, at time step Number of times it appears Indicate category The number of times it appears in the tag set; S33: The second layer of the double-layer reinitialization replication weight algorithm simulates the neocortical process by fusing short-term memory with existing long-term memory according to a specified retention ratio; The network is calculated at time step as follows: Upper processing category Long-term memory : in, Indicates time step Previous category The long-term memory retention factor is calculated as follows: Step S4: Repeat steps S1 to S3 for continuous online learning until the deep neural network training for all tasks is completed; Step S5: Input the different categories of images to be verified into the trained deep neural network to perform single-head image classification and obtain the image classification results.

2. The image classification method based on online continuous learning according to claim 1, characterized in that, Step S1 includes the following steps: Step S11: In each task After training, By capturing tasks The optimized network parameters are recorded by using the state of the deep neural network when the sample first appears. The network parameters include network weights. ,in Indicates the total number of parameters; Step S12: Calculate the Manhattan distance between the network weight parameters after training for the current task and the network weight parameters after training for the previous task; Step S13: Perform mean-based normalization and min-max normalization on the Manhattan distance to obtain the value of each parameter in the current task. k The importance metric; Step S14: Based on the principle that the deep neural network maintains the maximum task-related importance metric of each parameter throughout the continuous training process, determine the importance coefficient.

3. The image classification method based on online continuous learning according to claim 2, characterized in that, The Manhattan distance is calculated as follows: in, Indicates task and weight and The Manhattan distance between them.

4. The image classification method based on online continuous learning according to claim 3, characterized in that, The mean-based normalization process is expressed as follows: in, express The normalized mean value.

5. The image classification method based on online continuous learning according to claim 4, characterized in that, The minimum-maximum normalization process is expressed as follows: in, Representation and Task The relevant first The importance measure of each parameter This represents the set of Manhattan distances after mean-based normalization. and It is a hyperparameter that defines the range of importance of task-related parameters.

6. The image classification method based on online continuous learning according to claim 5, characterized in that, The importance coefficient is expressed as: in, Indicates the first The importance coefficients of each parameter in all previous tasks Indicates the current task.

7. The image classification method based on online continuous learning according to claim 1, characterized in that, Step S2 specifically involves: for the first... Let the gradient of the given parameters be denoted as . And the parameter importance coefficient As a correction factor, the gradient is corrected using the correction factor: in, Indicates at time step The above is the first The gradient after adjusting each parameter; Deep neural networks use modified gradients Update, among which This indicates the total number of parameters.

8. The image classification method based on online continuous learning according to claim 1, characterized in that, The loss function of the deep neural network during continuous training is expressed as: in, Represents the cross-entropy loss function. and These represent the cross-entropy loss of the data stream and the data retrieved from the memory buffer, respectively. and These represent the time steps retrieved from the memory buffer and the data stream, respectively. t A subset of training samples This indicates the categories encountered so far. Refers to the current training category.

Citation Information

Patent Citations

  • Regularization continuous learning method based on Bayesian parameter updating and weight memory

    CN116206337A

  • Continuous learning method for reasonably forgetting visual task knowledge in open domain environment

    CN117876765A