Control and monitor physical systems based on trained Bayesian neural networks

Through the marginal maximum likelihood method, BNN training accuracy and high computational cost in deep architectures is solved, and more accurate and stable physical system control and monitoring are achieved.

CN111796514BActive Publication Date: 2024-11-05ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010268454.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-04-09
Filing Date
2020-04-08
Publication Date
2024-11-05
Estimated Expiration
2040-04-08

AI Technical Summary

Technical Problem

现有技术在使用贝叶斯神经网络(BNN)进行深度架构训练时,难以提供准确的后验分布近似,且推断时间采样计算成本高,难以在安全性关键应用中有效控制或监视物理系统。

Method used

BNN is trained using marginal maximum likelihood method, integrating the weights to obtain marginal likelihood functions, maximizing the marginal likelihood functions to tune a priori hyperparameters, and introducing possible approximate correct (PAC) boundaries during training to reduce excessive Fitting risk and improving stability.

Benefits of technology

A more accurate posterior distribution approximation under the deep BNN architecture is achieved, which reduces the inference time sampling requirement, improves the accuracy and stability of the model control and monitoring physical system, and avoids the problems of overfitting and high computational costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111796514B_ABST
    Figure CN111796514B_ABST
Patent Text Reader

Abstract

Control and monitor physical systems based on trained Bayesian neural networks. Physical systems are increasingly controlled based on inferences obtained from machine-learned ("trained") models. Examples of such physical systems include computer-controlled systems such as robots, vehicles, household appliances, power tools, manufacturing machines, access control systems, building heating systems, and the like. The trained models are described in the form of Bayesian neural networks (BNNs), which provide quantification of their inference uncertainty during use and are trained using marginal maximum likelihood. Even when the network architecture is deep, the probably approximately correct (PAC) boundary can be used in training to incorporate prior knowledge and improve training stability. Thus, a more accurate trained model is obtained, enabling physical systems to be more accurately controlled and monitored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a training system and a computer-implemented training method for training a neural network for use as a trained model in controlling or monitoring a physical system. The invention further relates to an inference system and a computer-implemented inference method for controlling or monitoring a physical system using the trained model. The invention further relates to a computer-readable medium comprising data of the trained model, and to a computer-readable medium comprising data representing instructions arranged to cause a processor system to perform at least one of the computer-implemented methods. Background Art

[0002] Physical systems are increasingly being controlled based on inferences obtained from machine-learned ("trained") models. Such physical systems are also referred to as computer-controlled systems, and include robots, vehicles, household appliances, power tools, manufacturing machines, access control systems, building heating systems, and the like. Such physical systems may operate in an environment, which may be, for example, a warehouse in the case of a warehouse robot or a road network in the case of an autonomous vehicle. A machine-learnable model may be trained to infer the state of the environment and / or the state of the physical system based on one or more sensor measurements that relate to the state and that may be obtained from sensors in the environment or in the physical system.

[0003] In the example of an autonomous vehicle (which is an example of a physical system), a model may be trained to infer relative positioning relative to other vehicles on the road (which is an example of the state of a physical system relative to the environment) based on sensor measurements obtained from video, radar, and / or lidar (light detection and ranging) sensors integrated into the autonomous vehicle. Another example is a heating system for a building (a physical system), where it may be desirable to use sensor data obtained from a temperature sensor to determine the temperature (the state of the environment). Yet another example is an electric motor (a physical system), where it may be desirable to determine the position of the rotor (the state of the physical system) based on sensor data obtained from a positioning feedback sensor.

[0004] After the state of the environment and / or physical system has been inferred, the physical system can be controlled for operation based on the inferred state. In the previously mentioned example of an autonomous vehicle, the trained model can be used to control the driving and braking of the autonomous vehicle based on the inferred relative positioning of the autonomous vehicle with respect to other vehicles. Another example is a computer-controlled internal combustion engine, where the trained model can be used to control the operation of the internal combustion engine based on the inferred state of the internal combustion engine, which can be inferred, for example, from sensor data from temperature, position and / or pressure sensors.

[0005] Such trained models may also enable monitoring of physical systems. For example, a model may be trained and subsequently used to infer an undesirable state or undesirable output of a physical system, such that a warning signal may be issued to alert a user or operator of the physical system of the inferred undesirable state or output. A specific example is that a model may be trained to alert a driver if it is predicted that an autonomous vehicle will go off course or hit a pedestrian.

[0006] In such control and monitoring applications, it is increasingly considered crucial to provide not only inferences but also quantify the uncertainty of the inferences. Specifically, uncertainty quantification is considered crucial in safety-critical applications, where refusing to make inferences and / or refusing to take default actions under excessive uncertainty may be preferred. For example, an inference made to the driving action of an autonomous vehicle for avoiding obstacles may be rejected if the certainty that the inferred driving action actually avoids the obstacle is low. Such uncertainty quantification can also be used to detect whether the trained model is suitable for inputs out of distribution, such as inputs with characteristics that are not represented or insufficiently represented in the training data of the trained model. This may be the case if the trained model is applied to other types of input data in addition to the input data for which it was trained, or when the input data has been modified, for example due to adversarial attacks, or when the input data is damaged, etc.

[0007] It is known to use Bayesian neural networks (BNNs) to provide inferences and quantification of inference uncertainty. Unlike "vanilla" neural networks, BNNs have stochasticity about their synaptic weights because probability distributions are assigned to the weights. This enables quantification of inference uncertainty. For example, the standard deviation of the posterior predictive distribution of a BNN can be used as a quantitative and principled measure of inference uncertainty, or confidence in an inference.

[0008] Due to the stacked structure of BNNs, BNNs propagate inference uncertainty through (one or more) hidden layers and can therefore support complex uncertainty models. However, accurate inference of such highly nonlinear systems may not only be analytically intractable, but also difficult to approximate with sufficiently high accuracy.

[0009] Reference [1] describes a technique for training BNNs using sampling based on Monte Carlo loss. Reference [2] describes a deterministic Bayesian inference method using variational inference. Unfortunately, the techniques described by both references are prone to inaccurate approximations of the posterior distribution under deep BNN architectures. Unfortunately, reference [1] requires inference-time sampling, the computational cost of which is prohibitive for deep BNN architectures.

[0010] References

[0011] [1] Kendall, A. and Gal, Y. “ What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision ”, in NIPS, 2017, https: / / arxiv.org / abs / 1703.04977

[0012] [2] Wu, A., Nowozin, S., Meeds, E., Turner, R., Hernández-Lobato, J., and Gaunt, A.” Fixing Variational Bayes:Deterministic Variational Inference for Bayesian Neural Networks", In ICLR, 2019, https: / / arxiv.org / abs / 1810.03958 . Summary of the invention

[0013] It may be desirable to enable control or monitoring of a physical system based on a model that is trained to provide a quantification of its inference uncertainty during use, and which is trainable and trained to be more accurate relative to an approximation of the posterior distribution for a deep architecture.

[0014] According to a first aspect of the invention, there is provided a training system and a computer-implemented training method for training a neural network for use as a trained model in controlling or monitoring a physical system, as defined by claims 1 and 13, respectively. According to a further aspect of the invention, there is provided an inference system and a computer-implemented inference method for controlling or monitoring a physical system using a trained model, as defined by claims 10 and 14, respectively. According to a further aspect of the invention, there is provided a computer-readable medium comprising a trained Bayesian neural network, as defined by claim 9. According to a further aspect of the invention, there is provided a computer-readable medium as defined by claim 15.

[0015] The above measures provide a trained model in the form of a Bayesian neural network (BNN) for use in controlling or monitoring a physical system. As explained in the background section, the BNN is trained on training data that includes sensor measurements and associated states of the environment and / or physical system. However, instead of using sampling or variational inference based on Monte Carlo loss to train the model, the inventors have devised a method for training the BNN using marginal maximum likelihood. Specifically, the weights of the BNN are integrated-out to obtain the marginal likelihood function of the Bayesian neural network. Such integration of the weights of the BNN may refer to calculating the integral of the joint probability distribution of the variables in the BNN with respect to their weights. The result may be a probability distribution of only input and output observations, which no longer depends on the weight distribution. In other words, after integration, the BNN may no longer have hidden variables. The probability distribution may represent the marginal likelihood function of the BNN.

[0016] The inventors have further devised a method for maximizing the marginal likelihood function to tune the prior hyperparameters of the integrated weights of the Bayesian neural network, and thereby obtain a trained Bayesian neural network. Specifically, the marginal likelihood function is maximized by minimizing a loss function, the loss function comprising a data fitting term and a regularization term, the data fitting term expressing the fit to the training data, the regularization term providing regularization to reduce (the risk of) overfitting.

[0017] Unlike training using sampling or variational inference based on Monte Carlo loss or similar techniques, the inventors have determined that marginal maximum likelihood is better suited to deep BNN architectures and thus deep BNNs because marginal maximum likelihood allows for a more accurate approximation of the posterior distribution under a deep BNN architecture, and thereby a more accurate trained model. In other words, given the same constraints, e.g., on the computational complexity of training, the model trained by the present invention as claimed is more accurate. And there is no need to use inference time sampling, which would be prohibitive for deep BNN architectures.

[0018] After the model has been trained using marginal maximum likelihood, the trained model can be used to control or monitor the physical system. Specifically, the inference and its uncertainty can be used to generate output data for an output device for controlling or monitoring the physical system. Such output data can take various forms, such as control data or display data, depending on the type of the output device. For example, the output device can be an actuator that is part of the physical system or is located near the physical system. The output data can be used to control the actuator and thereby control the physical system. In other examples, the output device can be a rendering device that is configured to generate a sensory perceptible output signal based on the output data of the inference system. For example, the rendering device can be a display configured to display the output signal. Other types of sensory perceptible output signals include, but are not limited to, light signals, auditory signals, tactile signals, and the like. The corresponding rendering device itself is known. Based on the sensory perceptible output signal, the operator can then control the physical system. For example, the sensory perceptible output signal can indicate a fault in a component of the physical system, which can prompt the operator to control the physical system by stopping or pausing its operation. Another example is that the trained model may be used in a driver assistance system that uses the trained model to inform the driver of relevant objects in the preceding visual scene.

[0019] Typically, output data may be generated not only as a function of the inference itself, but also as a function of its inference uncertainty. For example, an inference with a higher inference uncertainty may result in other output data, such as its other (one or more) values, in addition to the same inference with a lower inference uncertainty. For example, if the inference uncertainty is high, the output data may include more "conservative" values, such as reduced in magnitude. Such conservatism may relate to safety aspects associated with the physical system. For example, if the inference uncertainty is high, actions that are considered less safe may be avoided. For example, in a case where the inference uncertainty of the inference on which the driving action is based is relatively low, output data may be generated to command a driving action in an autonomous vehicle, while if the inference uncertainty of the inference is relatively high, output data may be generated to command no driving action (e.g., maintaining a route). Various other ways of generating output data based on inferences and their inference uncertainties are also contemplated.

[0020] Optionally, the processor subsystem is configured to recursively integrate the weights of the Bayesian neural network from the input layer to the output layer of the Bayesian neural network. The inventors have considered that it is not easy to handle to calculate the marginal likelihood function by analytical calculation. Instead, an approximate calculation can be used, in which the weights of the BNN are recursively integrated from the input layer to the output layer of the BNN. Such an approximate calculation has been shown to use the central limit theorem (CLT) to obtain an approximation that is close enough to be used as an exact value in practice.

[0021] Optionally, the processor subsystem is configured to recursively integrate out the weights of the Bayesian neural network using asymptotic moment matching, based on a first moment and a second moment of a corresponding probability distribution of each weight. Here, the first moment may refer to a mean, and the second moment may refer to a variance of the corresponding probability distribution of the weight, wherein the first moment and the second moment together provide an approximation of the probability distribution as a normal distribution, which obtains a sufficiently close approximation when recursively integrated out.

[0022] Optionally, the input interface is configured to access prior knowledge data, the prior knowledge data representing a prior knowledge-based model of the relationship between the input and output of the physical system, and the processor subsystem is configured to train the model to incorporate the prior knowledge of the physical system by incorporating the prior knowledge-based model in the regularization term of the loss function. The inventors have considered that when using marginal maximum likelihood, prior hyperparameters are occupied for model fitting ("model" here and elsewhere refers to the Bayesian model represented by the BNN unless otherwise indicated). It is therefore desirable to obtain a mechanism for incorporating prior knowledge into the Bayesian model for domain experts, the prior knowledge such as (one or more) physical laws, which at least partially define the relationship between sensor measurements and environmental states and / or physical system states, so that only residual factors in the relationship may need to be learned from the training data. Surprisingly, the regularization term of the loss function is definable, so that such prior knowledge can be considered. Therefore, unlike references 1 and 2, the BNN can be trained to consider such prior knowledge by using a regularization term that incorporates prior knowledge.

[0023] For example, the regularization term can be limited to include a probability model, which represents a priori knowledge. In a specific example, the priori knowledge can represent the laws of thermodynamics, which can be converted into a differential equation system dy / dx = g(y,x) when applied to a specific situation. The differential equation system can be converted into the following probability model. First, the differential equation system can be solved to obtain a naive equation system, which is essentially a function that maps x to y, i.e. y=f(x). The function can represent the priori knowledge about the relationship between input and output, but may not explain all the dynamics in the relationship. However, the unexplained part of the relationship can be modeled as residual noise, such as Gaussian noise with zero mean and variance v. Thus, y is no longer a deterministic function of x, but a random variable from a normal distribution with mean f(x) and variance v.

[0024] Optionally, the regularization term is a Likely Approximately Correct (PAC) bound. The inventors have considered that without a regularization term, there is a risk of overfitting when maximizing the marginal likelihood function, because the resulting loss function is both nonlinear and can also have a large number of free parameters, and because the prior hyperparameters are accounted for for model fitting, the Bayesian model does not provide any mechanism for domain experts to incorporate prior knowledge into the model. These two deficiencies can be addressed by using a Likely Approximately Correct (PAC) bound as a regularization term, which introduces a principled complexity term into the marginal likelihood function.

[0025] Optionally, the loss function is defined by equation (5) of this specification.

[0026] Alternatively, the physical system may include the inference system. Thus, the inference system may be a subsystem of the physical system.

[0027] According to the abstract, it is noted that physical systems are increasingly controlled based on inferences obtained from machine-learned ("trained") models. Examples of such physical systems include computer-controlled systems such as robots, vehicles, household appliances, power tools, manufacturing machines, access control systems, building heating systems, and the like. The model is described in the form of a Bayesian neural network (BNN) that provides a quantification of its inference uncertainty during use and is trained using marginal maximum likelihood. Even when the network architecture is deep, a probably approximately correct (PAC) bound can be used in training to incorporate prior knowledge and improve training stability. Thus, a more accurate trained model is obtained, thereby enabling the physical system to be more accurately controlled and monitored.

[0028] It will be appreciated by those skilled in the art that two or more of the above-mentioned embodiments, implementations, and / or alternative aspects of the invention may be combined in any way deemed useful.

[0029] Modifications and variations of any system, any computer-implemented method, or any computer-readable medium that correspond to the modifications and variations of another of the described entities may be implemented by a person skilled in the art based on the present description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] These and other aspects of the invention will be apparent from and elucidated further with reference to the embodiments which are described by way of example in the following description and to the accompanying drawings in which:

[0031] Figure 1 An inference system is shown for controlling or monitoring a physical system operating in an environment using a trained model, wherein the model is trained to infer the state of the environment or the physical system based on sensor measurements and to provide a quantification of its inferred uncertainty during use, and wherein the inferred state and its inferred uncertainty are used to generate output data for an output device used in the control or monitoring of the physical system, such as an actuator or a rendering device;

[0032] Figure 2 An autonomous vehicle is shown incorporating the inference system for controlling the driving and braking of the autonomous vehicle based on sensor measurements obtained from a video camera integrated into the vehicle;

[0033] Figure 3 A training system is shown for training a model for use in controlling or monitoring a physical system operating in an environment;

[0034] Figure 4 The various steps for training the model are shown; and

[0035] Figure 5 A computer readable medium including data is shown.

[0036] It should be noted that the figures are purely diagrammatic and not drawn to scale.In the figures, elements corresponding to elements already described may have the same reference numerals.

[0037] Reference Numbers List

[0038] The following list of reference numerals is provided to facilitate the interpretation of the drawings and should not be construed as limiting the claims.

[0039] 20 Sensors

[0040] 22 Video Camera

[0041] 40 Output Devices

[0042] 42 Actuator (motor)

[0043] 50 Environment

[0044] 60 Physics System

[0045] 62 Autonomous Vehicles

[0046] 100 Inference system using the trained BNN

[0047] 120 Input interface

[0048] 122 Sensor data

[0049] 140 Output interface

[0050] 142 Output data

[0051] 160 Processor Subsystem

[0052] 180 Data storage interface

[0053] 190 Data storage device

[0054] 192 Data representation of trained BNN

[0055] 200 Training system for training BNN

[0056] 220 Input interface

[0057] 240 Processor Subsystem

[0058] 290 Data storage device

[0059] 292 Data Representation of (Trained) BNN

[0060] 294 Training Data

[0061] 310 Selecting the Normalized Likelihood Function, Neural Network Architecture, and Prior Distribution over Hypothesis Set

[0062] 320 Perform repeated moment matching

[0063] 330 Compute integrals analytically or approximately

[0064] 340 Determine PAC Boundaries

[0065] 350 Calculating and Minimizing PAC Boundaries

[0066] 360 Get Inference

[0067] 400 Computer readable medium

[0068] 410 Non-transitory data. DETAILED DESCRIPTION

[0069] The following relates to training models and using the trained models to control or monitor physical systems operating in an environment. Specifically, the model is trained to infer the state of the environment and / or physical system based on one or more sensor measurements, and to provide a quantification of its inference uncertainty during use. Figure 1 and Figure 2 involves the use of such a trained model, for example for controlling an autonomous vehicle, and Figure 3 and Figure 4 Involves training.

[0070] Figure 1 An inference system 100 is shown for controlling or monitoring a physical system 60 operating in an environment. Figure 1 The environment is not explicitly shown, and the physical system 60 is only schematically shown as a dashed outline. In general, such a physical system can be: a physical entity, such as a vehicle, a robot, etc.; or a connected or distributed system of physical entities, such as a lighting system; or any other type of physical system, such as a building. Figure 1 A physical system 60 is shown, which will include a sensor 20 that can measure one or more quantities that correlate with the state of the environment and / or the state of the physical system 60. Figure 1 As shown in , the sensor 20 can be part of the physical system 60. In other examples, the sensor 20 can be arranged remotely from the physical system in the environment, such as if the quantity(s) can be measured remotely. For example, a camera-based sensor can be arranged external to the robot but can nevertheless measure quantities associated with the robot, such as the robot's position and orientation within the warehouse.

[0071] The inference system 100 is shown to include an input interface 120, which is shown to access sensor data 122 from the sensor 20. In practice, the input interface 120 may represent a sensor interface. Alternatively, the input interface 120 may access sensor data from elsewhere, such as from a data storage device or a network location. Thus, the input interface 120 may have any suitable form, including but not limited to: a low-level communication interface, such as based on I2C or SPI data communication; but also a data storage interface, such as a memory interface or a persistent storage interface; or a personal area network, local area network or wide area network interface, such as a Bluetooth, Zigbee or Wi-Fi interface or an Ethernet or fiber optic interface.

[0072] The inference system 100 is further shown to include an output interface 140 for providing output data 142 to an output device 40, which may be, for example, an actuator 40 that is part of the physical system 60. For example, the actuator may be an electric, hydraulic, pneumatic, thermal, magnetic, and / or mechanical actuator. Specific, also non-limiting examples include electric motors, electroactive polymers, hydraulic cylinders, piezoelectric actuators, pneumatic actuators, servo mechanisms, solenoids, stepper motors, and the like. In another example, the output device may be a presentation device such as a display, a light source, a speaker, a vibration motor, and the like, which may be used to generate a sensory perceptible output signal that may present an inferred state or a result obtained from the inferred state, such as a fault diagnosis or any other type of obtained result, for use, for example, in guidance, navigation, or other types of control of the physical system. Note that although Figure 1 The output device 40 is shown as being part of the physical system 60, but this need not be the case. Alternatively, the output device 40 may be arranged external to the physical system 60 in the environment, but may nevertheless control or allow monitoring of the physical system 60. A specific, yet non-limiting example is that the output device 40 may be a traffic light, which may be used to control the operation of an autonomous vehicle.

[0073] The inference system 100 is further shown to include a processor subsystem 160 configured to infer a state of the environment and / or a state of the physical system 60 based on sensor data 122 accessed via the input interface 120, and to provide output data 142 to the output device 40 to enable control or monitoring of the physical system 60. To this end, the processor subsystem 160 may be configured to: access a data representation 192 of a trained Bayesian neural network; use the input data 122 as input to the trained Bayesian neural network to obtain an inference of the state of the environment and / or the state of the physical system 60 and a quantification of the inference uncertainty of the inference; and generate output data 142 for the output device 40 based on the inference and the quantification of the inference uncertainty of the inference.

[0074] The inference system 100 may include a data storage interface 180 for accessing a data storage device 190, which may be a volatile or non-volatile type of data storage device and may be used to temporarily or persistently store data used by the processor subsystem 160, including but not limited to data representations of the trained Bayesian neural network 192 and other temporary or persistent data.

[0075] Note that in some embodiments, the data storage interface 180 and the (sensor) input interface 120 may be the same interface or the same type of interface. In other embodiments, the two interfaces may be different types of interfaces and / or may be sub-interfaces of what is otherwise generally referred to as an "input interface".

[0076] Typically, the inference system 100 may be embodied as or in a single device or apparatus, such as a workstation or server. The server may be an embedded server. The device or apparatus may include one or more microprocessors that execute appropriate software. For example, the processor subsystem may be embodied by a single central processing unit (CPU), but also by a system or combination of such CPUs and / or other types of processing units. The software may have been downloaded and / or stored in a corresponding memory, such as a volatile memory such as RAM or a non-volatile memory such as flash memory. Alternatively, the processor subsystem of the system may be implemented in the device or apparatus in the form of programmable logic, such as a field programmable gate array (FPGA). Typically, each functional unit of the inference system 100 may be implemented in the form of a circuit. The inference system 100 may also be implemented in a distributed manner, for example involving different devices or apparatuses, such as distributed local or cloud-based servers. In some embodiments, the inference system 100 may be part of the physical system itself, and / or may represent a control system configured to control the physical system.

[0077] Figure 2 The above example is shown in which the inference system 100 is shown as a control system of an autonomous vehicle 62 operating in an environment 50. The autonomous vehicle 62 may incorporate the inference system 100 to control the travel and braking of the autonomous vehicle based on sensor measurements obtained from a video camera 22 integrated into the vehicle 62. For example, in the event that it is inferred that the autonomous vehicle 62 will collide with an obstacle, the inference system 100 may control the motor 42 to perform (regenerative) braking. As indicated in the Summary of the Invention section, inference uncertainty may be used to control travel and braking, among other things, because the confidence in the inference may determine the type of action to be taken or determine the magnitude (degree) or sub-type of the action to be taken, and so on.

[0078] Figure 3 A training system 200 is shown for training a model for use in controlling or monitoring a physical system operating in an environment. The training system 200 is shown to include: an input interface 220 configured to access model data 292 defining a Bayesian neural network; and training data 294 including sensor measurements and associated states of an environment or physical system. Figure 3 As shown in FIG. 1 , the input interface 220 may be a data storage interface 220 for a data storage device 290 including the data 292 , 294 . The data storage interface 220 and the data storage device 290 may correspond to Figure 1 The data storage interface 120 and the data storage device 190 are provided.

[0079] The training system 200 is further shown to include a processor subsystem 240 configured to train the Bayesian neural network based on the training data 294 by integrating the weights of the Bayesian neural network to obtain a marginal likelihood function of the Bayesian neural network, and tuning a priori hyperparameters of the integrated weights of the Bayesian neural network by maximizing the marginal likelihood function to obtain a trained Bayesian neural network. Specifically, the processor subsystem 240 can be configured to maximize the marginal likelihood function by minimizing a loss function, the loss function including a regularization term and a data fitting term expressing a fit to the training data.

[0080] Although not in Figure 3 , but the system 200 may further include an output interface configured to output trained model data representing the trained Bayesian neural network. In some examples, the input interface 220 may also represent the output interface, and thereby represent the input and output interface 220. In some examples, the model data 292 of the untrained Bayesian neural network may be replaced by the model data 292 of the trained Bayesian neural network during or after training, as the weights of the Bayesian neural network may be adapted to reflect the training on the training data 294. In some embodiments, the output interface may be similar to that described in reference to FIG. Figure 1 The input interface 120 is the same type of interface as described.

[0081] Typically, the training system 200 may be embodied as or in a single device or apparatus, such as a workstation or server. The server may be an embedded server. The device or apparatus may include one or more microprocessors that execute appropriate software. For example, the processor subsystem may be embodied by a single central processing unit (CPU), but also by a system or combination of such CPUs and / or other types of processing units. The software may have been downloaded and / or stored in a corresponding memory, such as a volatile memory such as RAM or a non-volatile memory such as flash memory. Alternatively, the processor subsystem of the system may be implemented in the device or apparatus in the form of programmable logic, for example as a field programmable gate array (FPGA). Typically, each functional unit of the training system 200 may be implemented in the form of a circuit. The training system 200 may also be implemented in a distributed manner, for example involving different devices or apparatuses, such as distributed local or cloud-based servers.

[0082] With further reference to the training of Bayesian neural networks, note the following. The training system can train a Bayesian neural network, which is a neural network whose synaptic weights follow a probability distribution, by so-called Bayesian model selection. This can involve integrating out all latent variables and maximizing the marginal log-likelihood with respect to its hyperparameters. Training can avoid overfitting under deep architectures, and since training is not built on intractable intermediate posterior weight inference steps, training can be more accurate than standard learning approaches such as variational inference (VI) and Markov chain Monte Carlo (MCMC) sampling. In addition, unlike many prior art approaches, training is deterministic and therefore does not suffer from distortions in intermediate sampling steps. Finally, it has been found that training is more stable, and training is more stable even under deep network architectures if a regularization term based on a PAC boundary is used.

[0083] The following example describes the training of the model in more detail. However, the actual implementation of the training can be implemented in various other ways, for example based on similar mathematical concepts.

[0084] We can consider a supervised learning problem, which consists of N input observations and the corresponding N output observations Such input observations may, for example, represent sensor measurements which may be indicative of, for example, the state of the physical system and / or its environment, whereas output observations may represent the state, for example as ground truth.

[0085] A Bayesian Neural Network (BNN) can be defined as:

[0086]

[0087] in can be the likelihood function for iid (independent and identically distributed) observations (x, y). Therefore, Can include V number of synaptic weights Or by the number of synaptic weights V The synaptic weight priors can be included in the set ϕ The standard approach in this field is to first infer , and then perform the calculation of the posterior predictive distribution for new data points Inference:

[0088]

[0089] The problem in this case may be that its accuracy is determined by the intermediate tasks, i.e. The accuracy of the inference of the intermediate task is a prerequisite, and the intermediate task has as many patterns as taking the local minimum of the loss function of the deterministic neural network as the model. This analytical bottleneck can cause large differences from the accurate model, resulting in suboptimal inference performance in all datasets. By avoiding solving such overly difficult intermediate tasks, the expected inference performance of the trained model can be increased.

[0090] The marginal likelihood function of a BNN can be calculated by integrating out its weights. Doing this by analytical calculation is not tractable. In some embodiments, a tunably tight approximation can be used, which can be recursive and can be described and explained as follows.

[0091] Assume a neural network with L layers, which are integrated up to layer This can result in of The following probabilistic process on the linear activation map of :

[0092]

[0093]

[0094] in It is in the layer Linear activation map of By using the Central Limit Theorem (CLT), it can be shown that the process converges to:

[0095]

[0096] in

[0097]

[0098]

[0099]

[0100] As K grows (e.g. more neurons are added to the layer Even for K = 10, the approximation can be considered close enough to be accurate in practice. When the defined termination condition is met, for example when the mapping is at the input layer The recursive algorithm can be completed when . At this stage, Can be x k Replace, the x k refers to the kth channel of a deterministic input observation whose first moment is itself and whose second moment is zero. The rest of the equation can remain the same. Since the equation of this form no longer depends on the layer below, the recursion can terminate.

[0101] After all BNN weights have been integrated out, the likelihood p(y|h L ), the likelihood p(y|h L ) is appropriate to the specific application of the model to be trained and is h L A function of, for example, subject to the normalization factor Z r r(y, h L ):

[0102]

[0103]

[0104] in and It can be a function mapping resulting from repeated moment matching from the input layer all the way to the output layer. For many likelihoods, such as the normal for regression and the Bernoulli for classification, analytical integration yields is possible. After this integration, the model no longer has any latent variables, and thus arrives at the marginal likelihood, which can be maximized with respect to the weight prior hyperparameters as follows:

[0105]

[0106] when To further improve the stability of training when including or consisting of a large number of free variables, which is natural when the neural network architecture is deep or wide, note the following. The risk of overfitting in this marginal maximum likelihood problem can arise from the training loss function without a complexity penalty. Due to the a priori hyperparameters is occupied for model fitting, so the model also does not provide a mechanism for domain experts to incorporate prior knowledge into the model. Both of these weaknesses can be addressed by developing a Probably Approximately Correct (PAC) bound that introduces a principled complexity term into the marginal maximum likelihood based on the training loss function given in Eq. (2).

[0107] We can first define the real risks as:

[0108]

[0109] And limit the relevant empirical risk to

[0110]

[0111] where h(.) is the predictor derived from the hypothesis family, and

[0112]

[0113] Is from an unknown data distribution The introduction of.

[0114] We can also define the following random variables

[0115]

[0116] where P is a distribution over the space of predictors h(.) incorporating prior knowledge. In other words, P may represent a probability model, which may in turn represent prior knowledge-based modeling of a relationship between, for example, sensor measurements and associated states, and thereby, for example, incorporating knowledge about the physical laws governing the relationship. As also described elsewhere with reference to the example of a relationship governed by the laws of thermodynamics, such physical laws or any other equation(s) may be expressed as a probability model in a manner as known per se in the art.

[0117] Applying the standard PAC theorem yields:

[0118]

[0119]

[0120] where delta can be a predefined confidence level bound between 0 and 1. For practical purposes, delta can be set to an arbitrarily low probability value, such as 0.1. The following proof: The upper bound exists on the right hand side of the inequality and ends up being the logarithm of the marginal likelihood of the training data at the bottom row:

[0121]

[0122]

[0123] .

[0124] Substituting this inequality into the PAC bound in equation (4), we obtain the following training objective, which can be used to train BNNs:

[0125]

[0126] In equation (5), the first term can represent the data fitting term, which describes the fitting of the training data, for example, for the input observation and output observations The regularization term can incorporate prior knowledge via a probability model P as part of the term.

[0127] If B can be upper bounded, the training algorithm can be considered complete. Since the likelihood function p(y|h) is assumed to be appropriate (e.g. bounded), its maximum can be trivially computed and used as an upper bound. For example, for the normal likelihood , can be simply calculated:

[0128]

[0129] And substitute the right-hand side into equation (5), then to minimize the resulting objective. For similar problems such as Bernoulli's, B is trivially bounded by one.

[0130] Figure 4 The various steps for training the model are shown. Step 310 may include selecting an appropriate (e.g., normalized) likelihood function p(y|h), a neural network architecture and the prior distribution P over the hypothesis set. Step 320 may include performing moment matching, which repeatedly uses equation (1) to obtain an approximation of the marginal likelihood p(h|a(x),b(x)). Step 330 may include analytically or approximately computing the integral Step 340 may include determining the bound B of equation (3) implied by p(y|h). Step 350 may include analytically computing the bound in equation (5) and determining the optimal solution that minimizes the bound. Step 360 may include To infer, that is, to predict new samples (x * ,y * ).

[0131] In general, the training can improve upon prior art Bayesian neural network inference algorithms in one or more of the following aspects. First, marginal maximum likelihood can be used for training rather than a posteriori parameter inference. Second, in some embodiments, even when the network architecture is deep, a probably approximately correct (PAC) bound can be used to both incorporate prior knowledge and also improve training stability. Third, in some embodiments, the PAC bound can be combined with the probabilistic concept of "likelihood", and thus both can support principled Bayesian analysis and can provide theoretical generalization performance guarantees before test time.

[0132] Various applications are envisioned. For example, the trained model can be applied to various types of sensor data, such as image or video sensor data. Typically, in applications where determining inference uncertainty is critical, the trained model can be used instead of a deterministic alternative. The trained model can further incorporate prior knowledge via its model parameters and via the form of the trained model. Thus, the trained model can be used to model the observed environment in part, for example, by first principle physics. For example, an internal combustion engine may follow the principles of thermodynamics, as well as many other external factors. Time series data can be collected from multiple engine sensors. An image can be constructed from a fixed time window of such sensor data, where time is one axis and the measurement data is the other axis. By sliding the window through time, an image sequence, such as a video, can be obtained. Thus, a Bayesian neural network can be made applicable to high-dimensional data. The Bayesian neural network can further incorporate the laws of thermodynamics as prior knowledge, while at the same time the remaining residual factors can be learned from the training data.

[0133] Any method described in this specification can be implemented on a computer as a computer-implemented method, as dedicated hardware, or as a combination of the two. Figure 5As illustrated in , instructions for a computer (e.g., executable code) may be stored on a computer-readable medium 400, such as in the form of a series 510 of machine-readable physical indicia and / or as a series of elements having different electrical (e.g., magnetic) or optical properties or values. The executable code may be stored in a temporary or non-temporary manner. Examples of computer-readable media include memory devices, optical storage devices, integrated circuits, servers, online software, and the like. Figure 5 An optical disc 400 is shown. In an alternative embodiment of the computer readable medium 400, the computer readable medium 400 may include transitory or non-transitory data 410 representing a trained model (BNN) as described elsewhere in this specification.

[0134] Examples, embodiments or optional features - whether or not indicated as non-limiting - should not be construed as limiting the invention as claimed.

[0135] It should be noted that the above-mentioned embodiments illustrate rather than limit the present invention, and those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference marks placed between brackets should not be interpreted as limiting the claims. The use of the verb "comprise" and its conjugations does not exclude the presence of elements or stages other than those stated in the claims. The article "one" or "an" before an element does not exclude the presence of multiple such elements. Statements such as "at least one of them" when before an element list or group indicate that all or any subset of elements are selected from the list or group. For example, the statement "at least one of A, B and C" should be understood to include only A, only B, only C, both A and B, both A and C, both B and C, or all A, B and C. The present invention can be implemented by means of hardware including several different elements, and by means of a suitably programmed computer. In the device claim that lists several components, several of these components can be embodied by the same item of hardware. The mere fact that certain measures are recorded in mutually different dependent claims does not indicate that the combination of these measures cannot be used advantageously.

Claims

1. A training system for training a neural network for use as a trained model in controlling or monitoring a robot or vehicle operating in an environment, wherein the model is trained to infer the state of the environment or the robot or vehicle based on one or more video or image sensor measurements and provides a quantification of its inference uncertainty during use, The training system comprises: - Input interface, which is configured to access: - Model data for defining Bayesian neural networks; - Training data, which includes video or image sensor measurements and associated states of the environment or robot or vehicle; A processor subsystem configured to train a Bayesian neural network based on the training data by: - recursively integrating the weights of the Bayesian neural network from the input layer to the output layer of the Bayesian neural network to obtain the marginal likelihood function of the Bayesian neural network; - maximizing a marginal likelihood function to tune a priori hyperparameters of the integrated weights of the Bayesian neural network to obtain a trained Bayesian neural network, wherein the marginal likelihood function is maximized by minimizing a loss function, the loss function comprising: i) Data fitting term, which expresses the fit to the training data, ii) Regularization term; - an output interface configured to output the trained model data, the trained model data representing the trained Bayesian neural network.

2. The training system of claim 1 , wherein the processor subsystem is configured to recursively integrate weights of the Bayesian neural network using asymptotic moment matching based on a first moment and a second moment of a corresponding probability distribution of each weight.

3. A training system according to any one of claims 1 or 2, wherein: - the input interface is configured to access a priori knowledge data representing a priori knowledge based model of the relationship between video or image sensor measurements and associated states; and -The processor subsystem is configured to train the model to incorporate prior knowledge of the robot or vehicle by incorporating a model based on prior knowledge in a regularization term of the loss function.

4. The training system of claim 3, wherein the prior knowledge-based model comprises modeling of physical laws that at least partially define a relationship between video or image sensor measurements and associated states.

5. The training system of claim 3, wherein the model based on prior knowledge is a probabilistic model.

6. A training system according to any one of claims 1 or 2, wherein: The regularization term is the PAC boundary.

7. A training system according to any one of claims 1 or 2, wherein: The regularization term penalizes the complexity of the Bayesian neural network.

8. An inference system for controlling or monitoring a robot or vehicle operating in an environment using a trained model, wherein the model is trained to infer the state of the environment or the robot or vehicle based on one or more video or image sensor measurements and provides a quantification of the inference uncertainty of the inference, the inference system comprising: - Input interface, which is configured to access: - input data representing at least video or image sensor measurements; - model data defining a trained Bayesian neural network as obtained by a training system according to any one of claims 1 to 7; - output interfaces for output devices, which are used in the control or monitoring of robots or vehicles; - a processor subsystem configured to: - using the input data as input to a trained Bayesian neural network to obtain an inference of the state of the environment or the robot or vehicle and a quantification of the inference uncertainty of the inference; as well as - generating output data for an output device for controlling or monitoring a robot or a vehicle based on the inferences and quantification of inference uncertainty of the inferences; Wherein the inference system is further configured to provide output data to an output device using the output interface.

9. An inference system according to claim 8, wherein the output device is an actuator associated with a robot or a vehicle, and wherein the inference system is an inference-based control system configured to control the robot or the vehicle by providing control data as output data to the actuator.

10. An inference system according to claim 8, wherein the output device is a rendering device, wherein the inference system is an inference-based monitoring system configured to monitor the operation of a robot or vehicle, and generate output data and provide the output data to the rendering device so that the rendering device generates a sensory perceptible output signal.

11. A computer-implemented training method for training a neural network for use as a trained model in controlling or monitoring a robot or vehicle, wherein the model is trained to infer the state of the environment or the robot or vehicle based on one or more video or image sensor measurements and to provide a quantification of its inference uncertainty during use, the training method comprising: -Access via input interface: - model data, which defines the Bayesian neural network; - Training data, which includes video or image sensor measurements and associated states of the environment or robot or vehicle; - Train the Bayesian neural network based on the training data by: - recursively integrating the weights of the Bayesian neural network from the input layer to the output layer of the Bayesian neural network to obtain the marginal likelihood function of the Bayesian neural network; - maximizing a marginal likelihood function to tune a priori hyperparameters of the integrated weights of the Bayesian neural network to obtain a trained Bayesian neural network, wherein the marginal likelihood function is maximized by minimizing a loss function, the loss function comprising: i) Data fitting term, which expresses the fit to the training data, ii) Regularization term; - outputting, via an output interface, trained model data, said trained model data representing the trained Bayesian neural network.

12. A computer-implemented inference method for controlling or monitoring a robot or vehicle operating in an environment using a trained model, wherein the model is trained to infer a state of the environment or the robot or vehicle based on one or more video or image sensor measurements, and providing a quantification of inference uncertainty of the inference, the inference method comprising: -Access via input interface: - input data representing at least one video or image sensor measurement; - model data defining a trained Bayesian neural network as obtained by a training system according to any one of claims 1 to 7; - using the input data as input to a trained Bayesian neural network to obtain an inference of the state of the environment or the robot or vehicle and a quantification of the inference uncertainty of the inference; - generating output data for an output device based on the inferences and quantification of inference uncertainty of the inferences, the output data being used in controlling or monitoring a robot or a vehicle; as well as - providing said output data to an output device via an output interface.

13. A computer readable medium comprising transitory or non-transitory data representing instructions arranged to cause a processor system to perform a computer-implemented method according to claim 11 or 12.