A continuous representation learning method based on representation reconstruction
By employing the RRCL method, supervised contrastive learning and representation reconstruction mechanisms are used to address the catastrophic forgetting problem in the representation space during continuous learning. This achieves a good distribution of class representations in the embedding space and improves the transfer performance of the model in downstream tasks.
Patent Information
- Application Number
- CN202310080064.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-08
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2043-02-08
AI Technical Summary
In continuous learning scenarios, especially in the class incremental learning setting, the model suffers severe catastrophic forgetting of the representation space in the task sequence, resulting in alienation of intra-class representations and closeness between classes, which affects the transfer performance of the model in downstream tasks.
We employ a representation reconstruction-based continuous representation learning method (RRCL) to learn new category representations in a fine-grained manner through supervised contrastive learning. By introducing a representation reconstruction mechanism, we utilize memory replay and balanced sampling strategies, combined with the repulsion mechanism of movable anchors, to optimize the distribution of category representations in the embedding space.
While maintaining model stability, it significantly mitigates the impact of representation forgetting, achieves a good class representation distribution, and improves the model's performance in downstream tasks.
Smart Images

Figure CN116186605B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of continuous learning, and in particular to a continuous representation learning method based on representation reconstruction. Background Technology
[0002] In recent years, deep neural networks have demonstrated their superior performance in numerous machine learning tasks. During neural network training, the principle of minimizing empirical risk is typically used for model optimization, and the learning process is based on the assumption of independent and identically distributed (i.i.d.) data. However, in the more common learning of task sequences in reality, this assumption is often not satisfied, leading to catastrophic forgetting. Specifically, when a model is trained using new task data, old knowledge is disrupted by the new information; that is, training the model on the new task dataset will cause its performance on the old tasks to deteriorate significantly.
[0003] In recent years, researchers in the field of continuous learning have proposed many methods to help mitigate forgetting, hoping to maintain the model's "stability" (the model's ability to remember old knowledge) and "plasticity" (the model's ability to learn new knowledge) during the learning process of task sequences. Most existing continuous learning methods adopt an end-to-end training framework and focus on preserving model parameters or functions. For example, regularization methods and knowledge distillation methods are widely used to preserve knowledge of the function space, while parameter isolation fixes a subset of parameters to ensure maximum stability for previous tasks.
[0004] However, compared to knowledge preservation in the function space, the preservation of representational knowledge in the embedding space should be given more attention. First, changes in the task boundary during continuous learning do not necessarily mean that useful knowledge has been forgotten; a simple adjustment, such as using a multi-head classifier or classifier weight reassignment, can restore it. Second, deep neural networks are considered by many scholars as a method for automatic feature extraction, and the representational power of the encoder essentially determines the performance ceiling of the continuous learning framework. Furthermore, people are usually interested not only in the final performance of the model but also in the transfer performance of the learned representations on other downstream tasks (such as object detection, semantic segmentation, style transfer, etc.). In recent years, representations learned by unsupervised representation learning methods have been able to be transferred to various downstream tasks with excellent performance, which also indicates that the preservation of representational knowledge in the embedding space can give the model better transfer performance.
[0005] A good distribution of representations in the embedding space is characterized by intra-class convergence and inter-class sparsity. However, research shows that during task sequence learning, semantically similar representations tend to diverge, while semantically dissimilar representations gradually converge, eventually leading to overlap between different categories. This indicates that category representation knowledge is being forgotten during continuous learning. To address this issue, this paper proposes a continuous representation learning algorithm based on representation reconstruction (RRCL). This algorithm employs a contrastive representation learning training paradigm and introduces a representation reconstruction mechanism to achieve a good distribution of category representations during continuous learning. Summary of the Invention
[0006] The purpose of this invention is to provide a representation reconstruction-based continuous representation learning method (RRCL) that improves upon traditional continuous learning and aims to solve the catastrophic forgetting problem of representation space in continuous learning scenarios.
[0007] Continuous learning scenarios: Continuous learning scenarios are generally divided into three categories, among which Class Incremental Learning (Class-IL) is the most challenging, as research has shown that the model experiences the most severe forgetting under this setting. In the Class-IL setting, the model learns on a task sequence t∈{1,2,...,T}, and can only use the task-specific dataset during training for each task. And Dt are mutually independent, that is During testing for each task, the model needs to be tested on the test set of all learned tasks, and the model cannot access task labels during the testing phase.
[0008] The catastrophic forgetting problem in representation space: During continuous learning, the distribution of category representations evolves towards greater dispersion within classes and greater proximity between classes, leading to the forgetting of representational knowledge. RRCL addresses this problem by employing a representation reconstruction mechanism to achieve a reasonable distribution of category representations during continuous learning, ultimately achieving excellent performance in downstream tasks.
[0009] The technical solution of this invention is:
[0010] A continuous representation learning method based on representation reconstruction includes:
[0011] S1. A supervised contrastive learning training paradigm is adopted to learn representational knowledge in new categories in a fine-grained manner;
[0012] S2. Then, a representation reconstruction method is introduced to reconstruct the category representations that are constantly being destroyed during the continuous learning process.
[0013] Preferably, in S1, a memory replay strategy is adopted, which stores a finite subset of old task training samples and mixes them into the new task samples when training the new task.
[0014] At the end of training for each task, a small subset of training samples is stored in a replay buffer. Only a subset of samples belonging to the old class is retrieved from the replay buffer. Due to buffer size limitations, when new class samples are added, an equal number of old class samples are randomly replaced. When task t arrives, two datasets are available: task-specific data D. t and a tiny replay buffer M containing a finite number of samples of previously observed classes.
[0015] Preferably, in S1, to avoid class imbalance, a balanced sampling strategy is used to obtain a mini-batch X = {x1, x2, ..., x...}. n In this balanced sampling strategy, the reciprocal of the number of samples in each class is used as the probability of a sample from that class being selected.
[0016] For each instance x in the mini-batch k Perform two identical and independent random data augmentations to generate two different perspectives. and Obtain small batches of enhanced views through random data augmentation.
[0017] Preferably, in S1, the view is input to an encoder and a multilayer perceptron, and data instances are mapped to a unit hyperspherical space: Where z i yes The high-dimensional eigenvector φ mapped onto the hypersphere θ G represents the encoder parameterized by θ. η This represents an MLP layer parameterized by η; it uses two fully connected layers with ReLU activation in between;
[0018] After obtaining all the data point vectors, supervised contrastive learning is used to learn the representation knowledge of the new category in a fine-grained manner. The loss function is expressed as Formula 1:
[0019]
[0020] Where A(i) is Except The set of all view indices other than A(i) is the set of all positive sample indices in A(i). A subset of indices with the same labels; furthermore, the similarity calculation function sim(a, b) is defined as the exponential cosine similarity between two vectors, as shown in Equation 2:
[0021]
[0022] Where τ represents a constant scaling factor, and ||*|| represents the Euclidean norm of the corresponding vector.
[0023] Preferably, in S2, a special class center is first introduced as an anchor point. Data points on the hypersphere are placed as close as possible to the class center of their respective classes, prompting the re-aggregation of similar representations on the hypersphere. The anchor point is the normalized mean of all point clusters belonging to the same class on the hypersphere, calculated as follows:
[0024]
[0025] Where, n k It is the number of samples in category k.
[0026] Preferably, in S2, in order to ensure that the representations of different categories are uniformly discrete, the anchor points spontaneously move away from other categories; these movable anchor points will guide the representations of each category on the hypersphere to obtain a more uniformly discrete distribution, thereby completing the reconstruction of the category representations.
[0027] The preferred method for controlling the direction and speed of anchor point movement is as follows:
[0028] An anchor point is subjected to repulsive forces from other anchor points. Projecting all these repulsive forces onto the tangent plane of the hypersphere, the direction of the resultant force of these projections is the direction of the anchor point's movement.
[0029] The magnitude of the repulsive force between anchor points is negatively correlated with the distance between them; the smaller the distance, the greater the repulsive force. The repulsive force exerted on anchor point k by anchor point i is expressed as:
[0030]
[0031] Item G on the left τ (*) represents the magnitude of the force, and the terms on the right represent the unit vector in the direction of the force; the magnitude of the force is estimated using a Gaussian potential kernel, i.e., a radial basis function (RBF) kernel.
[0032]
[0033] Each anchor point moves in the direction of the resultant force of the repulsive forces exerted on it by other classes projected onto the tangential plane; therefore, the movement of anchor point k is expressed as:
[0034]
[0035] Among them, C t It refers to all categories that have been learned during task t, |C t | represents the number of these categories;
[0036] At the start of each epoch of training, update the position of the movable anchor point as shown in Equation 7:
[0037]
[0038] γ is the movement step size, which updates all anchor points simultaneously.
[0039] Preferably, based on the definition of movable anchor points, the definition of the reconstruction loss function is as follows:
[0040]
[0041] The optimization objective of the reconstruction loss function is to maximize the similarity between Data Points and anchor points of their respective categories, and minimize the similarity between Data Points and anchor points of other categories. As anchor points automatically move towards a more uniform distribution, they guide the representations of each category to evolve towards intra-class convergence and inter-class uniform dispersion, ultimately achieving representation reconstruction.
[0042] The preferred, complete loss function is expressed as follows:
[0043]
[0044] λ is the weight coefficient. The encoder of RRCL is obtained by training using this algorithm.
[0045] The advantages of this invention are:
[0046] 1. The present invention is based on a continuous representation learning method for representation reconstruction, which consistently outperforms all other methods on both datasets, especially when the replay buffer space is smaller, the advantage of the RRCL method is more obvious.
[0047] 2. This invention, based on a representation reconstruction-based continuous representation learning method, maintains superior class representation capabilities compared to other methods at all stages of the task. RRCL successfully reconstructs well-distributed class representations, thereby significantly mitigating the impact of representation forgetting. Attached Figure Description
[0048] The present invention will be further described below with reference to the accompanying drawings and embodiments:
[0049] Figure 1 This is a diagram illustrating the overall architecture of the continuous representation learning method based on representation reconstruction of this invention.
[0050] Figure 2 A schematic diagram showing the repulsive force exerted on an anchor point by other anchor points;
[0051] Figure 3 This is a performance comparison chart of the classification task using the method of the present invention;
[0052] Figure 4 This is a comparison chart of the model representation capabilities of the method of the present invention. Detailed Implementation
[0053] Representation Reconstruction-Based Continuous Representation Learning (RRCL) differs from traditional end-to-end continuous learning algorithms in that it aims to obtain an encoder that consistently possesses a good distribution of class representations in the embedding space.
[0054] This invention is a continuous representation learning method based on representation reconstruction. First, it adopts a supervised contrastive learning training paradigm to learn representation knowledge in new categories in a fine-grained manner. Then, it introduces a representation reconstruction method to reconstruct the category representations that are constantly destroyed during the continuous learning process.
[0055] like Figure 1 The diagram shown is the overall architecture of the continuous representation learning method based on representation reconstruction according to the present invention.
[0056] First, RRCL employs a memory-replay strategy, storing a finite subset of training samples from older tasks and mixing them into the new task samples during training for the new task. Specifically, at the end of training for each task, a small subset of training samples is stored in a replay buffer, and only a subset of samples belonging to the old class is retrieved from this buffer. Due to the buffer size limitation, when new class samples are added, an equal number of old class samples are randomly replaced. Therefore, when task t arrives, two datasets are available: task-specific data D. t and a tiny replay buffer M containing a finite number of samples of previously observed classes.
[0057] To avoid class imbalance, we use a balanced sampling strategy to obtain a mini-batch X = {x1, x2, ..., x}. n In this balanced sampling strategy, the reciprocal of the number of samples in each class is used as the probability of a sample from that class being selected. Implementation details are shown in pseudocode 1.
[0058] Pseudocode 1 Balanced Sampling Strategy
[0059]
[0060] For each instance xk in the mini-batch, perform two identical and independent random data augmentations to generate two different perspectives. and This enhancement method allows us to obtain mini-batch enhanced views. Here, the data augmentation strategy used by RRCL is shown in pseudocode 2.
[0061] Pseudocode 2 Data Augmentation Strategies
[0062]
[0063] By inputting a view into an encoder and a multilayer perceptron (MLP), data instances are mapped to a unit hypersphere space. This process can be formally represented as: Where zi is The high-dimensional feature vectors (i.e., data points) mapped onto the hypersphere, φ θ G represents the encoder parameterized by θ. η This represents an MLP layer parameterized by η. Here, RRCL uses two fully connected layers with ReLU activation in between.
[0064] After obtaining all the data point vectors, RRCL uses supervised contrastive learning to learn the representation knowledge of the new category in a fine-grained manner. Its loss function can be expressed as follows:
[0065]
[0066] Where A(i) is Except The set of all view indices other than A(i) is the set of all positive sample indices in A(i). A subset of indices that share the same labels. Furthermore, the similarity calculation function sim(a, b) is defined as the exponential cosine similarity between two vectors, as shown below:
[0067]
[0068] Where τ represents a constant scaling factor, and ||*|| represents the Euclidean norm of the corresponding vector.
[0069] Intuitively, the optimization goal of this loss function is to bring instances of the same class as close as possible in the hypersphere, while keeping instances of different classes as far apart as possible in the hypersphere. This allows for fine-grained learning of intra-class convergent and inter-class discrete representation distributions in new tasks.
[0070] As mentioned earlier, when learning representational knowledge for a new task, the representational knowledge of the old classes is forgotten. Therefore, RRCL introduces a representation reconstruction method to recover the distribution of class representations across all learned tasks. The implementation mechanism of this representation reconstruction method will be explained in detail below.
[0071] First, RRCL introduces special class centers as anchor points. Data points on the hypersphere are positioned as close as possible to the class center of their respective class, prompting the re-aggregation of similar representations on the hypersphere. Unlike the concept of class prototypes in traditional continuous learning methods, the anchor point in RRCL is the normalized mean of all clusters of points belonging to the same class on the hypersphere. This can be calculated as follows:
[0072]
[0073] Where, n k It is the number of samples in category k.
[0074] As the gap between different classes continuously narrows during the learning process, simply using static anchors to attract samples from the same class is insufficient to maintain the discriminative power between the representations of different classes. Therefore, to ensure that the representations of different classes are uniformly discrete, RRCL allows these anchors to spontaneously move away from other classes. These movable anchors guide the class representations on the hypersphere to achieve a more uniform and discrete distribution, thereby completing the reconstruction of the class representations.
[0075] Controlling the direction and speed of movement is key to the design of movable anchor points. In RRCL, inspired by magnetism in the real physical world, like magnets with the same poles on a sphere, one anchor point exerts a repulsive force on other anchor points while simultaneously receiving repulsive forces from them. In the representation reconstruction method, this repulsive force propels the anchor points away from other anchor points, ultimately resulting in a more uniform distribution of anchor points on the hypersphere. Figure 2 As shown, in RRCL, an anchor point is subjected to repulsive forces from other anchor points. Projecting all these repulsive forces onto the tangent plane of the hypersphere, the direction of the resultant force of these projections is the direction of the anchor point's motion. The reason for fixing the direction of motion to the tangent plane is that the value of cosine similarity is most sensitive to movement along the tangent plane.
[0076] Similar to magnetism, the magnitude of the repulsive force between anchor points is negatively correlated with the distance between them; the smaller the distance, the greater the repulsive force. In RRCL, the repulsive force exerted on anchor point k by anchor point i can be expressed as:
[0077]
[0078] Item G on the left τ (*) denotes the magnitude of the force, and the terms on the right represent the unit vector in the direction of the force. The magnitude of the force is estimated using a Gaussian potential kernel (i.e., a radial basis function (RBF) kernel), namely:
[0079]
[0080] Each anchor point moves in the direction of the resultant force of the repulsive forces exerted on it by other classes projected onto the tangential plane. Therefore, the movement of anchor point k can be expressed as:
[0081]
[0082] Among them, C t It refers to all categories that have been learned during task t, |C t | represents the number of these categories.
[0083] Therefore, RRCL updates the position of the movable anchor at the beginning of each epoch of training in the following manner:
[0084]
[0085] Here, γ is the movement step size. Note that all anchor points must be updated simultaneously.
[0086] Based on the above definition of movable anchor points, RRCL defines the reconstruction loss function as follows:
[0087]
[0088] Intuitively, the optimization goal of this loss function is to maximize the similarity between Data Points and their respective class anchors, and minimize the similarity between Data Points and anchors of other classes. As the anchors automatically move towards a more uniform distribution, they guide the representations of each class to evolve towards intra-class convergence and inter-class uniform dispersion, ultimately achieving representation reconstruction.
[0089] The complete loss function of the RRCL algorithm can be expressed as follows, where λ is the weight coefficient:
[0090]
[0091] This algorithm can be used to train an encoder for RRCL that consistently has a good distribution of class representations in the embedding space.
[0092] To accurately convey the training process of the algorithm, this patent uses pseudocode 3 to describe the entire implementation process of the algorithm.
[0093] Complete implementation of the 3RRCL algorithm in pseudocode
[0094]
[0095] The following describes the experimental comparisons during the specific implementation of this invention.
[0096] 1. Experimental setup
[0097] Test platform setup: All experiments were conducted on a server equipped with four NVIDIA V100 GPUs, running Ubuntu 16.04.7 LTS, with a Hygon C86 7151 16-core Processor CPU, CUDA version 11.2, and PyTorch version 1.12.1.
[0098] Datasets: All methods were evaluated on the widely used Split-CIFAR-10 and Split-CIFAR-100 datasets. Split-CIFAR-10 is constructed by splitting the CIFAR-10 dataset into 5 tasks with non-overlapping classes, each task having 2 classes. Split-CIFAR-100 divides the CIFAR-100 dataset into 10 disjoint tasks, each task having 10 classes.
[0099] Benchmarks: RRCL is compared with several state-of-the-art and established continuous learning methods that also employ memory replay strategies. Specifically, the following baselines are selected: three knowledge distillation-based methods (iCarl, Der++, COIL); three gradient-based methods (A-GEM, GSS, MER); two bias-correction methods (BiC, WA); two representation learning methods (SCR, ER-AML), along with performance upper bounds for continuous learning (Joint multi-task learning) and lower bounds for continuous learning (Fine-tuning is not introduced). Comparisons are conducted in two ways: first, by using the classic continuous learning evaluation protocol proposed by Der++ to compare model performance on downstream classification tasks; second, by utilizing the best linear classifier to compare model representation capabilities.
[0100] Performance Comparison for Classification Tasks: To fairly compare each method, ResNet-18 was used uniformly as the backbone network, and all datasets were trained from scratch. At each task stage, a stochastic gradient descent (SGD) optimizer with momentum of 0.9 and weight decay of 0.0001 was used. The first 10 epochs were used for warm-up with an initial learning rate α = 0.01, which was then increased to α = 0.05. All models were trained for 100 epochs using cosine decay of the learning rate, with a decay rate of 0.1, at epochs 60, 75, and 90.
[0101] In performance comparisons for downstream classification tasks, since RRCL does not have a usable linear classifier, it uses a parameterless nearest neighbor mean (NCM) classifier during the inference phase. Specifically, after the encoder completes training, the NCM classifier first uses all embeddings of each class to compute the prototype of that class. The prototype is computed as follows:
[0102]
[0103] Next, instance x i The embedding is compared with all prototypes, and the category of the most similar prototype is used as the predicted category of the instance. In this case, the similarity metric used in cosine similarity classification is employed.
[0104]
[0105] Model Representation Capability Comparison: The linear probe (LP), commonly used in representation learning, is employed to compare the representation capabilities of the models. Specifically, after training for each task, the encoder parameters in the model are frozen, and an optimal linear classifier is trained from scratch using all training data from all past tasks. This method eliminates the bias of the linear classifier at task boundaries, allowing direct comparison of the model's representation capabilities at each stage of continuous learning. For fair comparison, a completely uniform training setup is used during the training of the linear classifier: 100 epochs, a mini-batch size of 256, SGD, momentum of 0.9, an initial learning rate α = 0.01, a warm-up to α = 0.1 for the first 10 epochs, a learning rate decay rate of 0.2, and further learning rate decay at epochs 60, 75, and 90.
[0106] 2. Experimental Results
[0107] Performance comparison results of classification tasks: Figure 3 The mean accuracy ± standard deviation (%) of RRCL and each baseline after 5 runs using different random seeds at the end of training is shown. This evaluates the overall performance of each method on all tasks of Split-CIFAR-10 and Split-CIFAR-100. The best accuracy results of the CL model on each benchmark are marked in bold.
[0108] It can be observed that RRCL consistently outperforms all other methods on both datasets, especially when the replay buffer space is smaller, where the advantage of the RRCL method is more obvious.
[0109] Model representation capability comparison results: To present the results more clearly, only the top five methods in terms of performance in downstream tasks are presented here. Figure 4 The results of representation learning methods such as DER, COIL, sCR, ER-AML, and RRCL using the protocol are shown at various task stages of Split-CIFAR-10.
[0110] The results show that RRCL maintains superior class representation capabilities compared to other methods at all stages of the task. RRCL successfully reconstructs well-distributed class representations, thus significantly mitigating representation forgetting.
[0111] With the rise of modern artificial intelligence technology, the need for on-device model training has become an important research area. The increasing complexity and workload of tasks underscore the necessity of bringing AI model training to the edge. After deploying AI to edge devices, due to data privacy or communication bandwidth limitations, the preferred approach is to continuously train AI models directly on the device. However, due to limitations in device storage space and the non-stationarity of data input, catastrophic forgetting of the model is unavoidable. By introducing the RRCL method, only a very small storage overhead is required to support edge devices in sequentially learning new input data while maintaining the model's learned knowledge.
[0112] The above embodiments are only for illustrating the technical concept and features of the present invention, and are intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be construed as limiting the scope of protection of the present invention. All modifications made according to the spirit and essence of the main technical solution of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A continuous representation learning method based on representation reconstruction, characterized in that, include: S1. A supervised contrastive learning training paradigm is adopted to learn representational knowledge in new categories in a fine-grained manner; S2. Then, a representation reconstruction method is introduced to reconstruct the category representations that are constantly being destroyed during the continuous learning process; The representation reconstruction method specifically involves: introducing movable anchor points and moving them on a hypersphere using a repulsion model to guide the representation distribution; First, a special class center is introduced as the anchor point. Data points on the hypersphere are close to the class center of their respective classes, prompting the re-aggregation of similar representations on the hypersphere. The anchor point is the normalized mean of all clusters of points belonging to the same class on the hypersphere, calculated as follows: Where, n k It is the number of samples in category k; To ensure that the representations of different categories are uniformly discrete, the anchor points spontaneously move away from other categories; these movable anchor points will guide the representations of each category on the hypersphere to obtain a more uniformly discrete distribution, thereby completing the reconstruction of the category representations; The method for controlling the direction and speed of anchor point movement is as follows: An anchor point is subjected to repulsive forces from other anchor points. Projecting all these repulsive forces onto the tangent plane of the hypersphere, the direction of the resultant force of these projections is the direction of the anchor point's movement. The magnitude of the repulsive force between anchor points is negatively correlated with the distance between them; the smaller the distance, the greater the repulsive force. The repulsive force exerted on anchor point k by anchor point i is expressed as: Item G on the left τ (*) represents the magnitude of the force, and the terms on the right represent the unit vector in the direction of the force; the magnitude of the force is estimated using a Gaussian potential kernel, i.e., a radial basis function (RBF) kernel. Each anchor point moves in the direction of the resultant force of the repulsive forces exerted on it by other classes projected onto the tangential plane; therefore, the movement of anchor point k is expressed as: Among them, C t It refers to all categories that have been learned during task t, |C t | represents the number of these categories; At the start of each epoch of training, update the position of the movable anchor point as shown in Equation 7: γ is the movement step size, which updates all anchor points simultaneously; Based on the definition of movable anchor points, the definition of the reconstruction loss function is as follows: The optimization objective of the reconstruction loss function is to increase the similarity between Data Points and anchor points of their respective categories, and to decrease the similarity between Data Points and anchor points of other categories. As the anchor points automatically move towards a more uniform distribution, they guide the representations of each category to evolve towards intra-class convergence and inter-class uniform dispersion, ultimately achieving representation reconstruction.
2. The continuous representation learning method based on representation reconstruction according to claim 1, characterized in that, In S1, a memory replay strategy is used to store a finite subset of old task training samples and mix them into the new task samples when training the new task. At the end of training for each task, a small subset of training samples is stored in a replay buffer. Only a subset of samples belonging to the old class is retrieved from the replay buffer. Due to buffer size limitations, when new class samples are added, an equal number of old class samples are randomly replaced. When task t arrives, two datasets are available: task-specific data D. t and a tiny replay buffer M containing a finite number of samples of previously observed classes.
3. The continuous representation learning method based on representation reconstruction according to claim 2, characterized in that, In S1, to avoid class imbalance, a balanced sampling strategy is used to obtain a mini-batch X = {x1, x2, ..., x}. n In this balanced sampling strategy, the reciprocal of the number of samples in each class is used as the probability of a sample from that class being selected. For each instance x in the mini-batch k Perform two identical and independent random data augmentations to generate two different perspectives. and Obtain small batches of enhanced views through random data augmentation.
4. The continuous representation learning method based on representation reconstruction according to claim 3, characterized in that, In S1, the view is input to an encoder and a multilayer perceptron, and data instances are mapped to a unit hyperspherical space: Where z i yes The high-dimensional eigenvector φ mapped onto the hypersphere θ G represents the encoder parameterized by θ. η This represents an MLP layer parameterized by η; it uses two fully connected layers with ReLU activation in between; After obtaining all the data point vectors, supervised contrastive learning is used to learn the representation knowledge of the new category in a fine-grained manner. The loss function is expressed as Formula 1: Where A(i) is Except The set of all view indices other than A(i) is the set of all positive sample indices in A(i). A subset of indices with the same labels; furthermore, the similarity calculation function sim(a,b) is defined as the exponential cosine similarity between two vectors, as shown in Equation 2: Where τ represents a constant scaling factor, and ||*|| represents the Euclidean norm of the corresponding vector.
5. The continuous representation learning method based on representation reconstruction according to claim 4, characterized in that, The complete loss function is expressed as follows: λ is the weight coefficient, and the encoder of RRCL is trained using the algorithm of this loss function.
Citation Information
Patent Citations
Condition calculation for continuous learning
CN114651261A
Long text semantic similarity calculation method based on comparative learning
CN114707516A