A module-aware assisted learning optimization method and computer product

By optimizing the neural network model through module-level auxiliary loss weights, the problem of module-level conflict in assisted learning is resolved, thereby improving the performance and generalization ability of assisted learning.

CN115860085BActive Publication Date: 2026-04-10TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TSINGHUA UNIVERSITY
Filing Date
2022-10-28
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing auxiliary learning strategies ignore the coupling relationship between different auxiliary loss functions and different modules of the neural network, resulting in conflicting loss functions at the module level, which impairs the performance of auxiliary learning.

Method used

The model parameters of each module are updated according to the module-level auxiliary loss weights corresponding to each module, the updated module-level auxiliary loss weights of each module are calculated, and the optimized neural network model is output when the validation conditions are met.

Benefits of technology

It effectively avoids conflicts at the module level, improves the performance of assisted learning, enables each module to obtain the most beneficial information for the target task, and has strong generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115860085B_ABST
    Figure CN115860085B_ABST
Patent Text Reader

Abstract

The embodiment of the application relates to the field of deep learning, and discloses a module perception auxiliary learning optimization method and a computer product, which comprise the following steps: updating model parameters of each module according to a module level auxiliary loss weight, and obtaining an updated neural network model; importing a top layer optimization training data set into the updated neural network model, and calculating an updated module level auxiliary loss weight corresponding to each module; taking the updated module level auxiliary loss weight as a module level auxiliary loss weight in the next cycle for the next cycle until the updated neural network model meets a verification condition, and outputting an optimized neural network model. Through the learnable module level auxiliary loss weight, the application solves a conflict problem of different auxiliary loss functions on a module level, makes the auxiliary loss function sufficiently optimize a module with a strong coupling relationship, so that each module obtains information most beneficial to a target task, and the performance of auxiliary learning is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of deep learning, in particular, to a module-aware auxiliary learning optimization method and a computer product. BACKGROUND

[0002] Deep learning is a new research direction in the field of machine learning, which is introduced into machine learning to make it closer to artificial intelligence. In deep learning, a loss function is used to measure the deviation between the prediction made by the model and the true value. Auxiliary learning is a commonly used strategy in deep learning, which aims to use the beneficial information in the auxiliary loss function to help the target task learn better.

[0003] However, existing auxiliary learning strategies only focus on balancing the auxiliary loss function and the target loss function. By linearly combining the auxiliary loss function and the target loss function, the combined loss is used to optimize the entire model, and the weight of the auxiliary loss function is adjusted to avoid negative impact on the target task. This method ignores the coupling relationship between different auxiliary loss functions and different modules of the neural network, i.e., different loss functions should be used to optimize different modules of the neural network. Ignoring such coupling relationship will cause different loss functions to conflict with each other in the modules of the neural network, thereby damaging the performance of auxiliary learning. Therefore, how to let auxiliary learning optimize the model at the module level and avoid conflict between different loss functions at the module level has become a problem to be solved. SUMMARY

[0004] Embodiments of the present application provide a module-aware auxiliary learning optimization method and a computer product, aiming to solve the problem of how to let auxiliary learning optimize the model at the module level and avoid conflict between different loss functions at the module level.

[0005] The first aspect of the embodiments of the present application provides a module-aware auxiliary learning optimization method, comprising:

[0006] updating the model parameters of each module according to the module-level auxiliary loss weight corresponding to each module to obtain an updated neural network model;

[0007] importing a top-level optimization training data set into the updated neural network model to calculate the updated module-level auxiliary loss weight corresponding to each module;

[0008] taking the updated module-level auxiliary loss weight corresponding to each module as the module-level auxiliary loss weight corresponding to each module in the next cycle for the next cycle until the updated neural network model meets a verification condition, and outputting the neural network model that meets the verification condition as an optimized neural network model.

[0009] Optionally, when the training round is the first cycle, the model parameters of each module are updated according to the module-level auxiliary loss weight corresponding to each module, to obtain an updated neural network model, comprising:

[0010] The bottom-layer optimization training data set is imported into the initial neural network model to obtain the bottom-layer optimization test data of each module in the first cycle;

[0011] According to the bottom-layer optimization test data of each module in the first cycle, the gradient of the model parameters of each module with respect to the auxiliary loss function corresponding to each module in the first cycle and the gradient of the model parameters of each module with respect to the target loss function in the first cycle are calculated;

[0012] The gradient of the model parameters of each module with respect to the auxiliary loss function corresponding to each module in the first cycle is weighted according to the initial module-level auxiliary loss weight corresponding to each module, and is combined with the gradient of the model parameters of each module with respect to the target loss function in the first cycle to obtain a combined weighted gradient for each module in the first cycle, and the number of the initial module-level auxiliary loss weight corresponding to each module is the same as the number of the auxiliary loss function;

[0013] The model parameters of each module are updated according to the combined weighted gradient for each module in the first cycle to obtain a first updated neural network model.

[0014] Optionally, when the training round is the nth cycle, comprising:

[0015] The bottom-layer optimization training data set is imported into the (n-1)th updated neural network model to obtain the bottom-layer optimization test data of each module in the nth cycle, wherein n is greater than or equal to 2;

[0016] According to the bottom-layer optimization test data of each module in the nth cycle, the gradient of the model parameters of each module with respect to the auxiliary loss function corresponding to each module in the nth cycle and the gradient of the model parameters of each module with respect to the target loss function in the nth cycle are calculated;

[0017] The gradient of the model parameters of each module with respect to the auxiliary loss function corresponding to each module in the nth cycle is weighted according to the module-level auxiliary loss weight corresponding to each module in the nth cycle, and is combined with the gradient of the model parameters of each module with respect to the target loss function in the nth cycle to obtain a combined weighted gradient for each module in the nth cycle, and the module-level auxiliary loss weight corresponding to each module in the nth cycle is the updated module-level auxiliary loss weight corresponding to each module in the (n-1)th cycle;

[0018] According to the combined weighted gradient of each module in the n th cycle, the model parameters of each module are updated to obtain an updated neural network model.

[0019] Optionally, the top-level optimization training data set is imported into the updated neural network model to calculate the updated module-level auxiliary loss weight corresponding to each module, including:

[0020] The top-level optimization training data set is imported into the updated neural network model to obtain top-level optimization test data, and the training data of the top-level optimization training data set is different from the bottom-level optimization training data in the training data set.

[0021] The target loss function for the top-level optimization test data is calculated, and the implicit gradient of the target loss function for the top-level optimization test data on the module-level auxiliary loss weight corresponding to each module is calculated.

[0022] According to the implicit gradient, the updated module-level auxiliary loss weight corresponding to each module is calculated.

[0023] Optionally, until the updated neural network model satisfies a verification condition, the neural network model satisfying the verification condition is output as an optimized neural network model, including:

[0024] When the training round is the m th preset training round, an updated neural network model of the m th preset training round is obtained.

[0025] The data of the verification set is imported into the updated neural network model of the m th preset training round to obtain m th verification data, and a verification result corresponding to the m th verification data is calculated.

[0026] In the case that m is greater than a preset comparison number, the verification result corresponding to the m-1 th verification data, the verification result corresponding to the m-2 th verification data, and the verification result corresponding to the m-3 th verification data are combined to form a comparison data set, and if the verification result corresponding to the m th verification data is not greater than all the verification results in the comparison data set, the updated neural network model of the m th preset training round is output as an optimized neural network model.

[0027] Optionally, the gradient of the loss function for the m th verification data on the model parameters of the updated neural network model of the m th preset training round is calculated as the verification result corresponding to the m th verification data.

[0028] The second aspect of the embodiment of the present application provides a module-aware auxiliary learning optimization device, including:

[0029] a parameter updating module, configured to update model parameters of each module according to a module-level auxiliary loss weight corresponding to each module, to obtain an updated neural network model;

[0030] a top-layer optimization module, configured to import a top-layer optimization training data set into the updated neural network model, and calculate an updated module-level auxiliary loss weight corresponding to each module;

[0031] a loop module, configured to take the updated module-level auxiliary loss weight corresponding to each module as a module-level auxiliary loss weight corresponding to each module in the next loop, and perform the next loop until the updated neural network model meets a verification condition, and output the neural network model meeting the verification condition as an optimized neural network model.

[0032] When the training round is the first loop, the parameter updating module comprises:

[0033] a first bottom-layer training submodule, configured to import a bottom-layer optimization training data set into an initial neural network model, to obtain bottom-layer optimization test data of each module in the first loop;

[0034] a first gradient calculation submodule, configured to calculate, according to the bottom-layer optimization test data of each module in the first loop, a gradient of an auxiliary loss function corresponding to each module with respect to model parameters of each module in the first loop, and a gradient of a target loss function with respect to the model parameters of each module in the first loop;

[0035] a first weighting submodule, configured to weight the gradient of the auxiliary loss function corresponding to each module with respect to the model parameters of each module in the first loop according to an initial module-level auxiliary loss weight corresponding to each module, and combine the weighted gradient with the gradient of the target loss function with respect to the model parameters of each module in the first loop, to obtain a combined weighted gradient for each module in the first loop, the number of the initial module-level auxiliary loss weights corresponding to each module being the same as the number of the auxiliary loss functions;

[0036] a first updating submodule, configured to update the model parameters of each module according to the combined weighted gradient for each module in the first loop, to obtain a first updated neural network model.

[0037] When the training round is the nth loop, the parameter updating module further comprises:

[0038] a second bottom-layer training submodule, configured to import the bottom-layer optimization training data set into an (n-1)th updated neural network model, to obtain bottom-layer optimization test data of each module in the nth loop, where n is greater than or equal to 2;

[0039] a second gradient calculation submodule configured to calculate, according to the bottom-layer optimization test data of each module in the nth cycle, a gradient of the auxiliary loss function corresponding to each module in the nth cycle with respect to the model parameter of each module, and a gradient of the target loss function in the nth cycle with respect to the model parameter of each module;

[0040] a second weighting submodule configured to weight, according to the module-level auxiliary loss weight corresponding to each module in the nth cycle, the gradient of the auxiliary loss function corresponding to each module in the nth cycle with respect to the model parameter of each module, and combine the gradient with the gradient of the target loss function in the nth cycle with respect to the model parameter of each module, to obtain a combined weighted gradient for each module in the nth cycle, the module-level auxiliary loss weight corresponding to each module in the nth cycle being the updated module-level auxiliary loss weight corresponding to the module in the (n-1)th cycle;

[0041] a second updating submodule configured to update the model parameter of each module according to the combined weighted gradient for each module in the nth cycle, to obtain a neural network model updated in the nth time.

[0042] The top-layer optimization module further comprises:

[0043] a top-layer training submodule configured to import a top-layer optimization training data set into the updated neural network model, to obtain top-layer optimization test data, the training data of the top-layer optimization training data set being different from the bottom-layer optimization training data in the training data set;

[0044] an implicit gradient calculation submodule configured to calculate a target loss function with respect to the top-layer optimization test data, and calculate an implicit gradient of the target loss function with respect to the module-level auxiliary loss weight corresponding to each module;

[0045] an auxiliary loss weight updating submodule configured to calculate the updated module-level auxiliary loss weight corresponding to each module according to the implicit gradient.

[0046] The cycle module further comprises:

[0047] a verification model obtaining submodule configured to obtain an updated neural network model in the mth preset training round when the training round is the mth preset training round;

[0048] a verification set importing submodule configured to import data of a verification set into the updated neural network model in the mth preset training round, to obtain mth verification data, and calculate a verification result corresponding to the mth verification data;

[0049] The verification submodule is configured to, when m is greater than the preset comparison number of times, group a verification result corresponding to the (m-1)th verification data, a verification result corresponding to the (m-2)th verification data, and a verification result corresponding to the (m-3)th verification data to form a comparison data set, and when the verification result corresponding to the mth verification data is not greater than all the verification results in the comparison data set, output the updated neural network model of the mth preset training round as the optimized neural network model.

[0050] The verification set importing submodule further includes:

[0051] The gradient calculation subunit is configured to calculate a gradient of a loss function with respect to the model parameters of the updated neural network model of the mth preset training round for the mth verification data as the verification result corresponding to the mth verification data.

[0052] The third aspect of the embodiments of the present application provides an electronic device including a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps in the module-aware auxiliary learning optimization method of any of the first aspect.

[0053] The fourth aspect of the embodiments of the present application provides a computer readable storage medium having a computer program / instruction stored thereon, and the computer program / instruction is executed by a processor to implement the steps in the module-aware auxiliary learning optimization method of any of the first aspect.

[0054] The fifth aspect of the embodiments of the present application provides a computer program product including a computer program / instruction, and the computer program / instruction is executed by a processor to implement the steps in the module-aware auxiliary learning optimization method of any of the first aspect.

[0055] Advantages:

[0056] The present application provides a module-aware auxiliary learning optimization method and a computer product, including: updating the model parameters of each module according to the module-level auxiliary loss weight corresponding to each module to obtain an updated neural network model; importing a top-level optimization training data set into the updated neural network model to calculate the updated module-level auxiliary loss weight corresponding to each module; taking the updated module-level auxiliary loss weight corresponding to each module as the module-level auxiliary loss weight corresponding to each module in the next cycle for the next cycle until the updated neural network model meets a verification condition, and outputting the neural network model meeting the verification condition as an optimized neural network model. The method has the following advantages:

[0057] (1) Through the module level auxiliary loss weight, the auxiliary loss function is fully optimized to the module with strong coupling relationship, the conflict problem of different auxiliary loss functions on the module level is solved, so that each module in the neural network model obtains the most beneficial information for the target task, and the performance of auxiliary learning is greatly improved.

[0058] (2) The auxiliary loss weight is optimized in a data driven manner, without specific understanding of the auxiliary task, which can adapt to various auxiliary loss scenarios, be applied to various neural network models, and has strong generalization ability. BRIEF DESCRIPTION OF DRAWINGS

[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0060] Figure 1 is an existing auxiliary learning method schematic diagram proposed by an embodiment of the present application;

[0061] Figure 2 is a module perception auxiliary learning optimization method schematic diagram proposed by an embodiment of the present application;

[0062] Figure 3 is a module perception auxiliary learning optimization method flow chart proposed by an embodiment of the present application;

[0063] Figure 4 is a module perception auxiliary learning optimization method cycle example diagram proposed by an embodiment of the present application;

[0064] Figure 5 is a module level learning optimization strength schematic diagram in a bird picture classification model proposed by an embodiment of the present application;

[0065] Figure 6 is a module level learning optimization strength schematic diagram in a recommendation model proposed by an embodiment of the present application;

[0066] Figure 7 is a module perception auxiliary learning optimization device schematic diagram proposed by an embodiment of the present application;

[0067] Figure 8 is an electronic device schematic diagram proposed by an embodiment of the present application. DETAILED DESCRIPTION

[0068] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of the present application.

[0069] In the related art, Figure 1 An existing auxiliary learning method is shown in a schematic diagram as shown in Figure 1 As shown, the neural network model of the target task includes five modules. After the training data in the training data set is imported into the neural network model and sequentially passes through the modules 1 to 5 in the model, model test data is obtained. The model test data is for the whole model (modules 1 to 5). The target loss function L goal and the auxiliary loss function L α1 and L α2 are calculated according to the model test data. By setting the weight λ1 of the auxiliary loss function L α1 and the weight λ2 of the auxiliary loss function L α2 , and linearly combining the target loss function to form a total loss function (L C =L goal +λ1L α1 +λ2L α2 ), the model parameters of modules 1 to 5 in the whole model are optimized.

[0070] However, the above auxiliary learning strategy only focuses on balancing the auxiliary loss function and the target loss function. By linearly combining the auxiliary loss function and the target loss function, the combined loss is used to optimize the whole model, and the weight of the auxiliary loss function is adjusted to avoid negative effects on the target task. This method ignores the coupling relationship between different auxiliary loss functions and different modules of the neural network, that is, different loss functions should be used to optimize different modules of the neural network. For example, the auxiliary loss function L α1 may have a stronger coupling relationship with modules 1 and 2, and its optimization contribution to the model parameters of modules 1 and 2 is greater, while the coupling relationship with modules 3, 4 and 5 is small. At this time, if the linear combination of the target loss function and the auxiliary loss function in the model parameter optimization of the whole model is ignored, the different loss functions will conflict with each other in the modules of the neural network, thereby damaging the performance of auxiliary learning.

[0071] Therefore, the embodiments of the present application propose a module-aware auxiliary learning optimization method, Figure 2 A schematic diagram of the module-aware auxiliary learning optimization method of the embodiments of the present application is shown in Figure 2As shown, the method of the embodiment of the present application will, in the training process, update the model parameters of the modules with strong coupling relationship with the auxiliary loss function L α1 for optimizing the model parameters in the modules 1, 2 and 3, the auxiliary loss function L α2 for optimizing the model parameters in the modules 2, 4 and 5, after the auxiliary loss function L α1 and the auxiliary loss function L α2 After optimizing the model parameters of the modules it targets, the target loss function L goal optimizes the model parameters of the overall neural network model (modules 1-5) for the target task.

[0072] For example, for the depth prediction auxiliary loss function and the normal vector prediction auxiliary loss function in the picture segmentation model, in the existing picture segmentation model, the depth prediction auxiliary loss weight and the normal vector prediction auxiliary loss weight are manually set to linearly combine the depth prediction auxiliary loss function based on the depth prediction auxiliary loss weight and the normal vector prediction auxiliary loss function based on the normal vector prediction auxiliary loss weight with the target loss function (picture segmentation loss) after the entire model training to optimize the model parameters in the picture segmentation model. However, the depth prediction auxiliary loss function only has a strong coupling relationship with certain modules in the model related to depth prediction, and the normal vector prediction auxiliary loss function only has a strong coupling relationship with certain modules in the model related to normal vector prediction. The method of the present application is to update the depth prediction auxiliary loss weight and the normal vector prediction auxiliary loss weight in the training process to continuously improve the effect of the auxiliary loss weight on the modules with strong coupling relationship in the cyclic process, so that the performance of the optimized picture segmentation model obtained finally is better.

[0073] The embodiment of the present application determines the coupling relationship of different auxiliary loss functions to different modules in the model by introducing learnable module-level auxiliary function loss weights, Figure 3 The module-aware auxiliary learning optimization method flowchart is shown as Figure 3 As shown, the method comprises the following steps:

[0074] S101, updating the model parameters of each module according to the module-level auxiliary loss weight corresponding to each module to obtain an updated neural network model.

[0075] S102, importing the top-level optimization training data set into the updated neural network model to calculate the updated module-level auxiliary loss weight corresponding to each module.

[0076] S103, taking the updated module-level auxiliary loss weight corresponding to each module as the module-level auxiliary loss weight corresponding to each module in the next cycle, until the updated neural network model meets the verification condition, and taking the neural network model meeting the verification condition as the optimized neural network model.

[0077] Before the specific implementation step S101, the training data set is divided into a bottom-layer optimization training data set and a top-layer optimization training data set, the bottom-layer optimization training data set is used to train the model parameters of different modules in the neural network model, and the top-layer optimization training data set is used to update the module-level auxiliary loss weight for the next cycle. It should be noted that, in order to ensure good performance for training data not seen in the training data set in the next cycle, in an optional implementation, the top-layer optimization training data set and the bottom-layer optimization training data set are set as non-repeating training data.

[0078] In the case of the first cycle of the training round, the updated module-level auxiliary loss weight of the previous cycle cannot be obtained, and the initial module-level auxiliary loss weight needs to be preset in the initial neural network model. Since the initial module-level auxiliary loss weight is not updated, it will not be 0, and in the first cycle, all auxiliary loss functions will act on all modules of the neural network model.

[0079] In the specific implementation step S101, first, the first cycle is performed, the bottom-layer optimization training data set is imported into the initial neural network model, and the bottom-layer optimization test data of each module in the first cycle is obtained; according to the bottom-layer optimization test data of each module in the first cycle, the auxiliary loss function and the target loss function corresponding to each module in the first cycle are calculated first, and then the gradient of the auxiliary loss function corresponding to each module in the first cycle on the model parameters of each module and the gradient of the target loss function in the first cycle on the model parameters of each module are calculated.

[0080] Subsequently, according to the initial module-level auxiliary loss weight corresponding to each module, the gradient of the auxiliary loss function corresponding to each module in the first cycle on the model parameters of each module is weighted, and is combined with the gradient of the target loss function in the first cycle on the model parameters of each module to obtain the combined weighted gradient for each module in the first cycle. Since the initial module-level auxiliary loss weight is preset and does not have a 0 value, the number of initial module-level auxiliary loss weights that can effectively act on each module is the same as the number of auxiliary loss functions; according to the combined weighted gradient for each module in the first cycle, the model parameters of each module are updated to obtain the first updated neural network model.

[0081] Specifically, the training data of the bottom-layer optimization training data set is first imported into module 1 of the initial neural network model to obtain bottom-layer optimization test data of module 1, and the auxiliary loss function values of different auxiliary loss functions for module 1 are calculated based on the bottom-layer optimization test data of module 1; the bottom-layer optimization test data of module 1 is then imported into module 2 to obtain bottom-layer optimization test data of module 2, and the auxiliary loss function values of all auxiliary loss functions for module 2 are calculated based on the bottom-layer optimization test data of module 2. In this way, the bottom-layer optimization test data of each module is obtained in turn, the loss function values of different loss functions for each module are calculated according to the bottom-layer optimization test data of each module, and the target loss function value of the target loss function L goal for the target task is calculated according to the bottom-layer optimization test data of all modules.

[0082] Subsequently, the gradients of the different auxiliary loss function values and the target loss function value for module 1 with respect to the model parameters of module 1 are calculated, the gradients of the model parameters of module 1 with respect to the auxiliary loss functions are weighted according to the initial module-level auxiliary loss weights for module 1, and the gradients of the model parameters of module 1 with respect to the target loss function value are summed to obtain the combined weighted gradients for module 1, based on which the model parameters of module 1 are updated.

[0083] The above process is repeated to update the model parameters of all modules in the model in turn, and the model in which the model parameters of all modules are updated is taken as the first updated neural network model. As described above, after the model parameters of all modules in the initial neural network model are updated based on all auxiliary loss functions, the first updated neural network model is obtained.

[0084] It should be noted that in an alternative embodiment, a preset number of bottom-layer optimization steps can be performed in the first loop according to the above process, and the specific preset number of bottom-layer optimization steps can be determined according to actual conditions, which is not limited in the present application.

[0085] For example, Figure 4 A cycle example diagram of the module-aware auxiliary learning optimization method is shown in FIG. 1, which shows the first cycle as an example, Figure 4 The left side shows an example of the first cycle, Figure 4 The neural network model shown in FIG. 1 includes three modules (module 1, module 2, and module 3), and two different module-level auxiliary loss functions L α1 and L α2 are set, so there will be six module-level auxiliary loss weights α 11 , α 12 , α 13 , α 21 , α 22 , and α 23Since the initial module-level auxiliary loss weights do not have a value of 0, each module will have two auxiliary loss functions that update the model parameters according to the initial module-level auxiliary loss weights. T steps of bottom-level optimization are set in a training epoch. The bottom-level optimization process is the same for each step. The following example uses the first step of the bottom-level optimization in the first epoch; subsequent steps follow the same process and will not be repeated here. First, the training dataset is imported into the bottom-level optimization training dataset into module 1 to obtain the bottom-level optimization test data for module 1. Based on the bottom-level optimization test data of module 1, the module-level auxiliary loss function L is calculated. α1 and module-level auxiliary loss function L α2 Subsequently, the underlying optimization test data of Module 1 is imported into Module 2 to obtain the underlying optimization test data of Module 2. Based on the underlying optimization test data of Module 2, the module-level auxiliary loss function L is calculated. α1 and module-level auxiliary loss function L α2 Import the underlying optimization test data of Module 2 into Module 3 to obtain the underlying optimization test data of Module 3. Calculate the module-level auxiliary loss function L based on the underlying optimization test data of Module 3. α1 and module-level auxiliary loss function L α2 The underlying optimization test data of Module 3 is used as the underlying optimization test data for the entire model. Based on this underlying optimization test data, the target loss function L for the target task is calculated. goal The target loss function value.

[0086] Subsequently, L for module 1 is calculated. α1 L α2 and L goal The gradient of the model parameters of module 1 is calculated according to the initial module-level auxiliary loss weights α. 11 and the initial module-level auxiliary loss weight α 21 For L of module 1 respectively α1 and L α2 Perform weighted calculations to obtain the weighted L for module 1. α1 and L α2 With L for module 1 goal The combined weighted gradients for module 1 are summed together, and the model parameters for module 1 are updated based on these combined weighted gradients. The L-value for module 2 is then calculated. α1 L α2 and L goal The gradient of the model parameters of module 2 is calculated according to the initial module-level auxiliary loss weights α. 12 and the initial module-level auxiliary loss weight α 22 For L of module 2 respectively α1 and L α2 We perform weighted calculations to obtain the weighted L for module 2.α1 and L α2 and L goal are summed up to obtain a combined weighted gradient for the module 2, and the model parameters of the module 2 are updated based on the combined weighted gradient for the module 2; L α1 , L α2 and L goal are summed up to obtain a combined weighted gradient for the module 3, and the model parameters of the module 3 are updated based on the combined weighted gradient for the module 3. 13 and the initial module-level auxiliary loss weight a 23 are weighted respectively to obtain weighted L α1 and L α2 are summed up to obtain a combined weighted gradient for the module 3, and the model parameters of the module 3 are updated based on the combined weighted gradient for the module 3. α1 and L α2 and L goal are summed up to obtain a combined weighted gradient for the module 2, and the model parameters of the module 2 are updated based on the combined weighted gradient for the module 2; L

[0087] Finally, after T steps are performed according to the above process, the model with the updated model parameters of the module 1, the module 2 and the module 3 is taken as the first updated neural network model.

[0088] After obtaining the first updated neural network model in the first cycle, the initial module-level auxiliary loss weight is also updated by top-level optimization, and the updated module-level auxiliary loss weight is used in the training process of the next cycle. The process of top-level optimization can be referred to the following content about the step S102, which is not described in detail here.

[0089] When the training cycle is not the first cycle, assuming that the training round is the nth cycle (n is greater than or equal to 2), at this time in the nth cycle, similar to the first cycle, the bottom-level optimization is performed based on the bottom-level optimization training data set. Different from the first cycle, the module-level auxiliary loss weight used in the nth cycle is the updated module-level auxiliary loss weight obtained in the top-level optimization in the previous cycle. The process of top-level optimization can be referred to the following content about the step S102, which is not described in detail here. Specifically, when the nth cycle is performed, first, the bottom-level optimization test data of each module in the nth cycle is obtained by importing the bottom-level optimization training data set into the (n-1)th updated neural network model; and the gradient of the auxiliary loss function corresponding to each module in the nth cycle with respect to the model parameters of each module, and the gradient of the target loss function in the nth cycle with respect to the model parameters of each module are calculated according to the bottom-level optimization test data of each module in the nth cycle.

[0090] Subsequently, according to the module-level auxiliary loss weights corresponding to each module in the nth iteration, the gradient of the auxiliary loss function corresponding to each module in the nth iteration with respect to the model parameters of each module is weighted and combined with the gradient of the target loss function corresponding to each module in the nth iteration to obtain the combined weighted gradient for each module in the nth iteration. The module-level auxiliary loss weights corresponding to each module in the nth iteration are the updated module-level auxiliary loss weights corresponding to each module in the (n-1)th iteration. The model parameters of each module are updated according to the combined weighted gradient for each module in the nth iteration to obtain the updated neural network model in the nth iteration.

[0091] It should be noted that, in one optional implementation, the preset number of underlying optimization steps can be executed sequentially in the nth loop according to the above process. The specific preset number of underlying optimization steps can be determined according to the actual situation, and this application does not impose any specific restrictions here.

[0092] For example, Figure 4 The right side shows an example of the second loop, when n=2. Figure 4 The neural network model shown consists of three modules (module 1, module 2, and module 3), and two different module-level auxiliary loss functions L are set. α1 and L α2 Therefore, there will be 6 module-level auxiliary loss weights α 11 ,α 12 ,α 13 ,α 21 ,α 22 ,α 23 Among the updated module-level auxiliary loss weights obtained after the first iteration of top-level optimization, only α... 12 and α 21 Non-zero values, other module-level auxiliary loss weights (α) 11 ,α 13 ,α 22 ,α 23 All α values ​​are reduced to 0 due to gradient descent; therefore, in the bottom-level optimization process of the second loop, only α... 12 and α 21 The corresponding loss function is used to update the model parameters of the corresponding module, α. 12 For L α1 For the weights of the auxiliary loss function in module 2, α 21 For L α2 The weights of the auxiliary loss function for module 1 are specified. Furthermore, in the second loop, T-step underlying optimization is also set, with the same underlying optimization process for each step. The following example uses the first step of the second loop's underlying optimization; subsequent steps follow the same process and will not be repeated here.

[0093] First, the training dataset is imported into the underlying optimization training dataset into Module 1 to obtain the underlying optimization test data for Module 1. Based on the underlying optimization test data of Module 1, the module-level auxiliary loss function L is calculated. α1 and module-level auxiliary loss function L α2 Subsequently, the underlying optimization test data of Module 1 is imported into Module 2 to obtain the underlying optimization test data of Module 2. Based on the underlying optimization test data of Module 2, the module-level auxiliary loss function L is calculated. α1 and module-level auxiliary loss function L α2 Import the underlying optimization test data of Module 2 into Module 3 to obtain the underlying optimization test data of Module 3. Calculate the module-level auxiliary loss function L based on the underlying optimization test data of Module 3. α1 and module-level auxiliary loss function L α2 The underlying optimization test data of Module 3 is used as the underlying optimization test data for the entire model. Based on this underlying optimization test data, the target loss function L for the target task is calculated. goal The target loss function value.

[0094] Subsequently, L for module 1 is calculated. α1 L α2 and L goal The gradient of the model parameters of module 1 is calculated by applying the module-level auxiliary loss weight α to module 1 in this iteration. 21 (α 11 (where α is 0), therefore, the underlying optimization test data based on module 1 is weighted according to the module-level auxiliary loss weight α. 21 Calculate the module-level auxiliary loss function L α2 According to the module-level auxiliary loss weight α 21 For L of module 1 α2 Weighted (L) α1 According to α 11 The weighting is also 0, so it will not be described further (the same applies below), thus obtaining the weighted L for module 1. α2 With L for module 1 goal The combined weighted gradients for module 1 are summed together, and the model parameters for module 1 are updated based on these combined weighted gradients. The L-value for module 2 is then calculated. α1 L α2 and L goal The gradient of the model parameters of module 2 is calculated according to the module-level auxiliary loss weight α. 12 For L targeting module 2 α1 We perform weighted calculations to obtain the weighted L for module 2. α1 With L for module 2 goalThe combined weighted gradients for module 2 are summed together, and the model parameters for module 2 are updated based on these combined weighted gradients. The L-value for module 3 is then calculated. α1 L α2 and L goal The gradient of the model parameters for module 3 is not applied to module 3 (α) because the module-level auxiliary loss weights in this iteration do not apply to module 3. 13 and α 23 All are 0), summed together to obtain the combined weighted gradient for module 3, based on L for module 3. goal The gradient of the model parameters of module 3 is used to update the model parameters of module 3.

[0095] Finally, after executing T steps according to the above process, the model with updated model parameters of module 1, module 2, and module 3 is used as the neural network model for the second update.

[0096] After obtaining the second updated neural network model in the second loop, top-level optimization is needed to update the module-level auxiliary loss weights in the second loop. The updated module-level auxiliary loss weights are used in the training process of the next loop. The specific top-level optimization process can be found in the content about step S102 below, which will not be described in detail here.

[0097] After obtaining the updated neural network model, in order to proceed with the next iteration, the module-level auxiliary loss weights corresponding to each module need to be updated. In this embodiment, step S102 is executed to obtain the updated module-level loss weights through top-level optimization.

[0098] In specific implementation step S102, the top-level optimization training dataset is imported into the updated neural network model to obtain the top-level optimization test data; the target loss function for the top-level optimization test data is calculated, and the implicit gradient of the target loss function for the top-level optimization test data with respect to the module-level auxiliary loss weights corresponding to each module is calculated; based on the implicit gradient, the updated module-level auxiliary loss weights corresponding to each module are calculated.

[0099] Specifically, after the content described in step S101 obtains the updated neural network model (the first updated neural network model or the nth updated neural network model), the top-level optimization test data set is first imported into the first updated neural network model, and the top-level optimization test data is obtained after being processed by all the modules of the neural network model. The loss function value of the target loss function for the target task is calculated based on the top-level optimization test data. Since the target loss function based on the top-level optimization test data has no direct correlation with the auxiliary loss weight, when updating the module-level auxiliary loss weight based on the target loss function based on the top-level optimization test data, according to the chain rule, the gradient of the target loss function based on the top-level optimization test data on the model parameters is first calculated, and then the implicit gradient of the module-level auxiliary loss weight corresponding to each module is calculated through the gradient of the target loss function on the model parameters.

[0100] It should be noted that when the gradient of the target loss function on the module-level auxiliary loss weight is expanded through the chain rule, the T steps of the bottom-level optimization need to be expanded, which will save all the computation graphs in the T-step optimization process. In order to reduce the calculation difficulty and cost, in an optional implementation, the best response approximation method is adopted, the model parameters in the T step are considered to be the same as the model parameters in the T step, so that the implicit gradient calculation is performed efficiently. The calculation of the implicit gradient through the best response approximation method can avoid saving the computation graph in the bottom-level optimization process, improve the efficiency of the top-level optimization, and reduce the calculation cost.

[0101] After obtaining the implicit gradient of the target loss function for the top-level optimization test data on the module-level auxiliary loss weight corresponding to each module, the updated module-level auxiliary loss weight corresponding to each module is calculated according to the implicit gradient.

[0102] Finally, the updated module-level auxiliary loss weight is taken as the module-level auxiliary loss weight in the next cycle for the bottom-layer optimization in the next cycle, and is updated again in the top-layer optimization in the next cycle according to the process as described above, so as to realize the learning and updating of the module-level auxiliary loss weight in each cycle. Since the module-level auxiliary loss weight in the embodiment of the present application is not artificially set for the module-level auxiliary loss weight in each cycle, but is trained based on the top-layer training data set and the model parameters optimized in the bottom layer during the training process, the module-level auxiliary loss weight in the embodiment of the present application is data-driven, does not need to know the specific auxiliary task, can adapt to various auxiliary loss scenarios, and can be applied to various neural network models (such as a picture classification model, a picture segmentation model, a recommendation model, etc.), and has strong generalization ability. For example, when considering a wider auxiliary loss (such as using L2 regularization as an auxiliary loss), the method provided in the embodiment of the present application can also handle the module-level influence in these cases, and the optimized neural network model obtained by training has better model performance.

[0103] Figure 5 A schematic diagram of module-level learning optimization strength in a bird picture classification model is shown, as shown in FIG. 1. Figure 5 As shown in FIG. 1, for a bird picture classification model (including 5 modules), the target task is bird classification, and two module-level auxiliary loss functions for bird wing color classification and bird bill shape classification are included.

[0104] According to the bird wing color classification auxiliary loss weight and the bird bill shape classification auxiliary loss weight corresponding to each module, the model parameters of each module are updated to obtain an updated bird picture classification model; the top-layer optimization training data set is imported into the updated bird picture classification model, and the updated bird wing color classification auxiliary loss weight and the bird bill shape classification auxiliary loss weight corresponding to each module are calculated; the updated bird wing color classification auxiliary loss weight and the bird bill shape classification auxiliary loss weight corresponding to each module are taken as the module-level auxiliary loss weight corresponding to each module in the next cycle for the next cycle, until the updated bird picture classification model meets a verification condition, and the bird picture classification model meeting the verification condition is taken as an optimized bird picture classification model and output.

[0105] The optimized bird picture classification model is obtained by training according to the above method, and the optimized bird picture classification model is used for bird classification. Figure 5It can be seen that the two module-level auxiliary loss functions for bird wing color classification and for bird beak shape classification have a stronger coupling relationship with module 1 and module 2, indicating that in the process of training cycles, the bird wing color classification auxiliary loss weight and the bird beak shape classification auxiliary loss weight are constantly updated in each cycle in a data-driven manner, so that the auxiliary loss function based on the bird wing color classification auxiliary loss weight optimizes module 1 and module 2 more intensively in the cycle training optimization, and the auxiliary loss function based on the bird beak shape classification auxiliary loss weight optimizes module 1 and module 2 more intensively in the cycle training optimization. The performance and accuracy of the optimized bird picture classification model trained by the method of the present application in processing bird picture classification problems are higher.

[0106] Figure 6 A schematic diagram of module-level learning optimization intensity in a recommendation model is shown, as shown in Figure 6 For a recommendation model (including 6 modules), the target task is to predict conversion rate (purchase / display), which includes a module-level auxiliary loss function for predicting click rate (CTR, click / display).

[0107] According to the auxiliary loss weight of the predicted click rate corresponding to each module, the model parameters of each module are updated to obtain an updated recommendation model; the top-level optimization training data set is imported into the updated recommendation model, and the auxiliary loss weight of the updated predicted click rate corresponding to each module is calculated; the auxiliary loss weight of the updated predicted click rate corresponding to each module is used as the module-level auxiliary loss weight corresponding to each module in the next cycle for the next cycle, until the updated recommendation model meets the verification condition, and the recommendation model that meets the verification condition is output as the optimized recommendation model.

[0108] In the method of training the optimized recommendation model according to the above embodiments of the present application, by Figure 6 It can be seen that the module-level auxiliary loss function for predicting click rate has a stronger coupling relationship with module 6, indicating that in the process of training cycles, the auxiliary loss weight for predicting click rate is constantly updated in each cycle in a data-driven manner, so that the auxiliary loss function based on the auxiliary loss weight for predicting click rate optimizes module 6 more intensively in the cycle training optimization, and optimizes other modules less intensively. The performance and accuracy of the optimized recommendation model trained by the method of the present application in processing recommendation problems are higher.

[0109] In addition, in order to ensure that the module-level auxiliary loss weight plays a better role in the main task, it is necessary to ensure that the top-level optimization process uses training data that has not been seen in the bottom-level optimization to update the module-level auxiliary loss weight based on the top-level optimization training data set. Therefore, in the method provided in the embodiment of the application, the top-level optimization training data set and the bottom-level optimization training data set are non-overlapping data in the training data set.

[0110] In each cycle, after the updated neural network model is obtained through the bottom-level optimization in step S101 and the updated module-level auxiliary loss weight is obtained through the top-level optimization in step S102, step S103 is performed to perform subsequent cycle training process, and an optimized neural network model meeting the condition is output.

[0111] In the implementation of step S103, the updated module-level auxiliary loss weight corresponding to each module is taken as the module-level auxiliary loss weight corresponding to each module in the next cycle, and the next cycle is performed according to the contents of steps S101 and S102. For the training optimization process in each cycle, refer to the above description, which will not be repeated here.

[0112] In an optional embodiment, in order to determine the end node of the cycle training optimization process, the neural network model is provided with a preset training round, and when the training process is cycled for a preset training round, the updated neural network model output in this cycle is verified on the validation set.

[0113] In the implementation, after the first preset training round, the updated neural network model of the first preset training round is output, the data of the validation set is imported into the updated neural network model of the first preset training round, and after the module of the updated neural network model of the first preset training round is processed, the corresponding first verification data is output, the loss function for the first verification data is calculated and saved.

[0114] Subsequently, the training is performed, and when the training round is the mth preset training round, the updated neural network model of the mth preset training round is obtained; the data of the validation set is imported into the updated neural network model of the mth preset training round to obtain the mth verification data, and the gradient of the model parameter of the updated neural network model of the mth preset training round with respect to the loss function of the mth verification data is calculated as the verification result corresponding to the mth verification data.

[0115] In a case that m is greater than the preset comparison times, the verification result corresponding to the (m-1)th verification data, the verification result corresponding to the (m-2)th verification data, and the verification result corresponding to the (m-3)th verification data are combined to form a comparison data set, and if the verification result corresponding to the mth verification data is not greater than all the verification results in the comparison data set, it is considered that the performance of the neural network model is no longer improved by the cyclic training optimization, and it is determined that the optimization is completed at this time, and the updated neural network model of the mth preset training round is output as the optimized neural network model. In the embodiment of the application, the preset comparison times is 3, and in a case that m is greater than 3, the verification results corresponding to the last three verification data (the (m-1)th verification data, the (m-2)th verification data, and the (m-3)th verification data) are compared to prevent the verification result of a certain time from being accidental and leading to incorrect judgment of the verification result corresponding to the mth verification data. The specific preset comparison times can be determined according to specific conditions, which is not limited in the application.

[0116] For example, the preset training round is 60 times, and the preset comparison times is 3. When the training set is trained to the 60th cycle (m=1), the 60th updated neural network model output by the 60th cycle is obtained, the data of the verification set is imported into the 60th updated neural network model, the corresponding first verification data is output, the gradient of the loss function with respect to the 60th updated neural network model is calculated as the verification result corresponding to the first verification data and is saved; then the training set is returned to continue training, and the above process is repeated to obtain the verification results corresponding to the verification data of the 120th cycle (m=2) and the 180th cycle (m=3). Until the 240th cycle (m=4), which is the fourth preset training round, is greater than the preset comparison times. The fourth verification data obtained from the 240th updated neural network model, the gradient of the loss function with respect to the model parameters of the 240th updated neural network model is calculated as the verification result corresponding to the fourth verification data; the verification result corresponding to the first verification data, the verification result corresponding to the second verification data, and the verification result corresponding to the third verification data are combined to form a comparison data set, and if the verification result corresponding to the fourth verification data is not greater than the verification result corresponding to the first verification data, the verification result corresponding to the second verification data, and the verification result corresponding to the third verification data in the comparison data set, it is considered that the performance of the neural network model is no longer improved by the cyclic training optimization, and it is determined that the optimization is completed at this time, and the 240th updated neural network model is output as the optimized neural network model.

[0117] The application provides a module-aware auxiliary learning optimization method, model parameters of each module are updated according to a module-level auxiliary loss weight corresponding to each module, an updated neural network model is obtained, a top-level optimization training data set is imported into the updated neural network model, and an updated module-level auxiliary loss weight corresponding to each module is calculated, the updated module-level auxiliary loss weight corresponding to each module is taken as a module-level auxiliary loss weight corresponding to each module in the next cycle, and the next cycle is performed until the updated neural network model meets a verification condition, and the neural network model meeting the verification condition is taken as an optimized neural network model and output. The application has the following advantages:

[0118] (1) The auxiliary loss function is fully optimized for the module with a strong coupling relationship by the module-level auxiliary loss weight, the conflict problem of different auxiliary loss functions at the module level is solved, so that each module in the neural network model obtains the most beneficial information for the target task, and the performance of auxiliary learning is greatly improved.

[0119] (2) The application optimizes the auxiliary loss weight in a data-driven manner, does not need to understand the specific auxiliary task, can adapt to various auxiliary loss scenarios, is applied to various neural network models, and has strong generalization ability.

[0120] Based on the same inventive concept, the application discloses a module-aware auxiliary learning optimization device, Figure 7 The module-aware auxiliary learning optimization device is shown in the schematic diagram, as shown in the schematic diagram, Figure 7 The module-aware auxiliary learning optimization device includes the following modules:

[0121] A parameter updating module is configured to update model parameters of each module according to a module-level auxiliary loss weight corresponding to each module, and obtain an updated neural network model.

[0122] A top-level optimization module is configured to import a top-level optimization training data set into the updated neural network model, and calculate an updated module-level auxiliary loss weight corresponding to each module.

[0123] A cycle module is configured to take the updated module-level auxiliary loss weight corresponding to each module as a module-level auxiliary loss weight corresponding to each module in the next cycle, and perform the next cycle until the updated neural network model meets a verification condition, and output the neural network model meeting the verification condition as an optimized neural network model.

[0124] When the training round is the first cycle, the parameter updating module includes the following modules:

[0125] A first bottom-level training submodule is configured to import a bottom-level optimization training data set into an initial neural network model, and obtain a bottom-level optimization test data of each module in the first cycle.

[0126] a first gradient calculation submodule, configured to calculate, according to the bottom-layer optimization test data of each module in the first cycle, a gradient of the model parameter of each module with respect to the auxiliary loss function corresponding to the module and a gradient of the model parameter of each module with respect to the target loss function in the first cycle;

[0127] a first weighting submodule, configured to weight the gradient of the model parameter of each module with respect to the auxiliary loss function corresponding to the module in the first cycle according to an initial module-level auxiliary loss weight corresponding to each module, and combine the gradient with the gradient of the model parameter of each module with respect to the target loss function in the first cycle, to obtain a combined weighted gradient of each module in the first cycle, wherein the number of the initial module-level auxiliary loss weights corresponding to each module is the same as the number of the auxiliary loss functions;

[0128] a first updating submodule, configured to update the model parameter of each module according to the combined weighted gradient of each module in the first cycle, to obtain a first updated neural network model.

[0129] When the training round is the nth cycle, the parameter updating module further comprises:

[0130] a second bottom-layer training submodule, configured to import the bottom-layer optimization training data set into the (n-1)th updated neural network model, to obtain bottom-layer optimization test data of each module in the nth cycle, wherein n is greater than or equal to 2;

[0131] a second gradient calculation submodule, configured to calculate, according to the bottom-layer optimization test data of each module in the nth cycle, a gradient of the model parameter of each module with respect to the auxiliary loss function corresponding to the module and a gradient of the model parameter of each module with respect to the target loss function in the nth cycle;

[0132] a second weighting submodule, configured to weight the gradient of the model parameter of each module with respect to the auxiliary loss function corresponding to the module in the nth cycle according to a module-level auxiliary loss weight corresponding to each module in the nth cycle, and combine the gradient with the gradient of the model parameter of each module with respect to the target loss function in the nth cycle, to obtain a combined weighted gradient of each module in the nth cycle, wherein the module-level auxiliary loss weight corresponding to each module in the nth cycle is an updated module-level auxiliary loss weight corresponding to the module in the (n-1)th cycle;

[0133] a second updating submodule, configured to update the model parameter of each module according to the combined weighted gradient of each module in the nth cycle, to obtain an nth updated neural network model.

[0134] The top layer optimization module further comprises:

[0135] a top layer training submodule configured to import the top layer optimization training data set into the updated neural network model to obtain top layer optimization test data, wherein the training data of the top layer optimization training data set is different from the bottom layer optimization training data in the training data set;

[0136] an implicit gradient calculation submodule configured to calculate a target loss function for the top layer optimization test data and calculate an implicit gradient of the target loss function for the top layer optimization test data with respect to the module level auxiliary loss weight corresponding to each module;

[0137] an auxiliary loss weight updating submodule configured to calculate the updated module level auxiliary loss weight corresponding to each module according to the implicit gradient.

[0138] The loop module further comprises:

[0139] a verification model obtaining submodule configured to obtain an updated neural network model of the mth preset training round when the training round is the mth preset training round, wherein m is greater than or equal to 2;

[0140] a verification set importing submodule configured to import data of a verification set into the updated neural network model of the mth preset training round to obtain mth verification data and calculate a verification result corresponding to the mth verification data;

[0141] a verification submodule configured to, when m is greater than a preset comparison number of times, group the verification result corresponding to the m-1th verification data, the verification result corresponding to the m-2th verification data and the verification result corresponding to the m-3th verification data into a comparison data set, and if the verification result corresponding to the mth verification data is not greater than all the verification results in the comparison data set, output the updated neural network model of the mth preset training round as an optimized neural network model.

[0142] The verification set importing submodule further comprises:

[0143] a gradient calculation subunit configured to calculate a gradient of a loss function for the mth verification data with respect to the model parameters of the updated neural network model of the mth preset training round as the verification result corresponding to the mth verification data.

[0144] Based on the same inventive concept, the embodiment of the present application discloses an electronic device, Figure 8 a schematic diagram of an electronic device according to an embodiment of the present application is shown, as Figure 8As shown, the electronic device 100 includes a memory 110 and a processor 120, the memory 110 and the processor 120 are connected through a bus in communication, and the memory 110 stores a computer program, the computer program is executable on the processor 120 to realize the steps in the module-aware assisted learning optimization method disclosed in the embodiments of the application.

[0145] Based on the same inventive concept, the embodiments of the present application disclose a computer readable storage medium, which stores a computer program / instruction, and the computer program / instruction is executed by a processor to realize the steps in the module-aware assisted learning optimization method disclosed in the embodiments of the application.

[0146] Based on the same inventive concept, the embodiments of the present application disclose a computer program product, which includes a computer program / instruction, and the computer program / instruction is executed by a processor to realize the steps in the module-aware assisted learning optimization method disclosed in the embodiments of the application.

[0147] Each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same and similar parts between each embodiment can be referred to each other.

[0148] The embodiments of the application are described with reference to flowcharts and / or block diagrams of the method, device, electronic device and computer program product according to the embodiments of the application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be realized by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal devices to produce a machine, so that the instructions executed by the computer or other programmable data processing terminal devices produce a device for realizing the functions specified in the flowcharts and / or block diagrams. Figure 1 The device for realizing the functions specified in one flow or multiple flows and / or blocks. Figure 1 The device for realizing the functions specified in one flow or multiple flows and / or blocks.

[0149] These computer program instructions can also be stored in a computer readable memory capable of guiding the computer or other programmable data processing terminal devices to work in a specific way, so that the instructions stored in the computer readable memory produce a product including instruction devices, which realize the functions specified in the flowcharts and / or block diagrams. Figure 1 The device for realizing the functions specified in one flow or multiple flows and / or blocks. Figure 1 The device for realizing the functions specified in one flow or multiple flows and / or blocks.

[0150] These computer program instructions can also be loaded into a computer or other programmable data processing terminal device, so that a series of operational steps are performed on the computer or other programmable terminal device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide a process for implementing the functions specified in the flowchart Figure 1 one flow or multiple flows and / or the functions specified in the block Figure 1 one block or multiple blocks.

[0151] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic inventive concept. Therefore, the appended claims are intended to cover all changes and modifications falling within the scope of the embodiments of the present application.

[0152] Finally, it should also be noted that, in this document, the relational terms such as first and second and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof are intended to cover a non-exclusive inclusion, so that a process, method, article, or terminal device including a series of elements includes not only those elements but also other elements not explicitly listed or other elements inherent in such a process, method, article, or terminal device. Without more limitations, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or terminal device including the element.

[0153] The above provides a detailed description of a module-aware assisted learning optimization method and computer product. The principles and implementation modes of the present application are described by using specific examples. The above description of the embodiments is only used to help understand the method and core idea of the present application. For those skilled in the art, according to the idea of the present application, the specific implementation modes and application ranges can be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A module-aware assisted learning optimization method, characterized in that, include: The model parameters of each module of the bird image classification model are updated according to the module-level auxiliary loss weights corresponding to each module, resulting in an updated neural network model. This includes updating the model parameters of each module according to the auxiliary loss weights for bird wing color classification and bird beak shape classification, resulting in an updated bird image classification model. The process involves importing the top-level optimized training dataset into the updated neural network model and calculating the updated module-level auxiliary loss weights for each module. Specifically, this includes: importing the top-level optimized training dataset into the updated bird image classification model and calculating the updated auxiliary loss weights for bird wing color classification and beak shape classification for each module; importing the top-level optimized training dataset into the updated bird image classification model to obtain top-level optimized test data; calculating the target loss function for the target task based on the top-level optimized test data, and calculating the implicit gradient of the target loss function for the top-level optimized test data with respect to the module-level auxiliary loss weights for each module, where the target task is bird classification; and calculating the updated module-level auxiliary loss weights for each module based on the implicit gradient. The updated module-level auxiliary loss weights corresponding to each module are used as the module-level auxiliary loss weights corresponding to each module in the next iteration, and the iteration continues until the updated neural network model meets the verification conditions. The neural network model that meets the verification conditions is then output as the optimized neural network model. This includes: using the updated bird wing color classification auxiliary loss weights and bird beak shape classification auxiliary loss weights corresponding to each module as the module-level auxiliary loss weights corresponding to each module in the next iteration, and the iteration continues until the updated bird image classification model meets the verification conditions. The bird image classification model that meets the verification conditions is then output as the optimized bird image classification model. During the training cycle, the auxiliary loss weights for bird wing color classification and bird beak shape classification are continuously updated in each cycle using a data-driven approach.

2. The module-aware assisted learning optimization method of claim 1, wherein, When the training iteration is in its first cycle, the model parameters of each module are updated according to the module-level auxiliary loss weights corresponding to each module, resulting in an updated neural network model, including: Import the underlying optimization training dataset into the initial neural network model to obtain the underlying optimization test data for each module in the first loop; Based on the underlying optimization test data of each module in the first loop, calculate the gradient of the auxiliary loss function corresponding to each module in the first loop with respect to the model parameters of each module, and the gradient of the target loss function in the first loop with respect to the model parameters of each module. According to the initial module-level auxiliary loss weights corresponding to each module, the gradient of the auxiliary loss function corresponding to each module in the first loop is weighted with respect to the model parameters of each module, and combined with the gradient of the target loss function in the first loop with respect to the model parameters of each module to obtain the combined weighted gradient for each module in the first loop. The number of initial module-level auxiliary loss weights corresponding to each module is the same as the number of auxiliary loss functions. The model parameters of each module are updated based on the combined weighted gradient for each module in the first loop, resulting in the first updated neural network model.

3. The module-aware assisted learning optimization method of claim 1, wherein, When the training round is the nth iteration, it includes: Import the underlying optimization training dataset into the neural network model updated in the (n-1)th iteration to obtain the underlying optimization test data for each module in the nth iteration, where n is greater than or equal to 2. Based on the underlying optimization test data of each module in the nth iteration, calculate the gradient of the auxiliary loss function corresponding to each module with respect to the model parameters of each module in the nth iteration, and the gradient of the target loss function with respect to the model parameters of each module in the nth iteration. According to the module-level auxiliary loss weights corresponding to each module in the nth iteration, the gradient of the auxiliary loss function corresponding to each module in the nth iteration with respect to the model parameters of each module is weighted and combined with the gradient of the target loss function in the nth iteration with respect to the model parameters of each module to obtain the combined weighted gradient for each module in the nth iteration. The module-level auxiliary loss weights corresponding to each module in the nth iteration are the updated module-level auxiliary loss weights corresponding to each module in the (n-1)th iteration. The model parameters of each module are updated based on the combined weighted gradient for each module in the nth iteration, resulting in the updated neural network model.

4. The module-aware assisted learning optimization method of claim 1, wherein, The training data in the top-level optimized training dataset is different from the training data in the bottom-level optimized training dataset of the training dataset.

5. The module-aware assisted learning optimization method of claim 1, wherein, Until the updated neural network model meets the verification criteria, the neural network model that meets the verification criteria is output as the optimized neural network model, including: When the training round is the m-th preset training round, obtain the updated neural network model for the m-th preset training round; The data from the validation set is imported into the updated neural network model of the m-th preset training round to obtain the m-th validation data, and the validation result corresponding to the m-th validation data is calculated. If m is greater than the preset number of comparisons, the verification results corresponding to the (m-1)th verification data, the verification results corresponding to the (m-2)th verification data, and the verification results corresponding to the (m-3)th verification data are combined to form a comparison dataset. If the verification result corresponding to the mth verification data is not greater than all the verification results in the comparison dataset, then the updated neural network model of the mth preset training round is output as the optimized neural network model.

6. The module-aware assisted learning optimization method of claim 5, wherein, Calculate the gradient of the loss function for the m-th validation data with respect to the model parameters of the neural network model updated in the m-th preset training round, and use it as the validation result corresponding to the m-th validation data.

7. A module-aware assisted learning optimization apparatus, comprising: include: The parameter update module is used to update the model parameters of each module according to the module-level auxiliary loss weights corresponding to each module, so as to obtain the updated neural network model. Specifically, it is used to update the model parameters of each module based on the auxiliary loss weights for bird wing color classification and bird beak shape classification corresponding to each module, so as to obtain an updated bird image classification model. The top-level optimization module is used to import the top-level optimization training dataset into the updated neural network model and calculate the updated module-level auxiliary loss weights corresponding to each module. Specifically, it is used to import the top-level optimization training dataset into the updated bird image classification model and calculate the updated auxiliary loss weights for bird wing color classification and bird beak shape classification corresponding to each module. It is also specifically used to import the top-level optimization training dataset into the updated bird image classification model to obtain top-level optimization test data. Based on the top-level optimization test data, it calculates the target loss function for the target task and the implicit gradient of the target loss function for the top-level optimization test data with respect to the module-level auxiliary loss weights corresponding to each module, where the target task is bird classification. Based on the implicit gradient, it calculates the updated module-level auxiliary loss weights corresponding to each module. The loop module is used to use the updated module-level auxiliary loss weights corresponding to each module as the module-level auxiliary loss weights corresponding to each module in the next loop, until the updated neural network model meets the verification conditions, and outputs the neural network model that meets the verification conditions as the optimized neural network model; specifically, it is used to use the updated auxiliary loss weights for bird wing color classification and bird beak shape classification corresponding to each module as the module-level auxiliary loss weights corresponding to each module in the next loop, until the updated bird image classification model meets the verification conditions, and outputs the bird image classification model that meets the verification conditions as the optimized bird image classification model; During the training loop, the auxiliary loss weights for bird wing color classification and bird beak shape classification are continuously updated in each loop using a data-driven approach.

8. An electronic device, comprising: It includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps in the module-aware assisted learning optimization method according to any one of claims 1-6.

9. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps in the module-aware assisted learning optimization method as described in any one of claims 1-6.

10. A computer program product comprising computer programs / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps in the module-aware assisted learning optimization method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Neural network model training method and data processing method and device

    CN112561028A

  • Neural network model training method and device

    CN112668716A