A deep neural network continual 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 overfitting of old knowledge in continuous learning are solved. This approach achieves efficient learning and retention of both new and old tasks, thereby improving the overall performance and stability of the model.

CN121389043BActive Publication Date: 2026-04-07UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing continuous learning methods suffer from poor parameter isolation, weak storage reusability, overfitting of old knowledge, and difficulty in dynamically balancing constraints in dynamic and complex scenarios, leading to performance degradation and loss of memory of old tasks when learning new tasks.

Method used

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 memory retention of new and old tasks.

Benefits of technology

It improves the overall performance of the model in continuous learning scenarios, ensuring the ability to learn new tasks while retaining the memory of old tasks to the greatest extent, reducing storage and computing costs, and enhancing the stability and robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121389043B_ABST
    Figure CN121389043B_ABST
Patent Text Reader

Abstract

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 and system based on task-level attention, which comprises a global experience pool construction, a hierarchical feature enhancement network and an exponential moving average model, and realizes efficient screening, storage and utilization of different task features through task flow reception, sub-task sequential training and dynamic inference steps, and by fusing a task attention module group and an experience replay mechanism in the sub-task sequential training and dynamic inference steps; and the optimized hierarchical feature enhancement network and dynamic feature fusion design significantly improve the comprehensive performance of model continuous learning. The present application takes into account the efficient learning ability of new tasks and the memory retention effect of old tasks, and provides a new solution for the application of deep neural networks in a multi-task continuous learning environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and machine learning technology, specifically to a method, system, and device for continuous learning of deep neural networks based on task-level attention. Background Technology

[0002] In the field of deep learning, continuous learning enables deep neural network models to rapidly train and update parameters using new data, building upon their existing training. When encountering entirely new data, compared to traditional machine learning which requires retraining the entire model, continuous learning only needs to train specific modules of the model on the new data, significantly saving time and computational resources. However, simply fine-tuning an existing model with new data can easily lead to a significant decline in performance on past tasks, a phenomenon known as catastrophic forgetting, where the model can be considered to have lost knowledge relevant to the old tasks. Therefore, the core task of continuous learning is to efficiently learn the knowledge contained in new data without significantly reducing the model's performance in applying already learned knowledge.

[0003] Currently, continuous learning methods can be mainly divided into three classic categories: First, regularization-based methods. These methods introduce regularization terms such as L2 regularization and elastic networks into the loss function to construct a balance constraint mechanism between new and old knowledge. While optimizing the new task, they restrict the variation of parameters related to the old task, thereby effectively mitigating the catastrophic forgetting problem of learned old knowledge when the model learns the new task. Second, replay-based methods. During the training of the new task, this method uses a sample storage pool to retain some domain-representative old task samples. By alternating between training new and old data or building generative models (such as GANs) to synthesize virtual samples, the old knowledge is dynamically reproduced and consolidated during the new training process. Third, parameter isolation-based methods. These methods aim to construct independent parameter scopes for different tasks. For example, through modular network design, task-specific adapters, or hierarchical parameter grouping techniques, the feature extraction and decision logic of each task are applied to their own dedicated parameter space, mitigating the parameter interference problem between tasks from the underlying architecture level.

[0004] The above three types of methods systematically address the core challenges of continuous learning from the perspectives of constraint optimization, experience reuse, and architecture design. However, existing technologies still have many shortcomings: (1) Parameter isolation methods: Although decoupling parameters through independent sub-networks reduces task interference, parameter reusability is poor, cross-task transfer is weak, and the parameters increase exponentially with the increase of tasks, making it difficult to meet the needs of computing power-constrained scenarios; (2) Recapitulation methods: Relying on historical sample storage to reproduce old knowledge, limited by storage capacity, insufficient buffers easily lead to representation drift and overfitting of old knowledge, and there are sample storage compliance risks and synthetic sample quality issues in privacy-sensitive fields; (3) Regularization methods: Balancing new and old knowledge through loss function constraints, but there is a contradiction between two-way adjustment, fixed constraints easily lead to underfitting of new knowledge, constraints are difficult to update when the distribution of old data changes, and they are sensitive to hyperparameters, making it difficult to dynamically balance in open environments. These shortcomings seriously restrict the large-scale application of continuous learning in dynamic and complex scenarios. Summary of the Invention

[0005] The purpose of this invention is to provide a deep neural network continuous learning method and system based on task-level attention, so as to improve the overall performance of the model in continuous learning scenarios, achieve both efficient learning ability for new tasks and memory retention effect for old tasks, and provide a brand-new solution for the application of deep neural networks in multi-task continuous learning environments.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A deep neural network continuous learning method based on task-level attention includes the following steps:

[0008] S1. System Initialization: Construct 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 Reception: Sequentially receive a task flow containing k learning tasks, k>1, where each learning task corresponds to a non-overlapping subset of categories, and assign a unique task identity index to each task; the task flow is defined as a category incremental learning scenario or a task incremental learning scenario depending on whether a task identity index is provided during its inference phase.

[0010] S3. Task-based sequential training: For the t-th learning task in the task flow, where t ranges from 1 to k, the following learning process is executed:

[0011] S31. Obtain the training sample set for the t-th learning task, and sample historical representative samples from the global experience pool. Combine the historical representative samples with the training sample set to obtain a mixed training batch.

[0012] S32. Use a hierarchical feature enhancement network to perform hierarchical feature extraction and feature enhancement processing on the mixed training batches to obtain enhanced features;

[0013] S33. Based on the enhanced features obtained in step S32, attention weights are obtained using the task attention module group, and sample-level adaptive weights are generated and dynamically adjusted according to the sample content.

[0014] S34. Fuse the attention weights and sample-level adaptive weights to obtain the fused weights, and then fuse the fused weights with the enhanced features obtained in step S32 to obtain the fused features;

[0015] S35. Input the fused features obtained in step S34 into the classifier to obtain the classification result;

[0016] 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 based on the total loss; update the parameters of the exponential moving average model based on the updated hierarchical feature enhancement network.

[0017] S37. Select representative samples from the training sample set of the t-th learning task and store them in the global experience pool according to the preset strategy;

[0018] S4. Based on the hierarchical feature enhancement network, task attention module group and classifier trained in step S3, predict the input sample to be classified and obtain the prediction result.

[0019] Furthermore, the method for obtaining attention weights using the task attention module group in step S33 is as follows:

[0020] The task attention module group comprises k independent task attention modules, each uniquely corresponding to a learning task; the task attention module group adopts one of the following two working modes according to different continuous learning scenarios:

[0021] In the incremental learning scenario: the module group receives the task identity index of the current training task, and directly calls the corresponding task attention module according to the task identity index to process the input enhancement features and generate the attention weights.

[0022] In the category incremental learning scenario: the module group simultaneously inputs the input enhancement features into multiple trained task attention modules; by calculating the reconstruction error between the enhancement features and the output of each module, the module with the smallest reconstruction error is selected as the adaptation module, and the attention weight generated by the adaptation module is output.

[0023] Furthermore, the task attention module in step S33 is constructed as an incomplete autoencoder, and the process of obtaining attention weights includes:

[0024] Encoding stage: The layered feature enhancement network output enhancement features are processed through a linear encoding layer, a ReLU activation function layer and a bottleneck layer to compress the 512-dimensional vector into a 64-dimensional latent space vector in order to remove redundant information and extract key features. The ReLU activation function is used to introduce nonlinear factors to enhance the nonlinear expressive power of the encoding stage.

[0025] Decoding stage: The 64-dimensional latent space vector is restored to a 512-dimensional vector by using a linear decoding layer in conjunction with the Sigmoid activation function, and attention weights are generated at the same time.

[0026] Furthermore, the classifier mentioned 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 using the following method:

[0027] At the output of the fully connected layer, an output node corresponding to the number of categories of the t-th learning task is added to obtain the extended fully connected layer;

[0028] Initialize the weight parameters corresponding to the newly added output nodes;

[0029] The expanded fully connected layer is trained using mixed training batches to obtain the classification results.

[0030] The classifier is configured as follows:

[0031] In the category incremental learning scenario, the predicted probabilities of all seen categories are directly output without applying a mask;

[0032] In the incremental learning scenario, a binary mask is generated based on the optimal task attention module determined by the current task identity index. The relevant category outputs of the corresponding task of the module are retained and the outputs of the remaining categories are set to zero.

[0033] Furthermore, the total loss in step S36 is a weighted sum of the experience replay loss, the pairwise difference regularization loss, and the consistency regularization loss.

[0034] The pairwise difference regularization loss is calculated based on the difference in attention weights output by different modules in the task attention module group;

[0035] The consistency regularization loss is the difference between the predicted distribution of the classifier and the exponential moving average model based on the fused features of the same batch of data.

[0036] The predicted distribution of the exponential moving average model is obtained by inputting the fused features into the exponential moving average model and calculating it using the same mapping logic as the classifier.

[0037] Furthermore, the implementation method of step S4 is as follows:

[0038] S41. Use a hierarchical feature enhancement network to extract enhanced features from the input samples to be classified;

[0039] S42. In the category incremental learning scenario, the task attention module matcher in the training optimization and control module is used to calculate the mean square error between the output of all trained task attention modules and the enhanced features, and the module with the smallest mean square error is selected as the optimal task attention module; in the task incremental learning scenario, the optimal task attention module corresponding to the t-th task is determined directly based on the current task identity index.

[0040] S43. Use the attention weights of the optimal task attention module to weight the enhanced features to obtain the weighted fused features;

[0041] S44. Input the weighted fused features into the classifier to obtain the prediction result.

[0042] A deep neural network continuous learning system based on task-level attention includes: 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 historical representative samples sampled from the global experience pool to construct a hybrid 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 batches to obtain enhanced features.

[0046] The task attention module group includes k independent task attention modules, each corresponding to a learning task; it receives enhancement 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 with the attention weights to obtain the fused features.

[0048] The classifier is connected to the dynamic feature fusion module; it is used to perform classification calculations on the fused features to obtain the classification result.

[0049] The training optimization and control module is connected to 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 and optimizes the model parameters based on the received classification results, the attention weights of each group, and the predicted distribution of the exponential moving average model, and determines and outputs the optimal task attention module index signal based on the enhanced features.

[0050] Furthermore, the global experience pool includes a sample selection unit and a storage and capacity management unit;

[0051] The sample selection unit is connected to the task data stream; it is used to select representative samples from the training sample set of the t-th learning task as historical representative samples after the t-th learning task is completed.

[0052] The storage and capacity management unit is connected to the sample selection unit and is used to store historical representative samples using a reservoir sampling algorithm, and dynamically adapt the global experience pool capacity based on training feedback and task flow data volume.

[0053] Furthermore, the hierarchical feature enhancement network includes a preprocessing unit and a ResNet-18 backbone network. The preprocessing unit serves as the input to the hierarchical feature enhancement network, performing size standardization and pixel normalization on the received mixed training batches to obtain standardized data. The ResNet-18 backbone network is connected to the preprocessing unit and, along the data transmission direction, sequentially includes an initial feature extraction module, a four-level cascaded feature extraction and enhancement unit, and a global feature integration layer. The initial feature extraction module receives the standardized data and performs downsampling and channel expansion processing to obtain an initial feature map. The four-level cascaded feature extraction and enhancement unit receives the initial features, performs hierarchical feature extraction on the initial features, and simultaneously enhances them to obtain hierarchically enhanced features. The global feature integration layer is used to perform spatial global integration of the final-level hierarchical enhanced features, generating enhanced features that are output to the dynamic feature fusion module and the task attention module group.

[0054] Furthermore, the feature extraction and enhancement unit consists of a feature extraction layer and a feature enhancement module; the feature extraction layer is used to extract hierarchical features; the feature enhancement module includes a channel attention module, a spatial context module, a first feature fusion module, and a residual overlay module; wherein:

[0055] The channel attention module is configured to perform global average pooling on the input hierarchical features, and then process them sequentially through the first fully connected layer, the ReLU activation function, the second fully connected layer, and the Sigmoid activation function to generate channel weights. The channel weights are then multiplied with the input hierarchical features channel by channel.

[0056] The spatial context module and the channel attention module are set up in parallel and are configured to sequentially perform 1×1 convolution dimensionality reduction, 3×3 depthwise separable convolution, 1×1 convolution dimensionality increase, batch normalization and ReLU activation on the input hierarchical features to generate spatial context features.

[0057] The first feature fusion module connects the outputs of the channel attention module and the spatial context module, and is configured to add the output of the channel attention module to the spatial context features output by the spatial context module element by element to obtain the fused enhanced features;

[0058] The residual overlay module is connected to the output of the first feature fusion module and is configured to add the fused enhanced features to the features output by the feature extraction layer element by element to output the final enhanced features.

[0059] Furthermore, 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 of the loss calculation unit is connected to the classifier, the task attention module group, and the exponential moving average model, and the output is connected to the optimizer; it is used to calculate the total loss based on the received classification results, the attention weights of each group, and the prediction distribution of the exponential moving average model; and output the calculated total loss signal to the input of the optimizer.

[0061] The output of the optimizer is connected to the hierarchical feature enhancement network, the task attention module group, and the classifier, respectively, and is used to update 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 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: smoothly update its own parameters according to the updated parameters of the hierarchical feature enhancement network through the exponential moving average algorithm; and 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.

[0063] The input of the task attention module matcher is connected to the hierarchical feature enhancement network to receive enhanced features and access each module in the task attention module group.

[0064] The matcher is configured as follows: In the category incremental learning scenario, the enhanced features are simultaneously input to each trained task attention module, their respective outputs are obtained, the mean squared error between the enhanced features and each output is calculated, and the optimal task attention module index signal is determined based on 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.

[0065] An electronic device includes a processor and a memory, wherein the memory stores a computer program, characterized in that the program, when executed by the processor, implements the steps of the above-described deep neural network continuous learning method based on task-level attention.

[0066] This invention simulates human continuous learning capabilities by constructing a special Task Attention Module (TLAM) and integrating mechanisms such as experience replay loss, consistency regularization loss, and pairwise difference regularization loss to achieve effective screening, storage, and utilization of different task features. Simultaneously, by leveraging hierarchical feature enhancement networks and fusion mechanisms, the model's performance in continuous learning scenarios is significantly improved, ensuring good learning ability for new tasks while maximizing the retention of memories from older tasks. Specifically: the hierarchical feature enhancement uses a convolutional neural network as the backbone network, integrating a feature enhancement module within the backbone network to enhance feature representation capabilities; a task feature attention module is constructed based on a task-specific feature screening mechanism using an undercomplete autoencoder to accurately remove irrelevant noise features and retain core task features; bidirectional information routing and pairwise difference regularization loss mechanisms are used to strengthen key task features and avoid feature confusion and interference; dynamic sparse regularization and long-sequence scalability mechanisms reduce model storage and computation costs, enhancing its stability and robustness in long-sequence tasks; and a feature-level dynamic routing fusion method is adopted, dynamically allocating fusion weights based on semantic similarity to improve the task discriminativeness of features. In terms of experimental validation, the TLAMiC method was tested on multiple benchmark datasets, including Seq-CIFAR10, Seq-CIFAR100, and Seq-TinyImageNet.

[0067] Compared with existing techniques such as Experience Replay (ER), Deep Residual Networks (DRN), and Progressive Neural Networks (PNNs), this method shows significant advantages in key metrics. Attached Figure Description

[0068] Figure 1 This is a schematic diagram of the structure of a deep neural network continuous learning system based on task-level attention, as shown in the example.

[0069] Figure 2 This is a schematic diagram of a hierarchical feature enhancement network for an embodiment.

[0070] Figure 3 This is a schematic diagram of the task attention module workflow in an embodiment.

[0071] Figure 4 A schematic diagram of the fusion module structure provided for an embodiment;

[0072] Figure 5 This is a schematic diagram of the learning process executed for the t-th learning task within the task flow in the embodiment. Detailed Implementation

[0073] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0074] This invention proposes a deep neural network continuous learning system based on task-level attention, which is built upon a modular hardware architecture. Training is deployed locally using a rack-mount server, with a typical configuration of: Intel® Xeon® Gold 6226R CPU, 128GB RAM, and 4×NVIDIA A100 40GB GPU. Other hardware (such as enterprise-grade NVMe storage, redundant power supplies, and data center network ports) is selected according to standard server specifications to ensure stable operation and data read / write requirements during long-term training. The system software layer is developed based on the PyTorch deep learning framework, enabling end-to-end training of the backbone network, task attention modules (TLAMs), and decision heads. The system structure is as follows: Figure 1 As shown, the system 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. During runtime, system initialization is performed first, completing hardware configuration and hyperparameter presets. Next, new task data is preprocessed to obtain enhanced features. Then, TLAM training is conducted, and the global experience pool is updated using the reservoir sampling method for hybrid training. During the inference phase, the optimal TLAM is selected based on the continuous learning scenario: for task increment scenarios, it is directly called according to the task index; for category increment scenarios, 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, which is then weighted and fused into the classifier to output the prediction result. During the training phase, the total loss is jointly optimized using experience replay loss, consistency regularization loss, and pairwise difference regularization loss, and task priority weights are introduced to alleviate recent task bias. Finally, accuracy, forgetting rate, parameter efficiency, and other metrics are tested on a benchmark dataset to complete the validation and evaluation. Each module is described in detail below:

[0075] The global experience pool, serving as a data storage module, stores and manages representative samples from historical learning tasks. The global experience pool includes a sample selection unit and a storage and capacity management unit. The sample selection unit is connected to the task data stream, i.e., the sequence data stream; it is used to select representative samples from the training sample set of the t-th learning task as historical representative samples after completing the t-th learning task. The storage and capacity management unit is connected to the sample selection unit and uses a reservoir sampling algorithm to store historical representative samples, dynamically adapting the global experience pool capacity based on training feedback and the amount of task stream data.

[0076] 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 hybrid training batch.

[0077] The hierarchical feature enhancement network is connected to the data sampling module; it is used to perform hierarchical feature extraction and enhancement processing on mixed training batches to obtain enhanced features. For example... Figure 2 As shown, the hierarchical feature enhancement network includes a preprocessing unit and a ResNet-18 backbone network. The preprocessing unit serves as the input to the hierarchical feature enhancement network, performing size standardization and pixel normalization on the received mixed training batches to obtain standardized data. The ResNet-18 backbone network is connected to the preprocessing unit and, along the data transmission direction, sequentially includes an initial feature extraction module, a four-level cascaded feature extraction and enhancement unit, and a global feature integration layer. The initial feature extraction module receives the standardized output and performs downsampling and channel expansion processing to obtain an initial feature map. The four-level cascaded feature extraction and enhancement unit receives the initial features, performs hierarchical feature extraction on the initial features, and simultaneously enhances them to obtain hierarchically enhanced features. The global feature integration layer is used to perform spatial global integration on the final-level hierarchical enhanced features to generate enhanced features, which are output to the dynamic feature fusion module and the task attention module group. In this embodiment, the feature extraction and enhancement unit consists of a feature extraction layer and a feature enhancement module. The feature extraction layer is used to extract hierarchical features. The feature enhancement module includes a channel attention module, a spatial context module, a first feature fusion module, and a residual superposition module.

[0078] The channel attention module is configured to perform global average pooling on the input hierarchical features, and then process them sequentially through the first fully connected layer, the ReLU activation function, the second fully connected layer, and the Sigmoid activation function to generate channel weights. The channel weights are then multiplied with the input hierarchical features channel by channel.

[0079] The spatial context module and the channel attention module are set up in parallel and are configured to sequentially perform 1×1 convolution dimensionality reduction, 3×3 depthwise separable convolution, 1×1 convolution dimensionality increase, batch normalization and ReLU activation on the input hierarchical features to generate spatial context features.

[0080] The first feature fusion module connects the outputs of the channel attention module and the spatial context module, and is configured to add the output of the channel attention module to the spatial context features output by the spatial context module element by element to obtain the fused enhanced features;

[0081] The residual overlay module is connected to the output of the first feature fusion module and is configured to add the fused enhanced features to the features output by the feature extraction layer element by element to output the final enhanced features.

[0082] like Figure 4 As shown, 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 comprises k independent task attention modules, each corresponding to a learning task; it receives 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 modules based on the task attention module index signal. The dynamic gating network module includes modules that receive enhanced features from a hierarchical feature enhancement network, which are then processed sequentially through a first fully connected layer for dimensionality reduction mapping, a ReLU activation function layer for nonlinear activation, a second fully connected layer for dimensionality increase reconstruction, and a Sigmoid activation function for nonlinear activation, generating sample-level dynamic weights. The second fusion module receives the attention weights output by the task attention module group, the sample-level dynamic weights output by the dynamic gating network module, and the enhanced features output by the hierarchical feature enhancement network. It fuses the attention weights and sample weights to obtain a fusion weight, and then multiplies the fusion weight element-wise with the enhanced features to obtain the final fusion feature. The fusion formula in this embodiment is:

[0083] α f *TLAM+(1-α f *GateNet;

[0084] Where, α f It is a balancing parameter that controls 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; it is used to perform classification calculations on the fused 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. Based on the received classification results, the attention weights of each group, and the predicted distribution of the exponential moving average (EMA) model, the training optimization and control module calculates the loss and optimizes the model parameters, 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 of the loss calculation unit is connected to the classifier, the task attention module group, and the exponential moving average model, and the output is connected to the optimizer; it is used to calculate the total loss based on the received classification results, the attention weights of each group, and the predicted distribution of the exponential moving average model; and outputs the calculated total loss signal to the input of the optimizer. The output of the optimizer is connected to the hierarchical feature enhancement network, the task attention module group, and the classifier, respectively, and is used to update the parameters of the hierarchical feature enhancement network, the task attention module group, and the classifier based on the received total loss signal. The optimizer used is the AdamW optimizer, with an initial learning rate of 1e−4. This learning rate allows the parameters to converge quickly in the early stages of model training. As training progresses, the learning rate decays by a factor of 0.5 every 5 tasks. The AdamW optimizer effectively prevents model parameters from growing excessively during training, avoiding overfitting. The learning rate decay strategy allows the model to learn quickly in the early stages of training, and then reduces the learning rate as it approaches the optimal solution, making the model converge to the optimal solution more stably. This improves the training effect and performance of the model.

[0087] The input 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: smoothly update its own parameters according to the updated parameters of the hierarchical feature enhancement network through the exponential moving average algorithm; and 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 of the task attention module matcher is connected to a hierarchical feature enhancement network to receive enhanced features and access each module in the task attention module group. The matcher is configured to: in a category incremental learning scenario, simultaneously input the enhanced features to each trained task attention module, obtain their respective outputs, calculate the mean squared error between the enhanced features and each output, and determine the optimal task attention module index signal based on the minimum error; in a 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 first t-1 learned tasks from the global experience pool, and compare the sampled representative samples with the training sample set D. t Merge them to obtain a mixed training batch.

[0100] S33. Using the mixed training batches as input, a hierarchical feature enhancement network is used to perform hierarchical feature extraction and feature enhancement processing to obtain enhanced features.

[0101] S34. The enhanced features are input into the dynamic gating fusion module. From the task attention module group corresponding to the t-th task: In the category incremental learning scenario, the matching task attention module is selected based on minimizing the reconstruction error, completing feature selection and weight learning to obtain attention weights for each dimension; In the task incremental learning scenario, the corresponding task attention module is directly called based on the current task identity index to complete feature selection and weight learning, thus obtaining attention weights for each dimension; After a cascade of processing including dimensionality reduction mapping, nonlinear activation, dimensionality increase reconstruction, and normalization activation, sample-level dynamic weights matching the dimensions of the input enhanced features are generated; The sample-level dynamic weights and attention weights are fused and then fused with the enhanced features to obtain the final fused features.

[0102] In this embodiment, the enhanced features are input into the task attention module group. The task attention module corresponding to the t-th task performs feature selection and weight learning with reconstruction error as a constraint, obtaining the attention weights for each dimension of the enhanced features. In this embodiment, the task attention module is constructed as an undercomplete autoencoder, consisting of a linear encoding layer and a linear decoding layer. A bottleneck structure is used to achieve efficient compression and selection of task-specific features. The workflow of the task attention module is as follows: Figure 3 As shown:

[0103] The encoding stage uses linear layers combined with the 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 this process, redundant information is removed and key features are extracted. The ReLU activation function introduces non-linear factors to enhance the network's ability to learn complex feature mapping relationships.

[0104] The decoding stage uses a linear layer with a Sigmoid activation function to reduce the 64-dimensional latent space vector to a 512-dimensional vector and generate attention weights.

[0105] The task attention module in this embodiment uses reconstruction error as a constraint and a closed-loop "compression-reconstruction" process to accurately remove irrelevant noise features while retaining core task features. Practical applications show that it effectively reduces the cosine similarity of features between tasks, significantly weakens cross-task interference, and ensures that each task's features are highly unique. The generated attention weights are used for subsequent weighted processing of enhanced features, further highlighting features relevant to the current task, thereby improving the selection ability of task-specific features and the discriminative power of feature representations, providing strong support for the task attention module to handle multi-task scenarios.

[0106] S35. Input the fused features into the classifier for classification to obtain the classification result. The classifier is a fully connected layer. When processing the t-th learning task in the task flow and t≥2, the classifier is dynamically expanded using the following method:

[0107] At the output of the fully connected layer, an output node corresponding to the number of categories of the t-th learning task is added to obtain the extended fully connected layer;

[0108] Initialize the weight parameters corresponding to the newly added output nodes;

[0109] The expanded fully connected layer is trained using mixed training batches to obtain the classification results.

[0110] In this embodiment, the classifier is configured as follows:

[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 in step S42, so as to retain the output of the relevant category and set the output of the remaining categories to zero.

[0112] In the Class Incremental Learning (Class-IL) scenario, the classifier directly outputs the predicted probabilities of all classes without the need for a masking mechanism.

[0113] S37. Calculate the total loss using the total loss function, and update the parameters of the hierarchical feature enhancement network, the current task-t attention module, and the classifier based on the total loss; the total loss function is a weighted sum of the empirical replay loss, pairwise difference regularization loss, and consistency regularization loss, and its mathematical expression is:

[0114] ;

[0115] in, For the total loss function, For the loss of experience replay, For consistency regularization loss, The weighting coefficients for consistency regularization loss are... These are the weighting coefficients for the pairwise difference regularization loss. For pairwise difference regularization loss;

[0116] The empirical replay loss is used to measure the difference between the predicted result and the true label, guiding the model to learn the correct classification. The calculation formula is as follows:

[0117] ;

[0118] in The cross-entropy loss is for the current task. The weighting coefficients for the experience playback loss are... For memory buffer medium sample Expectations Let cross-entropy be the loss function. The softmax activation function is used. For the entire continuous learning model, For the first from the buffer One input sample (image). For the corresponding The true label.

[0119] The consistency regularization loss is the difference between the predicted distributions of the classifier and the exponential moving average (EMA) model based on the fused features of the same batch of data, and is calculated using the following formula:

[0120] ;

[0121] in, For memory buffer Middle Triple Group Expectations For the first from the buffer One input sample (image). The pre-softmax response of the EMA model. Let L2 be the squared L2 norm of the vector. This is for the entire continuous learning model.

[0122] To avoid redundancy in TLAM functionality, during training for each new task, the pairwise difference regularization loss L between TLAM and all previous TLAMs is calculated. pd

[0123] ;

[0124] Among them, among them, This represents the summation of all historical tasks. For the first Datasets / Data Distribution for Each Task Samples in Expectations To enhance features, The softmax activation function is used. For the current task TLAM module, For historical missions, TLAM module It is the sum of the absolute values ​​of the vector components.

[0125] By incorporating into the total loss function and minimize This forces new and old TLAMs to learn differentiated feature representations. In long sequence tasks, this avoids the TLAMs learning similar features as the number of tasks increases, which would lead to a decrease in discriminative ability. Instead, it allows each TLAM to focus on learning unique features specific to the task, improving the discriminability between tasks and thus enhancing the model's performance in long sequence tasks.

[0126] Furthermore, to address the recent task bias, this embodiment introduces additional task priority weights into the total loss function to suppress the loss from recent tasks and compensate for the loss from older tasks, thereby adjusting the loss term and mitigating the model's tendency to overfit to recent tasks, balancing new knowledge learning with the retention of old knowledge. The adjusted loss term is:

[0127] ;

[0128] in, The total loss after introducing task priorities; This is the current task number being studied. Index for historical tasks ( ), This refers to the indexes of each task traversed during the calculation of weight normalization; For the first The priority weight of each task is defined as follows:

[0129]

[0130] in, To control the temperature coefficient of historical task priority decay / growth rate, To control the temperature parameters for the intensity of "recent suppression / old task compensation", It is a natural exponential function.

[0131] No. The combined loss of each task Defined as:

[0132]

[0133] in, 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 predicted distribution of the exponential moving average model is obtained by inputting the fused features into the exponential moving average model and calculating it using the same mapping logic as the classifier.

[0142] S38. Based on the updated hierarchical feature enhancement network parameters, update the parameters of the exponential moving average model using the exponential moving average algorithm. The update formula is as follows:

[0143] ;

[0144] in, Let the parameters of the EMA model be at the t-th update time. The smoothing coefficient of EMA. The EMA parameter is the value from the last update. Let be the parameter vector of the main model at time t. The parameters of the main model at the initial time t=0.

[0145] This allows the EMA model to continuously track changes in the parameters of the main model, providing a stable and consistent supervision signal 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 smooth model version by weighted averaging of historical model parameters, ensuring the smooth transfer of old knowledge during continuous learning. When training a new task, the EMA model retains knowledge information from the old task, helping the model to learn new knowledge without forgetting old knowledge by comparing and fusing it with the current model.

[0147] S39. After completing the training for the t-th learning task, a portion of representative samples are selected from the training sample set of the t-th learning task using the reservoir sampling method and stored as historical representative samples in the global experience pool. Specifically:

[0148] During the training of a new task, new task samples are continuously stored in the global experience pool according to the principle of equal probability. When the global experience pool reaches the preset capacity limit, the old samples in the pool are randomly replaced by an algorithm to ensure that the samples in the pool can always cover the data distribution of different tasks, providing rich and balanced multi-task data support for subsequent task training.

[0149] In subsequent training iterations, B samples are sampled from both the current task dataset and the global experience pool to form a mixed training batch for experience replay. This approach allows the model to review historical task samples while learning new knowledge, achieving cross-task knowledge consolidation and transfer, and effectively avoiding catastrophic forgetting.

[0150] S4. Dynamic Reasoning: Based on the hierarchical feature enhancement network, task attention module group, and classifier trained in step S3, dynamic reasoning is performed on the input samples to be classified. In this step, the classifier is configured to: generate a binary mask according to the task corresponding to the optimal task attention module selected in step S42 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... Weighted features Perform linear transformation and softmax activation to output multi-task classification probabilities: The Softmax function transforms the classifier's output into a probability distribution, assigning a probability value to each category. This allows users to intuitively understand the model's predictive likelihood for different categories. In task-incremental learning scenarios, the output layer dynamically masks irrelevant categories based on the task label. For example, when processing the current task, the system only focuses on categories relevant to that task, setting the prediction probability of other irrelevant categories to 0, ensuring that predictions only apply to the valid categories for the current task. This dynamic masking mechanism avoids decision-making errors caused by redundant output information in multi-task learning, improving the model's accuracy and reliability in practical applications.

[0151] S41. Use a hierarchical feature enhancement network to extract enhanced features with 512-dimensional vectors from the input samples to be classified;

[0152] S42. In the category incremental learning scenario, the Task Attention Module Matcher (TLAM matcher) in the Training Optimization and Control module is used to calculate the mean squared error between the output of all trained task attention modules and the enhanced features, and the task attention module with the smallest mean squared error is selected as the optimal task attention module; in the task incremental learning scenario, the optimal task attention module is directly determined based on the current task identity index. The system can automatically select the most suitable TLAM based on the characteristics of the input samples, extract features related to the current task, and improve the accuracy and efficiency of inference.

[0153] S43. Use the attention weights of the optimal task attention module to weight the enhanced features to obtain the weighted fused features;

[0154] S44. Input the weighted fused features into the classifier to obtain the prediction result. In this embodiment, the classifier performs a linear transformation and Softmax activation on the weighted features, outputting multi-task classification probabilities. In the task incremental learning scenario, the output layer dynamically masks irrelevant categories based on the task label. This ensures that the prediction is only for the valid category of the current task. This avoids decision errors caused by redundant information output by the model in multi-task learning, improving the accuracy and reliability of the model in practical applications.

[0155] Experimental verification and performance evaluation:

[0156] Benchmark settings:

[0157] Testing was conducted on benchmark datasets such as Seq-CIFAR10, Seq-CIFAR100, and Seq-TinyImageNet, with 5-20 tasks and 200-500 samples in buffer capacity. Comparison methods included Empirical Replay (ER), Deep Residual Networks (DRN), and Progressive Neural Networks (PNNs).

[0158] Key performance indicators are shown in Table 1:

[0159] Average accuracy: TLAMiC achieved 76.38% in Seq-CIFAR100 (500 buffers, 20 tasks), significantly higher than ER (63.09%) and PNNs (74.01%); Forgetting rate: The average accuracy of old tasks decreased by only 15.68%, nearly 50% lower than ER (31.36%); Parameter efficiency: The total number of parameters increased by only 12% in 20 tasks (from 11.23 million to 12.54 million), far lower than the 23-fold increase of PNNs (from 11.23 million to 26.45 million).

[0160] Table 1 Key Performance Indicators

[0161]

[0162] In complex image tasks involving occlusion and viewpoint changes: TLAMiC improves accuracy by 22.4% over traditional methods by maintaining accuracy on old tasks through a dynamic feature selection mechanism, verifying its robustness in real-world scenarios.

[0163] In summary, the present invention has the following advantages over the prior art:

[0164] The model significantly improves task recognition accuracy. In the Seq-CIFAR100 task, the average accuracy in the Class-IL scenario reaches 50.11%, a 15.3% improvement over the baseline DER++, and in the Task-IL scenario, it reaches 76.38%, surpassing parameter isolation methods such as PNNs. The model also exhibits significantly enhanced resistance to forgetting, with a 45% reduction in forgetting rate compared to ER. The accuracy retention rate of old tasks is improved by 30% under a buffer size of 500. Furthermore, the model's generalization and calibration performance are optimized, with a 58% reduction in recent bias and an expected calibration error (ECE) of only 12.53%. In terms of model efficiency, the model demonstrates excellent parameter scalability, with a single TLAM parameter accounting for only 0.3% of the backbone network and a cumulative parameter increase of only 11% across 20 tasks, far lower than the exponential growth of methods such as PNNs. Regarding robustness in long sequence learning, through reservoir sampling and dynamic feature selection mechanisms, the average accuracy in long sequences across 20 tasks reaches 84%, an improvement of more than 20% compared to traditional methods. This breaks through the capacity saturation bottleneck of fixed-capacity models and is suitable for large-scale continuous learning scenarios.

Claims

1. A deep neural network continuous learning method based on task-level attention, characterized in that, Includes the following steps: S1. System Initialization: Construct 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 Flow Reception: Sequentially receive a task flow containing k learning tasks, k>1, where each learning task corresponds to a non-overlapping subset of categories, and assign a unique task identity index to each task; the task flow is defined as a category incremental learning scenario or a task incremental learning scenario depending on whether a task identity index is provided during its inference phase. S3. Task-based sequential training: For the t-th learning task in the task flow, where t ranges from 1 to k, the following learning process is executed: S31. Obtain the training sample set for the t-th learning task, and sample historical representative samples from the global experience pool. Combine the historical representative samples with the training sample set to obtain a mixed training batch, where the training sample set and the historical representative samples are image datasets. S32. Use a hierarchical feature enhancement network to perform hierarchical feature extraction and feature enhancement processing on the mixed training batches to obtain enhanced features; S33. Based on the enhanced features obtained in step S32, attention weights are obtained using a task attention module group, and sample-level adaptive weights are generated using a dynamic gating network module that dynamically adjusts according to the sample content. The implementation method is as follows: The task attention module group comprises k independent task attention modules, each uniquely 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 incremental learning scenario: the module group receives the task identity index of the current training task, and directly calls the corresponding task attention module according to the task identity index to process the input enhancement features and generate the attention weights. In the category incremental learning scenario: the module group simultaneously inputs the input enhancement features into multiple trained task attention modules; by calculating the mean square error between the enhancement features and the output of each module, the module with the smallest mean square error is selected as the adaptation module, and the attention weights generated by the adaptation module are output. S34. Fuse the attention weights and sample-level adaptive weights to obtain the fused weights, and then fuse the fused weights with the enhanced features obtained in step S32 to obtain the fused features; S35. Input the fused features obtained in step S34 into the classifier to obtain the 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 based on the total loss; update the parameters of the exponential moving average model based on the updated hierarchical feature enhancement network. S37. Select representative samples from the training sample set of the t-th learning task and store them in the global experience pool according to the preset strategy; S4. Based on the hierarchical feature enhancement network, task attention module group and classifier trained in step S3, predict the input sample to be classified and obtain the prediction result.

2. The deep neural network continuous learning method based on task-level attention according to claim 1, characterized in that, The task attention module in step S33 is constructed as an incomplete autoencoder, and the process of obtaining attention weights includes: Encoding stage: The layered feature enhancement network output enhancement features are processed through a linear encoding layer, a ReLU activation function layer and a bottleneck layer to compress the 512-dimensional vector into a 64-dimensional latent space vector in order to remove redundant information and extract key features. The ReLU activation function is used to introduce nonlinear factors to enhance the nonlinear expressive power of the encoding stage. Decoding stage: The 64-dimensional latent space vector is restored to a 512-dimensional vector by using a linear decoding layer in conjunction with the Sigmoid activation function, and attention weights are generated at the same time.

3. The deep neural network continuous learning method based on task-level attention according to claim 1, characterized in that, The total loss in step S36 is a weighted sum of the experience replay loss, the pairwise difference regularization loss, and the consistency regularization loss. The pairwise difference regularization loss is calculated based on the difference in attention weights output by different modules in the task attention module group; The consistency regularization loss is the difference between the predicted distribution of the classifier and the exponential moving average model based on the fused features of the same batch of data. The predicted distribution of the exponential moving average model is obtained by inputting the fused features into the exponential moving average model and calculating it using the same mapping logic as the classifier.

4. The deep neural network continuous learning method based on task-level attention according to claim 1, characterized in that, The implementation method of step S4 is as follows: S41. Use a hierarchical feature enhancement network to extract enhanced features from the input samples to be classified; S42. In the category incremental learning scenario, use the task attention module matcher in the training optimization and control module to calculate the mean square error between the output of all trained task attention modules and the enhanced features, and select the module with the smallest mean square error as the optimal task attention module. In the incremental learning scenario, the optimal task attention module corresponding to the t-th task is determined directly based on the current task identity index. S43. Use the attention weights of the optimal task attention module to weight the enhanced features to obtain the weighted fused features; S44. Input the weighted fused features into the classifier to obtain the prediction result.

5. A deep neural network continuous learning system based on task-level attention, characterized in that, The method for implementing any one of claims 1 to 4 includes: 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; 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 historical representative samples sampled from the global experience pool to construct a hybrid training batch. 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 batches to obtain enhanced features. The task attention module group includes k independent task attention modules, each corresponding to a learning task; it receives enhancement 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 hierarchical feature enhancement network and the task attention module group respectively; it is used to fuse the enhanced features with the attention weights to obtain the fused features. The classifier is connected to the dynamic feature fusion module; it is used to perform classification calculations on the fused features to obtain classification results. The training optimization and control module is connected to 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 results, the attention weights of each group, and the predicted distribution of the exponential moving average (EMA) model, and determines and outputs the optimal task attention module index signal based on the enhanced features.

6. The deep neural network continuous learning system based on task-level attention according to claim 5, characterized in that, The global experience pool includes a sample selection unit and a storage and capacity management unit; The sample selection unit is connected to the task data stream; Used to select representative samples from the training sample set of the t-th learning task as historical representative samples after completing the t-th learning task; The storage and capacity management unit is connected to the sample selection unit and is used to store historical representative samples using a reservoir sampling algorithm, and dynamically adapt the global experience pool capacity based on training feedback and task flow data volume.

7. The deep neural network continuous learning system based on task-level attention according to claim 5, characterized in that, The hierarchical feature enhancement network includes a preprocessing unit and a ResNet-18 backbone network. The preprocessing unit serves as the input to the hierarchical feature enhancement network, performing size normalization and pixel normalization on the received mixed training batches to obtain normalized data. The ResNet-18 backbone network is connected to the preprocessing unit and, along the data transmission direction, sequentially includes an initial feature extraction module, a four-level cascaded feature extraction and enhancement unit, and a global feature integration layer. The initial feature extraction module receives the normalized data and performs downsampling and channel expansion processing to obtain an initial feature map. The four-level cascaded feature extraction and enhancement unit receives the initial features, performs hierarchical feature extraction on the initial features, and simultaneously enhances them to obtain hierarchically enhanced features. The global feature integration layer is used to perform spatial global integration of the final-level hierarchical enhancement features, and generate enhanced features that are output to the dynamic feature fusion module and the task attention module group.

8. The deep neural network continuous learning system based on task-level attention according to claim 7, characterized in that, The feature extraction and enhancement unit consists of a feature extraction layer and a feature enhancement module; the feature extraction layer is used to extract hierarchical features; the feature enhancement module includes a channel attention module, a spatial context module, a first feature fusion module, and a residual overlay module; wherein: The channel attention module is configured to perform global average pooling on the input hierarchical features, and then process them sequentially through the first fully connected layer, the ReLU activation function, the second fully connected layer, and the Sigmoid activation function to generate channel weights. The channel weights are then multiplied with the input hierarchical features channel by channel. The spatial context module and the channel attention module are set up in parallel and are configured to sequentially perform 1×1 convolution dimensionality reduction, 3×3 depthwise separable convolution, 1×1 convolution dimensionality increase, batch normalization and ReLU activation on the input hierarchical features to generate spatial context features. The first feature fusion module connects the outputs of the channel attention module and the spatial context module, and is configured to add the output of the channel attention module to the spatial context features output by the spatial context module element by element to obtain the fused enhanced features; The residual overlay module is connected to the output of the first feature fusion module and is configured to add the fused enhanced features to the features output by the feature extraction layer element by element to output the final enhanced features.

9. The deep neural network continuous learning system based on task-level attention according to claim 8, characterized in that, 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 of the loss calculation unit is connected to the classifier, the task attention module group, and the exponential moving average model, and the output is connected to the optimizer; it is used to calculate the total loss based on the received classification results, the attention weights of each group, and the predicted distribution of the exponential moving average model. The calculated total loss signal is output to the input of the optimizer. The output of the optimizer is connected to the hierarchical feature enhancement network, the task attention module group, and the classifier, respectively, and is used to update 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 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: smoothly update its own parameters according to the updated parameters of the hierarchical feature enhancement network through the exponential moving average algorithm; and 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. The input of the task attention module matcher is connected to the hierarchical feature enhancement network to receive enhanced features and access each module in the task attention module group. The matcher is configured to: in the category incremental learning scenario, simultaneously input the enhanced features into each trained task attention module, obtain their respective outputs, calculate the mean square error between the enhanced features and each output, and determine the optimal task attention module index signal based on 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

  • Less-sample continuous learning with task-specific parameter selection

    CN119670812A

  • Pumped storage power station construction anomaly detection method and system based on unmanned aerial vehicle image analysis

    CN119888507A