Deep neural network continuous learning method and system based on task-level attention
By employing a deep neural network approach based on task-level attention, combined with a global experience pool and a task attention module, the problems of poor parameter isolation and reusability and insufficient storage capacity in continuous learning are solved. This approach enables efficient learning and memory retention of both new and old tasks, thereby improving the overall performance and stability of the model.
Patent Information
- Application Number
- CN202511974406.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-12-25
AI Technical Summary
Existing continuous learning methods suffer from problems such as poor parameter isolation and reusability, insufficient storage capacity, and difficulty in dynamically balancing constraints in dynamic and complex scenarios, leading to performance degradation and resource waste in multi-task learning.
We employ a deep neural network approach based on task-level attention. By constructing a global experience pool, a hierarchical feature enhancement network, and a task attention module, and combining experience replay loss, consistency regularization loss, and pairwise difference regularization loss, we achieve efficient learning and retention of new and old tasks.
It improves the overall performance of the model in continuous learning scenarios, ensures the ability to learn new tasks and retain old tasks, reduces storage and computing costs, and enhances the stability and robustness of the model in long sequence tasks.
Smart Images

Figure CN121389043A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence and machine learning, and particularly relates to a deep neural network continuous learning method, system and device based on task-level attention. BACKGROUND
[0002] In the field of deep learning, continuous learning enables a deep neural network model to quickly complete model training and parameter updating through incremental learning based on original training. Compared with the traditional machine learning mode of retraining the entire model when new class data is obtained, continuous learning only needs to train part of the model for new data, thereby greatly saving time and computing resources. However, if the existing model is only fine-tuned using new data, the performance of the model on past tasks will be significantly reduced, that is, catastrophic forgetting occurs. At this time, it can be considered that the model has lost the knowledge related to the old task. Therefore, the core task of continuous learning is to efficiently learn the knowledge contained in new data without significantly reducing the application performance of the model on the learned knowledge.
[0003] Currently, continuous learning methods can be mainly divided into three classic categories: the first is the regularization-based method. This method introduces regularization terms such as L2 regularization and elastic network into the loss function to construct a balance constraint mechanism for new and old knowledge, limits the variation range of parameters related to old tasks while optimizing new tasks, thereby effectively reducing the catastrophic forgetting problem of learned old knowledge when the model learns new tasks. The second is the replay-based method. This method retains part of the old task samples with domain representation in the sample storage pool during the training of new tasks, and realizes the dynamic reproduction and consolidation of old knowledge in the new training process by alternately training new and old data or constructing a generated model (such as GAN) to synthesize virtual samples. The third is the parameter isolation-based method. This method aims to construct independent parameter scopes for different tasks, such as modular network design, task-specific adapters or hierarchical parameter grouping, so that the feature extraction and decision logic of each task act on the exclusive parameter space, thereby alleviating the parameter interference problem between tasks from the bottom architecture level.
[0004] The three methods above respectively start from the dimensions of constraint optimization, empirical reuse and architecture design, and systematically deal with the core challenges in continuous learning. However, the existing technologies still have many deficiencies: (1) Parameter isolation type method: Although the independent subnetwork decouples the parameters, it reduces the task interference, but the parameter reuse is poor, the cross-task migration is weak, and the parameters increase exponentially with the increase of tasks, which is difficult to meet the demand of power limited scene; (2) Repetitive method: It depends on the storage of historical samples to reproduce old knowledge, which is limited by the storage capacity. Insufficient buffer can easily lead to representation drift and overfitting of old knowledge, and there are sample storage compliance risks and synthetic sample quality problems in privacy sensitive fields; (3) Regularization method: Balance new and old knowledge through loss function constraint, but there is a contradiction in bidirectional adjustment. Fixed constraints can easily lead to underfitting of new knowledge, and it is difficult to update the constraints when the distribution of old data changes, and it is sensitive to hyperparameters, and it is difficult to dynamically balance in an open environment. These shortcomings seriously restrict the large-scale application of continuous learning in dynamic and complex scenarios. SUMMARY
[0005] The purpose of the present application is a deep neural network continuous learning method and system based on task-level attention, which improves the comprehensive performance of the model in the continuous learning scene, realizes the balance between efficient learning ability of new tasks and memory retention effect of old tasks, and provides a new solution for the application of deep neural networks in multi-task continuous learning environment.
[0006] To achieve the above purpose, the technical scheme adopted by the present application is as follows:
[0007] A deep neural network continuous learning method based on task-level attention, comprising the following steps:
[0008] S1. System initialization: build a global experience pool, a hierarchical feature enhancement network, an exponential moving average model and a classifier; the initial parameters of the exponential moving average model are consistent with the initial parameters of the hierarchical feature enhancement network;
[0009] S2. Task flow receiving: sequentially receive a task flow containing k learning tasks, k>1, wherein each learning task corresponds to a mutually disjoint category subset, and each task is assigned a unique task identity index; the task flow is defined as a category incremental learning scene or a task incremental learning scene according to whether it provides a task identity index in the reasoning stage;
[0010] S3. Sequential training of subtasks: for the tth learning task in the task flow, t from 1 to k, execute the following learning process:
[0011] S31. Obtain the training sample set of the tth learning task, and sample the historical representative samples from the global experience pool to obtain the mixed training batch by combining the historical representative samples with the training sample set;
[0012] S32. perform hierarchical feature extraction and feature enhancement processing on the mixed training batch using the hierarchical feature enhancement network to obtain enhanced features;
[0013] S33. based on the enhanced features obtained in step S32, use the task attention module group to obtain attention weights, and use the sample-level adaptive weights dynamically adjusted according to sample content to be generated;
[0014] S34. fuse the attention weights and the sample-level adaptive weights to obtain fused weights, and fuse the fused weights with the enhanced features obtained in step S32 to obtain fused features;
[0015] S35. input the fused features obtained in step S34 into the classifier to obtain a classification result;
[0016] S36. calculate the total loss, update the parameters of the hierarchical feature enhancement network, the task attention module corresponding to the current task, and the classifier according to the total loss; and update the parameters of the exponential moving average model according to the updated hierarchical feature enhancement network;
[0017] S37. according to a preset strategy, select representative samples from the training sample set of the tth learning task and store them in the global experience pool;
[0018] S4. based on the hierarchical feature enhancement network, the task attention module group and the classifier trained in step S3, predict the input sample to be classified to obtain a prediction result.
[0019] Further, the implementation method of obtaining the attention weights using the task attention module group in step S33 is as follows:
[0020] The task attention module group includes k independent task attention modules, each module corresponding to a unique learning task; the task attention module group adopts one of the following two working modes according to different continuous learning scenarios:
[0021] In the task incremental learning scenario: the module group receives the task identity index of the current training task, directly calls the corresponding task attention module according to the task identity index, and processes the input enhanced features to generate the attention weights.
[0022] In the class incremental learning scenario: the module group inputs the input enhanced features into multiple trained task attention modules at the same time; by calculating the reconstruction error between the enhanced features and the outputs of each module, the module with the smallest reconstruction error is selected as the adaptive module, and the attention weights generated by the adaptive module are output.
[0023] Further, the task attention module in step S33 is constructed as an undercomplete autoencoder, and the process of obtaining the attention weights includes:
[0024] The encoding stage: the layered feature enhancement network output enhanced features are compressed from 512-dimensional vectors to 64-dimensional latent space vectors through a linear encoding layer, a ReLU activation function layer and a bottleneck layer, so as to remove redundant information and extract key features, wherein the ReLU activation function is used to introduce a non-linear factor to enhance the non-linear expression ability of the encoding stage;
[0025] The decoding stage: the 64-dimensional latent space vector is restored to a 512-dimensional vector through a linear decoding layer combined with a Sigmoid activation function, while attention weights are generated.
[0026] Further, the classifier in step S35 is a fully connected layer, when processing the t-th learning task in the task flow and t≥2, the classifier is dynamically expanded by the following method:
[0027] An output node corresponding to the number of classes of the t-th learning task is added at the output end of the fully connected layer to obtain an expanded fully connected layer;
[0028] The weight parameters corresponding to the newly added output nodes are initialized;
[0029] The expanded fully connected layer is trained using a mixed training batch to obtain a classification result output.
[0030] The classifier is configured to:
[0031] In the class-incremental learning scenario, the prediction probabilities of all seen classes are directly output without applying a mask;
[0032] In the task-incremental learning scenario, a binary mask is generated according to the optimal task attention module determined by the current task identity index, the relevant class outputs of the module are retained and the remaining class outputs are set to zero.
[0033] Further, the total loss in step S36 is the weighted sum of the experience replay loss, the pair-wise difference regularization loss and the consistency regularization loss;
[0034] The pair-wise difference regularization loss is calculated based on the difference between the attention weights output by different modules in the task attention module group;
[0035] The consistency regularization loss is the difference between the prediction distribution generated by the fusion features of the same batch of data by the classifier and the exponential moving average model;
[0036] The prediction distribution of the exponential moving average model is calculated by inputting the fusion features into the exponential moving average model through the same mapping logic as the classifier.
[0037] Further, the implementation method of step S4 is:
[0038] S41. extracting enhanced features of the input sample to be classified using the hierarchical feature enhancement network;
[0039] S42. in the class-incremental learning scenario, using the task attention module matcher in the training optimization and control module to calculate the mean square error of the outputs of all trained task attention modules and the enhanced features, and selecting the module with the minimum mean square error as the optimal task attention module; in the task-incremental learning scenario, directly determining the optimal task attention module corresponding to the tth task according to the current task identity index;
[0040] S43. weighting the enhanced features using the attention weights of the optimal task attention module to obtain weighted fusion features;
[0041] S44. inputting the weighted fusion features into the classifier to obtain a prediction result.
[0042] A deep neural network continuous learning system based on task-level attention, comprising: a global experience pool, a data sampling module, a hierarchical feature enhancement network, a task attention module group, a dynamic feature fusion module, a classifier, and a training optimization and control module;
[0043] The global experience pool is used to store and manage representative samples from historical learning tasks;
[0044] The data sampling module is connected to the global experience pool and the current task data stream; it is used to merge the training sample set of the current task with the historical representative samples sampled from the global experience pool to construct a mixed training batch;
[0045] The hierarchical feature enhancement network is connected to the data sampling module; it is used to perform hierarchical feature extraction and enhancement processing on the mixed training batch to obtain enhanced features;
[0046] The task attention module group includes k independent task attention modules, each module corresponding to a learning task; it receives the enhanced features and the optimal task attention module index signal from the training optimization and control module, and outputs the attention weights generated by the matched task attention module according to the task attention module index signal;
[0047] The dynamic feature fusion module is connected to the hierarchical feature enhancement network and the task attention module group, respectively; it is used to fuse the enhanced features and the attention weights to obtain fusion features;
[0048] The classifier is connected to the dynamic feature fusion module; it is used to perform classification calculation on the fusion features to obtain a classification result;
[0049] The training optimization and control module is connected with the classifier, the task attention module group, the hierarchical feature enhancement network and the exponential moving average model respectively; the training optimization and control module calculates the loss based on the received classification result, the attention weight of each group and the prediction distribution of the exponential moving average model, and optimizes the model parameters, and determines and outputs the optimal task attention module index signal based on the enhanced feature.
[0050] Further, the global experience pool comprises a sample selection unit and a storage and capacity management unit.
[0051] The sample selection unit is connected with the task data stream; and is used for selecting representative samples from the training sample set of the tth learning task as historical representative samples after completing the tth learning task.
[0052] The storage and capacity management unit is connected to the sample selection unit, and is used for storing the historical representative samples by using a reservoir sampling algorithm, and dynamically adapting the capacity of the global experience pool based on the training feedback and the task flow data volume.
[0053] Further, the hierarchical feature enhancement network comprises a preprocessing unit and a ResNet-18 backbone network; the preprocessing unit is used as an input end of the hierarchical feature enhancement network, and is used for performing size standardization and pixel normalization processing on the received mixed training batch to obtain standardized data; the ResNet-18 backbone network is connected with the preprocessing unit, and is sequentially provided with an initial feature extraction module, a four-stage series-connected feature extraction and enhancement unit and a global feature integration layer in the data transmission direction; the initial feature extraction module receives the standardized data and performs down-sampling and channel expansion processing to obtain an initial feature map; the four-stage series-connected feature extraction and enhancement unit receives the initial feature, performs hierarchical feature extraction and synchronous enhancement on the initial feature to obtain hierarchical enhanced features; and the global feature integration layer is used for performing spatial global integration on the last-stage hierarchical enhanced features to generate enhanced feature output to the dynamic feature fusion module and the task attention module group.
[0054] Further, the feature extraction and enhancement unit is composed of a feature extraction layer and a feature enhancement module; the feature extraction layer is used for extracting hierarchical features; and the feature enhancement module comprises a channel attention module, a spatial context module, a first feature fusion module and a residual superposition module; wherein:
[0055] The channel attention module is configured to perform global average pooling on the input hierarchical feature, and sequentially undergoes a first full connection layer, a ReLU activation function, a second full connection layer and a Sigmoid activation function processing to generate channel weights, and the channel weights are multiplied with the input hierarchical feature channel by channel;
[0056] The spatial context module is arranged in parallel with the channel attention module, configured to sequentially perform 1*1 convolution dimension reduction, 3*3 depth separable convolution, 1*1 convolution dimension increase, batch normalization and ReLU activation processing on the input hierarchical features to generate spatial context features;
[0057] The first feature fusion module is connected to the output ends of the channel attention module and the spatial context module, configured to element-wise add the output of the channel attention module and the spatial context features output by the spatial context module to obtain fusion enhanced features;
[0058] The residual superposition module is connected to the output end of the first feature fusion module and is configured to element-wise add the fusion enhanced features and the features output by the feature extraction layer to output the final enhanced features.
[0059] Further, the training optimization and control module includes a loss calculation unit, an AdamW optimizer, an exponential moving average model and a task attention module matcher;
[0060] The input end of the loss calculation unit is connected to the classifier, the task attention module group and the exponential moving average model, and the output end is connected to the optimizer; the total loss is calculated according to the received classification result, the attention weight of each group and the prediction distribution of the exponential moving average model; the calculated total loss signal is output to the input end of the optimizer;
[0061] The output end of the optimizer is connected to the hierarchical feature enhancement network, the task attention module group and the classifier respectively, for updating the parameters of the hierarchical feature enhancement network, the task attention module group and the classifier according to the received total loss signal;
[0062] The input end of the exponential moving average model is connected to the parameter update end of the hierarchical feature enhancement network; the exponential moving average model is configured to: according to the updated parameters of the hierarchical feature enhancement network, update the parameters of the exponential moving average model by the exponential moving average algorithm; and receive the fusion features output by the dynamic feature fusion module, generate a prediction distribution through the same mapping logic as the classifier; output the generated prediction distribution to the loss calculation unit for calculating the consistency regularization loss;
[0063] The input end of the task attention module matcher is connected to the hierarchical feature enhancement network to receive the enhanced features, and access each module in the task attention module group;
[0064] The matcher is configured to: in a category incremental learning scene, input the enhanced feature into each trained task attention module at the same time, obtain respective outputs, calculate the mean square error between the enhanced feature and each output, and determine the optimal task attention module index signal according to the minimum error; in a task incremental learning scene, directly receive the current task identity index signal as the optimal task attention module index signal. Finally, the optimal task attention module index signal is output to the task attention module group.
[0065] An electronic device comprises a processor and a memory, and the memory stores a computer program, wherein the program is executed by the processor to implement the steps of the task-level attention-based deep neural network continuous learning method.
[0066] The application simulates human continuous learning ability, constructs a special task attention module (TLAM), and fuses experience replay loss, consistency regularization loss and pair difference regularization loss mechanism, to realize effective screening, storage and utilization of different task features. At the same time, by using a hierarchical feature enhancement network and a fusion mechanism, the performance of the model in the continuous learning scene is significantly improved, which not only guarantees good learning ability for new tasks, but also maximizes the memory of old tasks. In specific implementation: the hierarchical feature enhancement uses a convolutional neural network as a backbone network, and integrates a feature enhancement module in the backbone network to improve the feature expression ability; a task-specific feature screening mechanism based on an undercomplete autoencoder is used to construct a task feature attention module, to accurately remove irrelevant noise features and retain core task features; with the help of bidirectional information routing and pair difference regularization loss mechanism, task key features are strengthened to avoid feature confusion and interference; through dynamic sparse regularization and long sequence scalability mechanism, the storage and calculation cost of the model is reduced, and its stability and robustness in long sequence tasks are enhanced; a feature-level dynamic routing fusion method is used to dynamically allocate fusion weights according to semantic similarity, to improve the task discriminability of the features. In the experimental verification aspect, the TLAMiC method completes the test on multiple benchmark datasets such as Seq-CIFAR10, Seq-CIFAR100 and Seq-TinyImageNet.
[0067] Compared with existing technologies such as experience replay (ER), deep residual network (DRN) and progressive neural network (PNN), the method has significant advantages in key indicators. BRIEF DESCRIPTION OF DRAWINGS
[0068] Figure 1 The figure is a task-level attention-based deep neural network continuous learning system structure schematic diagram for an embodiment;
[0069] Figure 2 The figure is a hierarchical feature enhancement network schematic diagram for an embodiment;
[0070] Figure 3 Task attention module workflow schematic diagram for the embodiment;
[0071] Figure 4 Fusion module structure schematic diagram provided for the embodiment;
[0072] Figure 5 Learning process schematic diagram performed for the tth learning task in the task flow in the embodiment. DETAILED DESCRIPTION
[0073] The technical solutions of the present application will be described in detail below with reference to the accompanying drawings and embodiments.
[0074] The present application proposes a deep neural network continuous learning system based on task-level attention. The deep neural network continuous learning system is built on a modular hardware architecture. A rack server is used for local training, and the typical configuration is as follows: the CPU uses Intel® Xeon® Gold 6226R, the memory is 128 GB, and the GPU configuration is 4 x NVIDIA A100 40 GB. The remaining hardware (such as enterprise-level NVMe storage, redundant power supply, and data center network port) is selected according to the standard of a regular server to ensure the stable operation of long-time training and data read-write requirements. The system software layer is developed based on the PyTorch deep learning framework, which can realize the end-to-end training of the backbone network, task attention module (TLAM), and decision head. The system structure is shown in Figure 1 As shown in the figure, it includes a global experience pool, a data sampling module, a hierarchical feature enhancement network, a dynamic gating fusion module, a classifier, and a training optimization and control module. At runtime, first, system initialization is performed, hardware configuration and hyperparameter presetting are completed; then, new task data is preprocessed to obtain enhanced features; then, TLAM training is carried out, and the global experience pool is updated through the reservoir sampling method, and mixed training is carried out; in the inference stage, the optimal TLAM is selected according to the continuous learning scene: in the task incremental scene, the task index is directly called; in the class incremental scene, the TLAM matcher selects the TLAM with the smallest error based on the reconstruction mean square error of the input enhanced features to generate task-level attention, and the features are weighted and fused to input the classifier to output the prediction result. In the training stage, the total loss is composed of experience replay loss, consistency regularization loss, and pairwise difference regularization loss for joint optimization, and task priority weight is introduced to alleviate the bias of recent tasks; finally, the accuracy, forgetting rate, and parameter efficiency are tested on the benchmark dataset to complete verification and evaluation. The details of each module are as follows:
[0075] The global experience pool serves as a data storage module for storing and managing representative samples from historical learning tasks. The global experience pool comprises a sample selection unit and a storage and capacity management unit. The sample selection unit is connected to a task data stream, i.e., a sequence data stream, and is configured to select representative samples from a training sample set of the tth learning task as historical representative samples after completion of the tth learning task. The storage and capacity management unit is connected to the sample selection unit and is configured to store the historical representative samples using a reservoir sampling algorithm and dynamically adapt the capacity of the global experience pool based on training feedback and the amount of task stream data.
[0076] The data sampling module is connected to the global experience pool and a current task data stream, and is configured to merge the training sample set of the current task with the historical representative samples sampled from the global experience pool to construct a mixed training batch.
[0077] The hierarchical feature enhancement network is connected to the data sampling module and is configured to perform hierarchical feature extraction and enhancement processing on the mixed training batch to obtain enhanced features. As shown in Figure 2 The hierarchical feature enhancement network comprises a preprocessing unit and a ResNet-18 backbone network. The preprocessing unit serves as an input end of the hierarchical feature enhancement network and is configured to perform size standardization and pixel normalization processing on the received mixed training batch to obtain standardized data. The ResNet-18 backbone network is connected to the preprocessing unit and sequentially comprises an initial feature extraction module, a four-stage series-connected feature extraction and enhancement unit, and a global feature integration layer in the direction of data transmission. The initial feature extraction module receives the standardized data and performs down-sampling and channel expansion processing to obtain an initial feature map. The four-stage series-connected feature extraction and enhancement unit receives the initial feature and performs hierarchical feature extraction and synchronous enhancement on the initial feature to obtain hierarchical enhanced features. The global feature integration layer is configured to perform spatial global integration on the last-stage hierarchical enhanced features to generate enhanced features, which are output to a dynamic feature fusion module and a task attention module group. The feature extraction and enhancement unit of the present embodiment comprises a feature extraction layer and a feature enhancement module. The feature extraction layer is configured to extract hierarchical features. The feature enhancement module comprises a channel attention module, a spatial context module, a first feature fusion module, and a residual superposition module. Wherein:
[0078] The channel attention module is configured to perform global average pooling on the input hierarchical features and sequentially pass through a first fully connected layer, a ReLU activation function, a second fully connected layer, and a Sigmoid activation function to generate channel weights, and multiply the channel weights with the input hierarchical features channel by channel.
[0079] The spatial context module is arranged in parallel with the channel attention module, configured to sequentially perform 1x1 convolution dimension reduction, 3x3 depth separable convolution, 1x1 convolution dimension increase, batch normalization and ReLU activation processing on the input hierarchical feature to generate spatial context features;
[0080] The first feature fusion module is connected to the output ends of the channel attention module and the spatial context module, configured to element-wise add the output of the channel attention module and the spatial context features output by the spatial context module to obtain fusion enhanced features.
[0081] The residual superposition module is connected to the output end of the first feature fusion module, and is configured to element-wise add the fusion enhanced features and the features output by the feature extraction layer to output the final enhanced features.
[0082] As shown in Figure 4 The dynamic gating fusion module includes a task attention module group, a dynamic gating network module and a second fusion module. The task attention module group includes k independent task attention modules, each corresponding to a learning task; it receives enhanced features and an optimal task attention module index signal from the training optimization and control module, and outputs the attention weight generated by the matching task attention module according to the task attention module index signal. The dynamic gating network module includes sequentially connected enhanced features from the hierarchical feature enhancement network, and the enhanced features are sequentially processed by the first fully connected layer dimension reduction mapping, the ReLU activation function layer for nonlinear activation, the second fully connected layer dimension reconstruction, and the Sigmoid activation function for nonlinear activation to generate sample-level dynamic weights. The second fusion module receives the attention weight output by the task attention module group, the sample-level dynamic weight output by the dynamic gating network module, and the enhanced features output by the hierarchical feature enhancement network, fuses the attention weight and the sample weight to obtain fusion weight, and element-wise multiplies the fusion weight and the enhanced features to obtain the final fusion features. The fusion formula of the embodiment is:
[0083] α f *TLAM+(1-α f )*GateNet;
[0084] Wherein, α f is a balance parameter, controlling the fusion ratio of TLAM and GateNet; TLAM is the output of the task attention module; GateNet is the output of the dynamic gating network module;
[0085] The classifier is connected to the dynamic gating fusion module; for classifying and calculating the fusion features to obtain the classification result.
[0086] The training optimization and control module is connected to the classifier, the task attention module group and the hierarchical feature enhancement network respectively. The training optimization and control module calculates the loss and optimizes the model parameters based on the received classification results, the attention weight of each group and the prediction distribution of the exponential moving average (EMA) model, and determines and outputs the optimal task attention module index signal based on the enhanced features. The training optimization and control module includes a loss calculation unit, an AdamW optimizer, an exponential moving average (EMA) model and a task attention module matcher (TLAM matcher). The input end of the loss calculation unit is connected to the classifier, the task attention module group and the exponential moving average model, and the output end is connected to the optimizer; the total loss is calculated according to the received classification results, the attention weight of each group and the prediction distribution of the exponential moving average model; and the calculated total loss signal is output to the input end of the optimizer. The output end of the optimizer is connected to the hierarchical feature enhancement network, the task attention module group and the classifier respectively, and the parameters of the hierarchical feature enhancement network, the task attention module group and the classifier are updated according to the received total loss signal. The optimizer adopts the AdamW optimizer, and the initial learning rate is set to 1e−4. The learning rate can make the parameters converge quickly in the early stage of model training, and is attenuated by 0.5 times every 5 tasks as the training proceeds. The AdamW optimizer can effectively prevent the overgrowth of model parameters during training and avoid overfitting. The learning rate attenuation strategy can make the model learn quickly in the early stage of training, and reduce the learning rate when approaching the optimal solution, so that the model converges more stably to the optimal solution. The training effect and performance of the model are improved.
[0087] The input end of the exponential moving average model is connected to the parameter updating end of the hierarchical feature enhancement network; the exponential moving average model is configured to: update the parameters of the exponential moving average model by the exponential moving average algorithm according to the updated parameters of the hierarchical feature enhancement network; receive the fused features output by the dynamic feature fusion module, generate a prediction distribution through the same mapping logic as the classifier; and output the generated prediction distribution to the loss calculation unit for calculating the consistency regularization loss.
[0088] The input end of the task attention module matcher is connected to the hierarchical feature enhancement network to receive the enhanced features, and each module in the task attention module group is accessed; the matcher is configured to: in the category incremental learning scenario, input the enhanced features into each trained task attention module at the same time, obtain the respective outputs, calculate the mean square error between the enhanced features and the respective outputs, and determine the optimal task attention module index signal according to the minimum error; in the task incremental learning scenario, directly receive the current task identity index signal as the optimal task attention module index signal. Finally, the optimal task attention module index signal is output to the task attention module group.
[0089] Based on the above-mentioned task-level attention-based deep neural network continuous learning system, this embodiment also provides a task-level attention-based deep neural network continuous learning method, including the following steps:
[0090] S1. System Initialization:
[0091] A global experience pool is constructed and initialized to empty. In this embodiment, the global experience pool serves as a data storage module, employing an NVMe solid-state drive supporting HMB (Host Memory Buffer) technology to construct a high-speed data buffer. This technology allows the SSD controller to access 64-128MB of host memory via the PCIe channel as an FTL mapping table cache, enabling fast read / write and dynamic sample replacement capabilities, even without onboard DRAM. The initial capacity of the global experience pool is set to 200 samples, a value that takes into account the typical task data scale and system storage resources.
[0092] A hierarchical feature enhancement network is constructed to serve as a shared feature extractor throughout the task flow.
[0093] Construct an exponential moving average (EMA) model and set the initial parameters of the EMA model to be consistent with the initial parameters of the hierarchical feature enhancement network.
[0094] S2. Task Flow Reception: Receives k learning tasks sequentially, k > 1. Each learning task corresponds to a set of categories, and the category sets of each task are mutually exclusive. To clarify the boundaries of subsequent inference, the task identity is defined as: the index number t uniquely corresponding to the t-th learning task in the task flow, t ∈ {1, 2, ..., k}. This number is used to indicate the learning task to which a test sample belongs and uniquely determine the subset of categories covered by that task. Task Flow Reception: Receives a task flow containing k consecutive learning tasks, k > 1. All task lists come from the same overall category set, and each learning task corresponds to a non-overlapping subset of categories across all tasks. The task flow is divided into two continuous learning scenarios:
[0095] In the Class Incremental Learning (Class-IL) scenario: During the inference phase, the model is provided with a task identity, and the model only needs to complete the classification within the subset of categories specified by that identity;
[0096] Task-Incremental Learning (Task-IL) scenario: During the inference phase, the model is not provided with a task identity, and the model needs to complete the classification within the scope of all known categories;
[0097] S3. Task-based Sequential Training: For the t-th learning task in the task flow, t iterates sequentially from 1 to k, executing as follows: Figure 5 The learning process shown:
[0098] S31. Obtain the training sample set D corresponding to the t-th learning task. t .
[0099] S32. Sample representative samples from the previous (t-1)th learned task from the global experience pool, and fuse the sampled representative samples with the training sample set D t to obtain a mixed training batch.
[0100] S33. Input the mixed training batch into the hierarchical feature enhancement network to perform hierarchical feature extraction and feature enhancement processing, and obtain enhanced features.
[0101] S34. Input the enhanced features into the dynamic gated fusion module, and through the task attention module group corresponding to the tth task: in the class incremental learning scenario, select the matched task attention module according to the criterion of minimum reconstruction error, complete feature screening and weight learning, and then obtain the attention weight of each dimension; in the task incremental learning scenario, directly call the corresponding task attention module according to the current task identity index, complete feature screening and weight learning, and then obtain the attention weight of each dimension; after sequentially passing through the cascade processing of dimension reduction mapping, nonlinear activation, dimension reconstruction, and normalization activation, the sample-level dynamic weight matching the dimension of the input enhanced feature is generated; after the sample-level dynamic weight and the attention weight are fused, they are fused with the enhanced features to obtain the final fusion features.
[0102] In this embodiment, the enhanced features are input into the task attention module group, and the attention weight of each dimension in the enhanced features is obtained by the task attention module corresponding to the tth task and the feature screening and weight learning with the reconstruction error as the constraint. In this embodiment, the task attention module is constructed as an undercomplete autoencoder, which is composed of a linear encoding layer and a linear decoding layer, and realizes efficient compression and screening of task-specific features through a bottleneck structure. The workflow of the task attention module is as shown in Figure 3 .
[0103] The encoding stage is a linear layer with a ReLU activation function: the enhanced features output by the hierarchical feature enhancement network are compressed from a 512-dimensional vector to a 64-dimensional latent space, in which redundant information is removed and key features are extracted; the ReLU activation function introduces a nonlinear factor to enhance the learning ability of the network for complex feature mapping relationships.
[0104] The decoding stage is a linear layer with a Sigmoid activation function: the 64-dimensional latent space vector is restored to a 512-dimensional vector, and the attention weight is generated at the same time.
[0105] The task attention module of the embodiment is constrained by reconstruction error, and irrelevant noise features are accurately removed and core task features are retained through a closed-loop process of "compression-recovery". Practical application shows that it can effectively reduce the cosine similarity of features between tasks, greatly weaken cross-task interference, and ensure that the features of each task have high uniqueness; the generated attention weight is used for subsequent weighted processing of enhanced features, further highlighting the features related to the current task, and thus improving the selection ability of task-specific features and the discrimination of feature representation, providing strong support for the task attention module to process multi-task scenarios.
[0106] S35. The fusion features are input into a classifier for classification to obtain a classification result. The classifier is a fully connected layer, when processing the tth learning task in the task flow and t≥2, the classifier is dynamically expanded by the following method:
[0107] An output node corresponding to the number of classes of the tth learning task is added at the output end of the fully connected layer to obtain an expanded fully connected layer;
[0108] The weight parameters corresponding to the newly added output nodes are initialized;
[0109] The expanded fully connected layer is trained using a mixed training batch to obtain a classification result output.
[0110] In the embodiment, the classifier is configured to:
[0111] In the task incremental learning (Task-IL) scenario, when the task identity is known, a binary mask is generated according to the task corresponding to the optimal task attention module selected by step S42, to retain the output of the relevant classes and set the output of the remaining classes to zero;
[0112] In the class incremental learning (Class-IL) scenario, the classifier directly outputs the prediction probabilities of all classes without the need for a mask mechanism.
[0113] S37. The total loss is calculated using a total loss function, and the parameters of the hierarchical feature enhancement network, the current tth task attention module and the classifier are updated according to the total loss; the total loss function is the weighted sum of the experience replay loss, the pair-wise difference regularization loss and the consistency regularization loss, and its mathematical expression is:
[0114] ;
[0115] wherein, is the total loss function, is the experience replay loss, is the consistency regularization loss, is the weight coefficient of the consistency regularization loss, a weight coefficient of the pair-wise difference regularization loss, a pair-wise difference regularization loss;
[0116] The experience replay loss is used to measure the difference between the predicted result and the true label, guiding the model to learn the correct classification, and the calculation formula is:
[0117] ;
[0118] wherein is the cross-entropy loss on the current task, is a weight coefficient of the experience replay loss, is the expectation of the samples in the memory buffer , is the expectation of the samples in the memory buffer , is the cross-entropy loss function, is the softmax activation function, is the entire lifelong learning model, is the i-th input sample (image) from the buffer, is the true label corresponding to .
[0119] The consistency regularization loss is the difference between the prediction distribution of the fusion features of the same batch of data by the classifier and the exponential moving average (EMA) model, and the calculation formula is:
[0120] ;
[0121] wherein is the expectation of the triplets in the memory buffer , is the i-th input sample (image) from the buffer, is the pre-softmax response of the EMA model, is the squared L2 norm of the vector, is the entire lifelong learning model. To avoid functional redundancy of the TLAM, during the training of each new task, the pair-wise difference regularization loss L pd
[0122] ;
[0123] wherein, wherein, indicates the summation over all historical tasks,
[0124] is the data set / data distribution of the i-th task samples in the batch expectations, enhanced features, softmax activation function, current task TLAM module, TLAM module of historical tasks, sum of absolute values of vector components.
[0125] By including in the total loss function and minimizing , the new and old TLAMs are forced to learn differentiated feature representations. In long sequence tasks, the ability to distinguish between tasks decreases as the number of tasks increases, which can be avoided. Each TLAM can focus on learning unique features of a specific task to improve task distinguishability and thus improve model performance in long sequence tasks.
[0126] In addition, for task recent bias, the embodiment additionally introduces a task priority weight in the total loss function to suppress the loss of recent tasks and compensate for the loss of old tasks to adjust the loss term, alleviate the model's overfitting tendency to recent tasks, and balance new knowledge learning and old knowledge retention. The adjusted loss term is:
[0127] ;
[0128] wherein, is the total loss after introducing the task priority; is the task sequence number currently being learned; is the historical task index , is each task index traversed when calculating weight normalization; is the priority weight of the th task, which is defined as:
[0129]
[0130] wherein, is a temperature coefficient that controls the decay / growth speed of the historical task priority, is a temperature parameter that controls the strength of "recent suppression / old task compensation", is a natural exponential function.
[0131] The comprehensive loss of the th task is defined as:
[0132]
[0133] wherein, For the first Experience replay (ER) loss for each task, For the first Consistency regularization loss for each task, For the first Pairwise difference regularization loss for each task; and These are the weight coefficients for the consistency regularization term and the pairwise difference regularization term, respectively, consistent with their meanings in the total loss function.
[0134] Calibration regularization: Temperature scaling is added to the classifier output layer to improve model confidence calibration by minimizing the expected calibration error (ECE). The formula for calculating the expected calibration error is:
[0135] ;
[0136] in, This refers to the number of bins after dividing the sample according to confidence level. For the first The set of samples contained in each confidence bin. For set The number of samples in the middle To include the total number of samples used in the calculation to minimize the expected calibration error, and These represent the accuracy and average confidence level within each bin.
[0137] Temperature scaling adjusts the Softmax output by introducing a parameter T:
[0138] ;
[0139] in, This is a Softmax function with a temperature parameter T. The first of the Softmax output vectors One portion, The logits vector output by the classifier. For logits vector The One portion, The total number of categories, It is a natural exponential function.
[0140] By optimizing T to minimize ECE, the confidence level of the model predictions is better matched with the actual accuracy, thereby improving the reliability and interpretability of the output.
[0141] The prediction distribution of the exponential moving average model is calculated by inputting the fused features into the exponential moving average model through the same mapping logic as the classifier.
[0142] S38. Update the parameters of the exponential moving average model using the updated hierarchical feature enhancement network parameters, and the update formula is:
[0143]
[0144] wherein, is the parameter of the EMA model at the tth update time, is the smoothing coefficient of EMA, is the EMA parameter at the last update time, is the parameter vector of the main model at the tth update time, is the parameter of the main model at the initial time t=0.
[0145] The EMA model continuously tracks the parameter changes of the main model, providing stable and consistent supervision signals for subsequent training.
[0146] In this embodiment, the EMA model update rate is the decay parameter β of the exponential moving average model. The EMA model generates a smoothed model version by weighted averaging of historical model parameters, and in continuous learning, it can ensure the smooth transmission of old knowledge. When training a new task, the EMA model retains the knowledge information of the old task, and through comparison and fusion with the current model, it helps the model to learn new knowledge while not forgetting old knowledge.
[0147] S39. After completing the training of the tth learning task, a portion of representative samples are selected from the training sample set of the tth learning task as historical representative samples and stored in the global experience pool according to the reservoir sampling method. Specifically:
[0148] During the training of the new task, new task samples are continuously stored in the global experience pool according to the equal probability principle; when the global experience pool reaches the preset upper limit of capacity, old samples in the pool are randomly replaced through an algorithm to ensure that the samples in the pool always cover the data distribution of different tasks, providing rich and balanced multi-task data support for subsequent task training.
[0149] In the training iteration of the subsequent task, B samples are sampled from the current task dataset and the global experience pool respectively to form a mixed training batch for experience replay. This way can let the model review historical task samples while learning new knowledge, realize cross-task knowledge consolidation and transfer, and effectively avoid catastrophic forgetting.
[0150] S4. Dynamic inference: based on the hierarchical feature enhancement network, task attention module group and classifier trained in step S3, dynamic inference is performed on the input sample to be classified. In this step, the classifier is configured to: according to the task corresponding to the optimal task attention module selected by step S42, generate a binary mask to retain the output of the relevant category, while setting the output of all other irrelevant categories in the classifier to zero. In this embodiment, the classifier The weighted feature is linearly transformed and Softmax activated to output multi-task classification probabilities: The Softmax function converts the output of the classifier into a probability distribution, so that each category has a corresponding probability value, making it easy for users to intuitively understand the model's prediction likelihood for different categories. In the task incremental learning scenario, the output layer dynamically masks irrelevant categories according to the task label. For example, when the system is processing the current task, only the categories related to the task are focused on, and the prediction probabilities of other irrelevant categories are set to 0, ensuring that the prediction is only for the valid categories of the current task. This dynamic masking mechanism can avoid decision errors caused by redundant information in the model during multi-task learning, improving the accuracy and reliability of the model in practical applications.
[0151] S41. Extract enhanced features with 512-dimensional vectors from the input sample to be classified using the hierarchical feature enhancement network;
[0152] S42. In the category incremental learning scenario, use the task attention module matcher (TLAM matcher) in the training optimization and control module to calculate the mean square error of the output of all trained task attention modules and the enhanced features, and select the task attention module with the smallest mean square error as the optimal task attention module; in the task incremental learning scenario, directly determine the optimal task attention module according to the current task identity index. The system can automatically select the most suitable TLAM according to the characteristics of the input sample, extract features related to the current task, and improve the accuracy and efficiency of inference.
[0153] S43. Weight the enhanced features using the attention weights of the optimal task attention module to obtain weighted fusion features;
[0154] S44. Input the weighted fusion features into the classifier to obtain the prediction result. In this embodiment, the classifier linearly transforms and Softmax activates the weighted features to output multi-task classification probabilities. In the task incremental learning scenario, the output layer dynamically masks irrelevant categories according to the task label. Ensuring that the prediction is only for the valid categories of the current task. Avoiding decision errors caused by redundant information in the model during multi-task learning, improving the accuracy and reliability of the model in practical applications.
[0155] Experimental verification and performance evaluation:
[0156] Benchmark setup:
[0157] Experiments are conducted on benchmark datasets such as Seq-CIFAR10, Seq-CIFAR100 and Seq-TinyImageNet, with task numbers set to 5-20 and buffer capacity set to 200-500 samples. Comparative methods include experience replay (ER), deep residual network (DRN) and progressive neural networks (PNNs).
[0158] Key performance indicators are shown in Table 1:
[0159] Average accuracy: TLAMiC achieves 76.38% in Seq-CIFAR100 (500 buffer, 20 tasks), which is significantly higher than ER (63.09%) and PNNs (74.01%); forgetting rate: the average accuracy of old tasks decreases by only 15.68%, which is nearly 50% lower than ER (31.36%); parameter efficiency: the total parameter growth is only 12% (from 11.23 million to 12.54 million) under 20 tasks, which is much lower than the 23-fold growth (from 11.23 million to 26.45 million) of PNNs.
[0160] Table 1 Key performance indicators
[0161]
[0162] In complex image tasks involving occlusion and viewpoint changes: TLAMiC improves the accuracy retention rate of old tasks by 22.4% through a dynamic feature selection mechanism, demonstrating its robustness in real-world scenarios.
[0163] In summary, the present application has the following advantages compared to the prior art:
[0164] The task recognition accuracy is significantly improved. In the Seq-CIFAR100 task, the average accuracy of the Class-IL scenario is 50.11%, which is 15.3% higher than the baseline DER++, and the Task-IL scenario is 76.38%, which surpasses the parameter isolation method PNNs, the anti-forgetting ability is greatly enhanced, the forgetting rate is reduced by 45% compared with ER, the old task accuracy retention rate is improved by 30% under the 500 buffer scale, and the model generalization and calibration performance are optimized, the task recent bias is reduced by 58%, and the expected calibration error (ECE) is only 12.53%; In terms of model efficiency, the parameter expansion is excellent, the single TLAM parameter is only 0.3% of the backbone network, and the cumulative parameter growth of 20 tasks is only 11%, which is much lower than the exponential growth of PNNs and other methods; In terms of long sequence learning robustness, through the reservoir sampling and dynamic feature selection mechanism, the average accuracy in the 20-task long sequence is 84%, which is more than 20% higher than traditional methods, breaking through the capacity saturation bottleneck of fixed capacity models, and suitable for large-scale continuous learning scenarios.
Claims
1. A deep neural network continual learning method based on task-level attention, characterized in that, The method comprises the following steps: S1. System initialization: build a global experience pool, a hierarchical feature enhancement network, an exponential moving average model, and a classifier; the initial parameters of the exponential moving average model are consistent with the initial parameters of the hierarchical feature enhancement network; S2. Task stream receiving: sequentially receive a task stream containing k learning tasks, k>1, wherein each learning task corresponds to a mutually disjoint category subset, and each task is assigned a unique task identity index; the task stream is defined as a category incremental learning scenario or a task incremental learning scenario according to whether the reasoning stage provides the task identity index; S3. Sequential training by task: for the tth learning task in the task stream, t is from 1 to k, the following learning process is performed: S31. Obtain the training sample set of the tth learning task, and sample the historical representative samples from the global experience pool, combine the historical representative samples with the training sample set to obtain a mixed training batch; S32. Perform hierarchical feature extraction and feature enhancement processing on the mixed training batch using the hierarchical feature enhancement network to obtain enhanced features; S33. Based on the enhanced features obtained in step S32, use the task attention module group to obtain attention weights, and use the sample-level adaptive weight dynamically adjusted according to the sample content; S34. Fuse the attention weights and the sample-level adaptive weights to obtain fused weights, and fuse the fused weights with the enhanced features obtained in step S32 to obtain fused features; S35. Input the fused features obtained in step S34 into the classifier to obtain a classification result; S36. Calculate the total loss, and update the parameters of the hierarchical feature enhancement network, the task attention module corresponding to the current task, and the classifier according to the total loss; update the parameters of the exponential moving average model according to the updated hierarchical feature enhancement network; S37. According to a predetermined strategy, select representative samples from the training sample set of the tth learning task and store them in the global experience pool; S4. Based on the hierarchical feature enhancement network, the task attention module group, and the classifier trained in step S3, predict the input sample to be classified to obtain a prediction result. 2.The task-level attention based deep neural network continual learning method of claim 1, wherein, The implementation method of obtaining attention weights in step S33 using a task attention module group is as follows: The task attention module group comprises k independent task attention modules, each module corresponding to a learning task; the task attention module group adopts one of the following two working modes according to different continuous learning scenarios: In the task incremental learning scenario: the module group receives the task identity index of the current training task, directly calls the corresponding task attention module according to the task identity index, and processes the input enhanced features to generate the attention weights; In the category incremental learning scenario: the module group inputs the input enhanced features into multiple trained task attention modules; By calculating the mean square error between the enhanced features and the outputs of each module, select the module with the smallest mean square error as the adaptive module, and output the attention weights generated by the adaptive module. 3.The task-level attention based deep neural network continual learning method of claim 2, wherein, The task attention module in step S33 is constructed as an undercomplete autoencoder, and the process of obtaining attention weights includes: The encoding stage: the layered feature enhancement network output enhanced features are compressed from 512-dimensional vectors to 64-dimensional latent space vectors through a linear encoding layer, a ReLU activation function layer and a bottleneck layer, so as to remove redundant information and extract key features, wherein the ReLU activation function is used to introduce a non-linear factor to enhance the non-linear expression capability of the encoding stage; The decoding stage: the 64-dimensional latent space vectors are restored to 512-dimensional vectors through a linear decoding layer combined with a Sigmoid activation function, while attention weights are generated. 4.The task-level attention based deep neural network continual learning method of claim 1, wherein, The total loss in the step S36 is a weighted sum of the experience replay loss, the pair-wise difference regularization loss and the consistency regularization loss; The pair-wise difference regularization loss is calculated based on the difference between the attention weights output by different modules in the task attention module group; The consistency regularization loss is the difference between the prediction distribution generated by the fusion features of the same batch of data by the classifier and the exponential moving average model; The prediction distribution of the exponential moving average model is calculated by inputting the fusion features into the exponential moving average model through the same mapping logic as the classifier. 5.The task-level attention based deep neural network continual learning method of claim 1, wherein, The implementation method of the step S4 is: S41. Extracting enhanced features of the input sample to be classified using the layered feature enhancement network; S42. In the class incremental learning scenario, using the task attention module matcher in the training optimization and control module to calculate the mean square error of the outputs of all trained task attention modules and the enhanced features, and selecting the module with the smallest mean square error as the optimal task attention module; In the task incremental learning scenario, the optimal task attention module corresponding to the tth task is determined directly according to the current task identity index; S43. Weighting the enhanced features using the attention weights of the optimal task attention module to obtain weighted fusion features; S44. Inputting the weighted fusion features into the classifier to obtain the prediction result. 6.A deep neural network continual learning system based on task-level attention, characterized in that, It comprises: a global experience pool, a data sampling module, a layered feature enhancement network, a task attention module group, a dynamic feature fusion module, a classifier and a training optimization and control module; The global experience pool is used to store and manage representative samples from historical learning tasks; The data sampling module is connected to the global experience pool and the current task data stream; It is used to merge the training sample set of the current task with the historical representative samples sampled from the global experience pool to construct a mixed training batch; The layered feature enhancement network is connected to the data sampling module; It is used to perform layered feature extraction and enhancement processing on the mixed training batch to obtain enhanced features; The task attention module group comprises k independent task attention modules, each of which corresponds to a learning task; It receives the enhanced features and the optimal task attention module index signal from the training optimization and control module, and outputs the attention weights generated by the matched task attention module according to the task attention module index signal; The dynamic feature fusion module is connected to the layered feature enhancement network and the task attention module group, respectively; It is used to fuse the enhanced features and the attention weights to obtain fusion features; The classifier is connected to the dynamic feature fusion module; The classification result is obtained by performing classification calculation on the fused features. The training optimization and control module is connected with the classifier, the task attention module group, the hierarchical feature enhancement network and the exponential moving average (EMA) model respectively; the training optimization and control module calculates the loss and optimizes the model parameters based on the received classification result, the attention weight of each group and the prediction distribution of the exponential moving average (EMA) model, and determines and outputs the optimal task attention module index signal based on the enhanced features. 7.The task-level attention based deep neural network continual learning system of claim 6, wherein, The global experience pool comprises a sample selection unit and a storage and capacity management unit. The sample selection unit is connected with the task data stream. The representative samples are selected from the training sample set of the tth learning task as historical representative samples after completing the tth learning task. The storage and capacity management unit is connected to the sample selection unit, and is used for storing the historical representative samples by using a reservoir sampling algorithm, and dynamically adapting the capacity of the global experience pool based on training feedback and task flow data volume. 8.The task-level attention based deep neural network continual learning system of claim 6, wherein, The hierarchical feature enhancement network comprises a preprocessing unit and a ResNet-18 backbone network; the preprocessing unit is used as an input end of the hierarchical feature enhancement network, and is used for performing size standardization and pixel normalization processing on the received mixed training batch to obtain standardized data; the ResNet-18 backbone network is connected with the preprocessing unit, and is sequentially provided with an initial feature extraction module, a four-stage series-connected feature extraction and enhancement unit and a global feature integration layer along a data transmission direction; the initial feature extraction module receives the standardized data and performs down-sampling and channel expansion processing to obtain an initial feature map; the four-stage series-connected feature extraction and enhancement unit receives the initial feature, performs hierarchical feature extraction and synchronous enhancement on the initial feature to obtain hierarchical enhanced features; The global feature integration layer is used for performing spatial global integration on the last-stage hierarchical enhanced features to generate enhanced feature output to the dynamic feature fusion module and the task attention module group. 9.The task-level attention based deep neural network continual learning system of claim 8, wherein, The feature extraction and enhancement unit is composed of a feature extraction layer and a feature enhancement module; the feature extraction layer is used for extracting hierarchical features; the feature enhancement module comprises a channel attention module, a spatial context module, a first feature fusion module and a residual superposition module; wherein: The channel attention module is configured to perform global average pooling on the input hierarchical features, and sequentially undergo first full connection layer, ReLU activation function, second full connection layer and Sigmoid activation function processing to generate channel weights, and multiply the channel weights with the input hierarchical features channel by channel; The spatial context module is arranged in parallel with the channel attention module, and is configured to sequentially perform 1×1 convolution dimension reduction, 3×3 depth separable convolution, 1×1 convolution dimension increase, batch normalization and ReLU activation processing on the input hierarchical features to generate spatial context features; The first feature fusion module is connected with the output ends of the channel attention module and the spatial context module, and is configured to add the output of the channel attention module and the spatial context features output by the spatial context module element by element to obtain fused enhanced features; A residual superposition module is connected to the output end of the first feature fusion module and is configured to perform element-by-element addition of the fused enhanced feature and the feature output by the feature extraction layer, and output the final enhanced feature. 10.The task-level attention based deep neural network continual learning system of claim 9, wherein, The training optimization and control module includes a loss calculation unit, an AdamW optimizer, an exponential moving average (EMA) model, and a task attention module matcher; The input end of the loss calculation unit is connected to the classifier, the task attention module group, and the exponential moving average model, and the output end is connected to the optimizer; the total loss is calculated according to the received classification result, the attention weight of each group, and the prediction distribution of the exponential moving average model; The calculated total loss signal is output to the input end of the optimizer; The output end of the optimizer is connected to the hierarchical feature enhancement network, the task attention module group, and the classifier, respectively, for updating the parameters of the hierarchical feature enhancement network, the task attention module group, and the classifier according to the received total loss signal; The input end of the exponential moving average model is connected to the parameter update end of the hierarchical feature enhancement network; the exponential moving average model is configured to: according to the updated parameters of the hierarchical feature enhancement network, update the parameters of the exponential moving average model by the exponential moving average algorithm; and receive the fused feature output by the dynamic feature fusion module, generate a prediction distribution through the same mapping logic as the classifier; output the generated prediction distribution to the loss calculation unit for calculating the consistency regularization loss; The input end of the task attention module matcher is connected to the hierarchical feature enhancement network to receive the enhanced feature and access each module in the task attention module group; The matcher is configured to: in the class incremental learning scenario, input the enhanced feature into each trained task attention module at the same time, obtain the respective outputs, calculate the mean square error between the enhanced feature and each output, and determine the optimal task attention module index signal according to the minimum error; In the task incremental learning scenario, the current task identity index signal is directly received as the optimal task attention module index signal; finally, the optimal task attention module index signal is output to the task attention module group.
Citation Information
Patent Citations
Mining area land utilization classification method and system based on confrontation fusion features and Transform
CN118887530A
Less-sample continuous learning with task-specific parameter selection
CN119670812A
Multi-network fusion hyperspectral image classification method with anti-noise performance
CN119762896A
Pumped storage power station construction anomaly detection method and system based on unmanned aerial vehicle image analysis
CN119888507A
Computer vision neural networks with learned tokenization
US20230409899A1
Cited By
Universal electroencephalogram signal decoding method based on cross-task continuous learning
CN122133754A