Fine-grained continuous learning method based on residual concept guidance
By decoupling the concepts of task sharing and class uniqueness, and adjusting the cue dimension by combining inter-class distribution trends and local feature sensitivity, the problem of feature confusion and dimensionality explosion in tasks with small fine-grained class differences in existing technologies is solved, thereby improving the model's continuous learning ability and feature discrimination power.
Patent Information
- Application Number
- CN202511011054.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-10-28
AI Technical Summary
Existing regularization-based continuous learning models are prone to feature confusion when dealing with tasks with small fine-grained class differences. Furthermore, the prompt learning method ignores the fine-grained inheritance relationship of concept representation, making it difficult to effectively transfer semantic associations between new and old tasks. In particular, the prompt space dimension explosion problem in complex task sequences significantly reduces the model's continuous learning ability.
By using a residual-based approach, the concepts of task sharing and task class uniqueness are decoupled. The cue dimensions are dynamically adjusted by utilizing inter-class distribution trends and the sensitivity of fine-grained local features. Combined with the ternary loss function system to optimize the model, a hierarchical semantic representation system is established to enhance feature discriminative power and avoid parameter inflation.
It effectively alleviates the confusion between fine-grained categories, maintains semantic inheritance, avoids parameter inflation, improves the model's dynamic adaptability in fine-grained tasks, and enhances feature discrimination power.
Smart Images

Figure CN120851131A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image classification, and more particularly to a fine-grained continuous learning method guided by the concept of residuals. Background Technology
[0002] Continuous learning methods play a crucial role in machine learning, and regularization-based continuous learning models are among the current mainstream approaches. These models retain historical task knowledge by constraining the updates of neural network parameters, using regularization loss to balance the learning of new and old knowledge. However, this approach has limitations. The parameter space constraints cannot completely prevent knowledge forgetting, especially when dealing with continuous tasks with fine-grained class differences, where the model is prone to feature confusion. Furthermore, dynamically adjusting the regularization strength presents significant challenges as the number of tasks increases.
[0003] With the development of cue-based learning techniques, cue-based continuous learning models have gradually emerged. This approach achieves knowledge transfer by freezing the backbone network parameters and dynamically adjusting task-specific cue vectors, improving model adaptability while reducing parameter updates. However, existing cue-based learning methods often neglect the fine-grained inheritance relationships of concept representations, making it difficult to effectively transfer semantic connections between new and old tasks. Especially in complex task sequences, the dimensionality explosion problem of the cue space significantly reduces the model's continuous learning ability. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a fine-grained continuous learning method based on the concept of residuals.
[0005] The objective of this invention is achieved through the following technical solution: A first aspect of the present invention provides a fine-grained continuous learning method based on the concept of residuals, comprising the following steps: Input image and freeze the VIT model to extract depth features; The deep features are input into the concept decoupling module to obtain decoupled task-shared concepts and task-class unique concepts; wherein, the task-shared concepts capture the common semantic features of different fine-grained categories in the same continuous learning task, and the task-class unique concepts capture the unique discriminative features of a specific category in the same continuous learning task. The task-sharing concept residual is injected into the initial query to obtain a shared query, the task-class-unique concept residual is injected into the initial query to obtain a class-unique query, and the shared query and the class-unique query are concatenated to obtain a hierarchical query. The hierarchical query is input into the suggestion pool to obtain a fused suggestion; wherein, the total length of the fused suggestion corresponds to the sensitivity of inter-class distribution trends and fine-grained local features; The fusion prompts are stitched together with the input image and fed into the VIT model, which outputs a classification head that generates the category probability distribution.
[0006] Furthermore, the VIT model includes: The image segmentation module divides the input image into blocks, performs linear projection, and adds [CLS] markers to obtain the segmented image; Add a position encoding module to add position encoding to the block image to obtain a block-encoded image; The Transformer encoder includes multi-layer self-attention modules, each of which includes a multi-head self-attention layer, a multi-layer perceptron (MLP), residual connections, and layer normalization. After the block-encoded image is processed by the Transformer encoder, task-related deep features are extracted from the output embedding labeled with [CLS].
[0007] Furthermore, the concept decoupling module includes a first encoder, which projects depth features onto the concept space to obtain concept features, and decouples the concept features into task-shared concepts and task-class unique concepts.
[0008] Furthermore, the concept decoupling module also includes a second encoder with a different parameter space than the first encoder. The second encoder directly generates a comparison-shared concept with the task-shared concept comparison reference generated by the first encoder by directly using feature mapping to represent the deep features.
[0009] Further, the first encoder includes: The two-layer fully connected network structure maps the deep features output by the ViT model to the concept space in the first layer. The output dimension is the predefined concept embedding dimension, generating intermediate concept feature representations. The second layer decouples the intermediate concept features into task-shared concepts and class-unique concepts. The output dimensions correspond to the number of channels for task-shared concepts and the number of channels for class-unique concepts, respectively. The first encoder achieves concept decoupling through two-level mapping, and the output is directly used for residual injection. The second encoder includes: A single-layer fully connected network structure is used to input the deep features output by the ViT model. The task-sharing concept is directly generated through a single-layer linear transformation, and the output dimension is consistent with the number of task-sharing concept channels in the first encoder.
[0010] Furthermore, the inter-class distribution trend is calculated using the inter-class characteristic variance index, and the calculation method includes: For the deep feature matrix of each continuous learning task, we first calculate the feature centers of each class, and then calculate the inter-class feature variance through the feature centers of each class as the inter-class distribution trend. The sensitivity of the fine-grained local features is calculated using multi-scale attention entropy, and the calculation method includes: For the Transformer encoder in the VIT model, the first... l The attention matrix output by the multi-layer self-attention module is used to calculate the normalized entropy value, and then the average normalized entropy value is obtained by cross-layer and cross-head averaging at the task level, which serves as the sensitivity of fine-grained local features.
[0011] Furthermore, the total length of the fusion prompt is calculated as follows: By using learnable parameters, the sensitivity of inter-class distribution trends and fine-grained local features is fused to obtain a comprehensive difficulty score; The overall difficulty score is input into a gating function composed of fully connected layers to obtain a continuous mask; The corresponding prompt is retained when the continuous mask is greater than or equal to the learnable threshold; otherwise, the prompt is blocked.
[0012] Furthermore, the step of concatenating the fusion prompt with the input image and inputting them together into the VIT model, and outputting the classification head to generate the category probability distribution, includes: The fusion cue is dynamically appended to the input image as an additional token, which together with the original image patch embedding forms a complete input representation; After being fused with the query representation through the residual concept injection mechanism, it participates in the self-attention calculation as enhanced contextual information, and outputs the classification head to generate the category probability distribution.
[0013] Furthermore, the method also includes: A ternary loss function system is constructed to train the non-frozen module; the ternary loss function system includes: contrastive loss function, cosine loss function, and cross-entropy loss function; wherein: The contrastive loss function is used to constrain the semantic consistency of the task-shared concepts of the first encoder and the contrastive shared concepts of the second encoder, thereby strengthening the clustering of similar samples in the task-shared concept space. The cosine loss function is used to enhance the distinguishability between the task-class unique concept and the task-shared concept of the first encoder; The cross-entropy loss function is used to supervise the classification performance of the model and maintain the discriminativeness of the classification boundary.
[0014] The beneficial effects of this invention are: In an exemplary embodiment of the present invention, the feature discrimination power is enhanced by decoupling task sharing / class-specific concepts. Through this explicit concept decoupling, the model can establish a hierarchical semantic representation system, effectively alleviating the confusion problem between fine-grained categories. At the same time, the total length of the fusion prompt is adjusted by the distribution trend between classes and the sensitivity of fine-grained local features. The prompt dimension is dynamically adjusted by difficulty-aware gating, which maintains semantic inheritance and avoids parameter inflation, effectively alleviating the feature confusion and dynamic adaptation problem of fine-grained tasks. Attached Figure Description
[0015] Figure 1 This is a flowchart of a fine-grained continuous learning method based on the concept of residuals, as described in an exemplary embodiment of the present invention. Figure 2 This is a schematic diagram of a specific exemplary embodiment of the present invention; Figure 3 This is a schematic diagram of a conceptual decoupling module in an exemplary embodiment of the present invention; Figure 4 This is a schematic diagram of the experimental setup for exploring the impact of the number of neurons in the second layer of the concept modeling module on model performance in an exemplary embodiment of the present invention; Figure 5 This is an L2 distance histogram comparing the existing method and the method of the present invention in an exemplary embodiment of the present invention; Figure 6 This is a visualization of fine-grained features learned by various methods in an exemplary embodiment of the present invention on a CUB-200. Detailed Implementation
[0016] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] In the description of this invention, it should be noted that the directions or positional relationships indicated by terms such as "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer" are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0018] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0019] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0020] See Figure 1 , Figure 1 The flowchart illustrates a fine-grained continuous learning method based on the concept of residuals, as provided in an exemplary embodiment of the present invention, including the following steps: S01: Input image: Extract depth features using a frozen VIT model. S02: Input the deep features into the concept decoupling module to obtain decoupled task-shared concepts and task-class unique concepts; wherein, the task-shared concepts capture the common semantic features of different fine-grained categories in the same continuous learning task, and the task-class unique concepts capture the unique discriminative features of a specific category in the same continuous learning task. S03: Inject the task sharing concept residual into the initial query to obtain a shared query, inject the task class unique concept residual into the initial query to obtain a class unique query, and concatenate the shared query and the class unique query to obtain a hierarchical query; S04: Input the hierarchical query into the suggestion pool to obtain fused suggestions; wherein, the total length of the fused suggestions corresponds to the sensitivity of inter-class distribution trends and fine-grained local features; S05: Combine the fusion prompts with the input image and input them together into the VIT model. The output classification head generates the category probability distribution.
[0021] Specifically, compared to existing technologies that use the VIT model to extract features and obtain query vectors, and then provide suggestions for selection, this exemplary embodiment employs decoupling of task sharing / class-specific concepts to enhance feature discriminative power. Through this explicit concept decoupling, the model can establish a hierarchical semantic representation system, effectively alleviating the confusion problem between fine-grained categories. At the same time, this exemplary embodiment adjusts the total length of the fused suggestions based on the distribution trend between classes and the sensitivity of fine-grained local features, and dynamically adjusts the suggestion dimension through difficulty-aware gating, thus maintaining semantic inheritance while avoiding parameter inflation, effectively alleviating the feature confusion and dynamic adaptation challenges of fine-grained tasks.
[0022] In other words, addressing the limitations of existing technologies that "retain historical task knowledge by constraining neural network parameter updates and balance the learning of new and old knowledge using regularization loss, the parameter space constraints cannot completely prevent knowledge forgetting, especially when dealing with continuous tasks with small fine-grained class differences, where the model is prone to feature confusion. Furthermore, as the number of tasks increases, the dynamic adjustment of regularization strength also faces significant challenges," this exemplary embodiment enhances feature discriminative power by decoupling task-shared / class-unique concepts and dynamically adjusts the cue length by combining feature variance and attention entropy, effectively alleviating the challenges of feature confusion and dynamic adaptation in fine-grained tasks.
[0023] Addressing the issue in existing technologies where "cue-based continuous learning models are emerging. This approach achieves knowledge transfer by freezing backbone network parameters and dynamically adjusting task-specific cue vectors, improving model adaptability while reducing parameter updates. However, existing cue-based learning methods often neglect the fine-grained inheritance relationships of concept representations, making it difficult to effectively transfer semantic connections between new and old tasks. Especially in complex task sequences, the dimensionality explosion of the cue space significantly reduces the model's continuous learning ability," this exemplary embodiment proposes residual concept decoupling, separating task-shared and class-specific features, and dynamically adjusting the cue dimension through difficulty-aware gating, thus maintaining semantic inheritance while avoiding parameter inflation.
[0024] The following content will provide a detailed explanation of each step, as detailed in the following text: Figure 2 As shown: More preferably, in an exemplary embodiment, in step S01, the VIT model includes: The image segmentation module divides the input image into blocks, performs linear projection, and adds [CLS] markers to obtain the segmented image; Add a position encoding module to add position encoding to the block image to obtain a block-encoded image; The Transformer encoder includes multi-layer self-attention modules, each of which includes a multi-head self-attention layer, a multi-layer perceptron (MLP), residual connections, and layer normalization. After the block-encoded image is processed by the Transformer encoder, task-related deep features are extracted from the output embedding labeled with [CLS].
[0025] Specifically, in this exemplary embodiment, the encoder parameters are frozen based on the ViT-Base / 16 model pre-trained on ImageNet-21k, a task-adaptive learnable cue pool is constructed, and image features are dynamically interacted through multi-head attention. Finally, the deep features extracted by the ViT model (Vision Transformer) are... , where d is the feature dimension of the last layer output of ViT.
[0026] Subsequently, the classification head module inputs deep features to generate a category probability distribution; the concept decoupling module decouples deep features into task-shared concepts and class-specific concepts; the residual injection module superimposes the concepts into the initial query in a residual manner to form an enhanced query representation; and the adaptive prompt gating assesses the task difficulty based on inter-class distribution dispersion and attention disorder, and dynamically adjusts the prompt length to adapt to fine-grained classification requirements.
[0027] More preferably, in an exemplary embodiment, such as Figure 3 As shown, in step S02, the concept decoupling module includes a first encoder. The first encoder The deep features are projected onto the concept space to obtain the concept features, and the concept features are decoupled into task-shared concepts and task-class unique concepts.
[0028] Specifically, in this exemplary embodiment, the first encoder Joint concept modeling is achieved through a two-stage fully connected layer: the first stage integrates deep features... Projected into the concept space Where W and H correspond to the width and height of the image features, respectively, and N represents the number of class-independent embeddings; the second stage decouples the concept features. Including the concept of task sharing The unique concept of task class .
[0029] The concept of task sharing aims to capture common semantic features across different fine-grained categories within the same continuous learning task (such as cross-category commonalities like bird wing textures and car headlight shapes), while the concept of task-class uniqueness focuses on the unique discriminative features of a specific category (such as feather color gradients and car logo details). Through this explicit conceptual decoupling, the model can establish a hierarchical semantic representation system, effectively mitigating the confusion between fine-grained categories.
[0030] In the subsequent implementation, cosine loss separation is adopted. and The representation space is detailed in the subsequent loss function section. In other words, to strengthen the difference between task-shared concepts and task-class unique concepts, the cosine similarity loss function is used to minimize the correlation of their inner product space, prompting the two subspaces to form an orthogonal basis, thereby ensuring that shared concepts do not encroach on the representation capacity of unique concepts.
[0031] More preferably, in an exemplary embodiment, such as Figure 3 As shown, in step S02, the concept decoupling module further includes a second encoder with a different parameter space than the first encoder. The second encoder The deep features are directly generated through feature mapping to create a comparison reference between the task-shared concept and the one generated by the first encoder.
[0032] Specifically, in this exemplary embodiment, to enhance the reliability of the decoupling process, the second encoder... Independently generated comparison reference The encoder employs a dual constraint mechanism. By generating a comparison reference directly through feature mapping in different parameter spaces, the representation coupling that may occur in a single encoder during joint optimization is avoided.
[0033] In the subsequent implementation, the InfoNCE loss constraint will be used. and The shared concept outputs (see the subsequent loss function section for details) align the common semantics between the two in the latent space. Specifically, this dual-path comparison mechanism preserves the stability of the shared concepts of the tasks while enhancing the generalization ability of the representation through independent encoding processes.
[0034] At the feature processing level, the outputs of both encoders undergo channel normalization to eliminate the interference of feature scale differences on concept decoupling. This normalization strategy effectively improves the stability of the optimization process, especially when processing high-dimensional features of fine-grained data, and can suppress the impact of noise on the concept space.
[0035] More preferably, in an exemplary embodiment, the first encoder includes: The encoder employs a two-layer fully connected network structure. The first layer maps the deep features output by ViT to the concept space, with the output dimension being a predefined concept embedding dimension, generating intermediate concept feature representations. The second layer decouples the intermediate concept features into task-shared concepts and class-unique concepts, with the output dimensions corresponding to the number of channels for task-shared concepts and the number of channels for class-unique concepts, respectively. This encoder achieves concept decoupling through two-level mapping, and its output is directly used in the residual injection module.
[0036] The second encoder includes: The single-layer fully connected network structure takes the deep features output by the ViT model as input and directly generates task-shared concepts through a single-layer linear transformation. The output dimension is consistent with the number of task-shared concept channels of the first encoder. This encoder is only enabled during the training phase. It constrains the consistency of the task-shared concept distribution output by the first encoder by comparing the loss function. It does not participate in inference calculation and does not involve the generation of class-unique concepts.
[0037] Specifically, in this exemplary embodiment, the first fully connected layer of the first encoder linearly projects the deep features output by ViT onto the intermediate concept space, wherein the output dimension is dynamically configured according to the fine-grained complexity of the dataset: 64-dimensional concept embedding is used for FGVC-Aircarft and Stanford-Cars with high inter-class similarity, and 128-dimensional concept embedding is used for CUB-200 and FOOD-101 with large intra-class differences; the second layer generates task-shared concepts and class-unique concepts through two parallel fully connected branches, wherein the output of task-shared concepts is fixed as single-channel common semantic features, and the number of output channels of class-unique concepts is strictly aligned with the number of current task categories, thereby achieving explicit concept decoupling.
[0038] The second encoder uses a single-layer fully connected network with an independent parameter space to directly map and generate a contrastive reference representation of the same dimension as the first encoder's shared concept. This module is only activated during the training phase. It constrains the distribution consistency of the first encoder's shared concept output through contrastive learning based on InfoNCE loss. After training, it is discarded and does not participate in the inference process. It does not involve the generation of class-unique concepts at all.
[0039] It should be noted that in actual use, only the results of the first encoder are used, and the comparison reference of the second encoder is only used in the training phase.
[0040] More preferably, in an exemplary embodiment, in step S03, the task shared concept residual is injected into the initial query to obtain a shared query, the task class unique concept residual is injected into the initial query to obtain a class unique query, and the shared query and the class unique query are concatenated to obtain a hierarchical query, as follows: The core idea of step S03 is to construct a hierarchical query representation through residual concept injection, thereby enhancing the model's ability to discriminate fine-grained categories. Specifically, given the initial query vector extracted by the pre-trained model... This exemplary embodiment introduces the concept of task sharing. The unique concept of task class The formula for residual injection is: , .
[0041] In other words, the concept of task sharing is embedded. Embedded with the unique concept of task class An enhanced hierarchical query is generated by injecting the initial query vector q through a residual join, where shared queries are used. Capture commonalities across tasks and perform class-unique queries. Fine-grained differences in coding. It should be noted that this relates to the concept of task sharing. By comparing learning loss Constraining its cross-task commonalities, a unique concept for each task class. By minimizing the cosine similarity loss Enhance inter-class differentiation. This dual-path injection mechanism enables shared queries. Inheriting the general representation capabilities of pre-trained models, while class-unique queries... Fine-grained differences are captured by refining local features.
[0042] The final concatenation operation generates a hierarchical query. .
[0043] More preferably, in an exemplary embodiment, in step S04, the hierarchical query is input to the suggestion pool to obtain a fused suggestion; wherein, the total length of the fused suggestion corresponds to the sensitivity of inter-class distribution trends and fine-grained local features.
[0044] in , Each by and Generated via the hint pool, total length The design dynamically adjusts the gating based on difficulty. It preserves the semantic integrity of the original query through residual connections, while constructing an orthogonal conceptual subspace in the feature space—shared concepts prevent cross-task confusion, and task-class unique concepts enhance intra-class compactness through a maximum response selection mechanism.
[0045] More preferably, in an exemplary embodiment, in step S04, the inter-class distribution trend is calculated using an inter-class feature variance index, and the calculation method includes: For the deep feature matrix of each continuous learning task, we first calculate the feature centers of each class, and then calculate the inter-class feature variance through the feature centers of each class as the inter-class distribution trend. The sensitivity of the fine-grained local features is calculated using multi-scale attention entropy, and the calculation method includes: For the Transformer encoder in the VIT model, the first... l The attention matrix output by the multi-layer self-attention module is used to calculate the normalized entropy value, and then the average normalized entropy value is obtained by cross-layer and cross-head averaging at the task level, which serves as the sensitivity of fine-grained local features.
[0046] Specifically, in fine-grained continuous learning scenarios, fixed-length cue vectors are difficult to adapt to the needs of different task complexities, easily leading to overfitting. Therefore, in this exemplary embodiment, a difficulty-aware adaptive cue generation mechanism is proposed. Its core idea is to quantify task difficulty through dual indicators and dynamically adjust the cue length based on a comprehensive score. The inter-class feature variance is calculated. This measures the dispersion of the sample distribution, reflecting the difficulty of distinguishing different fine-grained categories, and also extracts the multi-scale attention entropy of the intermediate layers of the Transformer. The representation model focuses on the information density of the pattern.
[0047] Specifically, the first step is to construct the inter-class feature variance. The metric reflects the degree of dispersion of the sample distribution. For the feature matrix of the t-th task... First, calculate the feature centers of various types. Then through the feature center Calculate the variance of features between classes When the variance of features between classes When the value increases, it indicates a high degree of overlap in features between classes, making it more difficult to distinguish them.
[0048] In a specific exemplary embodiment, the calculation of inter-class variance specifically includes: Given the image feature matrix of the t-th task , where N is the number of fine-grained categories in the current task, and d is the feature dimension of the ViT output. For each category Calculate its feature centers: Where K is the total number of instances of category i. Let represent the feature vector of the k-th sample. The between-class variance is defined as: This indicator measures the dispersion of different categories in the feature space using second-order statistics. A larger value indicates that the distributions of various features overlap significantly, making differentiation difficult; conversely, a smaller value indicates good separability between classes.
[0049] Simultaneously, multi-scale attention entropy is introduced. Evaluate the information density of the model's attention patterns. Select the attention matrix of the l-th layer in the ViT network. Calculate its normalized entropy value. And at the task level, cross-layer and cross-head averaging is performed to obtain This metric captures the ambiguity of the model's decision boundary through higher-order statistics. An increase in entropy value means that attention is scattered in non-critical areas, increasing task complexity.
[0050] In a specific exemplary embodiment, the multi-scale attention entropy calculation (i.e., the calculation of the normalized entropy value based on the attention matrix) includes the following sub-steps: In the l-th layer of the ViT network, the matrix of the h-th attention head is selected. Where H and W are the feature map resolutions. Calculate its normalized information entropy: This formula quantifies the uncertainty of the distribution of attention weights at different spatial locations. It calculates the entropy value of each position in the matrix and then performs normalization.
[0051] Perform cross-scale aggregation on L selected layers (in one exemplary embodiment, layers 2 / 4 / 10 / 12 are selected) and K attention heads (i.e., perform cross-layer and cross-head averaging at the task level to obtain the average normalized entropy value): In the formula, N is the number of samples in the current task. An increase in the value indicates that the model's focus is scattered, making it difficult to concentrate on key discrimination regions, thus increasing task complexity. Here, N is the number of images, representing the average across images; L is the total number of layers, representing the average across layers; and K is the total number of heads, representing the average across heads.
[0052] More preferably, in an exemplary embodiment, in step S04, the total length of the fusion prompt is calculated as follows: By using learnable parameters, the sensitivity of inter-class distribution trends and fine-grained local features is fused to obtain a comprehensive difficulty score; The overall difficulty score is input into a gating function composed of fully connected layers to obtain a continuous mask; The corresponding prompt is retained when the continuous mask is greater than or equal to the learnable threshold; otherwise, the prompt is blocked.
[0053] Specifically, in this exemplary embodiment, the above-mentioned indicators are fused through a learnable parameter α to form a comprehensive difficulty score. This method achieves a synergistic evaluation of linear separability and nonlinear structure awareness: variance. The judgment of the distribution trend among dominant classes, while entropy Enhanced sensitivity to fine-grained local features. The parameter α is dynamically optimized during training to adaptively balance the contribution weights of the two types of indicators.
[0054] In one specific exemplary embodiment, through learnable parameters Linearly merge the two types of indicators: in This is the normalized attention entropy. This design allows the model to automatically balance statistical properties during training. Reflecting inter-class linear separability and cognitive characteristics (Revealing the boundary complexity of nonlinear decision-making).
[0055] Then, the overall score will be determined. A continuous mask is obtained by inputting a gating function consisting of fully connected layers. To suppress redundant parameters, a learnable threshold is set. Binarization processing: when The corresponding hint token is retained when it is active, otherwise it is blocked. This mechanism ensures that the class has a unique hint. Effective length The model adaptively shrinks according to task complexity. Through this flexible adjustment strategy, the model can use compact cueing for simple tasks to avoid overfitting, while expanding the cueing capacity for difficult tasks to enhance representational ability, achieving the best balance between computational efficiency and classification performance.
[0056] In one specific exemplary embodiment, the dynamic gating mechanism specifically includes: Will Input a single-layer MLP to generate a continuous mask: in, for dimensional vector. Passed through a threshold. Perform binary decision-making: when The corresponding prompt token is retained when it is active; otherwise, it is blocked.
[0057] More preferably, in an exemplary embodiment, in step S04, the step of concatenating the fusion prompt with the input image and inputting them together into the VIT model, and outputting the classification head to generate a category probability distribution, includes: The fusion cue is dynamically appended to the input image as an additional token, which together with the original image patch embedding forms a complete input representation; After being fused with the query representation through the residual concept injection mechanism, it participates in the self-attention calculation as enhanced contextual information, and outputs the classification head to generate the category probability distribution.
[0058] Specifically, in this exemplary embodiment, during the prediction phase of the model, the final cues generated by the concept modeling module are dynamically concatenated into the input sequence as additional tokens, forming a complete input representation together with the original image patch embeddings. These cue tokens, along with the image patch tokens, are input into the multi-head self-attention layer of the ViT model, where they interact globally through a self-attention mechanism to capture semantic associations across cues and image regions. After forward propagation through multiple Transformer blocks, the model extracts task-related comprehensive features from the [CLS]-tagged output embeddings and inputs them into the classification head to generate class probability distributions.
[0059] In this process, the cross-entropy loss function is used to supervise the classification performance of the model, driving the optimization of the prompt generation module and the classifier by minimizing the difference between the predicted probability and the true label (see the subsequent loss function section for details).
[0060] Specifically, the cue token is not directly appended to the end of the original input sequence. Instead, it is fused with the query representation through a residual concept injection mechanism and then participates in the self-attention computation as enhanced contextual information. This design allows the cue token to dynamically adjust the ViT model's attention weights for different semantic regions, strengthening its ability to model fine-grained differences. Simultaneously, the gradient backpropagation of the cross-entropy loss not only updates the cue parameters for the current task but also ensures the decoupling of task-shared concepts and category-unique concepts through contrastive learning and difference maximization constraints, thereby mitigating knowledge interference between tasks.
[0061] It should be noted that, regarding the implementation of "the concatenation of the hint token is not directly appended to the end of the original input sequence, but rather fused with the query representation through a residual concept injection mechanism," the hint token fusion mechanism in the residual concept guidance framework is implemented through hierarchical concept injection: First, a lightweight encoder is used to decouple the task-shared concept and the class-unique concept from the image depth features. Then, these concept features are injected into the initial query representation through residual superposition to form an enhanced shared query and a class-unique query. Subsequently, the enhanced query input prompt pool generates dynamic fusion prompts, which serve as task-aware contextual prior tokens. These prompts, along with the original image patch embeddings, are combined with a unified positional encoding and input into the Transformer encoder. During the self-attention computation process, the model is guided to focus on fine-grained discrimination regions, and finally, the probability distribution is output by the classification head.
[0062] More preferably, in an exemplary embodiment, the method further includes: A ternary loss function system is constructed to train the non-frozen module; the ternary loss function system includes: contrastive loss function, cosine loss function, and cross-entropy loss function; wherein: The contrastive loss function is used to constrain the semantic consistency of the task-shared concepts of the first encoder and the contrastive shared concepts of the second encoder, thereby strengthening the clustering of similar samples in the task-shared concept space. The cosine loss function is used to enhance the distinguishability between the task-class unique concept and the task-shared concept of the first encoder; The cross-entropy loss function is used to supervise the classification performance of the model and maintain the discriminativeness of the classification boundary.
[0063] Specifically, in this exemplary embodiment, the method achieves a balanced improvement in feature decoupling and classification performance through a multi-objective collaborative optimization framework, the core of which lies in constructing a ternary loss function system.
[0064] First, an improved InfoNCE contrastive loss function is adopted. Strengthening similar samples in the concept space of task sharing The clustering property is determined by comparing the loss function. The calculation formula maximizes the mutual information of positive sample pairs, promoting the formation of compact clusters based on the common features of different tasks. Secondly, a cosine loss function with orthogonal constraints is introduced. Building the concept of task sharing With class unique concept The repulsive force is minimized by the cosine loss formula, reducing the cosine similarity between the two concept spaces on the unit hypersphere, thus forming an approximately orthogonal basis for the two concept spaces. Finally, the standard cross-entropy loss function is used. To maintain the discriminative nature of the classification boundary and ensure that the feature decoupling process does not impair the original classification performance, the three elements are adjusted through adaptive weight coefficients. and Jointly construct the total loss function During backpropagation, the parameters of the concept encoder and the prompt generation module are optimized simultaneously. This collaborative mechanism enables the shared concept network to stably extract cross-task commonalities (such as the distribution patterns of bird plumage), while the class-unique network focuses on capturing fine-grained differences (such as details of beak morphology). During the continuous learning phase, the parameters of the pre-trained backbone network are frozen, and only the key-value pairs in the prompt pool P that are relevant to the current task are updated. Historical knowledge is maintained through a momentum update strategy.
[0065] By enhancing the consistency of similar features through contrastive learning, separating shared and unique concepts using cosine constraints, and combining classification error supervision, the collaborative optimization of these three aspects achieves a balance between feature decoupling and classification accuracy. The optimized hierarchical prompts are then combined with the pre-trained model, and continuous incremental learning and prompt pooling are performed through backpropagation of the three types of losses.
[0066] In one example, the contrast loss function With cosine loss function Together they act on the concept of task sharing and class unique concept The modeling process. The specific calculation process is as follows: Contrast loss function The calculations include: Contrast loss is used to constrain the first encoder. Second encoder The semantic consistency of the generated task-sharing concept is expressed as follows: in, Indicates via the first encoder The generated shared concept embedding vector for the i-th task. For the second encoder The corresponding concept in the output. Temperature coefficient (default in this exemplary embodiment) =0.1), used to adjust the sharpness of the similarity distribution, where N represents the batch size. Molecular part Indicates and Matched positive samples (i.e., different perspectives on the same task), denominator This includes all negative sample pairs in the current batch (cross-task concepts). This loss maximizes the cosine similarity of positive sample pairs while suppressing the similarity of negative sample pairs, thus promoting consistent conceptual representations of the same task across different encoding paths.
[0067] Cosine loss function The calculations include: Cosine loss is used to enhance class uniqueness concepts. With the concept of task sharing The discrimination index is expressed as: in, and These represent the embedding vectors of shared concepts and class-unique concepts under the same task, respectively. for Norm normalization operation, This represents the dot product operation. This loss function forces the model to decouple the two types of concepts by minimizing the dot product of the normalized vectors of two concepts (equivalent to minimizing the cosine similarity): when... hour, and The concepts are distributed in opposite directions in the embedding space to ensure that shared concepts describe commonalities in tasks (such as the shape of bird wings), while class-unique concepts capture fine-grained differences (such as details of feather texture).
[0068] Cross-entropy loss function The calculations include: The cross-entropy loss function, as the fundamental optimization objective for classification tasks, decouples the concepts of joint constraints from classification decisions. Its expression is as follows: Where N is the batch sample size, and C is the total number of current task categories. The true label (one-hot encoded) of sample i in category c. The loss is the class probability distribution predicted by the model. This loss is used to optimize the model end-to-end through backpropagation, thereby improving classification accuracy.
[0069] In a specific exemplary embodiment, by using the contrastive loss function Cosine loss function and cross-entropy loss function By combining these methods, the total loss function is finally generated. The specific formula is as follows: in, and These are the balancing hyperparameters that control the loss. The three types of loss functions use adaptive weighting coefficients... and Jointly construct the total loss function During backpropagation, the parameters of the concept encoder and the prompt generation module are optimized simultaneously.
[0070] To further illustrate the beneficial effects of the residual-guided continuous learning method described in the above exemplary embodiment, experiments are conducted to verify its practical performance. The experiments were performed on four fine-grained classification benchmark datasets (CUB-200, FGVC-Aircraft, Stanford-Cars, and Food-101), and the specific design and results are as follows: S1: Dataset.
[0071] To evaluate the effectiveness of our method, experiments were conducted using four widely used fine-grained datasets: FGVC-Aircraft, CUB-200, FOOD-101, and Stanford-Cars, containing 100, 200, 101, and 196 classes, respectively. Except for Stanford-Cars, our method used random seeds to split these datasets into 5, 10, and 20 non-overlapping continuous learning tasks. Specifically, the Food-101 dataset was split into 21, 11, and 6 initial task classes, while Stanford-Cars was split into 7, 14, and 28 CL tasks (continuous learning tasks). All experiments used random seeds from 1993, 1997, and 2025.
[0072] S2: Evaluation indicators.
[0073] For the evaluation metrics, the experiment used two metrics: average precision and forgetting rate, as designed in the following way: , in The model trained on task i is in The accuracy of the assessment during the test.
[0074] S3: Experiment details.
[0075] For the continuous learning setup, this experiment used the Adam optimizer with a batch size of 128, aligning the configuration as closely as possible to the Coda-prompt. The model was trained for 30 epochs per task on the FGVC-Aircraft dataset and for 20 epochs on the other three datasets. Hyperparameters and For FGVC - Aircraft, the learning rate was set to 0.8 and 0.7, and for the other three datasets, it was set to 0.5. Similar to Coda-prompt, this experiment used a ViT-B checkpoint, which was pre-trained on ImageNet-21K and then fine-tuned on ImageNet-1K. A cosine decay learning schedule was used with an initial learning rate of 0.001. For the lightweight concept modeling encoder, this experiment used two fully connected layers to construct the encoder, with the input dimension being the ViT output dimension, and the intermediate layers having 64 or 128 units. The output mapping corresponds to the number of task-specific shared and class-unique concepts; for detailed settings, please refer to [link to documentation]. Figure 4 . Figure 4 The horizontal axis represents the number of second-level units in the concept modeling module (64 / 128 / 256), and the vertical axis represents the average classification accuracy (%).
[0076] S4: Comparison method.
[0077] The comparative methods used in this experiment include: iCaRL, which preserves old class knowledge through feature replay and the nearest mean classifier, and mitigates forgetting by combining prototype reproduction; PoDNet, which compresses old task knowledge using a pooling output distillation strategy and designs a compact feature space to improve incremental performance for small tasks; DER, which dynamically expands network branches to adapt to new tasks and freezes old branch parameters to prevent catastrophic forgetting; L2P, which constructs a learnable cue pool and matches input features with cue key-value pairs using cosine similarity; DualPrompt, which separates general cue (shared across tasks) and expert cue (task-specific) and enhances task adaptability through dual-path injection; Coda-prompt, which dynamically assembles class-specific cue based on attention weights to achieve fine-grained feature decoupling; PC, which generates diverse soft cue using code and improves cue discriminability through clustering constraints; OVOR, which combines a single cue framework with virtual outlier regularization to suppress the overlap of decision boundaries between new and old classes; and two baseline methods: sequential fine-tuning and experience replay. Comparisons with these methods on four datasets more intuitively demonstrate the superiority of this method.
[0078] S5: Experimental results.
[0079] This experiment investigated the performance of various methods on 5, 10, and 20 tasks across four datasets (FGVC, CUB, CAR, and FOOD). The results show that RCG achieves superior performance on most metrics. Specifically: (1) In the short CL task (5 / 7 task) setting, our method achieved 63.28% (CARS), 84.78% (FOOD), 55.38% (FGVC), and 83.49% (CUB) in Avg., significantly outperforming recent prompt-based methods. Compared to the suboptimal method (Coda-Prompt), our method improved by 2.22%, 1.33%, 4.58%, and 1.81%, respectively. Furthermore, it outperformed classic replay-based and rule-based methods by an average of approximately 25%.
[0080] (2) Under long CL task settings (10 / 14 / 20 / 28 tasks), this method improves performance by an average of about 1.5% compared to the suboptimal method. Due to the varying difficulty of tasks in fine-grained datasets, the lack of fixed-length hints limits its ability to flexibly adapt to different types of instances. These limitations hinder its ability to achieve optimal performance through timely optimization.
[0081] (3) This experiment reports the degree of forgetting in RCG under different CL scenarios (Fot.). Compared with the best-performing baseline, our method achieved an average improvement of 1.7% on Fot. However, it is worth noting that Avg. is more important than Fot. because Avg. has already explained forgetting and plasticity, while Fot. only provides additional insights about forgetting. Therefore, our method considers a slight trade-off of forgetting acceptable in the context of the overall performance improvement of RCG implementation.
[0082] (4) This experiment reports the results of the proposed method on two commonly used datasets, CIFAR and ImageNet-R. The results show that the performance of the proposed method is comparable to the latest state-of-the-art methods, indicating that the proposed method is not limited to fine-grained datasets (that is, it does not overfit specific data distributions) and has strong generalization ability in different scenarios.
[0083] To further illustrate the roles of each module in the residual-based continuous learning method of this invention, this experiment verifies the synergistic effect of the core modules through ablation experiments. The specific experimental details are as follows: S1: Validity analysis of the proposed components.
[0084] This method consists of two core modules: a concept decoupling module (CG) and an adaptive prompt generation module (APG). This experiment validates the performance impact of these two modules on four datasets, demonstrating that they significantly improve model performance through synergy. Specifically: (1) Using the CG module alone: Significantly improves average accuracy (Avg.) and reduces forgetting rate (Fot.) on all four datasets. Experiments show that injecting query vectors into the model can effectively enhance class-specific information, thereby achieving higher classification accuracy (e.g., an improvement of 3.8% in Avg. on the CUB-200 dataset) and lower catastrophic forgetting (e.g., a reduction of 12.1% in Fot. on the Stanford-Cars dataset).
[0085] (2) Using the APG module alone: via inter-class variance With attention entropy The task difficulty assessment mechanism maps task complexity to the dynamic adjustment of class-unique hint length, which also brings significant performance improvements (e.g., a 2.9% improvement for Avg. and an 8.7% reduction for Fot. on the FGVC-Aircraft dataset).
[0086] (3) Combined effect: The combination of CG and APG achieves more accurate task difficulty estimation and resource allocation. Ultimately, on average, it improves Avg by 4.63% and reduces Fot by 4.62% compared to the baseline method on four datasets (e.g., the combined gain Avg increases by 5.1% and Fot decreases by 6.3% on the Food-101 dataset). S2: Compatibility Analysis.
[0087] This experiment integrates and tests the two core modules with current mainstream continuous learning methods (L2P, DualPrompt, Coda-prompt). The results show that: (1) Adding the CG module: The average accuracy (Avg.) of all three methods improved by 1%-2% (e.g., L2P improved from 79.56% to 80.23%). This further verifies that the concept injection mechanism can enhance the category classification boundary, alleviate fine-grained semantic ambiguity, and improve the model's discriminative power.
[0088] (2) Adding the APG module: The performance of the three methods improved by an average of about 2% (e.g., CODA-Prompt improved from 80.45% to 81.87%). Compared with the CG module, dynamic adjustment of the cue length has a more significant impact on the performance of fine-grained continuous learning, indicating that fixed-length cue is prone to feature redundancy or insufficient information.
[0089] (3) Plug and play features: The modular design of this solution can be flexibly integrated without modifying the original method architecture (e.g., the forgetting rate is reduced by 1.7% after DualPrompt integration), and the performance gain stability is ensured through independent parameter space.
[0090] S3: Hyperparameter analysis.
[0091] To investigate the impact of the number of neurons in the second layer of the concept modeling module on model performance, this method was tested on four datasets (CARS dataset with 14 tasks, and the others with 10 tasks for continuous learning). The average accuracy under different neuron configurations is as follows: Figure 4 As shown, the horizontal axis represents the number of units in the second layer of the concept modeling module (64 / 128 / 256), and the vertical axis represents the average classification accuracy (%). The results show that: (1) Relationship between number of neurons and accuracy: On all datasets, the accuracy was significantly improved in the early stage of increasing the number of neurons (16→64) (e.g., the accuracy of the CUB dataset increased from 68.2% to 72.5%). However, when the number of neurons exceeded the critical value (FGVC / CARS:64, FOOD / CUB:128), a saturation effect occurred, and further increases led to a decrease in performance (e.g., the accuracy of the FOOD dataset decreased by 1.8% when it went from 128 to 256).
[0092] (2) Optimal configuration selection: In all continuous learning scenarios, the number of neurons was set to 64 for FGVC and CARS datasets, and 128 for FOOD and CUB datasets. This configuration balances model capacity and overfitting risk, and the validation set loss is reduced by 12.3% (compared to the suboptimal configuration).
[0093] (3) Other hyperparameter descriptions: loss weight parameters ( , The optimal value is determined through grid search; the class uniquely indicates the basic length. Set to 8, dynamically adjust the range [4,16]; the training time comparison shows that this scheme only increases the computational cost by 7.3% compared to the benchmark method.
[0094] To further illustrate the module effectiveness of the fine-grained continuous learning method based on the residual concept of this invention, this experiment verifies the improvement of the core module's discriminative power through visual comparison. The specific experimental content is as follows: like Figure 5 As shown, by comparing the intra-class / inter-class feature distance distributions of DualPrompt, L2P, CODA-Prompt, and RCG, Figure 5 The horizontal axis represents the L2 distance value of paired samples in the feature space (ranging from 0 to 1), and the vertical axis represents the sample pair density (frequency statistics) within a specific L2 distance interval. Figure 5In red, the distance between classes is represented, which is the distance distribution of samples of different classes in the feature space. In blue, the distance between classes is represented, which is the distance distribution of samples of the same class in the feature space. Figure 5 The middle gap represents the minimum inter-class distance difference (right peak position - left peak position), Intra Avgdis represents the average intra-class sample distance (left peak position), Inter Avgdis represents the average inter-class sample distance (right peak position), and Density represents the sample pair density within the L2 distance interval. Ultimately, it was found that: The traditional method (DualPrompt / L2P) has a mean intra-class distance of 1.02 and an inter-class distance of only 0.89, indicating significant feature confusion. CODA-Prompt improves inter-class distance to 1.12 (0.95 within a class) and achieves a separation of 0.23 through class-specific suggestions; This method, through a conceptual decoupling mechanism, compresses the intra-class distance to 0.79 and expands the inter-class distance to 1.19, forming a significant separation gap of 0.40, which is 73.9% better than the suboptimal method.
[0095] in addition, Figure 6 The attention heatmap comparison further reveals that traditional methods are easily affected by complex background interference in bird recognition on the CUB dataset (background activation accounts for 35%). Although CODA-Prompt suppresses background noise, it suffers from local over-focusing (coverage of key areas is only 62%). In contrast, RCG achieves 88% complete coverage of the target region through an adaptive cueing mechanism, while reducing background interference to 12%. This visual evidence fully demonstrates that residual concept injection and dynamic cueing adjustment mechanisms effectively improve the discriminative power of fine-grained features, providing visual evidence for improved classification performance.
[0096] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A fine-grained continuous learning method based on the concept of residuals, characterized in that: Includes the following steps: Input image and freeze the VIT model to extract depth features; The deep features are input into the concept decoupling module to obtain decoupled task-shared concepts and task-class unique concepts; wherein, the task-shared concepts capture the common semantic features of different fine-grained categories in the same continuous learning task, and the task-class unique concepts capture the unique discriminative features of a specific category in the same continuous learning task. The task-sharing concept residual is injected into the initial query to obtain a shared query, the task-class-unique concept residual is injected into the initial query to obtain a class-unique query, and the shared query and the class-unique query are concatenated to obtain a hierarchical query. The hierarchical query is input into the suggestion pool to obtain a fused suggestion; wherein, the total length of the fused suggestion corresponds to the sensitivity of inter-class distribution trends and fine-grained local features; The fusion prompts are stitched together with the input image and fed into the VIT model, which outputs a classification head that generates the category probability distribution.
2. The fine-grained continuous learning method based on the concept of residuals as described in claim 1, characterized in that: The VIT model includes: The image segmentation module divides the input image into blocks, performs linear projection, and adds [CLS] markers to obtain the segmented image; Add a position encoding module to add position encoding to the block image to obtain a block-encoded image; The Transformer encoder includes multi-layer self-attention modules, each of which includes a multi-head self-attention layer, a multi-layer perceptron (MLP), residual connections, and layer normalization. After the block-encoded image is processed by the Transformer encoder, task-related deep features are extracted from the output embedding labeled with [CLS].
3. The fine-grained continuous learning method based on the concept of residuals according to claim 2, characterized in that: The concept decoupling module includes a first encoder, which projects depth features onto the concept space to obtain concept features, and decouples the concept features into task-shared concepts and task-class unique concepts.
4. The fine-grained continuous learning method based on the concept of residuals according to claim 3, characterized in that: The concept decoupling module also includes a second encoder with a different parameter space than the first encoder. The second encoder directly generates a comparison-shared concept with the task-shared concept comparison reference generated by the first encoder by using feature mapping to represent the deep features.
5. The fine-grained continuous learning method based on the concept of residuals according to claim 4, characterized in that: The first encoder includes: The two-layer fully connected network structure maps the deep features output by the ViT model to the concept space in the first layer. The output dimension is the predefined concept embedding dimension, generating intermediate concept feature representations. The second layer decouples the intermediate concept features into task-shared concepts and class-unique concepts. The output dimensions correspond to the number of channels for task-shared concepts and the number of channels for class-unique concepts, respectively. The first encoder achieves concept decoupling through two-level mapping, and the output is directly used for residual injection. The second encoder includes: A single-layer fully connected network structure is used to input the deep features output by the ViT model. The task-sharing concept is directly generated through a single-layer linear transformation, and the output dimension is consistent with the number of task-sharing concept channels in the first encoder.
6. The fine-grained continuous learning method based on the concept of residuals according to claim 5, characterized in that: The inter-class distribution trend is calculated using the inter-class characteristic variance index, and the calculation method includes: For the deep feature matrix of each continuous learning task, we first calculate the feature centers of each class, and then calculate the inter-class feature variance through the feature centers of each class as the inter-class distribution trend. The sensitivity of the fine-grained local features is calculated using multi-scale attention entropy, and the calculation method includes: For the Transformer encoder in the VIT model, the first... l The attention matrix output by the multi-layer self-attention module is used to calculate the normalized entropy value, and then the average normalized entropy value is obtained by cross-layer and cross-head averaging at the task level, which serves as the sensitivity of fine-grained local features.
7. The fine-grained continuous learning method based on the concept of residuals according to claim 6, characterized in that: The total length of the fusion prompt is calculated as follows: By using learnable parameters, the sensitivity of inter-class distribution trends and fine-grained local features is fused to obtain a comprehensive difficulty score; The overall difficulty score is input into a gating function composed of fully connected layers to obtain a continuous mask; The corresponding prompt is retained when the continuous mask is greater than or equal to the learnable threshold; otherwise, the prompt is blocked.
8. The fine-grained continuous learning method based on the concept of residuals according to claim 7, characterized in that: The process of concatenating the fusion prompt with the input image and inputting them together into the VIT model, and outputting the classifier head to generate the class probability distribution, includes: The fusion cue is dynamically appended to the input image as an additional token, which together with the original image patch embedding forms a complete input representation; After being fused with the query representation through the residual concept injection mechanism, it participates in the self-attention calculation as enhanced contextual information, and outputs the classification head to generate the category probability distribution.
9. A fine-grained continuous learning method based on residual concept as described in claim 8, characterized in that: The method further includes: A ternary loss function system is constructed to train the non-frozen module; the ternary loss function system includes: contrastive loss function, cosine loss function, and cross-entropy loss function; wherein: The contrastive loss function is used to constrain the semantic consistency of the task-shared concepts of the first encoder and the contrastive shared concepts of the second encoder, thereby strengthening the clustering of similar samples in the task-shared concept space. The cosine loss function is used to enhance the distinguishability between the task-class unique concept and the task-shared concept of the first encoder; The cross-entropy loss function is used to supervise the classification performance of the model and maintain the discriminativeness of the classification boundary.
Citation Information
Cited By
Classification system completion method and system based on visual injection
CN122310236A