A deep neural network continuous learning method and related device based on anisotropic flatness

By performing singular value decomposition on the feature variance of deep neural networks, the flat regions of the loss function surface are determined, and the learning rate is adjusted to alleviate forgetting. This solves the catastrophic forgetting problem of deep learning models in natural image classification sequence tasks, improves continuous learning ability, and ensures data security.

CN119761409BActive Publication Date: 2025-10-28XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411891444.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-10-28
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Deep learning models suffer from catastrophic forgetting in sequence tasks of natural image classification, which limits their ability to learn continuously in the dynamic and changing real world.

Method used

By performing singular value decomposition on the variance of features in each layer of a deep neural network, a flat region of the loss function surface is determined, and the learning rate is adjusted within this region. A training strategy that can mitigate forgetting is designed to enable the deep neural network to continuously learn on new tasks.

Benefits of technology

It effectively mitigates catastrophic forgetting, enhances the continuous learning ability of deep learning models, and maintains the performance of historical tasks on new tasks. It is applicable to supervised learning, unsupervised learning, reinforcement learning, and self-supervised learning, while eliminating the need to save historical task data, thus ensuring data security and privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761409B_ABST
    Figure CN119761409B_ABST
Patent Text Reader

Abstract

This invention discloses a method and related apparatus for continuous learning of deep neural networks based on anisotropic flatness. The method includes: acquiring a sequence of tasks for classifying natural images; the deep neural network learning sequentially on the sequence of tasks; after the deep neural network has finished learning on the (t-1)th task, updating the variance of the features of each layer of the deep neural network; performing singular value decomposition on the variance of the updated features of each layer of the neural network to obtain singular vectors and singular values; determining a training strategy to mitigate forgetting based on the singular vectors and singular values; and achieving continuous learning of the deep neural network on the tth task based on the training strategy to mitigate catastrophic forgetting, and achieving image classification for the tth task. This invention ensures that the loss function value of the deep neural network remains unchanged on historical tasks after learning on new tasks, effectively mitigating catastrophic forgetting and improving the effect of continuous learning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a deep neural network continuous learning method and related apparatus based on anisotropic flatness. Background Technology

[0002] In recent years, deep learning technology has achieved performance surpassing human capabilities in natural image classification. However, its ability to continuously learn in the dynamically changing real world still needs improvement. In continuous learning scenarios, deep learning models need to learn sequentially on natural image classification tasks, ultimately achieving good performance on all learned tasks. A major challenge facing deep learning is the catastrophic forgetting phenomenon, where the classification performance of a deep learning model on older tasks drops sharply after learning on new tasks. This catastrophic forgetting phenomenon severely limits the continuous learning ability of deep learning models, thus limiting their deployment in the dynamically changing real world. Summary of the Invention

[0003] To address the catastrophic forgetting phenomenon in the training of deep learning models for sequence tasks of natural image classification, the present invention aims to provide a mathematically sound method and related apparatus for continuous learning of deep neural networks based on anisotropic flatness, which does not rely on storing historical task data. This learning method can alleviate the catastrophic forgetting phenomenon faced by deep learning models when continuously learning on sequence tasks, thereby improving the continuous learning capability of deep learning models.

[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0005] A continuous learning method for deep neural networks based on anisotropic flatness includes the following steps:

[0006] The task is to obtain the sequence of natural images to be classified.

[0007] The deep neural network learns sequentially on the sequence task of classifying natural images. After the deep neural network finishes learning on the (t-1)th task, it updates the variance of the features of each layer of the deep neural network.

[0008] Singular value decomposition is performed on the variance of the features of each layer of the updated neural network to obtain singular vectors and singular values;

[0009] Based on singular vectors and singular values, a training strategy that can alleviate forgetting is determined;

[0010] Based on a training strategy that can mitigate catastrophic forgetting, a deep neural network is made capable of continuous learning on the t-th task and image classification is achieved on the t-th task.

[0011] Furthermore, in the sequence task of classifying natural images, the data of the first task contains m categories, the data of the second task contains n new categories that do not overlap with the categories of the first task, and so on, the t-th task contains n new categories that do not overlap with the categories of the previous t-1 tasks, and the deep neural network classifies the m+(t-1)*n categories.

[0012] Furthermore, the deep neural network learns sequentially on the task of classifying natural images. After the deep neural network has finished learning on the (t-1)th task, the variance of the features of each layer of the deep neural network is updated, including the following steps:

[0013] The data D of the (t-1)th task t-1 The input is fed into a deep neural network f(w) with H layers to obtain the features of each layer. H represents the total number of layers in the deep neural network, and the variance of the features in each layer is calculated. pass Incremental calculation yields the variance of the first t-1 tasks at layer l. in Let be the variance of the first t-2 tasks at level l.

[0014] Furthermore, the variance of features in each layer of the neural network is decomposed using singular value decomposition to obtain singular vectors and singular values. Based on the singular vectors and singular values, a training strategy to mitigate forgetting is determined, including the following steps:

[0015] Based on singular vectors and singular values, a flat region of the loss function surface of the deep neural network on the (t-1)th task is determined, and a training strategy to alleviate forgetting is determined based on the flat region.

[0016] Furthermore, based on singular vectors and singular values, the flat region of the loss function surface of the deep neural network on the (t-1)th task is determined;

[0017] The variance of the first t-1 tasks at level l Perform singular value decomposition to obtain the singular vector matrix. and singular value matrix in The column vectors represent the flat direction, and the singular value matrix... The singular value matrix is ​​a diagonal matrix. The diagonal elements of the singular value matrix represent the flatness of the corresponding flat direction, thereby determining the flat region of the loss function surface of the deep neural network on the (t-1)th task.

[0018] Furthermore, based on the flat regions, training strategies to mitigate forgetting are identified, including the following process:

[0019] Within a flat region, the learning rate is calculated based on the singular value matrix along the corresponding flat direction. The learning rate is increased along the flat direction with smaller singular values, which is a training strategy that can alleviate catastrophic forgetting.

[0020] Furthermore, based on a training strategy that mitigates catastrophic forgetting, a deep neural network is continuously learned on the t-th task, and image classification for the t-th task is achieved, including the following steps:

[0021] The deep neural network is initialized with the deep neural network learned on the (t-1)th task, and based on a training strategy that can mitigate catastrophic forgetting, the deep neural network is continuously learned on the tth task, so that the deep neural network learns on the tth task and achieves image classification for the tth task.

[0022] A deep neural network continuous learning system based on anisotropic flatness includes:

[0023] A sequence task acquisition module for classifying natural images is used to acquire sequence tasks for classifying natural images.

[0024] The variance update module is used for the deep neural network to learn sequentially on the task of classifying natural images. After the deep neural network has finished learning on the (t-1)th task, it updates the variance of the features of each layer of the deep neural network.

[0025] The singular value decomposition module is used to perform singular value decomposition on the variance of the features of each layer of the updated neural network to obtain singular vectors and singular values.

[0026] A forgetting mitigation training strategy determination module is used to determine forgetting mitigation training strategies based on singular vectors and singular values.

[0027] The continuous learning module is used to enable the deep neural network to continuously learn on the t-th task based on a training strategy that can mitigate catastrophic forgetting, and to achieve image classification on the t-th task.

[0028] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the aforementioned deep neural network continuous learning method based on anisotropic flatness.

[0029] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the described deep neural network continuous learning method based on anisotropic flatness.

[0030] Compared with the prior art, the present invention has the following beneficial effects:

[0031] This invention identifies a flat region on the loss function surface of a deep neural network across historical tasks (t-1 tasks). Within this flat region, the performance of the deep neural network on previous tasks remains relatively stable. This ensures that the deep neural network, after learning on new tasks (t tasks), remains within this flat region, maintaining its performance on historical tasks (t-1 tasks) and mitigating catastrophic forgetting. This invention prioritizes the performance of the deep neural network on previous tasks, ensuring that the loss function value remains unchanged after learning on new tasks, effectively mitigating catastrophic forgetting and improving continuous learning. This invention is applicable to supervised learning, unsupervised learning, reinforcement learning, and self-supervised learning. Furthermore, this system does not require storing historical task data, which is beneficial for data security and privacy protection. Attached Figure Description

[0032] Figure 1 This is a flowchart of the deep neural network continuous learning method based on anisotropic flatness according to the present invention.

[0033] Figure 2 The diagrams show the effects of continuous learning in this invention, where (a) the experimental results of adding 20 new categories to each task, (b) the experimental results of adding 10 new categories to each task, and (c) the experimental results of adding 5 new categories to each task.

[0034] Figure 3 This is a schematic diagram of a deep neural network continuous learning system based on anisotropic flatness. Detailed Implementation

[0035] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Preferred embodiments of the invention are shown in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.

[0036] See Figure 1 In one embodiment of the present invention, a deep neural network continuous learning method based on anisotropic flatness is provided, which is applicable to continuous learning problems on multiple tasks.

[0037] The present invention will be described in detail below using natural image classification as an example.

[0038] In a continuous learning scenario, a deep neural network learns sequentially on a series of natural images to be classified. The data for the first task contains m categories, and the deep neural network needs to learn to classify these m categories of images. The data for the second task contains n new categories (not overlapping with the categories of the first task), and the deep neural network needs to learn to classify these m+n categories of images. And so on, the t-th task contains n new categories (not overlapping with the categories of the previous t-1 tasks), and the deep neural network needs to learn to classify these m+(t-1)*n categories.

[0039] See Figure 1 The following section uses the learning of a deep neural network f(w) on the t-th task as an example to introduce the specific implementation steps of this continuous learning method:

[0040] Step S1: Obtain the sequence task to be classified for natural images;

[0041] Step S2: The deep neural network learns sequentially on the sequence task of classifying natural images. After the deep neural network finishes learning on the (t-1)th task (i.e., the old task data), the variance of the features of each layer of the deep neural network is updated. The specific calculation process is as follows:

[0042] The data D of the (t-1)th task t-1 The input is fed into a deep neural network f(w) with H layers to obtain the features of each layer. H represents the total number of layers in the deep neural network, and the variance of the features in each layer is calculated. pass Incremental calculation yields the variance of the first t-1 tasks at layer l. in Let be the variance of the first t-2 tasks at level l (l = 1, ..., H); specifically, when t = 1, It is a zero matrix.

[0043] Step S3: Perform singular value decomposition on the variance of the features of each layer of the updated neural network to obtain singular vectors and singular values;

[0044] Step S4: Based on singular vectors and singular values, determine a training strategy that can alleviate forgetting. The specific process is as follows: Based on singular vectors and singular values, determine the flat region of the loss function surface of the deep neural network on the (t-1)th task, and determine a training strategy that can alleviate forgetting based on the flat region.

[0045] The variance of the first t-1 tasks at level l Perform singular value decomposition to obtain the singular vector matrix. and singular value matrix in The column vectors represent the flat direction, and the singular value matrix... It is a diagonal matrix, and its diagonal elements represent the flatness of the corresponding flat direction. The smaller the singular value, the flatter the corresponding direction, thus determining the flat region of the loss function surface of the deep neural network on the (t-1)th task.

[0046] Based on the above characteristics, a training strategy to mitigate catastrophic forgetting is determined: in flat regions, based on the singular value matrix... Calculate the learning rate along the corresponding flat direction, such that the learning rate is larger along the flat direction with smaller singular values, for example... in and These represent the minimum singular value and the maximum singular value, respectively.

[0047] Step S5: Based on a training strategy that mitigates catastrophic forgetting, the deep neural network continuously learns on the t-th task and achieves image classification for the t-th task. The forgetting-mitigation-mitigation training strategy ensures that the deep neural network maintains its performance on previous tasks after training. The specific process is as follows:

[0048] The deep neural network is initialized with the deep neural network learned on the (t-1)th task, and based on a training strategy that mitigates catastrophic forgetting, it achieves continuous learning on the tth task (new task data), so that the deep neural network retains the performance of the historical tasks after learning on the tth task (mitigating catastrophic forgetting). The specific process is as follows:

[0049] The data D of the t-th task t The data is fed into a deep neural network to obtain the prediction results;

[0050] Using a loss function, the difference between the predicted result and the standard result (set according to actual needs) is calculated, and the gradient is calculated using the backpropagation algorithm. In particular, the parameters w of the l-th layer are... l The corresponding gradient is g l (l=1,…,H);

[0051] Update the parameters w of the l-th layer of the deep neural network layer by layer l =w l -Δw l (l=1,…,H), taking the l-th layer as an example, parameter w l Corresponding parameter update Δw l for:

[0052]

[0053] in, and Let be the singular vectors and the learning rate (l = 1, ..., H);

[0054] Repeat the iterative parameter update process until the deep neural network can classify natural images of the learned m+(t-1)*n categories. At this point, the deep neural network can classify images from both the t-th task and the previous t-1 tasks. This demonstrates that the proposed method effectively mitigates catastrophic forgetting and enhances the continuous learning capability of the deep neural network.

[0055] After the deep neural network finishes learning on the t-th task, it can continue learning on the (t+1)-th task based on steps 1 and 2.

[0056] exist Figure 2 In (a), the first task contains 100 categories, and the second through sixth tasks each contain 20 categories. After learning the sixth task, the deep neural network needs to learn to classify images into 200 categories. Figure 2 In (b), the first task contains 100 categories, and the second through eleventh tasks each contain 10 categories. After learning the eleventh task, the deep neural network needs to learn to classify images into 200 categories. Figure 2 In (c), the first task contains 100 categories, and the second to twenty-first tasks each contain 10 categories. After learning the twenty-first task, the deep neural network needs to learn to classify images of 200 categories. In fact, the solid blue line represents the effect of the continuous learning method of this invention, and the dashed red line represents the baseline. It can be seen that this invention effectively alleviates the catastrophic forgetting phenomenon and improves the continuous learning ability of the deep neural network.

[0057] See Figure 3 In another embodiment of the present invention, a deep neural network continuous learning system based on anisotropic flatness is provided, comprising:

[0058] A sequence task acquisition module for classifying natural images is used to acquire sequence tasks for classifying natural images.

[0059] The variance update module is used for the deep neural network to learn sequentially on the task of classifying natural images. After the deep neural network has finished learning on the (t-1)th task, it updates the variance of the features of each layer of the deep neural network.

[0060] The singular value decomposition module is used to perform singular value decomposition on the variance of the features of each layer of the updated neural network to obtain singular vectors and singular values.

[0061] A forgetting mitigation training strategy determination module determines forgetting mitigation training strategies based on singular vectors and singular values.

[0062] The continuous learning module is used to enable the deep neural network to continuously learn on the t-th task based on a training strategy that can mitigate catastrophic forgetting, and to achieve image classification on the t-th task.

[0063] In this invention, a deep neural network f(w) with parameters w and number of layers H is used in sequence tasks {D1, D2, ..., D...} t-1 D t In a configuration where continuous learning is performed on a sequence of tasks, after the deep neural network f(w) learns on an old task (e.g., the (t-1)th task), the variance increment update module incrementally calculates the variance of the old task data at each layer of the deep neural network. Then, singular value decomposition is performed layer by layer on the feature variance to obtain singular values ​​and singular vectors. The learning rate along the corresponding singular vector is adaptively determined using the singular values, thus obtaining a training strategy that mitigates forgetting. When the deep neural network is trained on a new task (e.g., the tth task), the forgetting-mitigation-mitigation training strategy is used to iteratively update the deep neural network until the deep neural network reaches its optimal performance on that task. Repeating the above process enables continuous learning of the deep neural network on sequence tasks.

[0064] This invention considers the performance of deep neural networks on historical tasks and designs a variance update module and a singular value decomposition (SVD) module to determine a training strategy that mitigates forgetting. This ensures that the performance of the deep neural network on historical tasks remains unchanged after training on new tasks, effectively mitigating catastrophic forgetting and improving continuous learning. This invention does not impose constraints on the structure, loss function, or data labeling of the deep neural network, making it applicable to supervised learning, unsupervised learning, reinforcement learning, and self-supervised learning. Furthermore, this invention eliminates the need to store historical task data, thus benefiting data security and privacy protection.

[0065] In another embodiment of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the aforementioned deep neural network continuous learning method based on anisotropic flatness.

[0066] In another embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, it implements the deep neural network continuous learning method based on anisotropic flatness.

[0067] The above description is only of the preferred embodiment of the present invention and should not be construed as limiting the scope of the claims. The present invention is not limited to the above embodiments, and variations in its specific structure are permitted. All variations made within the scope of the independent claims of the present invention are also within the scope of protection of the present invention.

[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

Claims

1. A continuous learning method for deep neural networks based on anisotropic flatness, characterized in that, Includes the following steps: The task is to obtain the sequence of natural images to be classified. Deep neural networks learn sequentially on the task of classifying natural images into sequences. When the deep neural network learns on the first sequence... After learning on each task, update the variance of the features of each layer of the deep neural network; Singular value decomposition is performed on the variance of the features of each layer of the updated neural network to obtain singular vectors and singular values; Based on singular vectors and singular values, a training strategy that can alleviate forgetting is determined; Based on training strategies that mitigate catastrophic forgetting, deep neural networks are implemented in the first stage... Continuous learning on each task, and achieving the first Image classification for one task; Based on singular vectors and singular values, the deep neural network is determined in the first... Flat regions of the loss function surface for each task are identified, and training strategies that can mitigate forgetting are determined based on these flat regions. Forward The task in the first layer variance Perform singular value decomposition to obtain the singular vector matrix. and singular value matrix , ,in The column vectors represent the flat direction, and the singular value matrix... This is a diagonal matrix, where the diagonal elements represent the flatness along the corresponding flat direction. The smaller the singular value, the flatter the corresponding direction, thus determining the degree of flatness of the deep neural network in the first position. A flat region of the loss function surface on each task; Identify training strategies to mitigate catastrophic forgetting: in flat regions, based on singular value matrices Calculate the learning rate for the corresponding flat direction, such that the learning rate is larger along the flat direction with smaller singular values. ,in and These represent the minimum singular value and the maximum singular value, respectively.

2. The deep neural network continuous learning method based on anisotropic flatness according to claim 1, characterized in that, In a sequence task to classify natural images, the data of the first task contains m categories, the data of the second task contains n new categories that do not overlap with the categories of the first task, and so on. The t-th task contains n new categories that do not overlap with the categories of the previous t-1 tasks. The deep neural network classifies the m+(t-1)*n categories.

3. The deep neural network continuous learning method based on anisotropic flatness according to claim 1, characterized in that, Deep neural networks learn sequentially on the task of classifying natural images into sequences. When the deep neural network learns on the first sequence... After learning on each task, the variance of the features of each layer of the deep neural network is updated, including the following steps: The first Data for each task Input to the layer number is Deep neural networks In the process, the features of each layer are obtained. , H represents the total number of layers in the deep neural network, and the variance of the features of each layer is calculated. ;pass Incremental calculation yields the previous The task in the first layer variance ,in For the front The task in the first Variance of the layer.

4. The deep neural network continuous learning method based on anisotropic flatness according to claim 1, characterized in that, Based on training strategies that mitigate catastrophic forgetting, deep neural networks are implemented in the first stage... Continuous learning on each task, and achieving the first Image classification for a given task includes the following steps: Deep neural networks in the first The deep neural network learned on the first task is initialized, and based on a training strategy that mitigates catastrophic forgetting, the deep neural network is implemented on the second task. Continuous learning on each task enables deep neural networks to achieve [the following] in the [number]th task. Learn on the first task and achieve the first Image classification for a single task.

5. A deep neural network continuous learning system based on anisotropic flatness, characterized in that, include: A sequence task acquisition module for classifying natural images is used to acquire sequence tasks for classifying natural images. The variance update module is used for the deep neural network to learn sequentially on the task of classifying natural images. When the deep neural network learns on the sequence of images to be classified, the variance update module is used to update the variance of the images to be classified on the sequence of images to be classified. After learning on each task, update the variance of the features of each layer of the deep neural network; The singular value decomposition module is used to perform singular value decomposition on the variance of the features of each layer of the updated neural network to obtain singular vectors and singular values. A forgetting mitigation training strategy determination module is used to determine forgetting mitigation training strategies based on singular vectors and singular values. The continuous learning module is used to implement deep neural networks in the first stage based on training strategies that mitigate catastrophic forgetting. Continuous learning on each task, and achieving the first Image classification for one task; Based on singular vectors and singular values, the deep neural network is determined in the first... Flat regions of the loss function surface for each task are identified, and training strategies that can mitigate forgetting are determined based on these flat regions. Forward The task in the first layer variance Perform singular value decomposition to obtain the singular vector matrix. and singular value matrix , ,in The column vectors represent the flat direction, and the singular value matrix... This is a diagonal matrix, where the diagonal elements represent the flatness along the corresponding flat direction. The smaller the singular value, the flatter the corresponding direction, thus determining the degree of flatness of the deep neural network in the first position. A flat region of the loss function surface on each task; Identify training strategies to mitigate catastrophic forgetting: in flat regions, based on singular value matrices Calculate the learning rate for the corresponding flat direction, such that the learning rate is larger along the flat direction with smaller singular values. ,in and These represent the minimum singular value and the maximum singular value, respectively.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the deep neural network continuous learning method based on anisotropic flatness as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the deep neural network continuous learning method based on anisotropic flatness as described in any one of claims 1 to 4.