Method for training machine learning model

By using task-specific uncertainty weighting losses in multitask neural networks, the problem of difficulty in precision in loss weighting in multitask networks is solved, and a more stable and fast training process is achieved.

CN119443177APending Publication Date: 2025-02-14ROBERT BOSCH GMBH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411039319.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-08-03
Filing Date
2024-07-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In multitasking neural networks, task-specific loss weighting is difficult to implement precisely, resulting in unstable network training and slow learning process, especially in environments with multiple tasks or significantly different tasks.

Method used

The weights of the neural network are initialized and updated by weighting the loss, especially the uncertainty based on the optimal analysis calculation, to compensate tasks of different scales.

Benefits of technology

This method can effectively compensate for differences between tasks within the initial iteration of training, resulting in a more stable training process, faster convergence and improved overall performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443177A_ABST
    Figure CN119443177A_ABST
Patent Text Reader

Abstract

The invention relates to a method (100) for training a machine learning model, comprising the following training steps: providing (101) training data specific to an application of the machine learning model; initiating (102) a processing of the training data, wherein a plurality of tasks are simultaneously processed by the machine learning model; determining (103) a loss of each task, the specific loss being based on a difference between an output generated by the machine learning model and a default value; weighting (104) the determined loss, the weighting being performed based on the analytical calculation using at least one task-specific uncertainty; the weights of the machine learning model are updated (105) based on the weighted loss for training of the machine learning model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for training a machine learning model. The present invention also relates to a machine learning model, a computer program, a device and a storage medium for this purpose. Background Art

[0002] When multiple tasks are processed simultaneously in a neural network (e.g., semantic segmentation, object recognition, classification, etc.), this is called multitasking. In most cases, all tasks share a part of the network (called the "backbone"), and each task gets its own layer (called the "head").

[0003] To train a multi-task network, the various losses for each task must be combined into an overall loss. The precise weighting of the task-specific losses is critical to ensure the desired distribution of the content of the neural network. Summary of the invention

[0004] The subject matter of the invention relates to a method, a machine learning model, a computer program, a device and a computer-readable storage medium. Further features and details of the invention can be obtained from the corresponding description and the drawings. Of course, the features and details described in conjunction with the method according to the invention also apply in conjunction with the machine learning model according to the invention, the computer program according to the invention, the device according to the invention and the computer-readable storage medium according to the invention, and vice versa in each case, so that with respect to the present disclosure, reference is always made to the various aspects of the invention or can be made to each other.

[0005] The subject matter of the present invention specifically relates to a method for training a machine learning model for application to a machine, such as for object recognition in autonomous driving. The method comprises at least a portion of the following training steps:

[0006] - providing training data, which is specific to the application of the machine learning model,

[0007] - initiating processing of the training data, wherein multiple tasks are processed simultaneously by the machine learning model,

[0008] - determining a loss for each task, the specific loss being based on the difference between an output generated by the machine learning model and a default value (where the default value may be predefined) in order to provide a reference, e.g. in the form of ground truth, for the application of the machine learning model,

[0009] - weighting the determined losses, which weighting may be performed using at least one task-specific uncertainty based on an analytical calculation, preferably based on an optimal calculation and in particular on the optimal analytical calculation, in particular in order to compensate for tasks of different scales,

[0010] -Updating the weights of the machine learning model based on the weighted loss for training the machine learning model.

[0011] In the method according to the invention, it can be provided that various losses, such as classification loss and regression loss, are learned simultaneously using a multi-task loss. This is used for specific purposes where different quantities and units can be used. At least one task-specific, i.e., in particular task-dependent uncertainty can be used, which can reflect the relative confidence between tasks and can be a function of the representation or unit of the task. Determining a specific loss and / or determining a weighting of the loss can be performed based on at least one loss function. The loss function (preferably a multi-task loss function for multi-task losses) can be based on maximizing a Gaussian probability with random uncertainty.

[0012] Task-specific uncertainties can be used to compensate for tasks of different scales. For example, one task may be measured in millimeters, while another task may be measured in meters, which may result in significantly different loss weights that must be compensated. It is not always sufficient to initialize task weights using traditional methods. Although known methods mainly focus on calculating task weights during training, according to the present invention, the main focus may be on their initialization in particular. Complex multi-task systems include many different tasks. It has been found that the initialization of a good distribution of task weights in complex multi-task systems is crucial. Neural networks are usually trained using back propagation based on gradient descent methods, which usually adapt only slowly. Therefore, when the starting values ​​are too far away, large differences in loss weights cannot usually be compensated. This may lead to divergent and slow learning processes. This problem also becomes more important for multi-task learning environments with multiple tasks (e.g., more than three) or significantly different tasks (e.g., not only classification tasks are different, but also object recognition and segmentation are different). Therefore, in environments such as autonomous driving, for example, various tasks such as pedestrian recognition, vehicle recognition, and road recognition usually require various formats, such as classification, bounding boxes, segmentation, and / or spline fitting.

[0013] It is also advantageous that, within the scope of the present invention, the step of updating the weights of the machine learning model is initially performed at the beginning of training and / or (subsequently) iteratively during training, in each case based on an analytically optimal calculation. Alternatively or additionally, the losses may initially be weighted differently (i.e. not in a constant manner), and the initialization of the weights of the loss functions for the losses of the various tasks and in particular the initialization of the task weights may occur differently. An advantage of the present invention is that large differences between tasks can be compensated within the first pair of iterations of training. It has been shown that this can lead to more stable training (relying solely on previous methods can lead to divergence), faster convergence (and therefore reduced computational costs) and improved overall performance for all tasks. The correct initialization of uncertainty weights can be a key component in the training process.

[0014] Optionally, it can be provided that the loss for each task is determined based on a task-specific loss function, which is preferably based on an approximation and / or maximization of a distribution of a location scale family and / or a Gaussian probability with random uncertainty. The location scale family may include a family of probability distributions parameterized by a location parameter and a non-negative scale parameter. In addition, the task-specific uncertainty can be determined based on the loss determined for a specific task. In addition, the representation or unit of the task may be different, and the task-specific uncertainty may be a function of the representation or unit. In addition, it is conceivable to perform a step of weighting the determined loss based on an analytically best calculation and / or loss function of the current and / or previous iteration of the training step. For regression tasks, the probability can be defined as a Gaussian distribution with a mean provided by the model output. For classification tasks, the model output can be processed by a softmax function, and samples can be taken from the resulting probability vector. In this way, the uncertainty term can be reduced during training, which improves the optimization process.

[0015] The analytical best calculation, in particular the analytical best calculation of the loss weight of the current iteration, can also be stabilized with the loss weights of a plurality of previous iterations of the training step, preferably by a moving average. Furthermore, it is conceivable that the analytical best calculation comprises the calculation of a moving average over the loss weights of the current iteration and a plurality of previous iterations of the training step. Thus, the machine learning model can be trained more reliably.

[0016] Another advantage within the scope of the present invention is achievable when the machine learning model is designed as an artificial neural network in order to simultaneously process multiple tasks for assisting machine operation, preferably for providing autonomous driving. Thus, more complex tasks for machine operation can be processed.

[0017] Furthermore, it is optionally provided that the training data is specific to sensor data collected from at least one sensor (preferably a camera sensor) of the machine (preferably a vehicle or a robot). The machine learning model can be trained for applications in autonomous driving and / or autonomous navigation, in particular for pedestrian recognition and / or vehicle recognition and / or road recognition. In many cases, a single neural network may be required to solve multiple tasks simultaneously, share knowledge between tasks and improve computational efficiency. Thus, for autonomous driving, for example, lanes, pedestrians, vehicles, drivable surfaces, etc. may be evaluated.

[0018] Furthermore, the tasks may include semantic segmentation and / or object recognition and / or classification, which are preferably represented differently and / or include different units, wherein the representations and / or units may lead to different scaling of the loss function.

[0019] In addition, the machine can also be designed as a tool, etc. For example, for a smart drill, the material type and depth of the drill need to be evaluated simultaneously. The machine can also be designed as a surveillance camera. For a surveillance camera, pedestrian recognition, potential dangerous situations, and other interesting tasks can be derived simultaneously.

[0020] The subject of the invention also relates to a machine learning model for assisting the operation of a machine by processing a plurality of tasks of the machine, in particular trained by the method according to the invention. The machine learning model according to the invention thus provides the same advantages as described in detail with respect to the method according to the invention.

[0021] The subject of the invention also relates to a computer program, in particular a computer program product, which comprises commands which, when executed by a computer, prompt the computer to perform the method according to the invention. The computer program according to the invention therefore provides the same advantages as described in detail with respect to the method according to the invention.

[0022] The subject matter of the invention also relates to a device for data processing, which is configured to perform the method according to the invention. For example, a computer that executes the computer program according to the invention can be provided as a device. The computer can have at least one processor for executing the computer program. In addition, a non-volatile data memory can be provided, in which the computer program is stored and from which the computer program can be read by the processor for execution.

[0023] The subject matter of the present invention may also relate to a computer-readable storage medium comprising a computer program and / or commands which, when executed by a computer, prompt the computer to perform the method according to the present invention. The storage medium is designed, for example, as a data storage such as a hard disk and / or a non-volatile memory and / or a memory card. The storage medium may, for example, be integrated into a computer.

[0024] Furthermore, the method according to the invention can also be designed as a computer-implemented method. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Further advantages, features and details of the invention result from the following description, in which exemplary embodiments of the invention are described in detail with reference to the accompanying drawings. The features mentioned in the claims and in the description may be essential to the invention individually or in any given combination. In the drawings:

[0026] Figure 1 Schematic visualizations of methods, devices, storage media and computer programs according to exemplary embodiments of the invention are shown.

[0027] Figure 2 An example of the results of equations for compensating multiple tasks is shown. DETAILED DESCRIPTION

[0028] exist Figure 1 Schematically shown in FIG. 1 are a method 100, an apparatus 10, a storage medium 15 and a computer program 20 according to an exemplary embodiment of the present invention. Also shown is a machine learning model 50 according to an exemplary embodiment of the present invention.

[0029] Figure 1 A method 100 is shown which can be used to train a machine learning model 50 for application to a machine. The provision of training data is initially carried out according to a first training step 101. The training data may be specific to the application of the machine learning model 50. This may mean that the training data comprises inputs of a type also processed by the machine learning model in a subsequent application. The training data may also comprise default values, i.e. reference values ​​which in particular indicate which output of the machine learning model 50 is expected from the processing.

[0030] Processing of the training data may then begin according to a second training step 102, wherein a plurality of tasks are processed simultaneously by the machine learning model. Losses may then be determined according to a third training step 103. Losses are determined specifically for each task, wherein the specific losses may be based on the difference between the output generated by the learning model 50 and a default value. The determined losses may then be weighted according to a fourth training step 104, wherein the weighting may be performed based on an analytically optimal calculation using task-specific uncertainties. Furthermore, as a fifth training step 105, updating the weights of the machine learning model 50 based on the weighted losses used to train the machine learning model 50 may be provided.

[0031] The present invention can be based on and built on known methods, such as the methods described in Kendall, Alex, Yarin Gal, and Roberto Cipolla, "Multi-task learning using uncertainty to weigh losses for scene geometry and semantics," Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018. This allows the use of task-specific uncertainties in order to compensate for tasks of various scales. For example, one task may be measured in millimeters, while another task may be measured in meters, which may result in significantly different loss weightings, which can be compensated for according to implementation variations of the present invention. However, the initialization of all task weights is typically a fixed constant, such as 1. This initialization can be improved according to implementation variations of the present invention, and therefore greatly improved results can be obtained in large, diverse multi-task environments.

[0032] During training, Kendall et al. (see above) use the following equation to compensate for the T tasks:

[0033]

[0034] Among them, L t (M φ (x), y) is the loss of task t based on input x, which is fed into the neural network M. φ In order to find the label y. The inverse task weight σ t is a scalar parameter learned (using gradient descent). Intuitively, σ t →inf would be optimal in order to minimize the loss in the first term; however, due to the second term log(σ t ), this is avoided. Therefore, all tasks are compensated with σ tto weight, which can be found using gradient descent. The exact form of the function can vary depending on the type of distribution assumed. In the current case, a Gaussian distribution is assumed, i.e., an L2-based regression task.

[0035] The invention can advantageously be divided into multiple steps: estimating the task weights for a first sample, weighting the tasks using a moving average, and seamlessly transferring to an uncertainty weighting method, for example according to Kendall et al. (see above).

[0036] According to the first step, the task weight of the first sample is estimated. During training, the following equation can be used to compensate T tasks. For simplicity, in the following discussion, the focus is on deriving the formula for regression tasks. For classification, the 2 in the denominator will become 1, for example:

[0037]

[0038] To estimate the optimal initialization and loss L(x,y) for a series of training samples, the initialization can be calculated analytically based on the above equation. Since it involves and, this can be performed independently for each σ_i. This leads to:

[0039]

[0040] Solving for σ t The following results were obtained:

[0041]

[0042] Thus, in the first iteration involving the loss for this particular task (e.g., based on the first image fed into the neural network and the computation of the loss), one can use To initialize the weights.

[0043] exist Figure 2 For a single loss L0=1, relative to the loss weight σ t Plot Equation 1 above. Clearly, the optimal solution is

[0044] This is significantly different from conventional solutions such as Kendall et al. that use a constant and backpropagation (gradient descent) for updating to initialize σ_t.

[0045] According to another step, a moving average is used to weight the tasks. For a subsequent training iteration i, a moving average can be calculated over the loss weights of the current iteration and the previous iterations:

[0046]

[0047] This can be performed for the first couple of iterations. The exact number N of first iterations using the analytical solution and the moving average is a hyperparameter. In general, experience has shown that the method is very robust to this hyperparameter. As a general rule, the following applies: the larger the variance of the task-specific loss on the samples, the larger the number of iterations used to estimate the initialization. From a technical point of view, any value between 1 and the total number of training steps is possible. The actual network training can also be performed starting from iteration 0, since there is an estimate of the loss weights at iteration 0.

[0048] According to the next step, a seamless transfer to an uncertainty weighting method, such as the method of Kendall et al., can then be made. After a predetermined number of iterations for initialization, a change can be made to the update of the uncertainty weighting based on gradient descent, similar to the method of Kendall et al.

[0049] In the description of the above embodiment, the present invention has been described only based on examples. Of course, if technically feasible, the individual features of the embodiment can be freely combined with each other without departing from the scope of the present invention.

Claims

1. A method (100) for training a machine learning model (50) for an application of a machine, the method comprising the following training steps: - providing (101) training data, said training data being specific to said application of said machine learning model (50), - initiating (102) processing of the training data, wherein a plurality of tasks are processed simultaneously by the machine learning model (50), - determining (103) a loss for each task, the specific loss being based on the difference between the output generated by the machine learning model (50) and a default value, - weighting (104) the determined losses, the weighting being performed based on analytical calculations using at least one task-specific uncertainty, -Updating (105) the weights of the machine learning model (50) based on the weighted loss for use in training the machine learning model (50).

2. The method (100) according to claim 1, characterized in that: The step of updating (105) the weights of the machine learning model (50) is initially performed at the beginning of the training and / or subsequently iteratively during the training, in each case based on an analytical optimal calculation, wherein the losses are initially weighted differently and the weighted initialization of the loss functions for the losses for various tasks, in particular the initialization of the task weights, is preferably performed differently.

3. The method (100) according to any one of the preceding claims, characterized in that The loss for each task is determined based on a task-specific loss function, wherein the task-specific loss function is preferably based on a distribution of a family of position scales and an approximation and / or maximization of a Gaussian probability with random uncertainty, wherein the task-specific uncertainty is determined based on a loss determined for a specific task, wherein the representation or units of the tasks are different, and wherein the task-specific uncertainty is a function of the representation or units, and the step of weighting (104) the determined loss is performed based on the analytically optimal calculation and / or loss function of the current and / or previous iteration of the training step.

4. The method (100) according to any one of the preceding claims, characterized in that The analytical best calculation, in particular the analytical best calculation of the loss weights of the current iteration, is additionally stabilized using the loss weights of a plurality of previous iterations of the training step, in particular by means of a moving average.

5. The method (100) according to any one of the preceding claims, characterized in that The machine learning model (50) is designed as an artificial neural multi-task network so as to process the multiple tasks simultaneously to assist in the operation of the machine, preferably for providing autonomous driving.

6. The method (100) according to any one of the preceding claims, characterized in that The training data is specific to sensor data collected from at least one sensor, preferably a camera sensor, of the machine, preferably a vehicle, wherein the machine learning model (50) is trained for an autonomous driving application, in particular for pedestrian recognition and / or vehicle recognition and / or road recognition, wherein the tasks include semantic segmentation and / or object recognition and / or classification.

7. A machine learning model (50) for assisting the operation of a machine by processing multiple tasks of the machine, the machine learning model being trained by a method according to any one of claims 1 to 6.

8. A computer program (20) comprising commands which, when the computer program (20) is executed by a computer (10), prompt the computer to perform a method (100) according to any one of claims 1 to 6.

9. A device (10) for data processing, the device being configured to perform the method (100) according to any one of claims 1 to 6.

10. A computer-readable storage medium (15) comprising instructions which, when executed by a computer (10), prompt the computer to perform the steps of the method (100) according to any one of claims 1 to 6.