Data splitting training method and system based on multi-task learning

By splitting the data set into data packets of scenes in different fields and performing calculation and separation at the shared layer, the problem of a small span of scene fields in the image classification model in multi-task learning is solved, and the generalization ability of the model is improved.

CN112801203BActive Publication Date: 2024-09-27宠会说社区(深圳)信息技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110186976.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-07
Publication Date
2024-09-27
Estimated Expiration
2041-02-07

AI Technical Summary

Technical Problem

Existing image classification models use the same data set in multi-task learning, resulting in a small span of scene fields and low generalization capabilities.

Method used

A data offload training method based on multi-task learning is adopted. By iterating the data set into data packages of scenarios in different fields, and performing calculation and separation on the shared layer, samples of scenarios in different fields are provided for learning tasks and the span of scenarios is increased.

Benefits of technology

It enhances the generalization ability of the image classification model trained by multi-task learning, and improves the model's adaptability and generalization ability in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112801203B
    Figure CN112801203B
Patent Text Reader

Abstract

The present application discloses a data diversion training method based on multi-task learning, comprising: obtaining a data set of at least one task; iterating data packets with different data from each of the data sets, each of the data packets at least representing a sub-domain scenario under the domain scenario of the corresponding data set, and the data contained is smaller than the data of the data set; splicing all the data packets according to a predetermined rule to form a data splicing set; inputting the data splicing set as a sample batch into a pre-constructed shared layer; receiving the calculation results output by the shared layer, and separating the calculation results according to the data packets to obtain separation results corresponding to samples of different sub-domain scenarios; inputting the separation results into different learning tasks for learning, and completing loss calculation and back-propagation parameter update operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a data diversion training method and system based on multi-task learning. Background Art

[0002] In image classification, multi-task learning is usually used to make the model not limited to the learning of one target task, but to enable the model to adapt to multiple task scenarios, which can effectively improve the functional ability of the image classification model.

[0003] Currently, in image classification models, the commonly used multi-task learning training method requires using the same samples to make prediction results and loss calculations in different tasks during the training process, and then uniformly updating the network parameters.

[0004] However, since the training of image classification models uses the same dataset as samples in multi-task learning, and the same dataset has a specific scene domain, the scene domain span between multi-task learning is not large, resulting in low generalization ability of the trained image classification model. Summary of the invention

[0005] In view of this, the present application provides a data diversion training method and system based on multi-task learning to solve the problem that the training of existing image classification models uses the same samples in multi-task learning, which makes the scene domain span between multiple tasks not large, resulting in low generalization ability of the trained image classification model.

[0006] The present application provides a data diversion training method based on multi-task learning, including: obtaining a data set of at least one task; iterating out data packets with different data from each of the data sets, each of the data packets at least representing a sub-domain scenario under the domain scenario of the corresponding data set, and the data contained is smaller than the data of the data set; splicing all the data packets according to predetermined rules to form a data splicing set; inputting the data splicing set as samples into a pre-constructed shared layer in the same batch; receiving the calculation results output by the shared layer, and separating the calculation results according to the data packets to obtain separation results corresponding to samples of different sub-domain scenarios; inputting the separation results into different learning tasks for learning, and completing loss calculation and back-propagation parameter update operations.

[0007] The method further includes: adjusting the size of the data packet to fix the total amount of data that the data packet can contain.

[0008] Among them, adjusting the size of the data packet includes: obtaining the resources allocated by the training device for the learning task, and adjusting the size of the data packet according to the resources and the number of tasks of the learning task, or, obtaining the weight ratio of the size of the data set and the weight ratio of different learning tasks, and adjusting the size of each data packet according to the weight ratio of the size of the data set and the weight ratio of the different learning tasks.

[0009] Wherein, the shared layer has at least two layers.

[0010] Wherein, the shared layer is a network shared hidden layer.

[0011] Among them, the method also includes: using a pre-trained data screening model to screen the data in the data set; the training method of the data screening model includes: constructing an input layer for receiving the data set; constructing a convolutional layer connected to the input layer; constructing a region extraction network layer connected to the convolutional layer; constructing a pooling layer connected to the convolutional layer and the region extraction network layer; constructing a classification layer connected to the pooling layer, the classification layer is used to divide the data in the data set into available data and unavailable data; and using data with available or unavailable labels to train the data screening model.

[0012] The loss calculation includes: logistic regression calculation and contrast loss calculation.

[0013] The above-mentioned data diversion training method based on multi-task learning in the present application can subdivide the data set of one domain scene into different domain scenes by iterating the data set into data packets of different domain scenes, so that after the calculation of the shared layer, it can provide samples of different domain scenes for the learning task, and also separate the separation results corresponding to the samples of different domain scenes. Therefore, when using the same batch of data sets, different scene domain data packets and their corresponding separation results are used for learning tasks, which increases the span of the domain scenes of the learning tasks, and thus enhances the generalization ability of the image classification model trained using multi-task learning.

[0014] A second aspect of the present application provides a data diversion method, comprising: acquiring a data set collected by a camera device; performing data diversion on the data set using a data diversion training model based on multi-task learning; the training method of the data diversion training model based on multi-task learning includes the steps in the data diversion training method based on multi-task learning as described in any of the above items.

[0015] The above-mentioned data diversion method of the present application can divert data and divert data packets of different domain scenarios. Therefore, when using the same batch of data sets, different scene domain data packets and their corresponding separation results can be used for learning tasks, thereby increasing the span of domain scenarios of learning tasks, and thus also enhancing the generalization ability of image classification models trained using multi-task learning.

[0016] A third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data diversion method described in any one of the above is implemented.

[0017] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the data diversion method described in any one of the above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 is a flow chart of a data splitting training method based on multi-task learning according to an embodiment of the present application;

[0020] Figure 2 It is a structural schematic diagram of a data screening model of a data diversion training method based on multi-task learning in an embodiment of the present application;

[0021] Figure 3 It is a flowchart of the data diversion method according to an embodiment of the present application;

[0022] Figure 4 is a schematic structural block diagram of a data distribution system according to an embodiment of the present application;

[0023] Figure 5 It is a schematic block diagram of the structure of the electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present application are clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application. In the absence of conflict, the following embodiments and their technical features can be combined with each other.

[0025] See also Figure 1 , a data diversion training method based on multi-task learning provided in an embodiment of the present application, including: S1, obtaining a data set of at least one task; S2, iterating out data packets with different data from each data set respectively, each data packet represents at least a sub-domain scenario under the domain scenario of the corresponding data set, and the data contained is smaller than the data of the data set; S3, splicing all data packets according to predetermined rules to form a data splicing set; S4, inputting the data splicing set as a sample batch into a pre-constructed shared layer; S5, receiving the calculation results output by the shared layer, and separating the calculation results according to the data packets to obtain separation results corresponding to samples of different sub-domain scenarios; S6, inputting the separation results into different learning tasks for learning, and completing the loss calculation and back propagation parameter update operation.

[0026] In this embodiment, the data set is iterated by a predetermined rule, and the predetermined rule can be identified according to the image recognition algorithm. For example, after identifying the data in the data set as categories such as scenery, trees, sky, grassland, moon, people, smiling expressions, sad expressions, etc., these categories are used as predetermined rules to iterate data packets with different categories of data, and the category of the data in the data packet represents the domain scene represented by the data packet. In order to increase the applicability of the data packet, a data packet may have two or more domain scenes. For example, the data in the data packet has the domain scenes of scenery and trees. When the data splicing set is calculated for the shared layer, the data packets are ordered. Enter the shared layer calculation. If a data in the data packet can participate in the shared layer calculation, all the data in the data packet can be calculated according to the data participating in the shared layer calculation. After the shared layer calculation, the calculation results output by the shared layer are separated. The separation can be performed according to the data packet. Since the data concatenation set is formed by the concatenation of data packets, each data packet can be regarded as a node, and each node will have a result. These results constitute the calculation results. Therefore, the calculation results can also be separated according to the results corresponding to these nodes, so that the separated results can be input into different learning tasks for learning, and the loss calculation and back propagation parameter update operation are completed.

[0027] From the above description, it can be seen that the present embodiment uses at least one data set. Therefore, when the number of data sets is small, the use of data sets can be reduced while increasing the domain span of learning tasks. Therefore, when the data set is limited, the task domain span is large, and the number of models is limited, training using this method can effectively save costs and achieve the output effect of multi-task model training.

[0028] During the whole process, by iterating the data set into data packets of different domain scenes, the data set of one domain scene can be subdivided into different domain scenes. Therefore, after the calculation of the shared layer, samples of different domain scenes can be provided for the learning task, and the separation results corresponding to the samples of different domain scenes are also separated. Therefore, when using the same batch of data sets, different scene domain data packets and their corresponding separation results are used for learning tasks, which increases the span of the domain scenes of the learning tasks, and thus enhances the generalization ability of the image classification model trained using multi-task learning.

[0029] In this embodiment, the algorithm used for iteration can be as shown in formula (1):

[0030]

[0031] in, It is called the iteration operator, x (k-1) Kx (k-n) is the initial value of the iteration.

[0032] When using an iterative algorithm, you need to first determine the iterative variable. In a problem that can be solved by an iterative algorithm, there is at least one variable that directly or indirectly deduces a new value from the old value. This variable is the iterative variable. The selection of the iterative variable is the basis for establishing the iterative relationship. Then you need to establish an iterative relationship. The iterative relationship refers to the formula or relationship for deducing the next value of a variable from its previous value. The establishment of the iterative relationship is the key to solving iterative problems. It can usually be done by recursion or reverse deduction. Finally, the iterative process is controlled. When to end the iterative process is a problem that must be considered when solving iterative problems. The iterative process cannot be repeated endlessly. The control of the iterative process can usually be divided into two cases: one is that the required number of iterations is a fixed value that can be calculated; the other is that the required number of iterations cannot be determined. For the former case, a fixed number of loops can be constructed to control the iterative process. For the latter case, it is necessary to further analyze the conditions for ending the iterative process.

[0033] In this embodiment, determining the iteration variables is to determine the iteration variables into two groups, one group is w and b, which are used to determine the parameter weights of the model, and the other group is Y, which is the final prediction result of the model. Establishing the iterative relationship is to establish the dependency relationship between the variables according to the loss function corresponding to the model. Iterative process control is to fix the two groups of variables to be solved respectively, and solve the other group of variables, and continuously iterate alternately to continuously update the variable values. The termination condition is to iterate until the objective function value finally converges to a stable value, at which time the model parameter value and the final classification prediction result can be determined.

[0034] Specifically, when using the iterative algorithm, it is shown as follows A1-A6:

[0035] (A1) First input the training sample,

[0036] X=[X1,X2,Λ,X t ],X t =[x1,x2,Λ,x n ]∈R d×n

[0037] Where t represents the number of tasks, it represents the number of iterations, and i represents the number of categories.

[0038] (A2) If w and b are fixed, the objective function is transformed into the solution formula (2):

[0039]

[0040] (A3) By using the singular value theorem, formula (1) is transformed into the form of the product of two standard orthogonal matrices and a diagonal matrix. For the following objective optimization problem:

[0041]

[0042] The equivalent solution Y can be obtained:

[0043] Y=U[I;0]V T (4)

[0044] Where U and V are orthogonal matrices generated after singular value decomposition, and have the following relationship, where A is a diagonal matrix:

[0045] X T W+I n b T =UAV T (5)

[0046] (A4) When Y is fixed, the objective function is respectively about b and w t,i Find the partial derivative and set the right side equal to zero, and we get:

[0047]

[0048] Then calculate the block diagonal matrix generated in the intermediate process And further obtained:

[0049]

[0050] Among them, b t,i is a t *I vector, corresponding to b t The i-th element of is a block diagonal matrix, and the jth diagonal element is I j The dimension is d j The identity matrix of

[0051]

[0052] (A5) Update the number of iterations it=it+1, and update the variable values, and the parameter matrix is ​​as follows:

[0053]

[0054] (A6) Determine whether the loss value of the objective function converges to a stable value. If not, repeat steps A2-A5 until the objective function value converges.

[0055] In this embodiment, the split function is used to separate the separation results.

[0056] In one embodiment, the data offloading training method based on multi-task learning further includes: adjusting the size of the data packet to fix the total amount of data that the data packet can contain.

[0057] By adjusting the size of the data packet, the total amount of data that the data packet can contain can be adjusted, so that the data packet can be more suitable for participating in the calculation of the shared layer.

[0058] In one embodiment, adjusting the size of a data packet includes: obtaining resources allocated by a training device for a learning task, and adjusting the size of the data packet based on the resources and the number of tasks of the learning task, or obtaining a weighted ratio of the size of a data set and a weighted ratio of different learning tasks, and adjusting the size of each data packet based on the weighted ratio of the size of the data set and the weighted ratio of different learning tasks.

[0059] In this embodiment, resources allocated by the device for the learning task are acquired, and the size of the data packet is adjusted according to the resources and the number of tasks.

[0060] By adjusting the size of the data packet in this way, the resources of the training device can be fully utilized during the multi-task learning process, thereby preventing the situation where the learning speed is slow due to insufficient resources of the training device.

[0061] In other embodiments, the size of each data packet is adjusted according to the size of the data set and the weight ratio of different learning tasks.

[0062] By adjusting the size of the data packet in this way, when most of the data in the data set can participate in the calculation of the shared layer, the data volume of the data packet can be reduced, so that more data packets can be iterated, which may increase the number of data packet domain scenarios; and when most of the data in the data set cannot participate in the calculation of the shared layer, increasing the data volume of the data packet can reduce the probability that the data in a data packet cannot participate in the calculation of the shared layer.

[0063] In one embodiment, the shared layers have at least two layers.

[0064] In one embodiment, the shared layer is the last layer of a pre-built convolutional layer.

[0065] In one embodiment, the loss calculation includes: logistic regression calculation and contrast loss calculation.

[0066] In this embodiment, the loss calculation may also be performed using a cross entropy loss function (Cross Entropy Loss) or a binary cross entropy function (Binary Cross Entropy).

[0067] And in the model of this embodiment, since multiple tasks are independent, different loss functions can be used for calculation in the model. Therefore, a model can use both the cross entropy loss function and the binary cross entropy function, or a combination of the two functions. Different loss functions can be selected according to the needs of the task. It is only necessary to set different weights according to different loss functions when merging the loss values ​​of different tasks, so that the loss values ​​can be merged smoothly, so that all target tasks can be optimized. In addition, a model can be used together for target detection tasks and classification tasks. The target detection task is the recognition of the image in the above embodiment, and the classification task is the classification of the image in the above embodiment.

[0068] In one embodiment, the method further includes: using a pre-trained data screening model to screen the data in the data set.

[0069] Data screening model such as Figure 3As shown, in this embodiment, the training method of the data screening model includes: constructing an input layer for receiving a data set; constructing a convolutional layer connected to the input layer; constructing a region extraction network layer connected to the convolutional layer; constructing a pooling layer connected to the convolutional layer and the region extraction network layer; constructing a classification layer connected to the pooling layer, the classification layer is used to divide the data in the data set into available data and unavailable data; and training the data screening model using data with available or unavailable labels.

[0070] By screening, completely useless data can be removed, making the data used for multi-task learning less noisy and more accurate.

[0071] See also Figure 3 , a data diversion method provided in an embodiment of the present application, includes: S11, obtaining a data set collected by a camera device; S12, performing data diversion on the data set using a data diversion training model based on multi-task learning.

[0072] The training method of the data diversion training model based on multi-task learning includes the steps in the data diversion training method based on multi-task learning described in any of the above embodiments. Please refer to the above embodiments of the data diversion training method based on multi-task learning for details, which will not be repeated here. In addition, in this embodiment, the data set used in step S11 is a set of data collected by the camera device, which is the data to be classified. The data diversion training model of multi-task learning used in step S12 classifies the above data set, and the data diversion training model of multi-task learning needs to use another data set in the pre-training process. The other data set used is a set of sample data.

[0073] See also Figure 4 , a data diversion system provided in an embodiment of the present application, includes: a data set acquisition module A1 and a diversion module A2; the data set acquisition module A1 is used to acquire the data set collected by the camera device; the diversion module A2 is used to perform data diversion on the data set using a pre-trained data diversion training model based on multi-task learning.

[0074] In one embodiment, the components of the data diversion training model pre-trained by the diversion module A2 based on multi-task learning include: an acquisition unit, a data set iteration unit, a data packet splicing unit, a data input unit, a separation unit and a learning unit; the acquisition unit is used to acquire the same number of data sets as the number of learning tasks; the data set iteration unit is used to iterate all data sets to generate data packets with different data, each data packet represents at least one domain scenario, and the data contained is less than the data of the data set; the data packet splicing unit is used to splice all data packets according to predetermined rules to form a data splicing set; the data input unit is used to input the data splicing set into a pre-built shared layer in the same batch; the separation unit is used to receive the calculation results output by the shared layer, and separate the calculation results according to the data packets to obtain separation results; the learning unit is used to input the separation results into different learning tasks for learning, and complete the loss calculation and back propagation parameter update operation.

[0075] In this embodiment, the data set acquired by the data set acquisition module A1 is a collection of data collected by the camera device, which is the data to be classified. The diversion module A2 classifies the data set acquired by A1. However, the multi-task learning data diversion training model used in the diversion module A2 needs to use another data set in the pre-training process. The other data set used is a collection of sample data.

[0076] Among them, the data set iteration unit integrates an iterative algorithm. For details, please refer to the relevant description in the embodiment of the data diversion training method based on multi-task learning, which will not be repeated here.

[0077] In one embodiment, the traffic distribution module A2 further includes: a data packet adjustment unit, configured to adjust the size of the data packet to fix the total amount of data that the data packet can contain.

[0078] In one embodiment, the data packet adjustment unit includes: a resource acquisition subunit, a data set size and weight ratio acquisition subunit, and an adjustment subunit; the resource acquisition subunit is used to acquire the resources allocated by the device for the learning task, the data set size and weight ratio acquisition subunit is used to acquire the size of the data set and the weight ratio of different learning tasks, and the adjustment subunit is used to adjust the size of the data packet according to the resources and the number of tasks of the learning task, or the adjustment subunit is used to adjust the size of each data packet according to the size of the data set and the weight ratio.

[0079] In one embodiment, the shared layers constructed have at least two layers.

[0080] In one embodiment, the shared layer is the last layer of a pre-built convolutional layer.

[0081] In one embodiment, the learning unit includes: a multi-task learning subunit, a loss calculation subunit and a parameter updating subunit. The multi-task learning subunit is used to input the separation results into different learning tasks for learning, the loss calculation subunit is used to calculate the loss value of the function, and the parameter updating subunit is used to back-propagate and update the parameters.

[0082] Among them, the loss calculation unit integrates logistic regression operation and contrast loss calculation. For details, please refer to the implementation example of the data diversion training method based on multi-task learning, which will not be repeated here.

[0083] In one embodiment, the diversion module A2 further includes: a data set screening unit and a data screening model training unit, wherein the data set screening unit is used to screen the data in the data set using the data screening model pre-trained by the data screening model training unit.

[0084] The process of training the data screening model in the data screening model training unit is as follows: construct an input layer for receiving a data set; construct a convolutional layer connected to the input layer; construct a region extraction network layer connected to the convolutional layer; construct a pooling layer connected to the convolutional layer and the region extraction network layer; construct a classification layer connected to the pooling layer, the classification layer is used to divide the data in the data set into available data and unavailable data; use data with available or unavailable labels to train the data screening model.

[0085] The data diversion system provided in this embodiment can divert data into data packets of different domain scenarios, so that when using the same batch of data sets, different scene domain data packets and their corresponding separation results can be used for learning tasks, thereby increasing the span of domain scenarios of learning tasks, and thus also enhancing the generalization ability of image classification models trained using multi-task learning.

[0086] The present application embodiment provides an electronic device. Figure 5 The electronic device includes: a memory 601, a processor 602, and a computer program stored in the memory 601 and executable on the processor 602. When the processor 602 executes the computer program, the data diversion training method based on multi-task learning described above is implemented.

[0087] Furthermore, the electronic device also includes: at least one input device 603 and at least one output device 604 .

[0088] The memory 601 , processor 602 , input device 603 and output device 604 are connected via a bus 605 .

[0089] The input device 603 may be a camera, a touch panel, a physical button or a mouse, etc. The output device 604 may be a display screen.

[0090] The memory 601 may be a high-speed random access memory (RAM) memory or a non-volatile memory, such as a disk memory. The memory 601 is used to store a set of executable program codes, and the processor 602 is coupled to the memory 601 .

[0091] Furthermore, the embodiment of the present application also provides a computer-readable storage medium, which may be disposed in the electronic device in each of the above embodiments, and the computer-readable storage medium may be the aforementioned memory 601. The computer-readable storage medium stores a computer program, which, when executed by the processor 602, implements the data diversion training method based on multi-task learning described in the above embodiments.

[0092] Furthermore, the computer storable medium may also be a U disk, a mobile hard disk, a read-only memory 601 (ROM), a RAM, a magnetic disk or an optical disk, and other media that can store program codes.

[0093] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0094] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0095] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.

[0096] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0097] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0098] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0099] The above is a description of a data diversion training method and system based on multi-task learning provided by the present invention. For technicians in this field, according to the ideas of the embodiments of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A data diversion method, characterized in that: include: Obtaining a data set collected by a camera device; Use the data diversion training model based on multi-task learning to divert data from the data set; The training method of the data diversion training model based on multi-task learning includes: obtaining a data set of at least one task; Iterate out data packets with different data from each of the data sets according to predetermined rules, wherein the predetermined rules are data categories within the data sets, and the data categories represent the domain scenarios represented by the data packets, and each of the data packets represents two or more domain scenarios of the corresponding data set, and the data contained is smaller than the data of the data set; splice all data packets according to the predetermined rules to form a data splicing set; input the data splicing set as samples into a pre-constructed shared layer in the same batch; receive the calculation results output by the shared layer, and separate the calculation results according to the data packets to obtain separation results corresponding to samples of different domain scenarios; input the separation results into different learning tasks for learning, and complete the loss calculation and back-propagation parameter update operation.

2. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in claim 1 is implemented.

3. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to claim 1 is implemented.