Multi-task learning auxiliary task selection method based on task association degree

By calculating the task correlation degree (TCC value) to evaluate the correlation between the auxiliary task and the main task, and automatically selecting the most suitable auxiliary task, the problem of unscientific auxiliary task selection in traditional methods is solved, and the efficiency and accuracy of multi-task learning is improved.

CN119883576AActive Publication Date: 2025-04-25JILIN UNIVERSITY
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510368323.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-04-25
Estimated Expiration
2045-03-27

AI Technical Summary

Technical Problem

The traditional multi-task learning-assisted task selection method lacks a scientific and systematic selection mechanism, making it difficult to ensure the optimal task combination, and it is difficult to deal with task correlation in complex multi-task scenarios, which easily leads to negative migration.

Method used

By calculating the task correlation (TCC value) between tasks, the correlation between auxiliary tasks and main tasks is dynamically evaluated, and the auxiliary tasks with the strongest synergy are automatically selected to build a multi-task learning model.

Benefits of technology

It improves the efficiency and accuracy of auxiliary task selection, reduces the occurrence of negative transfer phenomena, makes multi-task learning more efficient and reliable, and is suitable for complex multi-task scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883576A_ABST
    Figure CN119883576A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of machine learning and artificial intelligence, and provides a multi-task learning auxiliary task selection method based on task association degree. According to the method, the TCC is introduced, the relevance between the auxiliary task and the main task is quantified, the auxiliary task most suitable for the main task is automatically screened, the selection efficiency and precision are improved, the negative migration phenomenon is effectively reduced, and multi-task learning is more efficient and reliable; the introduced TCC can effectively evaluate the correlation among the tasks and automatically select the auxiliary task most related to the main task, so that the high calculation cost caused by directly searching task combinations is avoided, particularly, the calculation complexity is remarkably reduced when the number of the tasks is large, and the effect and efficiency of multi-task learning are ensured; the method is not limited by model types and shows wide applicability, additional parameters do not need to be added, a remarkable effect can be obtained through simple setting, and the method has high applicability and usability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of machine learning and artificial intelligence, and in particular relates to a multi-task learning auxiliary task selection method based on task association. Background Art

[0002] In industrial applications, the accuracy of machine learning models can often be improved with the help of transfer learning from relevant auxiliary information. In particular, in the manufacturing industry, the main task of predicting equipment failure time can be optimized with the help of auxiliary information such as historical sensor data, maintenance records, and operating status of the equipment. A common way to achieve this transfer learning is to convert this auxiliary information into auxiliary tasks (for example, predicting temperature fluctuations or vibration anomalies of the machine) and jointly optimize it with the main task (such as fault prediction) in a multi-task network. This multi-task network realizes the transfer of auxiliary task knowledge to the main task by sharing the underlying structure, thereby improving the prediction accuracy of the main task.

[0003] The key to improving the performance of the main task is to select auxiliary tasks with strong correlation. However, the traditional auxiliary task selection method has the following problems and is difficult to meet the needs of complex multi-task scenarios: 1. In traditional auxiliary task selection methods, the selection of auxiliary tasks often relies on expert experience or simple task combinations, lacks a scientific and systematic selection mechanism, and cannot ensure the optimal task combination.

[0004] 2. Current research mainly improves the multi-task learning effect by adjusting task weights or optimizing model structure. However, the weight adjustment process is complicated and time-consuming, especially when the amount of data is large or the number of tasks is large, it is difficult to achieve the optimal balance.

[0005] 3. As the number of tasks and data complexity increase, traditional methods find it difficult to handle complex task associations, and the accuracy of auxiliary task selection decreases accordingly.

[0006] 4. Improper task selection may cause conflicts between auxiliary tasks and main tasks, resulting in negative transfer. Not only will it fail to improve the performance of the main task, but it will increase the difficulty and uncertainty of model training.

[0007] In order to solve the above problems, the present invention proposes a multi-task learning auxiliary task selection method based on task relevance. Summary of the invention

[0008] The purpose of the present invention is to provide a method for selecting auxiliary tasks for multi-task learning based on task relevance, aiming to solve the problems raised in the above background technology.

[0009] To achieve the above object, the present invention provides the following technical solutions: A method for selecting auxiliary tasks for multi-task learning based on task relevance comprises the following steps: Step S1, data set preparation: In multi-task learning, first define the main task and several auxiliary tasks, and then construct a multi-task learning data set containing the main task and multiple auxiliary tasks. The data set contains the feature variables and target values ​​of each task; Step S2, TCC calculation: Dynamically evaluate the correlation between tasks by measuring the similarity between the loss change of each task and the gradient direction of the main task; Step S3, auxiliary task selection: according to the calculated TCC value, analyze the synergy or conflict between the auxiliary task and the main task, and select the auxiliary task with the strongest synergy; Step S4, model training and optimization: Use the selected auxiliary tasks and main tasks to build a multi-task learning model; during the training process, use standard training steps to optimize the model using the joint gradient of all tasks; regularly calculate and update the TCC value.

[0010] Furthermore, the TCC value ranges from -1 to 1, a TCC value close to 1 indicates a strong synergistic effect, and a value close to -1 indicates a conflict.

[0011] Furthermore, the specific process of the TCC calculation step is as follows: For each training batch At time step t On, set represents the shared parameters updated after applying the gradient step for the main task; assuming stochastic gradient descent, It is expressed as: Formula 1: ; in, Indicates the shared parameters before updating; represents the learning rate; Indicates that the main task is in batch Next parameter The gradient of Compute the change in loss for the main task and each auxiliary task using the updated shared parameters while keeping the specific parameters for each task and input batch constant; Auxiliary tasks i The loss change is defined as: Formula 2: ; in, Represents auxiliary tasks i The loss function of The loss change of the main task is defined as: Formula 3: ; in, Represents some parameters specific to the main task; Collect the loss change sequences of all batches and calculate TCC to quantify the degree of coordination or conflict between the auxiliary tasks and the optimization direction of the main task: Formula 4: ; in, Indicates the main task and auxiliary tasks TCC score; Represents the loss change sequence of the main task; Represents the loss change sequence of auxiliary tasks; Represents the main task loss change sequence And auxiliary task loss change sequence The covariance between and Represents the standard deviation of the loss change of the main task and auxiliary task respectively; TCC is calculated at the end of each training cycle and the results are averaged to obtain the comprehensive TCC value for the entire training process. The comprehensive TCC value is expressed as: Formula 5: ; in, n represents the nth training cycle; N Represents the total number of training cycles.

[0012] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention introduces TCC to quantify the correlation between auxiliary tasks and main tasks, thereby automatically selecting the auxiliary tasks that are most suitable for the main tasks. Compared with the traditional selection method that relies on expert experience and intuition, the present invention improves the efficiency and accuracy of selection, effectively reduces the occurrence of negative transfer, and makes multi-task learning more efficient and reliable.

[0013] 2. The TCC introduced in the present invention can effectively evaluate the correlation between tasks, automatically select the auxiliary tasks most relevant to the main task, avoid the high computational cost brought by directly searching for task combinations, and significantly reduce the computational complexity when the number of tasks is large, while also ensuring the effectiveness and efficiency of multi-task learning.

[0014] 3. The method proposed in the present invention is not limited by the model type and has wide applicability. It also does not need to add additional parameters and can achieve significant results through simple settings. It has strong applicability and ease of use. This makes the present invention provide a reliable solution for model optimization in complex multi-task scenarios and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 The present invention is a flowchart of the method.

[0016] Figure 2 This is a physical photo of the NH3 emission data collection experimental platform.

[0017] Figure 3 Schematic diagram of gradient direction similarity.

[0018] Figure 4 The prediction effects of different auxiliary tasks in specific low-sample areas. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0020] like Figure 1 As shown, it is a flowchart of a method for selecting auxiliary tasks for multi-task learning based on task relevance provided by an embodiment of the present invention. The method is implemented by a software system, runs on an Ubuntu 18.04 operating system, and uses the PyTorch 2.1.0 framework to build a multi-task learning model. The algorithm model for the entire auxiliary task selection is built in the PyCharm development environment.

[0021] The method comprises the following steps: Dataset preparation: In multi-task learning, we first define the main task and several auxiliary tasks, and then construct a multi-task learning dataset containing the main task and multiple auxiliary tasks. The dataset contains the characteristic variables and target values ​​of each task. In order to ensure the independence and effectiveness of model training, verification and testing, the dataset is divided into training set, verification set and test set. The training set is used for model parameter training, the verification set is used to adjust hyperparameters, and the test set is used to evaluate the final performance of the model.

[0022] Model setting and hyperparameter optimization: During the model building phase, set the appropriate optimizer, learning rate, number of layers, number of neurons, training cycle, and batch size. The selection of these hyperparameters will directly affect the training efficiency and final performance of the model.

[0023] Task Correlation Coefficient (TCC) calculation: TCC value is introduced as a quantitative indicator to evaluate the synergy or conflict between auxiliary tasks and main tasks. The correlation between tasks is dynamically evaluated by measuring the similarity between the loss change of each task and the gradient direction of the main task. The TCC value ranges from -1 to 1, where the closer the value is to 1, the stronger the synergy between the auxiliary task and the main task, and the closer the value is to -1, the more potential conflict there is.

[0024] Auxiliary task selection: Based on the calculated TCC value, analyze the synergy or conflict between the auxiliary tasks and the main task, and automatically select the auxiliary tasks that have the most positive contribution to the main task learning (i.e., the TCC value is closest to 1) from all auxiliary tasks. By selecting auxiliary tasks that are highly related to the main task, it ensures that the model can effectively improve the learning performance of the main task.

[0025] Model training and optimization: Use the selected auxiliary tasks and main tasks to build a multi-task learning model; during the training process, use the standard training steps to optimize the model using the joint gradient of all tasks; regularly calculate and update the TCC value to monitor the changes in the correlation between tasks. At the same time, adjust and optimize the hyperparameters of the model based on the performance on the validation set. After training, use the test set to verify the effectiveness of the proposed method to ensure that the selected auxiliary tasks significantly improve the performance of the main task in multi-task learning.

[0026] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.

[0027] 1. Multi-task learning dataset; 1.1 Real-time estimation of ammonia emissions from commercial vehicle SCR system based on multi-task selection; This paper verifies the effectiveness and feasibility of the multi-task learning auxiliary task selection method through an actual industrial case of real-time estimation of ammonia emissions in the selective catalytic reduction (SCR) system of commercial vehicles. The SCR system of commercial vehicles is an emission control technology that reduces nitrogen oxides (NOx) to harmless nitrogen (N2) and water (H2O) by injecting urea solution (such as AdBlue) into the exhaust flow to meet strict emission regulations.

[0028] Under ideal working conditions, the ammonia in the urea solution should fully react with NOx to reduce NOx to nitrogen and water. The standard SCR reaction can be expressed as: ; In this ideal reaction, all ammonia reacts with NOx, and no excess ammonia escapes. However, in actual operating conditions, due to changes in reaction conditions (such as excessive urea injection, too low reaction temperature, insufficient NOx concentration), the reaction is incomplete, causing some NH3 to be directly emitted without reacting with NOx. This phenomenon is called ammonia slip: ; Therefore, most of the data points show zero emissions, and non-zero NH3 emission values ​​are rare and fluctuate significantly, making accurate prediction of ammonia emissions difficult.

[0029] In order to improve the real-time estimation accuracy of ammonia emissions of the SCR system, the present invention introduces auxiliary tasks to optimize model performance. To this end, four auxiliary tasks are selected, namely Aux1 (cross-sensitivity coefficient), Aux2 (actual NOx concentration), Aux3 (pseudo NOx conversion rate) and Aux4 (real NOx conversion rate). The most suitable auxiliary task is determined by the multi-task learning auxiliary task selection method proposed in the present invention.

[0030] 1.2 Experimental design and data collection; The NH3 emission data collection experiment was carried out on a calibrated engine test bench, such as Figure 2 As shown in the figure, the test bench is equipped with a CuZeolite catalyst SCR system and uses a commercial diesel engine that meets current emission standards. The test bench is equipped with a SHENCK HD460 dynamometer, which can accurately control the engine load and speed to simulate actual driving conditions. The engine control unit (ECU) continuously provides key input parameters, including exhaust flow, urea injection rate, SCR system temperature, and inlet and outlet NOx concentrations, which are used to estimate NH3 emissions in real time.

[0031] The NH3 concentration was measured using a high-precision gas analyzer (HORIBA MEXA7100EGR), which has a measurement accuracy of ±1 ppm, ensuring the reliability of the data. The experiment was conducted under controlled conditions and followed standard procedures, covering a variety of operating conditions such as low load, high load and transient scenarios, and collecting comprehensive NH3 emission data. These data provide the basis for subsequent model training and verification.

[0032] 2. Calculation of TCC; In multi-task learning, tasks exchange information through continuous gradient updates of shared parameters, which helps to alleviate the bias in unbalanced regression tasks by leveraging data from auxiliary tasks. However, if the correlation between the auxiliary tasks and the main task is weak or conflicting, it will be difficult for the model to learn beneficial features, resulting in potential performance degradation.

[0033] The TCC proposed in this invention is an indicator that quantifies the cooperation or conflict between auxiliary tasks and the main task in the optimization direction of the main task. By calculating the TCC during the training process of all auxiliary tasks in a single multi-task network, the most effective auxiliary task can be selected to enhance the main task.

[0034] For each training batch At time step t On, set represents the shared parameters updated after applying the gradient step for the main task. Assuming stochastic gradient descent, this update can be expressed as: Formula 1: ; in, Indicates the shared parameters before updating; represents the learning rate; Indicates that the main task is in batch Next parameter The gradient of The updated shared parameters are used to compute the loss change for the main task and each auxiliary task while maintaining the specific parameters for each task. and input batch constant.

[0035] Auxiliary tasks i The loss change is defined as: Formula 2: ; in, Represents auxiliary tasks i The loss function of Similarly, the loss change for the main task is defined as: Formula 3: ; in, Represents some parameters specific to the main task; After each batch, the interim updates are reverted to restore the original parameters. Then, the standard training steps continue using the joint gradients of all tasks. In order to evaluate the synergy or conflict between the main task and each auxiliary task during the entire training cycle, the loss change sequence of all batches is collected and TCC is calculated to quantify the degree of synergy or conflict between the auxiliary tasks and the optimization direction of the main task: Formula 4: ; in, Indicates the main task and auxiliary tasks TCC score; Represents the loss change sequence of the main task; Represents the loss change sequence of auxiliary tasks; Represents the main task loss change sequence And auxiliary task loss change sequence The covariance between and Represent the standard deviation of the loss change of the main task and auxiliary task respectively.

[0036] The value range is between -1 and 1. A TCC value close to 1 indicates that the gradient direction of the auxiliary task is highly consistent with the main task, indicating a strong correlation between the tasks. This consistency enables the model to focus on shared gradient directions, thereby promoting better generalization in areas of high and low density data. Conversely, a TCC value close to -1 indicates that the gradient directions are opposite, indicating that there are conflicting updates, which may have a negative impact on the performance of the main task. It is recommended to calculate TCC at the end of each training cycle and average the results to obtain a comprehensive TCC value throughout the training process. The comprehensive TCC value is expressed as: Formula 5: ; in, n represents the nth training cycle; N represents the total number of training cycles. This method captures the dynamic relationship between tasks during the entire training process.

[0037] 3. Theoretical analysis of TCC; To conduct a theoretical analysis of TCC, the goal is to establish the relationship between TCC and the similarity of gradient directions of the main task and auxiliary tasks, such as Figure 3 As shown in the figure above, the more similar the gradient directions of the two tasks are, the stronger the synergy is; the figure below shows that when the gradient directions are not so similar or even opposite, training the two tasks together will cause conflicts.

[0038] Assuming the loss function and In shared parameters It is continuously differentiable, and the loss change can be expressed by Taylor expansion as:

[0039] in, Represents the loss of the main task after batch update; Indicates the loss of the main task before batch update; Represents auxiliary tasks i Updated losses; Represents auxiliary tasks i Losses before the update; Updated shared parameters:

[0040] Substituting Equation 1 into Equation 6 and Equation 7, the loss can be approximately expressed as:

[0041] Therefore, the main task and auxiliary task i The changes in losses are:

[0042] To calculate TCC, the first step is to calculate the covariance of the changes in the main task and auxiliary task losses:

[0043] in, represents the covariance of the main task loss change and the auxiliary task loss change; represents the corresponding mathematical expectation; By substituting the main task and auxiliary task i The loss change, the equation can be simplified to:

[0044] The variances of the main task and auxiliary task are:

[0045] in, represents the variance of the main task; represents the variance of the auxiliary task; Finally, TCC can be expressed as:

[0046] This shows that TCC is determined by the expected cosine similarity of the gradient directions and their squared expectation. A higher consistency in the gradient direction makes TCC approach 1, while gradients in the opposite direction make TCC approach -1.

[0047] 4. The impact of experimental design and auxiliary task selection; In the experiment, the multi-task learning auxiliary task selection method proposed in the present invention is used to simultaneously train related auxiliary tasks in a single multi-task learning network. The method determines the most suitable auxiliary task through TCC scoring. The model uses LSTM (Long Short-Term Memory) as the backbone network, which is suitable for this application scenario because of its low computational requirements and real-time processing capabilities. To ensure the fairness of the comparison, all models (including multi-task models and single-task models) use the same hyperparameter settings, which are determined through a comprehensive search process to ensure the comparability of the results. The performance of all models is evaluated using commonly used regression evaluation indicators, including mean square error (MSE), mean absolute error (MAE), determination coefficient (R²), and root mean square error (RMSE).

[0048]

[0049] The collected commercial vehicle SCR system ammonia emission dataset is divided into a complete test set and a specific low-sample area test set. The latter focuses on non-zero emission data, which is more sparse and complexly distributed, making it difficult to predict. The TCC scores of different auxiliary tasks and the test set performance comparison results are shown in Table 1:

[0050] From the experimental results in Table 1, we can see that Aux1 obtains the highest TCC score, indicating that it has the strongest synergy with the gradient direction of the main task. When trained simultaneously with the main task, Aux1 outperforms other auxiliary tasks on the test set.

[0051] To further illustrate the impact of auxiliary task selection, Figure 4 The comparison between the predicted values ​​and the actual values ​​(Measurement) of the model on the test set when different auxiliary tasks are jointly trained with the main task in specific low-sample areas is shown. Compared with other auxiliary tasks, the predicted values ​​of the Aux1 model with the highest TCC score on the test set show the highest consistency with the true values. The results show that selecting Aux1 can significantly improve the prediction accuracy in these areas. This analysis verifies the effectiveness of selecting auxiliary tasks based on TCC scores, among which Aux1 shows the strongest synergy and significantly improves the performance of the main task in sparse data areas.

[0052] Therefore, the multi-task learning auxiliary task selection method based on task correlation proposed in the present invention can automatically select the auxiliary task that best suits the main task in the multi-task learning framework. Suitable auxiliary tasks can significantly improve the prediction accuracy of the main task and the robustness of the model.

[0053] The above are only preferred embodiments of the present invention. It should be pointed out that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention. These should also be regarded as the protection scope of the present invention. These will not affect the effect of the implementation of the present invention and the practicality of the patent.

Claims

1. A method for selecting auxiliary tasks for multi-task learning based on task relevance, characterized in that: The following steps are involved: Step S1, data set preparation: In multi-task learning, first define the main task and several auxiliary tasks, and then construct a multi-task learning data set containing the main task and multiple auxiliary tasks. The data set contains the feature variables and target values ​​of each task; Step S2, TCC calculation: Dynamically evaluate the correlation between tasks by measuring the similarity between the loss change of each task and the gradient direction of the main task; Step S3, auxiliary task selection: according to the calculated TCC value, analyze the synergy or conflict between the auxiliary task and the main task, and select the auxiliary task with the strongest synergy; Step S4, model training and optimization: Use the selected auxiliary tasks and main tasks to build a multi-task learning model; during the training process, use standard training steps to optimize the model using the joint gradient of all tasks; regularly calculate and update the TCC value.

2. The method for selecting auxiliary tasks for multi-task learning based on task association according to claim 1, characterized in that: The TCC value ranges from -1 to 1. A TCC value close to 1 indicates a strong synergistic effect, and a value close to -1 indicates a conflict.

3. The method for selecting auxiliary tasks for multi-task learning based on task association according to claim 1, characterized in that: The specific process of the TCC calculation step is as follows: For each training batch At time step t On, set represents the shared parameters updated after applying the gradient step for the main task; assuming stochastic gradient descent, It is expressed as: Formula 1: ; in, Indicates the shared parameters before updating; represents the learning rate; Indicates that the main task is in batch Next parameter The gradient of Compute the change in loss for the main task and each auxiliary task using the updated shared parameters while keeping the specific parameters for each task and input batch constant; Auxiliary tasks i The loss change is defined as: Formula 2: ; in, Represents auxiliary tasks i The loss function of The loss change of the main task is defined as: Formula 3: ; in, Represents some parameters specific to the main task; Collect the loss change sequences of all batches and calculate TCC to quantify the degree of coordination or conflict between the auxiliary tasks and the optimization direction of the main task: Formula 4: ; in, Indicates the main task and auxiliary tasks TCC score; Represents the loss change sequence of the main task; Represents the loss change sequence of auxiliary tasks; Represents the main task loss change sequence And auxiliary task loss change sequence The covariance between and Represents the standard deviation of the loss change of the main task and auxiliary task respectively; TCC is calculated at the end of each training cycle and the results are averaged to obtain the comprehensive TCC value for the entire training process. The comprehensive TCC value is expressed as: Formula 5: ; in, n represents the nth training cycle; N Represents the total number of training cycles.

Citation Information

Patent Citations

  • Cross-domain entity linking method and device based on multi-task negative sampling and medium

    CN116663563A

  • Target identification method and device, electronic equipment and readable storage medium

    CN117315445A

  • Small sample image classification method and device based on self-supervised multi-task optimization, and medium

    CN118314376A

  • AI auxiliary decision support system for skin disease diagnosis

    CN119323574A

  • Space-air-ground integrated UAV-assisted IoT data collectioncollection method based on aoi

    US20230239037A1