Multi-task model training method and device, equipment and medium
By performing preset task type classification and hierarchical knowledge transfer training on multi-task models, the problem of inefficient training of multi-task models is solved, and fast training and efficient multi-task model training effects are achieved.
Patent Information
- Application Number
- CN202510668441.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-09-05
AI Technical Summary
In the prior art, multi-task model training has problems of imbalance and gradient conflict between tasks, resulting in inefficiency and convergence problems. It is difficult to effectively train, especially when there are limited computing resources or the priority of specific tasks is high.
Classify the basic task model set through preset task types, determine the core task model and auxiliary task model, and reorder the sequence based on the preset model construction rules, and use hierarchical knowledge transfer for model training, including the application of preset training standards and training sets, ensuring the performance of the core task model and the effective training of the auxiliary task model.
The training efficiency of multi-task model is improved, the rapid training of multi-task model is achieved, and the performance and overall performance of the core task model are ensured.
Smart Images

Figure CN120597977A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a training method, apparatus, equipment and medium for a multi-task model. Background Art
[0002] With the advancement of computer technology, machine learning algorithms, deep learning frameworks, and large language models have been gradually applied to model training to help solve various tasks such as intelligent recommendation, speech recognition, and portrait recognition. However, most previous models focused on single-task learning. However, the real world cannot be broken down into unrelated tasks. Even within single tasks, each task is interconnected. Therefore, single-task learning has gradually been replaced by multi-task learning.
[0003] Prior art typically uses parallel learning methods for multi-task model training. However, using these methods for multi-task model training can be difficult to address, such as imbalances between tasks and gradient conflicts. This can lead to some tasks being neglected or over-optimized. This can be particularly problematic when specific tasks have high priority or computing resources are limited, leading to inefficiencies and convergence issues. Therefore, how to rapidly train multi-task models and improve their training efficiency remains a pressing issue. Summary of the Invention
[0004] The present invention provides a multi-task model training method, apparatus, equipment and medium, which can solve the problem of low training efficiency of the multi-task model.
[0005] According to one aspect of the present invention, a multi-task model training method is provided, comprising:
[0006] Obtain a basic task model set corresponding to the current training task, and classify the basic task model set according to the preset task type to determine the core task model and auxiliary task model in the basic task model set;
[0007] Rearranging the core task model and the auxiliary task model based on the preset model construction rules to obtain a basic multi-task model corresponding to the current training task;
[0008] Performing model training on the basic multi-task model based on a preset training standard and a preset training set to obtain a trained target multi-task model;
[0009] Based on the basic task model set and the target multi-task model, the basic task sub-model corresponding to the current training task is determined, and the basic task sub-model is trained based on the preset training set to obtain a trained target task sub-model.
[0010] According to another aspect of the present invention, a multi-task model training device is provided, comprising:
[0011] A preprocessing module is used to obtain a basic task model set corresponding to the current training task, and classify the basic task model set according to the preset task type, and determine the core task model and auxiliary task model in the basic task model set;
[0012] A model construction module is used to rearrange the core task model and the auxiliary task model based on a preset model construction rule to obtain a basic multi-task model corresponding to the current training task;
[0013] A first model training module is used to perform model training on the basic multi-task model based on a preset training standard and a preset training set to obtain a trained target multi-task model;
[0014] The second model training module is used to determine the basic task sub-model corresponding to the current training task based on the basic task model set and the target multi-task model, and perform model training on the basic task sub-model based on the preset training set to obtain a trained target task sub-model.
[0015] According to another aspect of the present invention, an electronic device is provided, comprising:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the training method of the multi-task model described in any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the training method of the multi-task model described in any embodiment of the present invention when executed.
[0020] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the multi-task model training method according to any embodiment of the present invention.
[0021] The technical solution of the embodiment of the present invention classifies the task models of the basic task model set corresponding to the current training task by preset task types, and determines the core task model and auxiliary task model in the basic task model set. Then, the core task model and the auxiliary task model are sequenced and rearranged based on the preset model construction rules to obtain the basic multi-task model corresponding to the current training task. Furthermore, the basic multi-task model is model trained based on the preset training standard and the preset training set to obtain a trained target multi-task model. Finally, the basic task sub-model corresponding to the current training task is determined based on the basic task model set and the target multi-task model, and the basic task sub-model is model trained based on the preset training set to obtain a trained target task sub-model. Since the multi-task model is trained in a hierarchical knowledge transfer manner, the problem of low training efficiency of the multi-task model is solved, the multi-task model can be trained quickly, and the training efficiency of the multi-task model is improved.
[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 This is a flowchart of a multi-task model training method provided by the prior art;
[0025] Figure 2 is a flowchart of a multi-task model training method provided according to embodiment 1 of the present invention;
[0026] Figure 3 is a flowchart of a multi-task model training method provided according to embodiment 2 of the present invention;
[0027] Figure 4 is a flowchart of an optional multi-task model training method provided according to embodiment 2 of the present invention;
[0028] Figure 5 2 is a schematic structural diagram of a multi-task model training device provided according to a third embodiment of the present invention;
[0029] Figure 6 3 is a schematic diagram of the structure of an electronic device for implementing the training method of the multi-task model of an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", "objective", "foundation", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Figure 1 This is a flowchart of a multi-task model training method provided by existing technology. Specifically, the multi-task model includes n subtasks, namely Task 1, Task 2, Task n, and so on. First, each subtask obtains shared parameters from the shared parameter layer. Then, each subtask calculates its own loss in parallel. Finally, a weighted summation is used to determine the final output layer parameters, i.e., the total loss, which is used for gradient update.
[0033] However, although the multi-task model training method in the prior art can promote knowledge sharing between different tasks, it may lead to inefficiency and convergence problems when processing specific tasks with high priority or limited computing resources. Especially when there is a focus on certain tasks, the multi-task model training method in the prior art may not be able to effectively guarantee the performance of key tasks, while increasing the training cost. Therefore, in order to improve the training efficiency of the multi-task model, an embodiment of the present invention provides a multi-task model training method.
[0034] Example 1
[0035] Figure 2This is a flowchart of a multi-task model training method provided in the first embodiment of the present invention. This embodiment is applicable to the case where the key tasks in the multi-task model are trained under the condition of limited computing resources. The method can be executed by a multi-task model training device. The multi-task model training device can be implemented in the form of hardware and / or software. The multi-task model training device can be configured in an electronic device. Figure 2 As shown, the method includes:
[0036] S110. Obtain a basic task model set corresponding to the current training task, and classify the basic task model set according to a preset task type to determine a core task model and an auxiliary task model in the basic task model set.
[0037] A training task refers to a data-driven task that enables a model to learn patterns from experience. This training task enables the model to predict unknown data. The current training task refers to the training task that needs to be completed at the current moment. Typically, the current training task is determined based on the actual scenario requirements.
[0038] Among them, the task model may refer to the prediction model included in the current training task. Usually, the number of task models in a current training task is at least one, and each task model corresponds to an independent learning objective, such as classification, regression, or generation, but each task model improves the overall performance by sharing the underlying representation or parameters and utilizing the potential correlation between task models. That is, there is a potential correlation between task models, and multiple related or associated problems need to be solved at the same time. The basic task model may refer to the original untrained task model in the current training task. The basic task model set may refer to the set consisting of all basic task models corresponding to the same current training task.
[0039] Among them, the preset task type may refer to a pre-set category for model classification of the basic task model. Optionally, the preset task types may include: a temporal mask task type and an edge mask task type. The temporal mask task type may refer to a task type that requires the model to restore the masked temporal information by randomly masking continuous time periods or local subsequences in the input sequence. Exemplarily, the temporal mask task type is mainly for time series models. The edge mask task type may refer to a task type in which the mask object is a connecting edge or spatial boundary between nodes, and the model is required to predict the masked edge or boundary information. Exemplarily, the edge mask task type is mainly for image segmentation models.
[0040] The core task model may refer to a task model that requires emphasis in the current training task. For example, the core task model may be a basic task model of the temporal mask task type in the basic task model set. The auxiliary task model may refer to a task model that does not require emphasis in the current training task. For example, the auxiliary task model may be a basic task model of the edge mask task type in the basic task model set.
[0041] S120. Rearrange the core task model and the auxiliary task model based on a preset model construction rule to obtain a basic multi-task model corresponding to the current training task.
[0042] The preset model construction rules may refer to pre-set criteria for defining the multi-task model construction process. Optionally, the preset model construction rules may include a preset task arrangement order and a preset shared parameter grouping. The preset task arrangement order may refer to pre-set rules for the arrangement order of the task models in the multi-task model. For example, the preset task arrangement order may require that the core task model must be placed first and last, and the intermediate loop may involve the core task model and the auxiliary task models being looped in sequence. It is worth noting that, in embodiments of the present invention, the number of loops and the order of loops for the multiple task models in the intermediate loop may be allocated based on actual needs, and this is not specifically limited in embodiments of the present invention. Shared parameters may refer to the weights or structure of the same set of network layers shared by the multi-task models during model training. Shared parameters can be used to learn common feature representations across tasks. Generally, shared parameters can be determined based on the base large model corresponding to the current training task. For example, taking the base large model corresponding to the current training task as a basic building large model, which comprises four modules: a feature encoding layer, a graph relationship learning layer, a time series encoding layer, and a downstream task encoding layer, the shared parameters may include feature encoding parameters, time series encoding parameters, and graph encoding parameters. The preset shared parameter grouping may refer to a pre-set standard for determining the shared parameters that need to be updated for each task model in a multi-task model. Typically, the preset shared parameter grouping may be determined or modified based on actual application requirements. Exemplarily, the preset shared parameter grouping may update the feature coding parameters for the first task model, and the other task models update the remaining parameters respectively. It is worth noting that all the same shared parameters are included in each task model, and the role of the preset shared parameter grouping is to determine the shared parameter portion that each task model is responsible for updating during the model training process. For example, if the preset shared parameter grouping updates the feature coding parameters for the first task model, then during the model training process, the first task model fixes the timing coding parameters and graph coding parameters, and only updates the feature coding parameters.
[0043] Among them, the basic multi-task model may refer to an untrained multi-task model obtained by re-arranging the core task model and the auxiliary task model according to the preset model construction rules.
[0044] S130 , performing model training on the basic multi-task model based on a preset training standard and a preset training set to obtain a trained target multi-task model.
[0045] The preset training standard may refer to a pre-set rule for limiting the training process of the basic multi-task model. For example, the preset training standard may be the specific training process of each task model in the basic multi-task model. Specifically, the preset training standard may load the shared parameters trained by the previous task model for each task model, and retrain and update all parameters of the task model until the task model becomes the last task model in the basic multi-task model.
[0046] The preset training set may refer to a pre-defined core dataset used for training the basic multi-task model. Typically, the preset training set can be established based on historically collected data. For example, if the current training task is in the building domain, the temperature data for each historical time period in the current building can be used as the preset training set. The target multi-task model may refer to a multi-task model trained based on the preset training criteria and the preset training set.
[0047] S140. Determine a basic task sub-model corresponding to the current training task based on the basic task model set and the target multi-task model, and perform model training on the basic task sub-model based on the preset training set to obtain a trained target task sub-model.
[0048] The task sub-model can refer to the core task model with fixed shared parameters in the current training task. The base task sub-model can refer to the untrained task sub-model in the current training task. The target task sub-model can refer to the trained task sub-model in the current training task.
[0049] The technical solution of the embodiment of the present invention classifies the task models of the basic task model set corresponding to the current training task by preset task types, and determines the core task model and auxiliary task model in the basic task model set. Then, the core task model and the auxiliary task model are sequenced and rearranged based on the preset model construction rules to obtain the basic multi-task model corresponding to the current training task. Furthermore, the basic multi-task model is model trained based on the preset training standard and the preset training set to obtain a trained target multi-task model. Finally, the basic task sub-model corresponding to the current training task is determined based on the basic task model set and the target multi-task model, and the basic task sub-model is model trained based on the preset training set to obtain a trained target task sub-model. Since the multi-task model is trained in a hierarchical knowledge transfer manner, the problem of low training efficiency of the multi-task model is solved, the multi-task model can be trained quickly, and the training efficiency of the multi-task model is improved.
[0050] Example 2
[0051] Figure 3 A flowchart of a multi-task model training method provided in the second embodiment of the present invention. This embodiment is refined based on the above embodiment. In this embodiment, the operation of re-arranging the core task model and the auxiliary task model based on the preset model construction rules to obtain the basic multi-task model corresponding to the current training task is specifically refined. Specifically, it may include: re-arranging the core task model and the auxiliary task model based on the preset task arrangement order to determine the basic first task model, basic order task model and basic last task model corresponding to the current training task; wherein the basic order task model is at least one; based on the task model sequence of the basic first task model, basic order task model and basic last task model, the basic first task model, basic order task model and basic last task model are combined and processed to obtain the candidate multi-task model corresponding to the current training task; based on the preset shared parameter grouping, the grouping parameters corresponding to the basic first task model, basic order task model and basic last task model in the candidate multi-task model are determined to obtain the basic multi-task model corresponding to the current training task. Figure 3 As shown, the method includes:
[0052] S210. Obtain a basic task model set corresponding to the current training task, and classify the basic task model set according to a preset task type to determine a core task model and an auxiliary task model in the basic task model set.
[0053] Specifically, after determining the basic task model set corresponding to the current training task, the task models of the basic task model set can be classified according to the preset task type. The basic task models of the temporal mask task type in the basic task model set are used as the core task models, and the basic task models of the edge mask task type in the basic task model set are used as the auxiliary task models. In this way, the core task models and auxiliary task models in the basic task model set can be determined, providing an effective foundation for subsequent operations.
[0054] S220. Rearrange the core task model and the auxiliary task model based on the preset task arrangement order to determine the basic first-order task model, basic sequence task model and basic last-order task model corresponding to the current training task; wherein, there is at least one basic sequence task model.
[0055] The first task model may refer to the task model ranked first. Typically, the first task model is the core task model. The basic first task model may refer to the original, untrained first task model.
[0056] The sequential task model may refer to each task model that is ranked after the first task model and before the last task model. Generally, the sequential task model may be a core task model or an auxiliary task model. The basic sequential task model may refer to an untrained original sequential task model. It is worth noting that the number of basic sequential task models in the multi-task model is at least one.
[0057] The last-place task model refers to the task model ranked last. Typically, the last-place task model is the core task model. The basic last-place task model refers to the original, untrained last-place task model.
[0058] S230. Based on the task model sequence of the basic first-place task model, the basic order task model and the basic last-place task model, the basic first-place task model, the basic order task model and the basic last-place task model are combined and processed to obtain a candidate multi-task model corresponding to the current training task.
[0059] The task model sequence may refer to the order of the task models in the multi-task model. For example, the task model sequence may be the first, second, or last task model. The selected multi-task model may refer to the multi-task model initially generated after the task models are combined. Typically, the selected multi-task model may be the multi-task model before shared parameter grouping is performed.
[0060] S240. Determine grouping parameters corresponding to a basic first-order task model, a basic sequential task model, and a basic last-order task model in the to-be-selected multi-task model based on preset shared parameter grouping, and obtain a basic multi-task model corresponding to the current training task.
[0061] Specifically, after determining the core task model and the auxiliary task model in the basic task model set, the core task model and the auxiliary task model can be rearranged in sequence according to the preset task arrangement order to determine the basic first task model, basic order task model and basic last task model corresponding to the current training task. Then, according to the task model sequence of the basic first task model, the basic order task model and the basic last task model, the basic first task model, the basic order task model and the basic last task model are combined and processed in sequence to obtain the candidate multi-task model corresponding to the current training task. Finally, the grouping parameters corresponding to the basic first task model, the basic order task model and the basic last task model in the candidate multi-task model are determined according to the preset shared parameter grouping to obtain the basic multi-task model corresponding to the current training task. Thus, by constructing the basic multi-task model in a hierarchical knowledge transfer manner, the gradual accumulation and transfer of knowledge from one task model to the next task model can be achieved, thereby improving the overall performance of the multi-task model.
[0062] S250 , performing model training on a basic first-task model in the basic multi-task model based on a preset training set to obtain a trained target first-task model and a first grouping parameter corresponding to the target first-task model.
[0063] The target first task model may refer to a trained first task model, and the first grouping parameter may refer to a shared parameter corresponding to the target first task model.
[0064] S260 : Performing model training on a basic sequence task model in a basic multi-task model based on the first grouping parameters and a preset training set to obtain a trained target sequence task model and second grouping parameters corresponding to the target sequence task model.
[0065] The target sequence task model may refer to a trained sequence task model, and the second grouping parameter may refer to a shared parameter corresponding to the target sequence task model.
[0066] S270. Perform model training on the basic last-place task model in the basic multi-task model based on the second grouping parameters and the preset training set to obtain a trained target last-place task model; wherein the target last-place task model includes target shared parameters.
[0067] The target final task model may refer to a trained final task model, and the target shared parameters may refer to the shared parameters corresponding to the target final task model.
[0068] S280 , combining and processing the target first task model, the target order task model, and the target last task model to obtain a trained target multi-task model.
[0069] Specifically, after obtaining the basic multi-task model corresponding to the current training task, the preset training set can be input into the basic first task model of the basic multi-task model, and the preset training set can be used to perform model training on the basic first task model to obtain a trained target first task model, and the shared parameters corresponding to the target first task model are used as the first grouping parameters. Furthermore, the first grouping parameters are used to update the shared parameters of the subsequent basic order task model, and the model output of the target first task model is used to perform model training on the basic order task model to obtain a trained target order task model, and the shared parameters corresponding to the target order task model are used as the second grouping parameters. The above operations are repeated until the target order task model is the last order task model, and the shared parameters of the basic last task model are updated using the second grouping parameters, and the model output of the target order task model is used to perform model training on the basic last task model to obtain a trained target last task model, and the shared parameters corresponding to the target last task model are used as the target shared parameters. In this way, the performance of the core task model can be fully guaranteed, and at the same time, other auxiliary task models can also benefit from the shared parameters trained by the previous task model. It not only reduces repeated calculations and improves training efficiency, but also promotes information transfer across tasks.
[0070] S290. Determine a candidate task sub-model corresponding to the current training task based on the core task model in the basic task model set.
[0071] The task sub-model to be selected may refer to a preliminarily selected task model. For example, the task sub-model to be selected may be a core task model in the basic task model set.
[0072] S2100 , determining basic shared parameters corresponding to the candidate task sub-model based on target shared parameters corresponding to the target last task model in the target multi-task model.
[0073] The basic shared parameters may refer to the shared parameters corresponding to the task sub-model to be selected. For example, the basic shared parameters may be the target shared parameters corresponding to the target last-place task model.
[0074] S2110. Combine and process the basic shared parameters and the task sub-model to be selected to obtain a basic task sub-model corresponding to the current training task.
[0075] Specifically, after obtaining a trained target multi-task model, the core task model in the basic task model set can be used as the candidate task sub-model corresponding to the current training task. The target shared parameters corresponding to the target last task model in the target multi-task model are obtained and used as the basic shared parameters corresponding to the candidate task sub-model. Furthermore, the basic shared parameters are used to update the shared parameters in the candidate task sub-model. This results in the basic task sub-model corresponding to the current training task, providing an effective foundation for subsequent operations.
[0076] S2120 , adjusting the independent parameters in the basic task sub-model based on the preset training set to obtain a trained target task sub-model.
[0077] Specifically, after obtaining the basic task sub-model corresponding to the current training task, the preset training set can be input into the basic task sub-model. By fixing the basic shared parameters in the basic task sub-model and only updating the independent parameters in the basic task sub-model, the basic task sub-model can be trained to obtain the trained target task sub-model.
[0078] It is worth noting that, in addition to the shared parameters, each task model also includes independent parameters of each task model, which will not be further elaborated in the embodiment of the present invention.
[0079] S2130: Obtain basic building data corresponding to the current prediction task, and input the basic building data into the target task sub-model to obtain the data prediction result corresponding to the current prediction task.
[0080] Among them, basic building data can refer to the relevant building data corresponding to the current prediction task. For example, basic building data can be historical environmental data, building parameters and dynamic heat source data. Historical environmental data can represent the environmental data of the current building corresponding to the current prediction task in the historical time period. For example, temperature and humidity data, meteorological parameters or air quality indicators. Building parameters can represent the relevant parameters corresponding to the current building itself. For example, structural characteristics or spatial topology data. Dynamic heat source data can represent the relevant heat source data corresponding to the current building. For example, real-time monitoring data such as the operating status of the air-conditioning system, the power of lighting equipment, the heat generation of office equipment, or the indoor occupant density. The data prediction result can refer to the result of predicting the environmental data of the future time period based on the basic building data. For example, the data prediction result can be the prediction result of the indoor temperature of the current building in each time period in the future day.
[0081] Specifically, after obtaining a trained target task sub-model, the basic building data corresponding to the current prediction task can be input into the target task sub-model. The target task sub-model then uses the learned knowledge to analyze the basic building data and obtain the data prediction results corresponding to the current prediction task. This can provide an effective reference for practical applications.
[0082] The technical solution of the embodiment of the present invention classifies the task models of the basic task model set corresponding to the current training task by the preset task type, and determines the core task model and the auxiliary task model in the basic task model set. Furthermore, the core task model and the auxiliary task model are sequenced based on the preset task arrangement order to determine the basic first task model, the basic order task model and the basic last task model corresponding to the current training task. Based on the task model sequence of the basic first task model, the basic order task model and the basic last task model, the basic first task model, the basic order task model and the basic last task model are combined and processed to obtain the candidate multi-task model corresponding to the current training task, and the grouping parameters corresponding to the basic first task model, the basic order task model and the basic last task model in the candidate multi-task model are determined based on the preset shared parameter grouping to obtain the basic multi-task model corresponding to the current training task. Further, the basic first task model in the basic multi-task model is model trained based on the preset training set to obtain the trained target first task model and the first grouping parameter corresponding to the target first task model. The basic order task model in the basic multi-task model is trained based on the first grouping parameters and a preset training set to obtain a trained target order task model and a second grouping parameter corresponding to the target order task model. The basic last-place task model in the basic multi-task model is trained based on the second grouping parameters and a preset training set to obtain a trained target last-place task model. The target first-place task model, the target order task model, and the target last-place task model are combined to obtain a trained target multi-task model. Furthermore, a candidate task sub-model corresponding to the current training task is determined based on the core task model in the basic task model set. Basic shared parameters corresponding to the candidate task sub-model are determined based on the target shared parameters corresponding to the target last-place task model in the target multi-task model. The basic shared parameters and the candidate task sub-model are combined to obtain a basic task sub-model corresponding to the current training task. Independent parameters in the basic task sub-model are adjusted based on the preset training set to obtain a trained target task sub-model. Finally, basic building data corresponding to the current prediction task is obtained and input into the target task sub-model to obtain a data prediction result corresponding to the current prediction task. Since the multi-task model is trained in a hierarchical knowledge transfer manner, the problem of low training efficiency of the multi-task model is solved, the multi-task model can be trained quickly, and the training efficiency of the multi-task model is improved.
[0083] Figure 4The flowchart of an optional multi-task model training method provided by an embodiment of the present invention is shown. Specifically, the basic task model set corresponding to the current training task includes a basic task model 1 and a basic task model 2, wherein the basic task model 1 is a temporal mask task type and the basic task model 2 is an edge mask task type. First, the basic task model 1 and the basic task model 2 are classified as task models using the preset task type, and the basic task model 1 is determined as the core task model in the basic task model set, and the basic task model 2 is determined as the auxiliary task model in the basic task model set. Afterwards, the basic task model 1 is determined as the basic first task model and the basic last task model corresponding to the current training task according to the preset task arrangement order, and the basic task model 2 and the basic task model 1 are continuously iterated three times in sequence as the basic sequence task model corresponding to the current training task. Based on the task model sequence of the basic first task model, the basic order task model and the basic last task model, the basic first task model, the basic order task model and the basic last task model are combined and processed to obtain the candidate multi-task model corresponding to the current training task, and the grouping parameters corresponding to the basic first task model, the basic order task model and the basic last task model in the candidate multi-task model are determined according to the preset shared parameter grouping, so as to determine the shared parameters that each task model is responsible for updating, and obtain the basic multi-task model corresponding to the current training task. Among them, the basic first task model, the basic order task model and the basic last task model not only contain shared parameters, but also their own independent parameters. Then, the preset training set is input into the basic first task model of the basic multi-task model, and the basic first task model is trained using the preset training set to obtain the trained target first task model, and the shared parameters corresponding to the target first task model are used as the first grouping parameters. The first grouping parameters are used to update the shared parameters of the next basic order task model, and the model output results of the target first task model are used to train the basic order task model to obtain a trained target order task model and the shared parameters corresponding to the target order task model are used as the second grouping parameters. Repeat the above operations until the target order task model is the last order task model, then use the last second grouping parameters to update the shared parameters of the basic last task model, use the model output results of the last target order task model to train the basic last task model to obtain a trained target last task model, and use the shared parameters corresponding to the target last task model as the target shared parameters. It is worth noting that in the training process of each task model, not only the responsible shared parameters need to be updated, but also their respective independent parameters need to be updated.Furthermore, the core task model in the basic task model set is used as the candidate task sub-model corresponding to the current training task, and the target shared parameters corresponding to the target last task model in the target multi-task model are used as the basic shared parameters corresponding to the candidate task sub-model. The basic shared parameters and the candidate task sub-model are combined and processed to obtain the basic task sub-model corresponding to the current training task. Finally, the preset training set is input into the basic task sub-model. By fixing the basic shared parameters in the basic task sub-model and only updating the independent parameters in the basic task sub-model, the basic task sub-model is trained to obtain the trained target task sub-model. In this way, the training of the core task model in the multi-task model is completed.
[0084] Example 3
[0085] Figure 5 This is a structural diagram of a multi-task model training device provided in Example 3 of the present invention. Figure 5 As shown, the device includes: a pre-processing module 310, a model building module 320, a first model training module 330 and a second model training module 340;
[0086] Among them, the preprocessing module 310 is used to obtain the basic task model set corresponding to the current training task, and classify the basic task model set according to the preset task type, and determine the core task model and auxiliary task model in the basic task model set;
[0087] A model construction module 320 is configured to rearrange the core task model and the auxiliary task model based on a preset model construction rule to obtain a basic multi-task model corresponding to the current training task;
[0088] A first model training module 330 is configured to perform model training on the basic multi-task model based on a preset training standard and a preset training set to obtain a trained target multi-task model;
[0089] The second model training module 340 is used to determine the basic task sub-model corresponding to the current training task based on the basic task model set and the target multi-task model, and perform model training on the basic task sub-model based on the preset training set to obtain a trained target task sub-model.
[0090] The technical solution of the embodiment of the present invention classifies the task models of the basic task model set corresponding to the current training task by preset task types, and determines the core task model and auxiliary task model in the basic task model set. Then, the core task model and the auxiliary task model are sequenced and rearranged based on the preset model construction rules to obtain the basic multi-task model corresponding to the current training task. Furthermore, the basic multi-task model is model trained based on the preset training standard and the preset training set to obtain a trained target multi-task model. Finally, the basic task sub-model corresponding to the current training task is determined based on the basic task model set and the target multi-task model, and the basic task sub-model is model trained based on the preset training set to obtain a trained target task sub-model. Since the multi-task model is trained in a hierarchical knowledge transfer manner, the problem of low training efficiency of the multi-task model is solved, the multi-task model can be trained quickly, and the training efficiency of the multi-task model is improved.
[0091] Optionally, preset task types include: timing mask task type and edge mask task type.
[0092] Optionally, preset model building rules, including: preset task arrangement order and preset shared parameter grouping;
[0093] The model building module 320 can be used to:
[0094] Rearranging the core task model and the auxiliary task model based on a preset task arrangement order to determine a basic first task model, a basic order task model, and a basic last task model corresponding to the current training task; wherein the basic order task model is at least one;
[0095] Based on the task model sequence of the basic first task model, the basic order task model and the basic last task model, the basic first task model, the basic order task model and the basic last task model are combined and processed to obtain a candidate multi-task model corresponding to the current training task;
[0096] The grouping parameters corresponding to the basic first task model, the basic order task model and the basic last task model in the to-be-selected multi-task model are determined based on the preset shared parameter grouping to obtain the basic multi-task model corresponding to the current training task.
[0097] Optionally, the first model training module 330 may be specifically used to:
[0098] Performing model training on a basic first-task model in a basic multi-task model based on a preset training set to obtain a trained target first-task model and a first grouping parameter corresponding to the target first-task model;
[0099] Performing model training on a basic sequence task model in a basic multi-task model based on the first grouping parameters and a preset training set to obtain a trained target sequence task model and second grouping parameters corresponding to the target sequence task model;
[0100] Performing model training on a basic last-place task model in the basic multi-task model based on the second grouping parameters and a preset training set to obtain a trained target last-place task model; wherein the target last-place task model includes target shared parameters;
[0101] The target first task model, the target order task model and the target last task model are combined and processed to obtain a trained target multi-task model.
[0102] Optionally, the second model training module 340 may be specifically used to:
[0103] Determine a candidate task sub-model corresponding to the current training task based on the core task model in the basic task model set;
[0104] Determining the basic shared parameters corresponding to the candidate task sub-model based on the target shared parameters corresponding to the target last task model in the target multi-task model;
[0105] The basic shared parameters and the selected task sub-model are combined to obtain the basic task sub-model corresponding to the current training task.
[0106] Optionally, the second model training module 340 may be specifically used to:
[0107] Based on the preset training set, independent parameters in the basic task sub-model are adjusted to obtain a trained target task sub-model.
[0108] Optionally, the multi-task model training device may further include: a post-processing module for obtaining basic building data corresponding to the current prediction task after performing model training on the basic task sub-model based on the preset training set to obtain the trained target task sub-model, and inputting the basic building data into the target task sub-model to obtain the data prediction result corresponding to the current prediction task.
[0109] The multi-task model training device provided in an embodiment of the present invention can execute the multi-task model training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0110] Example 4
[0111] Figure 6A schematic diagram of the structure of an electronic device 410 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0112] like Figure 6 As shown, the electronic device 410 includes at least one processor 420, and a memory connected to the at least one processor 420 in communication, such as a read-only memory (ROM) 430, a random access memory (RAM) 440, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 420 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 430 or the computer program loaded from the storage unit 490 to the random access memory (RAM) 440. Various programs and data required for the operation of the electronic device 410 can also be stored in the RAM 440. The processor 420, ROM 430 and RAM 440 are connected to each other via a bus 450. An input / output (I / O) interface 460 is also connected to the bus 450.
[0113] Multiple components in the electronic device 410 are connected to the I / O interface 460, including an input unit 470, such as a keyboard, a mouse, etc.; an output unit 480, such as various types of displays, speakers, etc.; a storage unit 490, such as a magnetic disk, an optical disk, etc.; and a communication unit 4100, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 4100 allows the electronic device 410 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0114] The processor 420 may be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the processor 420 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 420 performs the various methods and processes described above, such as the training method of the multi-task model.
[0115] The method includes:
[0116] Obtain a basic task model set corresponding to the current training task, and classify the basic task model set according to the preset task type to determine the core task model and auxiliary task model in the basic task model set;
[0117] Rearranging the core task model and the auxiliary task model based on the preset model construction rules to obtain a basic multi-task model corresponding to the current training task;
[0118] Performing model training on the basic multi-task model based on a preset training standard and a preset training set to obtain a trained target multi-task model;
[0119] Based on the basic task model set and the target multi-task model, the basic task sub-model corresponding to the current training task is determined, and the basic task sub-model is trained based on the preset training set to obtain a trained target task sub-model.
[0120] In some embodiments, the training method of the multi-task model may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 490. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 430 and / or the communication unit 4100. When the computer program is loaded into the RAM 440 and executed by the processor 420, one or more steps of the training method of the multi-task model described above may be performed. Alternatively, in other embodiments, the processor 420 may be configured to execute the training method of the multi-task model by any other appropriate means (e.g., by means of firmware).
[0121] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0122] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0123] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0125] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0126] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0127] The present application also discloses a computer program product, comprising a computer program that, when executed by a processor, implements the multi-task model training method provided in any of the embodiments of the present application. This program product and the multi-task model training method disclosed in each embodiment of the present application share the same inventive concept and are therefore not described in detail here.
[0128] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0129] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A multi-task model training method, characterized in that: include: Obtain a basic task model set corresponding to the current training task, and classify the basic task model set according to the preset task type to determine the core task model and auxiliary task model in the basic task model set; Rearranging the core task model and the auxiliary task model based on the preset model construction rules to obtain a basic multi-task model corresponding to the current training task; Performing model training on the basic multi-task model based on a preset training standard and a preset training set to obtain a trained target multi-task model; Based on the basic task model set and the target multi-task model, the basic task sub-model corresponding to the current training task is determined, and the basic task sub-model is trained based on the preset training set to obtain a trained target task sub-model.
2. The method according to claim 1, characterized in that The preset task types include: a timing mask task type and an edge mask task type.
3. The method according to claim 1, characterized in that The preset model building rules include: preset task arrangement order and preset shared parameter grouping; The core task model and the auxiliary task model are sequenced and rearranged based on the preset model construction rules to obtain a basic multi-task model corresponding to the current training task, including: Rearranging the core task model and the auxiliary task model based on a preset task arrangement order to determine a basic first task model, a basic order task model, and a basic last task model corresponding to the current training task; wherein the basic order task model is at least one; Based on the task model sequence of the basic first task model, the basic order task model and the basic last task model, the basic first task model, the basic order task model and the basic last task model are combined and processed to obtain a candidate multi-task model corresponding to the current training task; The grouping parameters corresponding to the basic first task model, the basic order task model and the basic last task model in the to-be-selected multi-task model are determined based on the preset shared parameter grouping to obtain the basic multi-task model corresponding to the current training task.
4. The method according to claim 3, characterized in that The method of performing model training on the basic multi-task model based on a preset training standard and a preset training set to obtain a trained target multi-task model includes: Performing model training on a basic first-task model in a basic multi-task model based on a preset training set to obtain a trained target first-task model and a first grouping parameter corresponding to the target first-task model; Performing model training on a basic sequence task model in a basic multi-task model based on the first grouping parameters and a preset training set to obtain a trained target sequence task model and second grouping parameters corresponding to the target sequence task model; Performing model training on a basic last-place task model in the basic multi-task model based on the second grouping parameters and a preset training set to obtain a trained target last-place task model; wherein the target last-place task model includes target shared parameters; The target first task model, the target order task model and the target last task model are combined and processed to obtain a trained target multi-task model.
5. The method according to claim 4, characterized in that The determining the basic task sub-model corresponding to the current training task based on the basic task model set and the target multi-task model includes: Determine a candidate task sub-model corresponding to the current training task based on the core task model in the basic task model set; Determining the basic shared parameters corresponding to the candidate task sub-model based on the target shared parameters corresponding to the target last task model in the target multi-task model; The basic shared parameters and the selected task sub-model are combined to obtain the basic task sub-model corresponding to the current training task.
6. The method according to claim 1, characterized in that The performing model training on the basic task sub-model based on the preset training set to obtain a trained target task sub-model includes: Based on the preset training set, independent parameters in the basic task sub-model are adjusted to obtain a trained target task sub-model.
7. The method according to claim 1, characterized in that After the basic task sub-model is trained based on the preset training set to obtain a trained target task sub-model, the method further includes: Obtain basic building data corresponding to the current prediction task, and input the basic building data into the target task sub-model to obtain the data prediction result corresponding to the current prediction task.
8. A multi-task model training device, characterized in that: include: A preprocessing module is used to obtain a basic task model set corresponding to the current training task, and classify the basic task model set according to the preset task type, and determine the core task model and auxiliary task model in the basic task model set; A model construction module is used to rearrange the core task model and the auxiliary task model based on a preset model construction rule to obtain a basic multi-task model corresponding to the current training task; A first model training module is used to perform model training on the basic multi-task model based on a preset training standard and a preset training set to obtain a trained target multi-task model; The second model training module is used to determine the basic task sub-model corresponding to the current training task based on the basic task model set and the target multi-task model, and perform model training on the basic task sub-model based on the preset training set to obtain a trained target task sub-model.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the training method of the multi-task model according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which are used to enable a processor to implement the training method of the multi-task model according to any one of claims 1 to 7 when executed.