A self-supervised continuous learning method based on information loss mechanism

By introducing the InfoDrop mechanism into the self-supervised model, the amount of self-information of image blocks is calculated to selectively discard unimportant information, and a self-supervised continuous learning framework is constructed, which solves the adaptability problem of the deep learning model under changes in data distribution and significantly improves The robustness and adaptability of the model slow down the phenomenon of catastrophic forgetting.

CN115952851BInactive Publication Date: 2024-10-01UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211375805.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-04
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing deep learning models are unable to adapt to changes in data distribution when faced with changing environments, resulting in poor performance in continuous learning tasks, especially under unsupervised conditions. There is a lack of effective methods to maintain the robustness and robustness of the model. Adaptability.

Method used

Introduce the InfoDrop mechanism to selectively discard unimportant image information by calculating the self-information amount of image blocks, build a self-supervised continuous learning framework based on information loss, combine the self-supervised loss paradigm and the InfoDrop loss term, and optimize the model to operate under limited capacity. Extract important features and maintain model performance.

Benefits of technology

It significantly improves the performance of the self-supervised model in continuous learning tasks, slows down the catastrophic forgetting phenomenon, enhances the robustness and adaptability of the model, avoids the need for fine-tuning of the model, and is suitable for a variety of continuous learning strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115952851B_ABST
    Figure CN115952851B_ABST
Patent Text Reader

Abstract

The present invention proposes a self-supervised continuous learning method based on an information loss mechanism, including: (1) an unsupervised continuous learning framework based on information loss to encourage the model to learn only important feature representations on continuous tasks; (2) an InfoDrop loss term based on the self-supervised learning paradigm to help the model extract important feature representations of test samples after removing the Infodrop mechanism during the test phase. In addition, the unsupervised continuous learning framework proposed in the present invention can be used simultaneously with most continuous learning strategies. By discarding unimportant image information, the model only focuses on the feature representation of important image information to alleviate the limitation of model capacity, and improves the performance of the self-supervised model without introducing samples of historical tasks or parameter information of historical models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing and is mainly used to improve the performance of a self-supervised continuous learning model; it is mainly used in the field of image classification. Background Art

[0002] In recent years, deep learning (DL) has achieved remarkable success in machine learning, natural language processing and other fields. The focus of DL is to develop deep neural networks (DNN) by using fixed or predefined data sets for offline training. DNNs have shown remarkable performance on corresponding tasks. However, DNNs also have limitations. The trained DNNs are fixed, and the parameters inside the network will not change during operation, which means that DNNs will remain static after deployment and cannot adapt to changing environments. Real-world applications are not all single. In particular, applications related to autonomous agents involve processing continuously changing data. Over time, the data or tasks faced by the model will change. Static models do not perform well in such scenarios. One possible solution is to retrain the network when the data distribution changes. However, full training with an expanded data set is a computationally intensive task, which is impossible to achieve in the real world with limited computing resources. This leads to the need for a new algorithm that can achieve continuous learning under the condition of efficient resource utilization.

[0003] Continuous learning has demands and challenges in many real-world scenarios: robots need to autonomously learn new behavioral norms based on environmental changes in order to adapt to new environments and complete new tasks; autonomous driving programs need to adapt to different environments, such as from rural roads to highways, from well-lit places to dim environments; intelligent dialogue systems need to adapt to different users and scenarios; and smart medical applications need to adapt to new cases, new hospitals, and inconsistent medical conditions.

[0004] Continuous learning (CL) studies the problem of learning in non-stationary data streams. Its goal is to expand the adaptability of the model so that the model can learn corresponding knowledge in different tasks and remember the features learned in historical tasks. Depending on whether the input data has labels, continuous learning can be divided into supervised continuous learning (SCL) and unsupervised continuous learning (UCL). Supervised continuous learning often focuses on a series of related tasks. By adding artificially given labels to the input data, task information and task boundary information that needs to be generalized can be obtained. This setting no longer meets the needs of real-world scenarios: task labels are unknown, task boundaries are not clearly defined, and a large amount of class-labeled data is unavailable, which leads to unsupervised continuous learning and self-supervised continuous learning methods. Self-supervised learning is a part of unsupervised learning, which aims to eliminate the need for manual labeling in representation learning. Self-supervised learning uses unlabeled raw information to learn data representation. A true self-supervised continuous learning algorithm can use a continuously input non-independent and identically distributed data stream to learn a robust and adaptive model without forgetting the knowledge obtained in the past.

[0005] In recent years, CL research has mainly focused on SCL. These research results are usually not extended to practical application scenarios with biased data distribution. Therefore, UCL research that does not rely on manual annotation or supervised information has gradually attracted attention. Although the research time is short, the research problems are complex, and there are few results in the field of UCL, there are results that show that relying on manually labeled data is not necessary for continuous learning. Unsupervised visual representation can alleviate the problem of catastrophic forgetting, and UCL can perform better than SCL. References: Madaan, D., Yoon, J., Li, Y., Liu, Y., & Hwang, S. J. (2021, September). Representational continuity for unsupervised continual learning. In International Conference on Learning Representations. In order to improve the performance of unsupervised models, a model-independent lightweight method, namely information loss (InfoDrop), has attracted attention. This method improves the robustness and interpretability of the model by reducing the texture bias of Convolutional Neural Networks (CNN). References: Shi, B., Zhang, D., Dai, Q., Zhu, Z., Mu, Y., & Wang, J. (2020, November). Informative dropout for robust representation learning: A shape-bias perspective. In International Conference on Machine Learning (pp. 8828-8839). PMLR. Unsupervised continuous learning has extremely high research value and is one of the key technologies for building a true intelligent agent. This invention is committed to combining the information loss mechanism with the unsupervised continuous learning framework to improve the performance of the model, build a more robust and reasonable continuous learning model, and promote the continuous development of unsupervised continuous learning technology. Summary of the invention

[0006] The present invention is a self-supervised continuous learning method, which introduces the InfoDrop mechanism into the self-supervised model to enable the model to extract important image features in the continuous learning task. The method selects to discard unimportant image information by calculating the self-information of the image block, guides the model to focus on the important areas of the image information, and thus improves the performance of the self-supervised model.

[0007] The method first constructs a self-supervised continuous learning framework based on the information loss mechanism, divides the CIFAR-10 dataset into 5 tasks, trains the model on the corresponding dataset according to the order of task arrival, and uses the KNN algorithm to test the accuracy of the model. The method focuses on introducing the information loss mechanism in the self-supervised learning framework to improve the model performance. From the perspective of model capacity, the present invention mainly does the following work: 1) constructs a self-supervised learning model and a self-supervised continuous learning paradigm; 2) establishes an information loss mechanism based on information volume and Dropout method to help the model lose unimportant features in the image, retain important features, and integrate the information loss mechanism into the framework of self-supervised continuous learning; 3) based on the self-supervised loss paradigm, combined with an InfoDrop loss term, avoids the need to remove the InfoDrop mechanism to fine-tune the model during post-testing; 4) trains on the CIFAR-10 dataset, uses the KNN classification algorithm to test the accuracy of the model on the test set, evaluates the performance of the model, and compares it with a variety of continuous learning strategies. Through the above work, it is verified that the present invention can be applied to a variety of continuous learning strategies and can improve the performance of the model under different strategies. It is an unsupervised continuous learning method with strong applicability.

[0008] In order to conveniently describe the present invention, some terms are first defined.

[0009] Definition 1: Residual Convolutional Neural Network (ResNet). By adding "residual connection" to the convolutional network, the degradation phenomenon of deep network in training is solved, and the trainable depth of the neural network is greatly increased. Compared with the traditional convolutional neural network, the residual network has the advantages of better training and easier optimization. In the present invention, the residual convolutional neural network used is the Resnet18 network.

[0010] Definition 2: Adaptive average pooling layer. The adaptive average pooling layer can compress the spatial dimension, extract the mean of the data in the corresponding dimension, and adaptively output the result of the specified size, which can suppress some useless features to a certain extent.

[0011] Definition 3: SimSiam. This is another name for the Siamese network model. The SimSiam model maximizes the similarity between two augmentations of an image and learns representations without the need for negative sample pairs, large batches, and momentum encoding.

[0012] Definition 4: Dropout method. Dropout is a regularization method that sets a probability of being dropped for neurons in a certain layer of the network and randomly drops certain neurons according to the set probability during training to solve the problem of overfitting of the neural network.

[0013] Definition 5: Image Patch. Patch can be understood as an image block. During the operation of the neural network, the network divides the image into multiple small blocks, and the convolution kernel only looks at one small block at a time. This small block is called a Patch.

[0014] Definition 6: ReLU activation layer. Also known as rectified linear unit, it is an activation function commonly used in artificial neural networks. It usually refers to nonlinear functions represented by ramp functions and their variants, expressed as f(x)=max(0,x).

[0015] The technical solution of the present invention is a method for extracting features of continuous images based on an information loss mechanism, the method comprising:

[0016] Step 1: Preprocess the dataset;

[0017] Obtain images of real-world objects, annotate them according to the categories of the objects, normalize the pixel values ​​of all images, scale and crop the images, and then divide the images into multiple data sets, each of which contains images of different categories;

[0018] Step 2: Build a self-supervised learning model;

[0019] The self-supervised learning model consists of a feature encoder f Θ and feature prediction head h; feature encoder f Θ By feature extraction module f b and feature projection module f g Cascaded: The residual convolutional neural network Resnet18 is used to construct the feature extraction module. Its first layer is a convolutional neural network block, the second to fifth layers are residual network blocks, and the last layer is an adaptive average pooling layer; the feature projection module is composed of two linear layers connected; the feature encoder f Θ The input is an image The output is the feature representation of the image The feature prediction head h is composed of two linear layers connected together. Its input is the image feature z and its output is the prediction of the image feature. Convolutional neural network block structure see Figure 1 , the residual convolutional neural network block structure can be found in Figure 2 , the residual convolutional neural network Resnet18 structure see Figure 3 ;

[0020] Step 3: Construct a self-supervised continuous learning paradigm;

[0021] Self-supervised continuous learning aims to learn a series of unlabeled tasks that arrive in sequence. Learning feature representations for images, with datasets of different distributions for each task t=1,...,T;Generally, an image x is randomly sampled from the data set, and then two image transformation operations are performed on it to obtain two images x of related perspectives 1 and x 2 ; Use the feature encoder to look at a view x of the image 1 Perform feature encoding to obtain its feature z 1 =f(x 1 ), and similarly we can get another perspective x 2 Features of z 2 =f(x 2 ); The goal of self-supervised continuous learning is to enable the model to learn the historical tasks {T1, ..., T τ-1} and the current task T τ The image in represents:

[0022]

[0023] Among them, in small batch samples Calculate the loss term on t=1,...,τ The mean of x i,t Represents the dataset The i-th sample in the small batch of samples randomly sampled from above; the loss term For self-supervised learning loss, the self-supervised loss calculation formula in SimSiam is used here:

[0024]

[0025]

[0026] in is the feature encoder for The output, is the feature prediction head about The prediction of feature representation stopgrad(·) means stopping the gradient back propagation of the variable; ||·||2 is the two-norm operator;

[0027] However, achieving the goal of self-supervised learning is challenging because in the continuous learning setting, it is usually assumed that data from historical tasks are unavailable, which requires At t=1,...,τ-1, solve the model in the data set The optimal parameter Θ on t=1,...,τ *; Therefore, it is necessary to introduce some continuous learning strategies to help the model maintain its performance on historical tasks while learning the current task;

[0028] Step 4: Establish information loss mechanism

[0029] The InfoDrop mechanism is introduced, which is an information-based Dropout method to help continuous learning models discard unimportant features in the image and retain only important features. If the image patch input to the neuron contains less information, the InfoDrop mechanism will set the output of the neuron to zero with a higher probability, otherwise it will retain its output. Specifically, the Boltzmann distribution is used to calculate the first The output of the jth neuron in the cth channel in the layer The discard coefficient is:

[0030]

[0031] in, The neural network The input patch of the jth neuron in the cth channel in the layer; Defined as self-information, when the self-information in the input patch of a neuron is relatively low, the output of the neuron will be discarded with a greater probability, which prompts the neural network to pay less attention to the low-information areas in the image; T is the temperature coefficient, which is a "soft threshold" of the InfoDrop mechanism. When T becomes smaller, that is, the threshold is lowered, most patches will be retained, and only a few patches with low self-information will be discarded; when T becomes infinite, that is, the threshold becomes higher, the InfoDrop mechanism will degenerate into a conventional Dropout mechanism, and all patches will be discarded with equal probability; for The probability distribution of

[0032] To approximate the distribution InfoDrop mechanism assumptions Neighborhood The patches are sampled from the distribution when When the pattern of the patch in its neighborhood is repeated, it will cause a higher And thus get a low self-information; define the distribution The estimate is:

[0033]

[0034]

[0035] Among them, R represents The Manhattan radius of the domain, ||·|| represents the Euclidean distance, h is the bandwidth, and 6 is the bandwidth; from The calculation formula can be observed that when and its neighbors The more different the patches in a, the more self-information it contains, i.e. will be set to zero with a lower probability;

[0036] Step 5: Construct a self-supervised continuous learning framework based on information loss mechanism;

[0037] It is hoped that the model will only learn the feature representations of the areas with important information in the image on the dataset of the current task, and ignore the features of the unimportant areas, so as to ensure that the model can at least learn the key feature representations under the limited model capacity; generally, the InfoDrop mechanism is implemented when optimizing the neural network model on the training set, and the InfoDrop mechanism is cancelled when verifying the performance of the neural network model on the test set. However, since the InfoDrop mechanism will discard most of the areas with low self-information in the image, it will cause a greater distribution deviation between the training dataset and the test dataset, which will affect the performance of the model on the test set; therefore, before testing the model, the model with the InfoDrop mechanism removed is usually optimized for the second time on the training set; however, the second optimization requires additional training time and will also introduce the influence of unimportant information areas in the image on the model; in order to avoid the adverse effects of the second optimization, an information loss mechanism suitable for self-supervised continuous learning is constructed based on the self-supervised learning paradigm; when in the task When training the model, InfoDrop loss is introduced on the basis of the self-supervised loss term, and the following self-supervised learning paradigm with InfoDrop mechanism is constructed:

[0038]

[0039] The self-supervised learning paradigm consists of two items, the first is the original self-supervised loss term, and the second is the InfoDrop regularization term; For models with InfoDrop mechanism The output of Head. and f Θ Shared network weights; By minimizing the InfoDrop regularization term, the model without InfoDrop mechanism can be made Θ Output and models with InfoDrop mechanism Output to make the model f ΘWithout using the InfoDrop mechanism, we actively capture the features of the area with important information and ignore the unimportant features; see the schematic diagram of the method framework for Figure 4

[0040] Step 6: (1) Process the data set according to step 1 to obtain data sets for multiple tasks; (2) Construct an unsupervised learning model according to step 2; (3) Train the model on the training set of each task according to the order in which the tasks arrive;

[0041] Step 7: Use KNN algorithm to evaluate the performance of the model;

[0042] On Task Use KNN classification algorithm to classify model f Θ Steps to perform accuracy test:

[0043] (1) Task The training set on Convert to Feature Library where v i =f Θ (x i );

[0044] (2) Prediction tasks based on feature library The test set samples on Category

[0045] a) Calculate the test sample The feature representation Similarity with each representation in the feature library s ij =cos(f i , v j );

[0046] b) The first K largest items are used as test samples The K nearest neighbor set The weighted voting method is used to calculate the test samples The score on C categories, the category with the highest score is the predicted classification of the test sample, and the test sample The score calculation formula for the jth category is as follows:

[0047]

[0048] Where T is the temperature parameter; test sample The predicted category is

[0049] c) Calculation model f Θ On Task Test accuracy on:

[0050] Step 8: After training the model on each task, use the model’s feature encoder f Θ The feature extraction module in b To represent the features of the images in the test set of each task, the KNN classification algorithm is then used to evaluate the effectiveness of the model’s feature representation. The test results are shown in Table 1.

[0051] The innovation of this paper lies in:

[0052] (1) Based on the InfoDrop mechanism, the present invention establishes a framework that promotes the self-supervised model to extract important features on continuous tasks. In continuous learning tasks, due to the limited capacity of the model, a trade-off will be made between retaining the feature representation ability of past tasks and learning the feature representation ability of the current task. This framework discards unimportant image information so that the model only focuses on the feature representation of important image information, thereby alleviating the limitation of model capacity and improving the performance of the self-supervised model without introducing samples of historical tasks or parameter information of historical models.

[0053] (2) Based on the self-supervised loss paradigm, the present invention designs an InfoDrop loss term. By optimizing the loss term, the model can remove the InfoDrop mechanism during the testing phase and have the ability to directly extract important feature representations of the test samples, thereby avoiding fine-tuning of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 The convolutional network block structure diagram of the method of the present invention

[0055] Figure 2 The residual convolutional neural network block structure diagram of the method of the present invention

[0056] Figure 3 This is the residual convolutional neural network Resnet18 structure diagram of the method of the present invention

[0057] Figure 4 Schematic diagram of the framework of the method of the present invention DETAILED DESCRIPTION

[0058] Step 1: Preprocess the dataset;

[0059] Download the CIFAR-10 dataset (http: / / www.cs.toronto.edu / ~kriz / cifar.html). The CIFAR-10 dataset contains 10 categories of real-world color images. Each category contains 5,000 training images and 1,000 test images, and the image resolution is 32*32*2. Divide the CIFAR-10 dataset into 5 tasks. Each task's dataset contains two random categories of image samples, and the image categories of each task's dataset do not overlap.

[0060] Step 2: Build a self-supervised learning model;

[0061] The self-supervised learning model consists of a feature encoder f Θ And feature prediction head h. Feature encoder f Θ By feature extraction module f b and feature projection module f g Cascaded: The residual convolutional neural network Resnet18 is used to construct the feature extraction module. Its first layer is a convolutional neural network block, the second to fifth layers are residual network blocks, and the last layer is an adaptive average pooling layer; the feature projection module is composed of two linear layers connected. Feature encoder f Θ The input is an image The output is the feature representation of the image The feature prediction head h is composed of two linear layers connected together. Its input is the image feature z and its output is the prediction of the image feature. Convolutional neural network block structure see Figure 1 , the residual convolutional neural network block structure can be found in Figure 2 , the residual convolutional neural network Resnet18 structure see Figure 3 ;

[0062] Step 3: Construct a self-supervised continuous learning paradigm;

[0063] Self-supervised continuous learning aims to learn a series of unlabeled tasks that arrive in sequence. Learning feature representations for images, with datasets of different distributions for each task t=1,...,T. Generally, we will The image x is randomly sampled from the image, and then two image transformation operations are performed on it to obtain two related perspective images x 1 and x 2 . Using the feature encoder to image a view x 1 Perform feature encoding to obtain its feature z 1 =f(x 1 ), and similarly we can get another perspective x2 Features of z 2 =f(x 2 ). The goal of self-supervised continuous learning is to enable the model to learn the historical tasks {T1, ..., T τ-1} and the current task T τ The image in represents:

[0064]

[0065] Among them, in small batch samples Calculate the loss term on t=1,...,τ The mean of x i,t Represents the dataset The i-th sample in the small batch of samples randomly sampled from . The loss term For self-supervised learning loss, the self-supervised loss calculation formula in SimSiam is used here:

[0066]

[0067]

[0068] in is the feature encoder for The output, is the feature prediction head about The prediction of feature representation stopgrad(·) means stopping the gradient back propagation of the variable. ||·||2 is the two-norm operator.

[0069] However, achieving the goal of self-supervised learning is challenging because in the continuous learning setting, it is usually assumed that data from historical tasks are unavailable, which requires At t=1,...,τ-1, solve the model in the data set The optimal parameter Θ on t=1,...,τ * Therefore, it is necessary to introduce some continuous learning strategies to help the model maintain its performance on historical tasks while learning the current task.

[0070] Step 4: Establish information loss mechanism

[0071] The InfoDrop mechanism, an information-based Dropout method, is introduced to help continuous learning models discard unimportant features in the image and retain only important features. If the image patch input to a neuron contains less information, the InfoDrop mechanism will set the output of the neuron to zero with a higher probability, otherwise it will retain its output. Specifically, the Boltzmann distribution is used to calculate the first The output of the jth neuron in the cth channel in the layer The discard coefficient is:

[0072]

[0073] in, The neural network The input patch of the jth neuron of the cth channel in the layer. Defined as self-information, when the self-information in the input patch of a neuron is relatively low, the output of the neuron will be discarded with a greater probability, which prompts the neural network to pay less attention to the low-information areas in the image. T is the temperature coefficient, which is a "soft threshold" of the InfoDrop mechanism. When T becomes smaller, that is, the threshold is lowered, most patches will be retained, and only a few patches with low self-information will be discarded; when T becomes infinite, that is, the threshold becomes higher, the InfoDrop mechanism will degenerate into a conventional Dropout mechanism, and all patches will be discarded with equal probability. for The probability distribution of .

[0074] To approximate the distribution InfoDrop mechanism assumptions Neighborhood The patches are sampled from the distribution when When the pattern of the patch in its neighborhood is repeated, it will cause a higher And thus get a low self-information. Define the distribution The estimate is:

[0075]

[0076]

[0077] Among them, R represents The Manhattan radius of the domain, ||·|| represents the Euclidean distance, h is the bandwidth, and b is the bandwidth. The calculation formula can be observed that when and its neighbors The more different the patches in a, the more self-information it contains, i.e. will be set to zero with a lower probability.

[0078] Step 5: Construct a self-supervised continuous learning framework based on information loss mechanism;

[0079] It is hoped that the model will only learn the feature representations of areas with important information in the image on the dataset of the current task, and ignore the features of unimportant areas, so as to ensure that the model can at least learn the key feature representations under the limited model capacity. Generally, the InfoDrop mechanism is implemented when optimizing the neural network model on the training set, and the InfoDrop mechanism is canceled when verifying the performance of the neural network model on the test set. However, since the InfoDrop mechanism will discard most of the areas with low self-information in the image, it will cause a larger distribution deviation between the training dataset and the test dataset, which will affect the performance of the model on the test set. Therefore, before testing the model, the model with the InfoDrop mechanism removed is usually optimized a second time on the training set. However, the second optimization requires additional training time and will also introduce the influence of unimportant information areas in the image on the model. In order to avoid the adverse effects of the second optimization, an information loss mechanism suitable for self-supervised continuous learning is constructed based on the self-supervised learning paradigm. When in the task When training the model, InfoDrop loss is introduced on the basis of the self-supervised loss term, and the following self-supervised learning paradigm with InfoDrop mechanism is constructed:

[0080]

[0081] This self-supervised learning paradigm consists of two items, the first is the original self-supervised loss term, and the second is the InfoDrop regularization term. For models with InfoDrop mechanism The output of Head. and f Θ Shared network weights. By minimizing the InfoDrop regularization term, the model without InfoDrop mechanism can be made Θ Output and models with InfoDrop mechanism Output to make the model f Θ Without using the InfoDrop mechanism, we actively capture the features of the area with important information and ignore the unimportant features. Figure 4

[0082] Step 6: Process the data set according to step 1 to obtain data sets for multiple tasks; build an unsupervised learning model according to step 2, and train the model on the training set of each task according to the order in which the tasks arrive.

[0083] Step 7: Use KNN algorithm to evaluate the performance of the model;

[0084] On Task Use KNN classification algorithm to classify model f Θ Steps to perform accuracy test:

[0085] (1) Task The training set on Convert to Feature Library where v i =f b (x i );

[0086] (2) Prediction tasks based on feature library The test set samples on Category

[0087] a) Calculate the test sample The feature representation Similarity with each representation in the feature library s ij =cos(f i , v j );

[0088] b) The first K largest items are used as test samples The K nearest neighbor set The weighted voting method is used to calculate the test samples The score on C categories, the category with the highest score is the predicted classification of the test sample, and the test sample The score calculation formula for the jth category is as follows:

[0089]

[0090] Where T is the temperature parameter. Test sample The predicted category is

[0091] c) Calculation model f Θ On Task Test accuracy on:

[0092] Step 8: After training the model on each task, use the model’s feature encoder f Θ The feature extraction module in bTo represent the features of the images in the test set on each task, and then use the KNN classification algorithm to evaluate the effectiveness of the feature representation of the model. The test results are shown in Table 1. The present invention verifies the superiority of the self-supervised continuous learning framework based on the information loss mechanism on five typical continuous learning strategies: FINETUNE, DER, SI, LUMP, and CASSLE. As can be seen from Table 1, the self-supervised continuous learning framework proposed in the present invention can significantly alleviate the catastrophic forgetting phenomenon and improve the accuracy of the model on various tasks.

[0093] Image size: 32*32*3

[0094] The categories of images are: airplanes, cars, birds, cats, deer, dogs, frogs, horses, boats, and trucks.

[0095] Learning rate: 0.003

[0096] Training batch size N: 256

[0097] Iterations: 200

[0098] Table 1 is a graph showing the experimental results of the method of the present invention.

[0099]

Claims

1. A method for continuous extraction of image features based on information loss mechanism, the method comprising: Step 1: Preprocess the dataset; Obtain images of real-world objects, annotate them according to the categories of the objects, normalize the pixel values ​​of all images, scale and crop the images, and then divide the images into multiple data sets, each of which contains images of different categories; Step 2: Build a self-supervised learning model; The self-supervised learning model consists of a feature encoder f Θ and feature prediction head h; feature encoder f Θ By feature extraction module f b and feature projection module f g Cascaded: The residual convolutional neural network Resnet18 is used to construct the feature extraction module. Its first layer is a convolutional neural network block, the second to fifth layers are residual network blocks, and the last layer is an adaptive average pooling layer; the feature projection module is composed of two linear layers connected; the feature encoder f Θ The input is an image The output is the feature representation of the image The feature prediction head h is composed of two linear layers connected together. Its input is the image feature z and its output is the prediction of the image feature. Step 3: Construct a self-supervised continuous learning paradigm; Self-supervised continuous learning aims to learn a series of unlabeled tasks that arrive in sequence. Learning feature representations for images, with datasets of different distributions for each task Randomly sample image x from the data set, and then perform two image transformation operations on it to obtain two related perspective images x 1 and x 2 ; Using the feature encoder to analyze a view x of the image 1 Perform feature encoding to obtain its feature z 1 =f(x 1 ), sample the same method to get another perspective x 2 Features of z 2 =f(x 2 ); The goal of self-supervised continuous learning is to enable the model to learn the historical tasks {T1, ..., T τ-1 } and the current task T τ The image in represents: Among them, in small batch samples Calculate the loss term The mean of x i,t Represents the dataset The i-th sample in the small batch of samples obtained by random sampling, N is the total number of samples; the loss term For self-supervised learning loss, the self-supervised loss calculation formula in SimSiam is used here: in is the feature encoder for The output, is the feature prediction head about The prediction of feature representation stopgrad(·) means stopping the gradient back propagation of the variable; ||·||2 is the two-norm operator; Step 4: Establish information loss mechanism The InfoDrop mechanism is introduced, which is an information-based Dropout method to help continuous learning models discard unimportant features in the image and retain only important features; if the image patch input to the neuron contains less information, the Infodrop mechanism will set the output of the neuron to zero with a higher probability, otherwise it will retain its output; specifically, the output of the jth neuron in the cth channel in the lth layer of the neural network is calculated under the Boltzmann distribution The discard coefficient is: in, is the input patch of the jth neuron in the cth channel in the lth layer of the neural network; Defined as self-information, when the self-information in the input patch of a neuron is relatively low, the output of the neuron will be discarded with a greater probability, which prompts the neural network to pay less attention to the low-information areas in the image; T is the temperature coefficient, which is a "soft threshold" of the InfoDrop mechanism. When T becomes smaller, that is, the threshold is lowered, most patches will be retained, and only a few patches with low self-information will be discarded; when T becomes infinite, that is, the threshold becomes higher, the InfoDrop mechanism will degenerate into a conventional Dropout mechanism, and all patches will be discarded with equal probability; for The probability distribution of To approximate the distribution InfoDrop mechanism assumptions Neighborhood The patches are sampled from the distribution when When the pattern of the patch in its neighborhood is repeated, it will cause a higher And thus get a low self-information; define the distribution The estimate is: Among them, R represents The Manhattan radius of the domain, ||·|| represents the Euclidean distance, h is the bandwidth, and b is the bandwidth; from The calculation formula can be observed that when and its neighbors The more different the patches in a, the more self-information it contains, i.e. will be set to zero with a lower probability; Step 5: Construct a self-supervised continuous learning framework based on information loss mechanism; In order to avoid the adverse effects of the second optimization, an information loss mechanism adapted to self-supervised continuous learning is constructed based on the self-supervised learning paradigm; When training the model, InfoDrop loss is introduced on the basis of the self-supervised loss term, and the following self-supervised learning paradigm with InfoDrop mechanism is constructed: The self-supervised learning paradigm consists of two items, the first is the original self-supervised loss term, and the second is the InfoDrop regularization term; For models with InfoDrop mechanism The output of Head. and f Θ Shared network weights; By minimizing the InfoDrop regularization term, the model without InfoDrop mechanism can be made Θ Output and models with InfoDrop mechanism Output to make the model f Θ Actively capture features of areas with important information without using the InfoDrop mechanism, and ignore unimportant features; Step 6: (1) Process the data set according to step 1 to obtain data sets for multiple tasks; (2) Construct an unsupervised learning model according to step 2; (3) Train the model on the training set of each task according to the order in which the tasks arrive; Step 7: Use KNN algorithm to evaluate the performance of the model; On Task Use KNN classification algorithm to classify model f Θ Steps to perform accuracy test: (1) Task The training set on Convert to feature library where v i =f Θ (x i ); (2) Based on the feature library, prediction task The test set samples on Category a) Calculate the test sample The feature representation Similarity with each representation in the feature library s ij =cos(f i , v j ); b) The first K largest items are used as test samples The K nearest neighbor set The weighted voting method is used to calculate the test samples The score on C categories, the category with the highest score is the predicted classification of the test sample, and the test sample The score calculation formula for the jth category is as follows: Where T is the temperature parameter; test sample The predicted category is c) Calculation model f Θ On Task Test accuracy on: Step 8: After training the model on each task, use the model’s feature encoder f Θ The feature extraction module in b To represent the features of the images in the test sets of each task, and then use the KNN classification algorithm to evaluate the effectiveness of the feature representation of the model.

Citation Information

Patent Citations

  • Training machine learning models on multiple machine learning tasks

    CN109690576A

  • Deepfake video tampering detection method and system

    CN114612847A

  • Human motion prediction method capable of realizing continuous learning

    CN114758195A