Method, device and computer program for creating a machine learning system

By optimizing the architecture and parameterization of machine learning systems using the DARTS method and gradient descent, and by employing two-layer optimization and eigenvalue judgment, the problem of unclear architecture optimization in existing technologies is solved, achieving a more robust and efficient optimization process.

CN112085207BActive Publication Date: 2026-04-28ROBERT BOSCH GMBH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ROBERT BOSCH GMBH
Filing Date
2020-06-12
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies cannot clearly optimize the architecture of machine learning systems, resulting in poor performance.

Method used

The DARTS method is adopted to optimize the architecture and parameterization of the machine learning system through gradient descent. The optimization direction is determined by using the bi-level optimization problem and the eigenvalues ​​of the Hessian matrix. Combined with data augmentation and regularization techniques, the optimization process can be identified and interrupted early.

Benefits of technology

This achieves more robust optimization of the machine learning system, avoids getting stuck in steep optima, improves search efficiency and accuracy, and ensures good generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112085207B_ABST
    Figure CN112085207B_ABST
Patent Text Reader

Abstract

The invention relates to a method for creating a machine learning system, comprising the following steps. A first parameter set is iteratively optimized according to a first cost function (English: loss function) and a second parameter set is iteratively optimized according to a second cost function. Eigenvalues of a Hesse matrix of the first cost function are determined from the first parameter set. When one of the eigenvalues is greater than a predefinable threshold value, the optimization is interrupted. The invention also relates to a computer program, a device for carrying out the method and a machine-readable storage element, on which the computer program is stored.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The invention relates to a method for creating a machine learning system. The invention likewise relates to a device and a computer program, which are designed to carry out the method, respectively. TECHNICAL FIELD

[0003] Liu, Hanxiao, Karen Simonyan and Yiming Yang, "DARTS: Differentiable architecture search", arXiv preprint arXiv:1806.09055 (2018) discloses a method for optimizing the architecture of a neural network by means of a gradient descent method.

[0004] ADVANTAGES OF THE INVENTION

[0005] It has been observed that the known methods do not purposefully optimize a certain architecture of a machine learning system. This can lead to a poor performance of the machine learning system on training data.

[0006] The method having the features of independent claim 1 has the advantage that it is recognized early if the optimization of the architecture is developing in the wrong direction and is not purposefully running. A more robust optimization of the architecture can thereby be achieved. SUMMARY

[0007] In a first aspect, a computer-implemented method for creating a machine learning system is proposed. A first parameter set characterizes an architecture of the machine learning system and a second parameter set corresponds to a parameterization of the machine learning system. The method comprises the steps of first iteratively optimizing the first parameter set according to a first cost function and iteratively optimizing the second parameter set according to a second cost function. The iterative optimization of the two parameter sets can be carried out alternately. Next, eigenvalues of a Hesse matrix of the first cost function are determined with respect to the first parameter set. Next, the optimization is interrupted when one of the eigenvalues is greater than a predefinable threshold value. Alternatively, a criterion can be chosen as a threshold value, which criterion depends on a plurality of eigenvalues or all eigenvalues.

[0008] The Hessian matrix is ​​a matrix that, in multidimensional real analysis, is an analogy of the second derivative of a function. To determine an approximation of the eigenvalues, a first cost function can be evaluated on multiple randomly sampled training data. Preferably, the first cost function is determined for this purpose based on a mini-batch of randomly sampled training data. The eigenvalues ​​can be determined after each iteration step of optimizing the first and second parameter sets, or after a pre-given number of iteration steps.

[0009] The architecture of the machine learning system can be understood as the structure of the machine learning system. The structure of the machine learning system may include multiple layers or units, each layer or unit having multiple (activation) functions.

[0010] Iterative optimization can be understood as repeated optimization. Here, a modified solution is proposed for each iteration step, gradually approaching the optimal solution. For this purpose, optimization steps are executed multiple times consecutively. The optimization ends when one of the feature values ​​is greater than the threshold, or when the cost function has reached a pre-given value, or when the pre-given number of repetitions of the optimization step is reached. The optimization or architecture search can then be terminated, i.e., at least the first parameter set is output. The machine learning system can then be initialized based on the output first parameter set and parameterized based on the second parameter set. It is also conceivable to restart the method from scratch after exceeding the threshold, or to continue iterative optimization from the previously determined parameter set at a previous iteration step. It is also conceivable that after interrupting the optimization, at least the first parameter set determined before exceeding the threshold is output, specifically selecting the corresponding architecture.

[0011] For example, the iterative optimization is performed using a gradient descent method. Preferably, the gradient descent method proposed for DARTS is used for this purpose. The cost function can be understood as the difference or deviation between the determined output variable of the machine learning system and the pre-given training output variable. The training output variable is associated with the training input variable. These training input variables are processed by the machine learning system and output as output variables.

[0012] The first cost function can be determined based on a first training data set (e.g., validation data). The second cost function can be determined based on a second training data set. The training data respectively include pairs of training input variables and associated training output variables. It is conceivable to use the same cost function for two parameter sets and / or determine two cost functions based on the same training data.

[0013] The two cost functions can be determined based on the first parameter set (which characterizes the architecture of the machine learning system) and the second parameter set (e.g., the weights of the neural network), respectively. Then, when optimizing using the corresponding cost functions, the parameter sets that should not be optimized remain unchanged.

[0014] The first cost function and the second cost function can form a bi-level optimization problem. This bi-level optimization problem is a special type of optimization problem where one problem is embedded (nested) within another. The external optimization task of the bi-level optimization problem is generally called the upper-level optimization task, and the internal optimization task is generally called the lower-level optimization task. Thus, the external optimization task is the optimization of the first cost function, while the internal optimization task is the optimization of the second cost function. In bi-level optimization, optimization is performed using different variables, called upper-level variables and lower-level variables, which are associated with their respective optimization tasks.

[0015] The two-level optimization problem can be the DARTS optimization problem. DARTS can be understood as an architecture search method that optimizes the architecture of the machine learning system using gradient descent. The search architecture is created based on cells, and then optimized.

[0016] The goal of the iterative optimization is to determine the optimal first parameter set for optimizing the first cost function, and, given the optimal first parameter set, to obtain the optimal second parameter set for the first parameter set by optimizing (minimizing / maximizing) the second cost function. The first cost function can be a validation cost function, and the second cost function can be a training cost function.

[0017] If the true optimum is not found, the method terminates the optimization. This makes the method more robust and prevents it from getting stuck in a sharp optimum. It has been recognized that determining the termination condition based on the first cost function is sufficient, as the first cost function is more likely to lead to poor optimization results. This is because the first cost function used for architecture search tends to converge to a steep optimum. It should be noted that the second cost function is easier to optimize than the first cost function; therefore, a termination condition for architecture search is not required for the second cost function.

[0018] Furthermore, it is proposed that the iterative optimization be interrupted when the largest eigenvalue of the Hessian matrix is ​​greater than the threshold.

[0019] If the largest eigenvalue increases too much, the method may be interrupted because reaching, for example, a flat minimum of the cost function cannot be expected. A flat minimum of the cost function indicates whether good generalization can be achieved for new data. For this purpose, the largest eigenvalue is most characteristic because a large value of the largest eigenvalue characterizes a sharp optimum, which leads to poor generalization. Therefore, this approach leads to improved efficiency and robustness of the method.

[0020] Furthermore, it is proposed to determine a first average value for the maximum eigenvalue of the last iteration step, which can be pre-given in k possible sequential executions, particularly the last iteration step optimizing the first parameter set. A second average value is determined for the maximum eigenvalue of the last iteration step, which can be pre-given in k possible executions prior to the last iteration step. The optimization is interrupted when the ratio of the second average value to the first average value exceeds a pre-given threshold.

[0021] The advantage of this approach is the implementation of a simple interruption condition that is independent of the current optimization problem and the progress of the solution. Furthermore, the "search time" can be significantly reduced by interrupting earlier.

[0022] Furthermore, it is proposed to determine the average value for the last two, preferably the last five, or particularly preferably the last ten iterations. The threshold is greater than 0.6, preferably greater than 0.75. These values ​​have proven to be most suitable when the method is simulated for different training datasets.

[0023] Furthermore, it is proposed that at least the second cost function has a regularization term. This regularization term can be weighted using a regularization factor, wherein the regularization factor is greater than 3 * 10. -4 And preferably less than 1.

[0024] It has been recognized that regularizing only the second cost function is sufficient. This implicitly achieves regularization of the first cost function, which has a positive impact on the eigenvalues.

[0025] Regularization can be understood as a method to avoid overfitting the training data, resulting in better generalization. The regularization can be an additional term added to one of the cost functions, which depends on the parameter set. The regularization is used at least for the second cost function (in the internal optimization problem of architecture search). The regularization has a positive effect on the feature values. Therefore, the combination with the interruption criterion leads to a particularly robust optimization of the parameter set.

[0026] Furthermore, it is proposed that the regularization term is or Regularization, wherein the regularization factor corresponds to the value One of them, where i = {3; 6; 9; 27; 81}. These values ​​have proven to be most suitable when the method is simulated for different training datasets.

[0027] Alternatively, the regularization factor can be set via "hyperparameter optimization". For this purpose, it is preferable to use an additional dataset (e.g., a second validation set).

[0028] Furthermore, it is proposed that the cost function be determined based on the training data during optimization, wherein at least the training data used for the second cost function is expanded.

[0029] Expanding training data can be understood as adding artificially generated or manipulated training data to existing training data. Artificially generated or manipulated training data can be calculated based on existing training data. The artificially generated or manipulated training data can be obtained by applying affine transformations. For example, the training data can be transformed horizontally and / or vertically. Additionally or alternatively, scaling and / or "compression" can be performed. Additionally or alternatively, optical properties such as color or pattern can be altered. Additionally or alternatively, horizontal and vertical stretching can also be performed. Other expansions are possible.

[0030] In addition to directly augmenting the training data, augmentation should also be understood as applying the above methods (and others) to intermediate output variables (i.e., the output of any layer in the machine learning system).

[0031] Preferably, individual portions of the training input variables, such as images, are removed. This is a simple regularization technique, particularly effective for image processing via, for example, neural networks. These portions can be continuous parts of the training input variables, thereby effectively supplementing the training data with partially hidden versions of the existing training data. The size of the portions to be removed and the frequency with which they are removed from the training data can be chosen randomly. It is proposed that this probability increases with the progress of training, particularly linearly.

[0032] The advantage of data augmentation is that simulations have demonstrated its positive impact on the eigenvalues, thereby keeping them small. This effect also occurs with the regularization of the first cost function. Therefore, the combination of these precautions (depending on the eigenvalue interruption criteria, at least the regularization of the second cost function and the data augmentation) leads to better generalization and avoids exploring architecture parameterizations that result in poorly performing machine learning systems. This makes architecture search particularly robust.

[0033] Furthermore, it is proposed that after the optimization is interrupted, since the threshold has been exceeded, the machine learning system is created based on the first and second parameter sets from the preceding optimization iteration steps. Alternatively, the optimization can continue based on the first and second parameter sets determined at one of the previous iteration steps.

[0034] Furthermore, it is proposed that a machine learning system, particularly a neural network, be created for image processing. The image processing may involve classifying or segmenting images provided to the machine learning system.

[0035] Furthermore, it is proposed that the created machine learning system determines control variables based on acquired sensor variables. These sensor variables can be images detected by a camera. The control variables can be used to control the actuators of the technological system. This technological system can be, for example, at least partially autonomous machines, at least partially autonomous vehicles, robots, tools, machine tools, or flying objects such as drones.

[0036] On the other hand, a computer program is proposed. The computer program is designed to perform one of the aforementioned methods. The computer program includes instructions that, when executed on a computer, cause the computer to perform one of the methods having all its steps. Furthermore, a machine-readable storage module is proposed on which the computer program is stored. Additionally, an apparatus is proposed designed to perform one of the methods. Attached Figure Description

[0037] Embodiments of the above aspects are shown in the accompanying drawings and explained in more detail in the following description. Herein:

[0038] Figure 1 A schematic diagram of a DARTS unit is shown;

[0039] Figure 2 A schematic diagram of the flowchart for optimizing the architecture and parameterization of a machine learning system is shown;

[0040] Figure 3 A schematic diagram of a robot that is at least partially autonomous is shown.

[0041] Figure 4 A schematic diagram of a device used to optimize a machine learning system is shown. Detailed Implementation

[0042] The goal is to optimize the architecture of a machine learning system using a method corresponding to DARTS because this approach has the following advantages: it uses gradient descent and is therefore scalable. Furthermore, DARTS allows for alternating optimization of both the architecture and parameterization of the machine learning system. Parameterization can be understood as all the parameters of the machine learning system, based on which the system determines its output variables. In a first embodiment, the machine learning system may be a neural network. The parameterization of the neural network may include the weights of the neural network and the filter coefficients of the neural network's filters.

[0043] For DARTS, an architecture of a neural network, for example, with multiple cells connected to each other in a pre-defined order is shown. These connected cells describe a so-called search network, about which optimization should be performed. A cell is a directed acyclic graph with N distinct nodes. Each cell has at least one input node, preferably two or more. These cells also include multiple intermediate nodes and one output node. Each node represents an intermediate variable x(i) of the neural network, in other words, an activation map, and each edge (i, j) represents an operation. Specifically, this represents the transformation that maps the intermediate variable x(i) of node i to the intermediate variable x(j) of node j. All nodes are connected to all their preceding nodes. The output node is also connected to all its preceding nodes, where the output variable of the output node is determined by the concatenation of the intermediate variables of all its preceding nodes.

[0044] The intermediate result x(j) of the j-th node is determined as follows:

[0045]

[0046] in And O is the set of all possible operations.

[0047] The following possible operations can be envisioned. Skip connection, 3x3 average pooling, 3x3 max pooling, 3x3 and 5x5 convolutions (dilated separable convolutions, e.g., with a dilation factor of 2), and a "zero" connection (zero operation), which means there is no connection between nodes.

[0048] The input nodes are connected to the output node of the previous unit of the search network.

[0049] DARTS uses two different types of units. There are normal units that maintain the spatial resolution of their input variables, and reduction units that reduce the spatial resolution of their input variables, preferably to half. It should be noted that upsampling units that increase spatial resolution may also exist.

[0050] Normal unit in Figure 1 The upper part is schematically shown with reference numeral (101). For example, the normal unit (101) contains 6 nodes, including 2 input nodes (I_{k-1}, I_{k-2}), 3 intermediate nodes (0, 1, 2) and one output node (O_{k}).

[0051] In order to enable different calculations For optimization, especially using gradient descent, the function to be optimized must be continuous. In DARTS, this is achieved by introducing variables. To implement this, each operation on edge (i, j) is performed. Both with variables Association. Relaxation can be achieved through a weighted combination of all possible operations, where the weight of edge (i, j) is given by operation o using the following formula:

[0052]

[0053] This leads to the following equation, which is also referred to below as the mixed operation. :

[0054]

[0055] Equation (1) can now be rewritten using equation (3) as follows:

[0056]

[0057] The architecture can now be optimized alternately with respect to the variable α and the parameterized w of the operation using gradient descent. The following two-level optimization equation can be used to optimize both the parameterized w and the variable α:

[0058]

[0059] L val It is the first cost function applied to the validation dataset, and L train It is the second cost function applied to the training dataset.

[0060] Figure 2 A schematic flowchart illustrating the architecture and parameterization for optimizing machine learning systems is shown.

[0061] Method (20) begins at step 2000. In this step, the architecture of the machine learning system is predefined. In this embodiment, the machine learning system may be given by a neural network. The architecture may be predefined, for example, by the resolution of the input and output variables of the neural network and / or by a certain number of input variables. Similarly, the architecture of the neural network may be predefined by the minimum resolution of the intermediate variables of the neural network or the minimum resolution of a certain number of layers of the neural network, etc.

[0062] The characteristics of the cell type can also be defined in step 2000; for example, each cell type may have only 3 intermediate nodes. Similarly, the set of all possible operations for each edge can be specified in step 2000.

[0063] Next, a search network is created based on the pre-given architecture and defined units. To do this, multiple different unit types (normal units, reduced units, and upsampled units) are arranged sequentially to achieve the pre-given architecture. That is, after step 2000, there exists a search network comprising different sequentially arranged units, which should be optimized in subsequent steps.

[0064] In the subsequent step 2100, training data is provided, including training input variables and their respective associated training output variables. The training data is divided into two sets, which preferably each include the same number of training input variables and their respective associated training output variables.

[0065] After step 2100, an optional step 2200 is performed. In this step, the parameterization w of the search network can be optimized in advance using the training data or one of two training data sets. For this purpose, the training input data is propagated through the search network. Then, the second cost function L is determined based on the determined output variables of the search network and the corresponding training output variables. trainThe second cost function depends on the parameter w and the variable α. The second cost function L can then be optimized with respect to the parameter w using gradient descent methods, such as stochastic gradient descent (SGD). train Specifically, this involves minimizing or maximizing the second cost function. It should be noted that the parameterized w does not need to be fully optimized. It is sufficient to optimize the parameterized w through multiple iterations without convergence.

[0066] After either optional step 2200 or step 2100, step 2300 is performed. In this step, the search network is optimized according to the DARTS optimization algorithm in accordance with equation (5). That is, optimization is performed alternately with respect to the variable α and with respect to the parameter w using the gradient descent method. Based on the first cost function L val The variable α is optimized using the first training data set from the two training data sets from step 2100. After the optimization is completed, the second cost function L is used. train Optimization is performed on the parameterized w using the second training dataset. This alternating optimization of the variable α and the parameterization is performed multiple times in sequence.

[0067] After each optimization of variable α, or after multiple optimizations of variable α, the eigenvalues ​​of the Hessian matrix of the first cost function are determined based on variable α. If one of the eigenvalues ​​is greater than a pre-given threshold, the optimization is interrupted, and variable α, which existed before exceeding the threshold, is used. That is, variable α from the previous iteration is then passed to step 2400.

[0068] Preferably, the second cost function L is used in step 2300. train Regularization techniques are employed. For example, individual parts of the training input variables are removed. The size of the removed parts and the frequency with which these parts are removed from the training data can be randomly chosen. It is proposed that this probability increases linearly with the progress of training.

[0069] To perform further regularization, the mixed operations according to equation (3) can be randomly removed during the optimization, for example, by setting them to zero. Preferably, the probability of removal is set to zero at the start of the optimization. This probability can increase linearly with the progress of the cost function optimization until it reaches a pre-defined maximum probability value.

[0070] Step 2300 is repeated multiple times until an interruption criterion is met, where one of the characteristic values ​​is greater than a threshold. Then, the variable α from the previous iteration is passed to step 2400. If the optimal value of the cost function has been reached, or if the maximum number of iterations has been reached, the final determined variable α is passed to step 2400.

[0071] In the subsequent step 2400, the optimal architecture, and specifically the optimal computations, of the pre-given neural network from step 2000 are determined based on the variable α passed from step 2300. Relaxation is performed in reverse according to the DARTS method. This can be done, for example, by selecting the strongest computation for each edge based on the variable α:

[0072] (6)

[0073] After the optimal computations are determined in step 2400, the neural network is initialized in step 2500 based on these selected computations and the pre-given architecture from step 2000. Furthermore, the parameterized w optimized in step 2300 is also used for the initialization of the neural network.

[0074] Then, in optional step 2500, the parameterization w of the initialized neural network is repeatedly optimized using the provided training data. For this purpose, the training input variables are propagated through the initialized neural network, and the parameterization is adapted according to the determined output variables and the training output variables, particularly according to step 2100.

[0075] In a subsequent optional step 2600, the neural network initialized from step 2500 is used for the robot. For example, the neural network from step 2500 can be used to determine output variables based on provided input variables, wherein the robot is then controlled by a control unit based on said output variables.

[0076] This concludes method (20).

[0077] Figure 3 A schematic diagram of a robot that is at least partially autonomous is shown, which in a first embodiment is provided by a vehicle (300) that is at least partially autonomous. In another embodiment, the robot that is at least partially autonomous may be a maintenance robot, an assembly robot, or a stationary production robot, or alternatively, an autonomous flying object, such as a drone.

[0078] The at least partially autonomous vehicle (300) may include a detection unit (30). The detection unit (30) may be, for example, a camera, which detects the surrounding environment of the vehicle (300). The detection unit (30) may be connected to... Figure 2 The machine learning system is connected. In this embodiment, the machine learning system may be the neural network (40) from step 2600. The neural network (40) determines output variables based on provided input variables (e.g., provided by the detection unit (30)) and multiple parameters of the neural network (40). The output variables may be forwarded to the control unit (50).

[0079] The control unit (50) controls the actuator based on the output variables of the neural network (40), preferably controlling the actuator in such a way that the vehicle (300) performs collision-free maneuvers. In a first embodiment, the actuator may be the engine or braking system of the vehicle (300). In another embodiment, the partially autonomous robot may be a tool, machine tool, or production robot. The material of the workpiece can be classified by means of the neural network (40). Here, the actuator may be, for example, an electric motor that runs a grinding head.

[0080] Furthermore, the vehicle (300), particularly a semi-autonomous robot, includes a computing unit (60) and a machine-readable storage element (60). A computer program, comprising instructions that, when executed on the computing unit (60), cause the computing unit (60) to perform a method having all or only steps 2600, such as... Figure 2 As shown. Alternatively, the neural network (40) may be stored on a storage element (60), and the computing unit performs the computation of the neural network (40).

[0081] Figure 4 A schematic diagram is shown of a machine learning system for optimizing a neural network (40), and in particular a device (400) for performing steps for optimizing the neural network (40). The device (400) includes a training data module (410) and a difference module (420). The difference module (420) calculates the training output variable y based on the training data. s The difference between the output variable y determined by the neural network (40) and the variable α is determined specifically by means of a cost function. The training data module (410) contains training data. Suitably, the training data includes multiple training input variables, each of which is labeled. During optimization, the optimization module (430) determines the change θ' of parameterized w or variable α based on the difference determined by the difference module (420). Then, based on the change θ', an adaptation is performed in the memory P that stores parameterized w and variable α.

Claims

1. A method for creating a machine learning system for a technological system, said technological system comprising at least partially autonomous machines, at least partially autonomous vehicles, robots, tools, machine tools, or flying objects, wherein the created machine learning system is configured to determine control variables for controlling actuators of said technological system based on images detected by means of a camera. Wherein the first parameter set α represents the architecture of the machine learning system, and the second parameter set w is the parameterization of the machine learning system, the method includes the following steps: According to the first cost function L val The first parameter set is iteratively optimized, and based on the second cost function L... train The second parameter set is iteratively optimized, wherein the first cost function and the second cost function are initially derived based on the corresponding training input image and pre-given training control variables, respectively. Where the first cost function L val and the second cost function L train They depend on the first parameter set α and the second parameter set w, respectively; The first cost function L is determined based on the first parameter set α. val eigenvalues ​​of the Hessian matrix; The optimization is interrupted when one of the feature values ​​is greater than a pre-defined threshold.

2. The method according to claim 1, wherein, The iterative optimization is interrupted when the largest eigenvalue of the Hessian matrix is ​​greater than the pre-defined threshold.

3. The method according to claim 1 or 2, wherein, Determine the first average value of the largest eigenvalue for a given number of k sequentially executed last iteration steps. The second average value is determined by the maximum eigenvalue of the k iterative steps performed before the final iterative step. The optimization is interrupted when the ratio of the second average value to the first average value exceeds a pre-defined threshold.

4. The method according to claim 3, wherein, The pre-given number of k sequentially executed final iteration steps are the iteration steps for optimizing the first parameter set.

5. The method according to claim 3, wherein, The average value is determined based on the largest eigenvalue determined in each of the last five iterations. The threshold value is greater than 0.

6.

6. The method according to claim 1 or 2, wherein, At least the second cost function has a regularization term weighted by a regularization factor.

7. The method according to claim 6, wherein, The regularization term is or Regularization, and the regularization factor corresponds to the value. One of them, where i = {3;6;9;27;81}.

8. The method according to claim 1 or 2, wherein, The cost function is determined based on the training data during the optimization process. This includes at least expanding the training data used for the second cost function.

9. A machine-readable storage element having a computer program stored thereon, the computer program including instructions designed to cause the computer to perform the method according to any one of claims 1 to 8 when the instructions are executed.

10. An apparatus designed to perform the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and apparatus for neural network quantization

    CN107967515A

  • Robust width learning system

    CN109635245A